{include file='admin/arcade/header.html'} {include file='admin/arcade/menu.html'} {php} $getcatc = $this->get_template_vars('getcatc'); $getedit = $this->get_template_vars('getedit'); $getgamec = $this->get_template_vars('getgamec'); $geteditc = $this->get_template_vars('geteditc'); $getdelete = $this->get_template_vars('getdelete'); if($getcatc && $getgamec){ $catc = $getcatc; $gamec = $getgamec; $sql = "UPDATE `arcade_games` SET `categoryid` = '$catc' WHERE `gameid` = '$gamec' LIMIT 1"; $result=mysql_query($sql) or die(mysql_error()); echo "

Congratulations, your arcade game's category has been changed!"; } elseif ($_POST['submit']) { $gameid = $_POST['pgameid']; $file = $_POST['file']; $categoryid = $_POST['categoryid']; $shortname = $_POST['shortname']; $title = $_POST['title']; $file = $_POST['file']; $width = $_POST['width']; $height = $_POST['height']; $miniimage = $_POST['miniimage']; $stdimage = $_POST['stdimage']; $isreverse = $_POST['isreverse']; $description = $_POST['description']; $shortname = strip_tags($shortname); $shortname = trim($shortname); $title = strip_tags($title); $title = trim($title); $file = strip_tags($file); $file = trim($file); $width = strip_tags($width); $width = trim($width); $height = strip_tags($height); $height = trim($height); $miniimage = strip_tags($miniimage); $miniimage = trim($miniimage); $stdimage = strip_tags($stdimage); $stdimage = trim($stdimage); $isreverse = strip_tags($isreverse); $isreverse = trim($isreverse); if ($shortname == "") { echo "Please enter a category name."; } else if ($title == "") { echo "Please enter a valid title."; } else if ($description == "") { echo "Please enter a valid description."; } else if ($file == "") { echo "Please enter a valid .swf file name."; } else if ($miniimage == "") { echo "Please enter a valid mini image name."; } else if ($stdimage == "") { echo "Please enter a valid standard image name."; } else if ($isreverse == "") { echo "Please enter a valid reverse score setting."; } else { $sql = "UPDATE `arcade_games` SET `shortname` = '$shortname', `title` = '$title', `description` = '$description', `file` = '$file', `width` = '$width', `height` = '$height', `categoryid` = '$categoryid', `miniimage` = '$miniimage', `stdimage` = '$stdimage', `isreverse` = '$isreverse' WHERE `gameid` = '$gameid' LIMIT 1"; $result=mysql_query($sql) or die(mysql_error()); echo "

Congratulations, your arcade game has been edited!"; } } elseif ($getedit){ $editgame = $getedit; $sql="SELECT * FROM `arcade_games` WHERE `gameid` = '$editgame' LIMIT 1"; $result=mysql_query($sql); $row = mysql_fetch_array($result); $shortname = $row["shortname"]; $title = $row["title"]; $gameid = $row["gameid"]; $stdimage = $row["stdimage"]; $miniimage = $row["miniimage"]; $file = $row["file"]; $width = $row["width"]; $height = $row["height"]; $description = $row["description"]; $categoryid = $row["categoryid"]; $isreverse = $row["isreverse"]; $this->assign("gameid","$gameid"); $sql="SELECT * FROM `arcade_categories` WHERE `catid` = '$categoryid' LIMIT 1"; $result = mysql_query($sql); $row = mysql_fetch_array($result); $excatname = $row['catname']; echo"

Edit an existing game:

Shortname:

The shortname sets what the game will be listed as inside the database.
This must correspond with the shortname specified in the game itself.
It is usually the same as the filename.

Title:

Description:

File Name:

Must be placed in the /arcade/swf folder.
The file name should look like gamename.swf

Width:

Height:

Miniature Image Name:

Standard Image:

Reverse Scoring:

Must be either 1 or 0. 1 for reverse scoring, 0 for normal scoring.
If you dont know, it should probably be 0.

Game Category

"; } elseif ($getdelete){ $delid = $getdelete; $sql="DELETE FROM `arcade_games` WHERE `gameid` = '$delid' LIMIT 1"; $result=mysql_query($sql); echo"The game you selected has been deleted."; } else{ echo"

Select a category to be more specific:

All Games | "; $sql8="SELECT * FROM `arcade_categories` ORDER BY `displayorder`"; $result8=mysql_query($sql8); $catnum8 = mysql_num_rows($result8); for($i = 0; $i < $catnum8; $i++) { $row8 = mysql_fetch_array($result8); $catid = $row8["catid"]; $catname = $row8["catname"]; $this->assign("catid","$catid"); echo " $catname | "; } echo"

Choose from the following list of games to edit:

Game ID - Title - Edit "; $editgame = $getedit; if($geteditc){ $editc = $geteditc; if($editc == "allgs"){ $sql8="SELECT * FROM `arcade_games` ORDER BY `title`"; } else{ $sql8="SELECT * FROM `arcade_games` WHERE `categoryid` = '$editc' ORDER BY `title`"; } } else{ $sql8="SELECT * FROM `arcade_games` ORDER BY `title` LIMIT 10"; } $result8=mysql_query($sql8); $gamenum = mysql_num_rows($result8); for($i=0;$i<$gamenum; $i++) { $row8 = mysql_fetch_array($result8); $gameid = $row8["gameid"]; $title = $row8["title"]; $stdimage = $row8["stdimage"]; $this->assign("gameid","$gameid"); echo "
$gameid - $title - (Edit) - (Delete)
Change to category:
"; $sql5="SELECT * FROM `arcade_categories` ORDER BY `displayorder`"; $result5=mysql_query($sql5); $catnum5 = mysql_num_rows($result5); for($c = 0; $c < $catnum5; $c++) { $row5 = mysql_fetch_array($result5); $catid = $row5["catid"]; $catname = $row5["catname"]; $this->assign("catid","$catid"); echo " $catname :: "; } echo"


"; } } {/php} {include file='admin/arcade/footer.html'}