can anybody see whats wrong with this? its a whosonline.php from the scotspaul script, iv edited it to show the moods online but the admin stars dont show up... anyone know whats wrong with it?
<?php
ob_start();
header("Cache-Control: no-cache, must-revalidate");
include("config.inc.php");
header("Pragma: no-cache");
header("Content-type: text/vnd.wap.wml");
echo "<?xml version=\"1.0\"?>";
echo "<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.1//EN\" \"http://www.wapforum.org/DTD/wml_1.1.xml\">";
echo "<wml>";
$Connect = mysql_connect("$server","$user","$pass");
mysql_select_db("$dbname");
$result=mysql_query("select * from members where username='$username' and password='$password'");
$number_of_rows = mysql_num_rows($result);
if ($number_of_rows>0)
{
include("check.inc.php");
}
if ($ok>0)
{
include("smilies.inc.php");
$uonline = mysql_num_rows(mysql_query("select * from latest"));
//this variable might seem complicated, but it's really simple. The first thing it does is sends the query "select * from latest" to the database. This finds all the entries in the database. After that, it counts the number of entries with mysql_num_rows to find out exactly how many users are online.
//print the variable on our page!
echo "<card id=\"card1\" title=\"$uonline Users Online\">";
echo "<p align=\"center\">";
$id=1;
?>
[img]on.gif[/img]
<?php
$datime=date("H:i");
$dadate=(date("j/m/y"));
$sqlthing = mysql_query("SELECT * FROM highest WHERE id='$id'");
$highest=(mysql_result($sqlthing,0,"highest"));
if ($highest < $uonline)
{
$highest=$uonline;
$query = "update highest set highest='$highest' where id='$id'";
mysql_query($query); //send the query!
}
echo "Highest Online: $highest
";
if(!isset($_GET['page'])){
$page = 1;
} else {
$page = $_GET['page'];
}
$max_results = 15;
$from = (($page * $max_results) - $max_results);
$total_results = mysql_result(mysql_query("SELECT COUNT(*) as Num FROM latest"),0);
$total_pages = ceil($total_results / $max_results);
$sql = mysql_query("SELECT * FROM latest ORDER by ip asc LIMIT $from, $max_results");
while($row = mysql_fetch_array($sql)){
$name = $row['ip'];
$resultST=mysql_query("select * from members where username='$name' and stars='1'");
$number_of_rowsST = mysql_num_rows($resultST);
if ($number_of_rowsST == 1)
{
$stars = "*";
}
else
{
$stars = "";
}
$sql3 = "SELECT * FROM mood WHERE username='$name'";
$result3 = mysql_query($sql3);
$number_of_rows4 = mysql_num_rows($result3);
$zero=0;
$one=1;
if ($number_of_rows4 < $one)
{
$mood="Not Set";
}
if ($number_of_rows4>$zero)
{
$mood=(mysql_result($result3,0,"mood"));
}
echo "<a title=\"Enter\" href=\"profile.php?username=$username&password =$password&name=$name\">$name</a>
";
echo "(";
printf($mood);
echo ")
";
}
if($page < $total_pages){
$next = ($page + 1);
echo "<a href=\"".$_SERVER['PHP_SELF']."?page=$next&username=$username&password= $password\">(Next)</a>
";
}
if($page > 1){
$prev = ($page - 1);
echo "
<a href=\"".$_SERVER['PHP_SELF']."?page=$prev&username=$username&password= $password\">(Prev)</a>
";
}
$i = 1; $i <= $total_pages; $i++ ;
?>
[img]line.gif[/img]
<?php
$sqlthing = mysql_query("SELECT * FROM members WHERE username='$username'");
$pmname=(mysql_result($sqlthing,0,"pmname"));
$buddyname=(mysql_result($sqlthing,0,"buddyname")) ;
echo "<a title=\"Enter\" href=\"pm.php?username=$username&password=$pas sword\">($pmname Menu)</a>";
echo "
";
echo "<a title=\"Enter\" href=\"moodset.php?username=$username&password =$password\">(Change Mood)</a>";
echo "
";
echo "<a title=\"Enter\" href=\"forumindex.php?username=$username&passw ord=$password\">(Forums)</a>";
echo "
";
echo "<a title=\"Enter\" href=\"chatindex.php?username=$username&passwo rd=$password\">(Chat)</a>";
echo "
";
echo "<a title=\"Enter\" href=\"welcome.php?username=$username&password =$password\">(Main Menu)</a>";
echo "
";
}
echo "</p>";
echo "</card>";
echo "</wml>";
$contents = ob_get_contents();
ob_end_clean();
$contents = str_replace("&", "&", $contents);
$contents = str_replace("&", "&", $contents);
print($contents);
?>
<?php
ob_start();
header("Cache-Control: no-cache, must-revalidate");
include("config.inc.php");
header("Pragma: no-cache");
header("Content-type: text/vnd.wap.wml");
echo "<?xml version=\"1.0\"?>";
echo "<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.1//EN\" \"http://www.wapforum.org/DTD/wml_1.1.xml\">";
echo "<wml>";
$Connect = mysql_connect("$server","$user","$pass");
mysql_select_db("$dbname");
$result=mysql_query("select * from members where username='$username' and password='$password'");
$number_of_rows = mysql_num_rows($result);
if ($number_of_rows>0)
{
include("check.inc.php");
}
if ($ok>0)
{
include("smilies.inc.php");
$uonline = mysql_num_rows(mysql_query("select * from latest"));
//this variable might seem complicated, but it's really simple. The first thing it does is sends the query "select * from latest" to the database. This finds all the entries in the database. After that, it counts the number of entries with mysql_num_rows to find out exactly how many users are online.
//print the variable on our page!
echo "<card id=\"card1\" title=\"$uonline Users Online\">";
echo "<p align=\"center\">";
$id=1;
?>
[img]on.gif[/img]
<?php
$datime=date("H:i");
$dadate=(date("j/m/y"));
$sqlthing = mysql_query("SELECT * FROM highest WHERE id='$id'");
$highest=(mysql_result($sqlthing,0,"highest"));
if ($highest < $uonline)
{
$highest=$uonline;
$query = "update highest set highest='$highest' where id='$id'";
mysql_query($query); //send the query!
}
echo "Highest Online: $highest
";
if(!isset($_GET['page'])){
$page = 1;
} else {
$page = $_GET['page'];
}
$max_results = 15;
$from = (($page * $max_results) - $max_results);
$total_results = mysql_result(mysql_query("SELECT COUNT(*) as Num FROM latest"),0);
$total_pages = ceil($total_results / $max_results);
$sql = mysql_query("SELECT * FROM latest ORDER by ip asc LIMIT $from, $max_results");
while($row = mysql_fetch_array($sql)){
$name = $row['ip'];
$resultST=mysql_query("select * from members where username='$name' and stars='1'");
$number_of_rowsST = mysql_num_rows($resultST);
if ($number_of_rowsST == 1)
{
$stars = "*";
}
else
{
$stars = "";
}
$sql3 = "SELECT * FROM mood WHERE username='$name'";
$result3 = mysql_query($sql3);
$number_of_rows4 = mysql_num_rows($result3);
$zero=0;
$one=1;
if ($number_of_rows4 < $one)
{
$mood="Not Set";
}
if ($number_of_rows4>$zero)
{
$mood=(mysql_result($result3,0,"mood"));
}
echo "<a title=\"Enter\" href=\"profile.php?username=$username&password =$password&name=$name\">$name</a>
";
echo "(";
printf($mood);
echo ")
";
}
if($page < $total_pages){
$next = ($page + 1);
echo "<a href=\"".$_SERVER['PHP_SELF']."?page=$next&username=$username&password= $password\">(Next)</a>
";
}
if($page > 1){
$prev = ($page - 1);
echo "
<a href=\"".$_SERVER['PHP_SELF']."?page=$prev&username=$username&password= $password\">(Prev)</a>
";
}
$i = 1; $i <= $total_pages; $i++ ;
?>
[img]line.gif[/img]
<?php
$sqlthing = mysql_query("SELECT * FROM members WHERE username='$username'");
$pmname=(mysql_result($sqlthing,0,"pmname"));
$buddyname=(mysql_result($sqlthing,0,"buddyname")) ;
echo "<a title=\"Enter\" href=\"pm.php?username=$username&password=$pas sword\">($pmname Menu)</a>";
echo "
";
echo "<a title=\"Enter\" href=\"moodset.php?username=$username&password =$password\">(Change Mood)</a>";
echo "
";
echo "<a title=\"Enter\" href=\"forumindex.php?username=$username&passw ord=$password\">(Forums)</a>";
echo "
";
echo "<a title=\"Enter\" href=\"chatindex.php?username=$username&passwo rd=$password\">(Chat)</a>";
echo "
";
echo "<a title=\"Enter\" href=\"welcome.php?username=$username&password =$password\">(Main Menu)</a>";
echo "
";
}
echo "</p>";
echo "</card>";
echo "</wml>";
$contents = ob_get_contents();
ob_end_clean();
$contents = str_replace("&", "&", $contents);
$contents = str_replace("&", "&", $contents);
print($contents);
?>
Comment