HEX
Server: Apache
System: Linux www3.pit.tblive.com 5.14.0-687.38.1.el9_8.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Aug 12 17:19:12 EDT 2026 x86_64
User: awaldron (1020)
PHP: 8.1.34
Disabled: exec,passthru,shell_exec,system
Upload Files
File: /home/awaldron/www/archive/demo/rank.php
<?php
session_start();

include("_functions.php");
echo dbconnect();


$page_title = "Rank Left Navigation Links";

$updated = FALSE;
if (isset($_POST["submit"])) {	
	$updated = TRUE;
	$ok = 0; $tot = 0;
	$ctr = 0;
	while ($ctr < count($HTTP_POST_VARS)) {
		$dat = explode("-",key($HTTP_POST_VARS));
		if ($dat[0] == "page_rank") {
			$tot++;
			$sql = "UPDATE tbl_pages SET page_rank=".$HTTP_POST_VARS[key($HTTP_POST_VARS)]." WHERE page_id=".($dat[1]==""?0:$dat[1]);
			$result = mysql_query($sql);
			if ($result > 0) $ok++;
		}		
		$ctr++;
		next($HTTP_POST_VARS);
	}	
}

$lnav_mods = get_layout($_GET["p"],1);
$rnav_mods = get_layout($_GET["p"],3);

include("_pagestart.php");


if (!authorize(get_owners($_GET["p"]))) {  // CHECK IF USER ATTEMPTING THE EDIT IS THE USER WHO POSTED IT
	echo "<br><br><br>".error("You do not have the proper privileges to rank this navigation menu.")."<br><br><br>";
	echo "<center><a href=\"/content.php?p=".$_GET["p"]."\"><< Go Back</a></center><br><br><br>";
} else {

	echo "<P><div class=\"headline\"><b>".$page_title."</b></div><br><br>\n";
	
	if ($updated) echo "<center><b>".$ok."/".$tot." ranks updated succesfully.</b></center>\n";
	if ($updated) echo "<center><br><a href=\"/content.php?p=".$_GET["p"]."\">Go back to content of this page >></a></center>\n";
	
	$sql = "SELECT * FROM tbl_pages WHERE parent_id=".$_GET["p"]." AND page_active=1 ORDER BY page_rank ASC, page_id ASC";
	$result = mysql_query($sql);
	
	echo "<form action=\"rank.php?p=".$_GET["p"]."\" method=\"post\">\n";
	echo "<br><br><br><center><table border=0 cellpadding=4 cellspacing=1 bgcolor=\"#CCCCCC\">\n";
	echo "<tr class=\"header\"><td><b>Page Title</b></td><td><b>Set Rank</b></td></tr>\n";
	
	if (mysql_num_rows($result) != 0) {
		for ($i=0; $i < mysql_num_rows($result); $i++) {
			$p = mysql_fetch_array($result);
			echo "<tr bgcolor=\"".($i%2==0?"FFFFFF":"F0F0F0")."\"><td>".$p["page_title"]." &nbsp; &nbsp; &nbsp; </td>\n";
			echo "<td align=\"center\"><SELECT name=\"page_rank-".$p["page_id"]."\"><option></option>";
			for ($j=1; $j <= mysql_num_rows($result); $j++) {
				echo "<option value=\"".$j."\"".($j==$p["page_rank"]?" SELECTED":"").">".$j."</option>";
			}
			echo "</SELECT></td></tr>\n";
		}
	}
	
	echo "<tr><td colspan=2 align=center><input type=\"submit\" name=\"submit\" value=\"Submit\"></td></tr>\n";
	echo "</table></center>\n<br><br><br>";
	echo "<br><br><div class=\"pagefoot\"><div style=\"float:right\">Last Updated: ".date("F j, Y",$page_updated)." by <a href=\"/profile.php?u=".$username."\">".$username."</a></div>".owners($_GET["p"])."</div>\n";
}

include("_pageend.php");
?>