Talk Arcades: Forum for Arcade Webmasters    

  Talk Arcades > Arcades > Scripts & Software > phpArcadeScript

Welcome to Talk Arcades, the premier forum for arcade webmasters.

You are currently viewing our boards as a guest. By joining our community you will be able to make posts, communicate privately with other arcade webmasters and participate in our Live Marketplace. Registration is easy, so please join us today!

Reply
 
LinkBack Thread Tools Display Modes
Old 07-30-2008, 08:04 PM   #1 (permalink)
Ryan1212
Preferred Member
 
Join Date: Aug 2007
Posts: 160
Ryan1212 is on a distinguished road
Send a message via AIM to Ryan1212 Send a message via MSN to Ryan1212


Default small edit for the new game admin interface wanted

could anyone explain to me how to change the default option in the category drop down for this code?

Code:
function manage_games($base_url,$bt,$limit){ $content = "<table id=\"t1\" width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"4\" class=\"example table-autosort:0 table-autofilter table-autopage:$limit table-stripeclass:alternate table-page-number:t1page table-page-count:t1pages table-filtered-rowcount:t1filtercount table-rowcount:t1allcount\"> <thead> <tr> <th class=\"table-filterable table-sortable:default\">Title</th> <th class=\"table-filterable table-sortable:default\">Category</th> <th class=\"table-sortable:numeric\">Played Today</th> <th class=\"table-sortable:numeric\">Overall Played</th> <th class=\"table-filterable table-sortable:default\">Featured</th> <th class=\"table-sortable:numeric\">REPORTS</th> <th class=\"table-filterable table-sortable:default\">Status</th> <th>Action</th> </tr> </thead> <tbody>"; if($bt=="reported") $sql = "SELECT gameid,gametitle,category,timesplayed,gamestatus,playedtoday,featured,dateadded,reports from games WHERE (gamestatus=3 || reports > 0) ORDER BY gametitle ASC"; elseif ($bt=="submissions") $sql = "SELECT gameid,gametitle,category,timesplayed,gamestatus,playedtoday,featured,dateadded,reports from games WHERE gamestatus=5 ORDER BY gametitle ASC"; else $sql = "SELECT gameid,gametitle,category,timesplayed,gamestatus,playedtoday,featured,dateadded,reports from games ORDER BY gametitle ASC"; $result = @mysql_query($sql); if(mysql_num_rows($result)) { //output as long as there are still available fields while($row = mysql_fetch_array($result)) { $gameid = $row['gameid']; $gametitle = stripslashes($row['gametitle']); $category = $row['category']; $timesplayed = $row['timesplayed']; $gamestatus = $row['gamestatus']; $playedtoday = $row['playedtoday']; $featured = $row['featured']; $dateadded = $row['dateadded']; $reports = $row['reports']; if(strlen($gametitle)>30) $gametitle = substr($gametitle,0,27)."..."; $gamestatus = get_status($gamestatus); $category = get_category($category); if($featured==1) $featured = "FEATURED"; else $featured = ""; $gamelink = $base_url."index.php?action=playgame&gameid=$gameid"; $editlink = "index.php?action=editgame&bt=$bt&id=$gameid"; $deletelink = "index.php?action=deletegame&bt=$bt&id=$gameid"; $content.=" <tr> <td><a href=\"$gamelink\" target=\"_blank\">$gametitle</a></td> <td>$category</td> <td>$playedtoday</td> <td>$timesplayed</td> <td>$featured</td> <td>$reports</td> <td>$gamestatus</td> <td><a href=\"$editlink\" title=\"Edit Game\"><img src=\"./images/icon_edit.gif\" border=\"0\"></a> / <a href=\"$deletelink\" title=\"Delete Game\"><img src=\"./images/icon_delete.gif\" border=\"0\"></a></td> </tr>"; } }else{ $content.="<tr><td colspan=\"7\">No Games Found</td></tr>"; } $content.="</tbody> <tfoot> <td colspan=\"7\" class=\"product_listing\" style=\"text-align:center\"> <a href=\"#\" onclick=\"pageexample('previous'); return false;\">&lt;&lt;&nbsp;Previous</a>&nbsp;&nbsp; Page <span id=\"t1page\"></span>&nbsp;of <span id=\"t1pages\"></span>&nbsp;&nbsp; <a href=\"#\" onclick=\"pageexample('next'); return false;\">Next&nbsp;&gt;&gt;</a> </td> </tfoot> </table>"; return $content; }
Reason being the default right now is set on "all". The problem with this setting is that it shows ALL the games. That isnt bad if you want to find one specific game....once with a ctrl+f or something. But starting on that page, if you have more than 500 games it must load those 500 games every single time you visit the page. I have over 2500 so the 5-10 seconds this takes to load when i'm trying to move large quantities of games around takes forever.

I know this is a very easy edit but my html/php skills are not up to par for even that.
Ryan1212 is offline  
Digg this Post!
Reply With Quote
Old 07-30-2008, 09:00 PM   #2 (permalink)
2GrandArcade
Senior Member
 
Join Date: Feb 2007
Posts: 511
2GrandArcade is on a distinguished road


Default

to change to what.
the third sql
Quote:
$sql = "SELECT gameid,gametitle,category,timesplayed,gamestatus,p layedtoday,featured,dateadded,reports from games ORDER BY gametitle ASC";
is what you change to have it show a certain way.
example:
Quote:
$sql = "SELECT gameid,gametitle,category,timesplayed,gamestatus,p layedtoday,featured,dateadded,reports from games WHERE category=5 ORDER BY gametitle ASC";
that will show the action category if the action category id is 5.
you can have it show just games that were added x time ago,if the games have a time stamp.

if you want it switchable,well that takes some coding.
2GrandArcade is offline  
Digg this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Arcade Script Reviews arcadillo Scripts & Software 6 08-08-2008 02:35 AM


All times are GMT -6. The time now is 01:17 AM.


Powered by vBulletin® Version 3.6.3
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.0.0 RC6
© TalkArcades.com
Forum - Register - Calendar - Memberlist - FAQ - Search