Jump to content

[SOLVED] It was working flawlessly a few seconds ago...


Zoofu

Recommended Posts

<?php 
$id = $_GET['id'];
$query = mysql_query("SELECT * FROM users WHERE id = '$id'");
$fetch_array = mysql_fetch_array($query);
$username = $fetch_array['username'];
$id = $fetch_array['id'];
$tokens = $fetch_array['tokens'];
$posts = $fetch_array['posts'];
$level = $fetch_array['level'];
$exp = $fetch_array['exp'];

$sel=mysql_query("SELECT * FROM `users` WHERE `id`=".$id."") OR die(mysql_error());
$row=mysql_fetch_array($sel);

echo "<table border=\"0\" cellspacing=\"3\" cellpadding=\"3\" width=\"80%\">\n";
echo "<tr><td class=\"forum_header\"><center><b>".$username."</b><br>UserID: ".$id."</center></td></tr>\n";
echo "<br>\n";
echo "</table>\n";

echo "<table border=\"0\" cellspacing=\"3\" cellpadding=\"3\" width=\"30%\">\n";
echo "<tr><td class=\"forum_header\"><center><b>Lv. ".$level."</b><br><b>EXP: ( ".$exp." / 1000 ) </b><br><b><img src=\"./token.png\"> Tokens ( ".$tokens." )</b><br><img src=\"./Base.png\"></center></td></tr>\n";
echo "</table>\n";

echo "<table border=\"0\" cellspacing=\"3\" cellpadding=\"3\" width=\"50%\">\n";
echo "<tr><td class=\"forum_header\"><center><b>Statistics</center></b><br><b>Forum Posts:</b> ".$posts."<br><b>Comments Posted:</b> ".$comments."</td>\n";
echo "</tr></table>\n";
?>

<html>
<head>
<title>Zoofu | Profile</title>
</head>
<body>
</body>
</html>

<?php

$sql3 = "SELECT count(*) AS num_replies FROM `forum_replies` WHERE `tid`='".$row['id']."'";
$res3 = mysql_query($sql3) or die(mysql_error());
$row3 = mysql_fetch_assoc($res3);
echo "<br>";
echo "<b>User Comments ( ".$row3['num_replies']." )</b>";
echo "<br>";


$id = mss($_GET['id']);
$page = (!$_GET['page'] || $_GET['page'] < 0) ? "1" : $_GET['page']; 
$page = ceil($page);

$limit = 10; 
$start = $limit; 
$end = $page*$limit-($limit); 

if($id){
$sql = "SELECT * FROM `users` WHERE `id`='".$id."'";
$res = mysql_query($sql) or die(mysql_error());
if(mysql_num_rows($res) == 0){
	echo "Invalid Path!";
}else {
	$row = mysql_fetch_assoc($res);
	$sql2 = "SELECT * FROM `users` WHERE `id`='".$row['id']."'";
	$res2 = mysql_query($sql2) or die(mysql_error());
	$row2 = mysql_fetch_assoc($res2);
	if($row2['admin'] == 1 && $admin_user_level == 0){
		echo "You do not have permission!";
	}else {
		$a = (isa($row['uid'])) ? "<font style=\"color:#800000;\">Administrator</font>" : "";
		$amount_check = "SELECT * FROM `forum_replies` WHERE `tid`='".$id."'"; 
		$amount_check_res = mysql_query($amount_check) or die(mysql_error()); 
		$amount_count = mysql_num_rows($amount_check_res); 
		$pages = ceil($amount_count/$limit); 

		$previous = ($page-1 <= 0) ? "« Prev" : "<a href=\"./index.php?act=profile&id=".$id."&page=".($page-1)."\">« Prev</a>"; 
		$nextpage = ($page+1 > $pages) ? "Next »" : "<a href=\"./index.php?act=profile&id=".$id."&page=".($page+1)."\">Next »</a>"; 
		echo "<tr><td align=\"right\" colspan=\"2\">\n";
		echo "Pages: ";
		echo $previous; 
		for($i=1;$i<=$pages;$i++){ 
		    $href = ($page == $i) ? " ".$i." " : " <a href=\"./index.php?act=profile&id=".$id."&page=".$i."\">".$i."</a> "; 
     
		    echo $href; 
		} 
		echo $nextpage; 
		echo "</td></tr>\n";
		$select_sql = "SELECT * FROM `forum_replies` WHERE `tid`='".$id."' ORDER BY time DESC LIMIT ".$end.",".$start.""; 
		$select_res = mysql_query($select_sql) or die(mysql_error()); 

		while($rowr = mysql_fetch_assoc($select_res)){
			echo "<table border=\"0\" cellspacing=\"3\" cellpadding=\"3\" width=\"50%\">\n";
			echo "<tr><td colspan=\"2\" align=\"left\" class=\"forum_header\">Posted On: <em>".$rowr['date']."</em></td></tr>\n";
			echo "<tr><td align=\"left\" width=\"15%\" valign=\"top\" class=\"forum_header\">".uid($rowr['uid'], true)."<br><img src=\"./Base.png\"></td>\n";
			echo "<td align=\"left\" valign=\"top\" class=\"forum_header\">\n";
			echo nl2br(topic($rowr['message']))w;
			echo "</td>\n";
			echo "</tr>\n";
			echo "</table>\n";
			echo "<br>\n";
		}
		echo "<form method=\"post\" action=\"./index.php?act=pcomment&id=".$row['id']."\">\n";
		echo "<tr><td colspan=\"2\" align=\"center\"><textarea style=\"width:300px; height:100px\" name=\"pcomment\"></textarea><br><input type=\"submit\" name=\"submit\" value=\"Add Reply\" style=\"width:100px\"></td></tr>\n";
		echo "</table>\n";
	}
}
}else{
echo "Invalid Path!";
}

