View Full Version : Minifreunde Over ere.
Ryangel
08-28-2002, 01:36 PM
ok ... now i wasted 20 mins reading 6 pages of nonsense .. ermmm ... discussion back in the Full Release Room and the thread was closed and i cant discuss this :alien: well, here it is
originally post by minifreunde
Cool Vdinh!
Your Online-Thing works like a charm!!!
Question: Any Idea, how to make the "Tetris-King Addon" work with all other Arcade-Games (like on the Main Arcade Page)?
Heres the Functions-Code for 2.2.5:
Currently I'm using 3 extra queries to the showthread.php to do this ... Still wrecking my brain on how to make this into one query if possible. hmmm...
g-force2k2
08-28-2002, 02:26 PM
well what are the three queries that you're currently trying to run? regards...
g-force2k2
Ryangel
08-28-2002, 02:54 PM
These are the 4 queries that i use atm that works in showthread.php
$tetrisleaderboard = $DB_site->query_first('SELECT userid FROM arcade WHERE game = "tetris" ORDER BY score DESC LIMIT 1');
$tetriskingid = $tetrisleaderboard['userid'];
$pacmanleaderboard = $DB_site->query_first('SELECT userid FROM arcade WHERE game = "pacman" ORDER BY score DESC LIMIT 1');
$pacmankingid = $pacmanleaderboard['userid'];
$spaceinvadersleaderboard = $DB_site->query_first('SELECT userid FROM arcade WHERE game = "spaceinvaders" ORDER BY score DESC LIMIT 1');
$spaceinvaderskingid = $spaceinvadersleaderboard['userid'];
$snakeleaderboard = $DB_site->query_first('SELECT userid FROM arcade WHERE game = "snake" ORDER BY score DESC LIMIT 1');
$snakekingid = $snakeleaderboard['userid'];
though .... it'll be great if one query is posible... I have tried:
$leaderboard_query = $DB_site->query("SELECT game,userid, MAX(score) as score FROM arcade GROUP BY game ORDER BY score DESC");
while($leaderboard = $DB_site->fetch_array($leaderboard_query)){
if($leaderboard['game']=="tetris")
$tetriskingid = $leaderboard['userid'];
if($leaderboard['game']=="pacman")
$pacmankingid = $leaderboard['userid'];
if($leaderboard['game']=="spaceinvaders")
$spaceinvaderskingid = $leaderboard['userid'];
if($leaderboard['game']=="snake")
$snakeinvaderskingid = $leaderboard['userid'];
}
but this doesnt pull the userid and the max(score) to the same row... argh.
g-force2k2
08-28-2002, 03:36 PM
hmm... i think (from my past experiences) that they have to be seperate queries... unless you don't show them all on the same page... if they're shown seperately you can do something but if they're all included on one page i don't think its possible to do... (like i said from my experience ;))
regards...
g-force2k2
Kars10
08-28-2002, 03:56 PM
Hi Ryangel!!
Im very sad about closing the tetris-Thread...now i find this!!
Cool, hope you get it work...:D
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.