GreasySpoon
01-10-2009, 08:15 AM
If you want to get the game name in the 'Newest Champions' field clickable (as a link), than you have to modify only two lines in the arcade.php
Demo (http://www.netzwelt.de/forum/arcade.html)
Find:
$DB->query("SELECT c.*, g.gcat, cat.password FROM ibf_games_champs AS c, ibf_games_list AS g, ibf_games_cats AS cat WHERE c.champ_gid=g.gid AND g.gcat=cat.c_id AND g.active=1 AND trim(password)='' ORDER BY champ_date DESC LIMIT 0,5");
Replace with:
$DB->query("SELECT DISTINCT c.*, g.gcat, g.gid, cat.password FROM ibf_games_champs AS c, ibf_games_list AS g, ibf_games_cats AS cat WHERE c.champ_gid=g.gid AND g.gcat=cat.c_id AND g.active=1 AND trim(password)='' ORDER BY champ_date DESC LIMIT 0,5");
Find:
$row['text'] = preg_replace("/<% GAMENAME %>/i", $row['champ_gtitle'] , $row['text'] );
Replace with:
$row['text'] = preg_replace("/<% GAMENAME %>/i", '<a href="arcade.php?do=play&gameid=' . $row['gid'] . '" title="' . $row['champ_gtitle'] . '">' . $row['champ_gtitle'] . '</a>' , $row['text'] );
Enjoy
Demo (http://www.netzwelt.de/forum/arcade.html)
Find:
$DB->query("SELECT c.*, g.gcat, cat.password FROM ibf_games_champs AS c, ibf_games_list AS g, ibf_games_cats AS cat WHERE c.champ_gid=g.gid AND g.gcat=cat.c_id AND g.active=1 AND trim(password)='' ORDER BY champ_date DESC LIMIT 0,5");
Replace with:
$DB->query("SELECT DISTINCT c.*, g.gcat, g.gid, cat.password FROM ibf_games_champs AS c, ibf_games_list AS g, ibf_games_cats AS cat WHERE c.champ_gid=g.gid AND g.gcat=cat.c_id AND g.active=1 AND trim(password)='' ORDER BY champ_date DESC LIMIT 0,5");
Find:
$row['text'] = preg_replace("/<% GAMENAME %>/i", $row['champ_gtitle'] , $row['text'] );
Replace with:
$row['text'] = preg_replace("/<% GAMENAME %>/i", '<a href="arcade.php?do=play&gameid=' . $row['gid'] . '" title="' . $row['champ_gtitle'] . '">' . $row['champ_gtitle'] . '</a>' , $row['text'] );
Enjoy