0) {
$cat = $tempcat;
}
else {
$cat = "random";
}
}
else {
$cat = "random";
}
$cat_res = "";
$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"];
$cat_res .= "
";
if($cat == $catname){
$cat_res .= "";
}
else
{
$cat_res .= "";
}
$cat_res .= "";
if($cat == $catname){
$cat_res .= "";
}
else
{
$cat_res .= "";
}
$cat_res .= "
$catname
::
|
";
}
if ($_GET['do'] == 'newscore')
{
//echo" Error";
//echo "&validate=1µone=$microone&result=OK";
$score = base64_decode($_GET["check"]);
$pee = mysql_query("SELECT gameid FROM arcade_games where `shortname` = '".base64_decode($_GET['game'])."'");
$s2game = mysql_result($pee, 0);
$username = $VAR[4];
$sql = "INSERT INTO `arcade_highscores` (gamename, username, score) VALUES ('$s2game', '$username', '$score')";
$result=mysql_query($sql) or die(mysql_error());
header("Location: ".$VAR[0]."/arcade.php?highscore=".$s2game);
exit;
}
if ($_REQUEST['sessdo'] == 'sessionstart')
{
$sgame = $_REQUEST['gamename'];
$cat_sessionstart .= "&connStatus=1&initbar=$gamerand&gametime=" . TIMENOW . "&lastid=$lastid&result=OK";
$cat_sessionstart .= "";
}
if ($_REQUEST['sessdo'] == 'permrequest')
{
$cat_permrequest .= " Error";
$cat_permrequest .= "&validate=1µone=$microone&result=OK";
$score = $_REQUEST["score"];
$s2game = $_SESSION['sgameid'];
$username = $VAR[4];
$sql = "INSERT INTO `arcade_highscores` (gamename, username, score) VALUES ('$s2game', '$username', '$score')";
$result=mysql_query($sql) or die(mysql_error());
exit;
}
//done
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 = $VAR[4];
$isreverse = $row["isreverse"];
$cat_burn .= "
|
|
$title HIGHT SCORES
|
|
|
|
|
$title
|
$description
Times played: $timesplayed
|
|
|
 |
|
 |
|
|
|
Overall High Scores
|
|
|
|
| # |
Member |
Score |
";
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;
$cat_burn .= "
|
$rank
|
";
if ($username == $namecheck){
$cat_burn .= "
";
}
$cat_burn .= "
$username
";
if ($username == $namecheck){
$cat_burn .= "
";
}
$cat_burn .= "
|
$score
|
";
}
$cat_burn .= "
|
|
 |
|
 |
|
|
|
Your High Scores
|
|
|
|
|
#
|
Score
|
";
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;
$cat_burn .= "
|
$rank
|
$score
|
";
}
$cat_burn .= "
|
|
 |
|
 |
|
";
}
//done
else if (isset($_GET['play'])){
$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;
}
$cat_play .= "
";
}
//done
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"];
$cat_highscore .= "
|
|
$title HIGHT SCORES
|
|
|
|
|
$title
|
$description
Times played: $timesplayed
|
|
|
 |
|
 |
|
|
|
Overall High Scores
|
|
|
|
| # |
Member |
Score |
";
$namecheck = $VAR[4];
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;
$cat_highscore .= "
| $rank. |
";
if ($username == $namecheck){
$cat_highscore .= "
";
}
echo "
$username
";
if ($username == $namecheck){
$cat_highscore .= "
";
}
$cat_highscore .= "
|
$score |
";
}
$cat_highscore .= "
|
|
 |
|
 |
|
|
|
Your High Scores
|
|
|
|
|
#
|
Score
|
";
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;
$cat_highscore .= "
| $rank. |
$score |
";
}
$cat_highscore .= "
|
|
 |
|
 |
|
";
}
//done
else {
$cat_else .= "
|
|
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 = $VAR[4];
$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";
}
$cat_else .= "
|
$title
$description
|
$tempcat
(More)
|
$champname high score:
$champscore
|
Your high score:
$yourscore
[High Scores]
|
";
}
$cat_else .= "
|
|
 |
|
 |
|
";
}
require("system/header.php");
$mskin = sed_skinfile(array('arcade', 'fun'));
$t = new XTemplate($mskin);
$t->assign(array(
"ARCADE_CATS" => $cat_res,
"ARCADE_SESSIONSTART" => $cat_sessionstart,
"ARCADE_PERMREQUEST" => $cat_permrequest,
"ARCADE_BURN" => $cat_burn,
"ARCADE_PLAY" => $cat_play,
"ARCADE_HIGHSCORE" => $cat_highscore,
"ARCADE_ELSE" => $cat_else
));
$t->parse("MAIN");
$t->out("MAIN");
require("system/footer.php");
?>