0) { $cat = $tempcat; } else { $cat = "random"; } } else { $cat = "random"; } $sql="SELECT * FROM `arcade_categories` ORDER BY `displayorder`"; $result=mysql_query($sql); $catnum = mysql_num_rows($result); for($i = 0; $i < $catnum; $i++) { $row = mysql_fetch_array($result); $catname = $row["catname"]; echo " "; } ?>
MAIN "; if($cat == $catname){ echo ""; } else { echo ""; } echo ""; if($cat == $catname){ echo ""; } else { echo ""; } echo " $catname
"; } if ($_REQUEST['sessdo'] == 'permrequest') { echo" Error"; echo "&validate=1µone=$microone&result=OK"; $score = $_REQUEST["score"]; $s2game = $_SESSION['sgameid']; $username = $usr['name']; $sql = "INSERT INTO `arcade_highscores` (gamename, username, score) VALUES ('$s2game', '$username', '$score')"; $result=mysql_query($sql) or die(mysql_error()); exit; } if ($_REQUEST['sessdo'] == 'burn') { $gamename = $_SESSION['sgameid']; $sql="SELECT * FROM `arcade_games` WHERE `gameid` = '$gamename' LIMIT 1"; $result=mysql_query($sql); $row = mysql_fetch_array($result); $shortname = $row["shortname"]; $title = $row["title"]; $gameid = $row["gameid"]; $stdimage = $row["stdimage"]; $description = $row["description"]; $thiscat = $row["categoryid"]; $timesplayed = $row["timesplayed"]; $namecheck = $usr['name']; $isreverse = $row["isreverse"]; echo "
$title HIGHT SCORES
$title
$description

Times played: $timesplayed
Overall High Scores
"; if($isrverse == 1){ $sql="SELECT * FROM `arcade_highscores` WHERE `gamename` = '$gameid' ORDER BY `score` LIMIT 20"; } else{ $sql="SELECT * FROM `arcade_highscores` WHERE `gamename` = '$gameid' ORDER BY `score` DESC LIMIT 20"; } $result=mysql_query($sql); for($i = 0; $i < 20; $i++) { $row = mysql_fetch_array($result); $username = $row["username"]; $score = $row["score"]; $rank = $i + 1; echo " "; } echo"
# Member Score
$rank "; if ($username == $namecheck){ echo " "; } echo " $username "; if ($username == $namecheck){ echo " "; } echo " $score
Your High Scores
"; if($isreverse == 1){ $sql="SELECT * FROM `arcade_highscores` WHERE `gamename` = '$gameid' AND `username` = '$usr['name']' ORDER BY `score` LIMIT 20"; } else{ $sql="SELECT * FROM `arcade_highscores` WHERE `gamename` = '$gameid' AND `username` = '$usr['name']' ORDER BY `score` DESC LIMIT 20"; } $result=mysql_query($sql); $rescheck = mysql_num_rows($result); for($i = 0; $i < 20; $i++) { $row = mysql_fetch_array($result); $score = $row["score"]; $rank = $i + 1; echo " "; } echo"
# Score
$rank $score
"; } else if (isset($_GET['play'])){ protect(); $thisgameid = $_GET['play']; $_SESSION['sgameid'] = $thisgameid; $sql="SELECT * FROM `arcade_games` WHERE `gameid` = '$thisgameid' LIMIT 1"; $result=mysql_query($sql); $row = mysql_fetch_array($result); $shortname = $row["shortname"]; $title = $row["title"]; $gameid = $row["gameid"]; $stdimage = $row["stdimage"]; $description = $row["description"]; $thiscat = $row["categoryid"]; $timesplayed = $row["timesplayed"]; $file = $row["file"]; $width = $row["width"]; $height = $row["height"]; $gamename = $row["shortname"]; $isreverse = $row["isreverse"]; $timesnew = $timesplayed + 1; $sqlplay="UPDATE `arcade_games` SET `timesplayed` = '$timesnew' WHERE `gameid` = '$thisgameid' LIMIT 1"; $resultplay=mysql_query($sqlplay); $acta = mysql_query("SELECT * FROM `user_info` WHERE `user` = '$usr['name']'"); $actb = mysql_fetch_array($acta); $actpa = $actb["total"]; $actpb = $actpa + 1; //$actsql = mysql_query("UPDATE `user_info` SET `total` = '$actpb' WHERE `user` = '$usr['name']' LIMIT 1"); if($isreverse == 1){ $sql="SELECT * FROM `arcade_highscores` WHERE `gamename` = '$gameid' ORDER BY `score` LIMIT 1"; } else{ $sql="SELECT * FROM `arcade_highscores` WHERE `gamename` = '$gameid' ORDER BY `score` DESC LIMIT 1"; } $result=mysql_query($sql); $champnum = mysql_num_rows($result); if($champnum == 1){ $row = mysql_fetch_array($result); $champname = $row["username"]; $champscore = $row["score"]; } else { $champname = "None"; $champscore = 0; } echo"
$title
$title
Champion: $champname

