PDA

View Full Version : [HOW-TO] Make 'Newest Champions' clickable


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

Sharp Intellect
01-10-2009, 07:30 PM
this is a cool mod, but isn't working for me. All games are linking to /arcade.php?do=play&gameid=

Please help. Thanks!

GreasySpoon
01-10-2009, 07:44 PM
Sorry, my fault. I've missed the second line in our arcade.php

It was to early in the morning ;)

See the first post, i have added the second line.

Sharp Intellect
01-10-2009, 07:51 PM
beautiful. Thank you.

stangger5
01-11-2009, 10:13 AM
Hey GreasySpoon ,,,check out my arcade (http://www.next-level-arcade.com/ibproarcade.php?&act=Arcade) ..

I added the game images to the Newest Champions and Latest Arcade Score..

GreasySpoon
01-11-2009, 03:16 PM
Hi stangger5,

really not bad. Good job.

Greets

erjavid
02-04-2009, 08:22 PM
Thank you