?>

 

And for some reason, it's not working anymore... The profile page shows up blank.

 

http://zoofu.000space.com/index.php?act=profile&id=26

 

help?  :wtf:

Problem located!

 

<?php

$sql3 = "SELECT count(*) AS num_replies FROM `forum_replies` WHERE `tid`='".$row['id']."'";
$res3 = mysql_query($sql3) or die(mysql_error());
$row3 = mysql_fetch_assoc($res3);
echo "<br>";
echo "<b>User Comments ( ".$row3['num_replies']." )</b>";
echo "<br>";


$id = mss($_GET['id']);
$page = (!$_GET['page'] || $_GET['page'] < 0) ? "1" : $_GET['page']; 
$page = ceil($page);

$limit = 10; 
$start = $limit; 
$end = $page*$limit-($limit); 

if($id){
$sql = "SELECT * FROM `users` WHERE `id`='".$id."'";
$res = mysql_query($sql) or die(mysql_error());
if(mysql_num_rows($res) == 0){
	echo "Invalid Path!";
}else {
	$row = mysql_fetch_assoc($res);
	$sql2 = "SELECT * FROM `users` WHERE `id`='".$row['id']."'";
	$res2 = mysql_query($sql2) or die(mysql_error());
	$row2 = mysql_fetch_assoc($res2);
	if($row2['admin'] == 1 && $admin_user_level == 0){
		echo "You do not have permission!";
	}else {
		$a = (isa($row['uid'])) ? "<font style=\"color:#800000;\">Administrator</font>" : "";
		$amount_check = "SELECT * FROM `forum_replies` WHERE `tid`='".$id."'"; 
		$amount_check_res = mysql_query($amount_check) or die(mysql_error()); 
		$amount_count = mysql_num_rows($amount_check_res); 
		$pages = ceil($amount_count/$limit); 

		$previous = ($page-1 <= 0) ? "« Prev" : "<a href=\"./index.php?act=profile&id=".$id."&page=".($page-1)."\">« Prev</a>"; 
		$nextpage = ($page+1 > $pages) ? "Next »" : "<a href=\"./index.php?act=profile&id=".$id."&page=".($page+1)."\">Next »</a>"; 
		echo "<tr><td align=\"right\" colspan=\"2\">\n";
		echo "Pages: ";
		echo $previous; 
		for($i=1;$i<=$pages;$i++){ 
		    $href = ($page == $i) ? " ".$i." " : " <a href=\"./index.php?act=profile&id=".$id."&page=".$i."\">".$i."</a> "; 
     
		    echo $href; 
		} 
		echo $nextpage; 
		echo "</td></tr>\n";
		$select_sql = "SELECT * FROM `forum_replies` WHERE `tid`='".$id."' ORDER BY time DESC LIMIT ".$end.",".$start.""; 
		$select_res = mysql_query($select_sql) or die(mysql_error()); 

		while($rowr = mysql_fetch_assoc($select_res)){
			echo "<table border=\"0\" cellspacing=\"3\" cellpadding=\"3\" width=\"50%\">\n";
			echo "<tr><td colspan=\"2\" align=\"left\" class=\"forum_header\">Posted On: <em>".$rowr['date']."</em></td></tr>\n";
			echo "<tr><td align=\"left\" width=\"15%\" valign=\"top\" class=\"forum_header\">".uid($rowr['uid'], true)."<br><img src=\"./Base.png\"></td>\n";
			echo "<td align=\"left\" valign=\"top\" class=\"forum_header\">\n";
			echo nl2br(topic($rowr['message']))w;
			echo "</td>\n";
			echo "</tr>\n";
			echo "</table>\n";
			echo "<br>\n";
		}
		echo "<form method=\"post\" action=\"./index.php?act=pcomment&id=".$row['id']."\">\n";
		echo "<tr><td colspan=\"2\" align=\"center\"><textarea style=\"width:300px; height:100px\" name=\"pcomment\"></textarea><br><input type=\"submit\" name=\"submit\" value=\"Add Reply\" style=\"width:100px\"></td></tr>\n";
		echo "</table>\n";
	}
}
}else{
echo "Invalid Path!";
}

?>

 

Somewhere within there.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.