Score to Beat: $champscore

Play More Games
[View High Scores]
"; } else if (isset($_GET['highscore'])){ $hsgameid = $_GET['highscore']; $sql="SELECT * FROM `arcade_games` WHERE `gameid` = '$hsgameid' LIMIT 1"; $result=mysql_query($sql); $row = mysql_fetch_array($result); $shortname = $row["shortname"]; $title = $row["title"]; $gameid = $row["gameid"]; $stdimage = $row["stdimage"]; $description = $row["description"]; $thiscat = $row["categoryid"]; $timesplayed = $row["timesplayed"]; $isreverse = $row["isreverse"]; echo"
$title HIGHT SCORES
$title
$description

Times played: $timesplayed
Overall High Scores
"; $namecheck = $usr['name']; if($isrverse == 1){ $sql="SELECT * FROM `arcade_highscores` WHERE `gamename` = '$gameid' ORDER BY `score` LIMIT 20"; } else{ $sql="SELECT * FROM `arcade_highscores` WHERE `gamename` = '$gameid' ORDER BY `score` DESC LIMIT 20"; } $result=mysql_query($sql); for($i = 0; $i < 20; $i++) { $row = mysql_fetch_array($result); $username = $row["username"]; $score = $row["score"]; $rank = $i + 1; echo " "; } echo"
# Member Score
$rank. "; if ($username == $namecheck){ echo " "; } echo " $username "; if ($username == $namecheck){ echo " "; } echo " $score
Your High Scores
"; if($isreverse == 1){ $sql="SELECT * FROM `arcade_highscores` WHERE `gamename` = '$gameid' AND `username` = '$usr['name']' ORDER BY `score` LIMIT 20"; } else{ $sql="SELECT * FROM `arcade_highscores` WHERE `gamename` = '$gameid' AND `username` = '$usr['name']' ORDER BY `score` DESC LIMIT 20"; } $result=mysql_query($sql); $rescheck = mysql_num_rows($result); for($i = 0; $i < 20; $i++) { $row = mysql_fetch_array($result); $score = $row["score"]; $rank = $i + 1; echo " "; } echo"
# Score
$rank. $score
"; } else { echo "
WELCOME TO OUR GAME SPOT.
Game Category Champion Your Best
"; if($cat == 'random'){ $sql1="SELECT * FROM `arcade_games` ORDER BY `title`"; } else{ $sql="SELECT * FROM `arcade_categories` WHERE `catname` = '$cat' LIMIT 1"; $result=mysql_query($sql); $row = mysql_fetch_array($result); $maincat = $row["catid"]; $sql1="SELECT * FROM `arcade_games` WHERE `categoryid` = '$maincat' ORDER BY `shortname`"; } $result1=mysql_query($sql1); $gamenum = mysql_num_rows($result1); for($i = 0; $i < $gamenum; $i++) { $row = mysql_fetch_array($result1); $shortname = $row["shortname"]; $title = $row["title"]; $gameid = $row["gameid"]; $stdimage = $row["stdimage"]; $description = $row["description"]; $thiscat = $row["categoryid"]; $isreverse = $row["isreverse"]; $sql2="SELECT * FROM `arcade_categories` WHERE `catid` = '$thiscat' LIMIT 1"; $result2=mysql_query($sql2); $row = mysql_fetch_array($result2); $tempcat = $row["catname"]; if($isreverse == 1){ $sql3="SELECT * FROM `arcade_highscores` WHERE `gamename` = '$gameid' ORDER BY `score` LIMIT 1"; } else{ $sql3="SELECT * FROM `arcade_highscores` WHERE `gamename` = '$gameid' ORDER BY `score` DESC LIMIT 1"; } $result3=mysql_query($sql3); $champnum = mysql_num_rows($result3); if($champnum == 1){ $row = mysql_fetch_array($result3); $champname = $row["username"]; $champscore = $row["score"]; } else { $champname = "None"; $champscore = 0; } $user = $usr['name']; $sql4="SELECT * FROM `arcade_highscores` WHERE `gamename` = '$gameid' AND `username` = '$user' ORDER BY `score` DESC LIMIT 1"; $result4=mysql_query($sql4); $row4 = mysql_fetch_array($result4); $scorenum = mysql_num_rows($result4); if($scorenum == 1){ $yourscore = $row4["score"]; } else { $yourscore = "None"; } echo "
$title
$description
$tempcat
(More)
$champname high score:
$champscore
Your high score:
$yourscore
[High Scores]
"; } echo "
"; } ?>