Quote:
Originally Posted by sabret00the
got about 20 games, and to hardcode it would mean having to edit the page source every time i add a game, where if it was automatically done via the database it would say me so much stress.
|
I dunno a sh!t's worth about the proarcade's system, but this might help:
try doing this query in the segment of the proarcade.php file that is used whenever you view/play a game:
Code:
$gamenames = $DB_site->query('SELECT gameid,gamename FROM
gametable ORDER BY gamename ASC');
where
gameid is the game id column name,
gamename is the fieldname in your database table that holds the title of each game, and
gametable is the name of the right table for that
then add this code below that:
Code:
$gamenamesblock = '<table border="0"><tr valign="top"><td>';
$numgames = $DB_site->num_rows($gamenames);
$halfway = ceil($numgames/2);
$counter = 0;
while ($row = $DB_site->fetch_array($gamenames))
{
if ($counter++ == $halfway)
{
$gamenamesblock .= '</td><td>';
}
$gamenamesblock .= "<a href='proarcade.php?game=$row[gameid]'>$row[gamename]</a><br>\n";
}
$gamenamesblock .= '</td></tr></table>';
(make sure to adjust the link to point to the right stuff for proarcade.php !)
and then you can use
$gamenamesblock in the template that is used for the games (make sure that you use the template that is used in that same segment of proarcade.php where you place this code in).
Should work.