View Full Version : Arcade - Leader Board (v1.4)
Oblivion Knight
02-22-2005, 10:00 PM
This addon provides you with a Leader Board for v3arcade. Currently, it cannot be used for ibProArcade - if you adapt it, please share the code so that it can be added to the zip. You'll be credited for the work.
Dechevious has written a similar addon to this, but this code has been written from scratch and is far more optimized.. Currently, it is not fully phrased - but then again neither is v3arcade itself. Thanks to DRJ (https://vborg.vbsupport.ru/member.php?u=73443) for his contributions toward v1.4. Enjoy!
Version History:
? 1.0 - Original mod released.
? 1.1 - Cached 2 previously uncached templates.
? 1.2 - Query changed, orders count by DESC and userid by ASC.
? 1.3 - *CRITICAL UPDATE* - Optimized query, improved performance.
? 1.4 - arcade.php code block and arcade_kings_bit template changed.
Please click install if you find this useful.. :)
yoyoyoyo
02-23-2005, 12:37 PM
It only took me around 3 minutes to add and it seems to work fine. Thanks!
Creed
02-23-2005, 12:46 PM
I'm installing now, but I have had a hard time finding any of the hacks done by Dechevious or anyone else over at www.v3arcade.com :( I really need the a-z navigation hack, as well as the scrolling news hack. If you have any ideas were to find them let me know!
Oblivion Knight
02-23-2005, 12:47 PM
http://www.v3arcadegames.com/forums/forumdisplay.php?f=13
I believe the addons are free to all.. :)
Creed
02-23-2005, 12:48 PM
Wow, that was quick! I didn't know they had a different site up now...or maybe I was just going to the wrong place ;) THX!!!
Oblivion Knight
02-23-2005, 12:52 PM
It's an unofficial v3arcade "fansite". There's a membership fee if you wish to download the games there..
Like I say, I'm fairly sure Dechevious said that the addons are free to all though.
SVTOA
02-23-2005, 02:43 PM
Nice work Andy. Quick and easy.
thanks, will do the switch ;)
msimplay
02-23-2005, 04:58 PM
installed thank you that worked well :D
DR?@M W?@V?R
02-24-2005, 08:30 AM
Nice addon :)
Uncached templates: ARCADE (1)
Uncached templates: arcade_header (1)
Change:
$globaltemplates = array(
'arcade_kings',
'arcade_kings_bit'
);
To:
$globaltemplates = array(
'ARCADE',
'arcade_header',
'arcade_kings',
'arcade_kings_bit'
);
Oblivion Knight
02-24-2005, 08:59 AM
Whoops, sorry about that.. :o
I've modified my arcade.php file significantly, and all templates are called at the beginning of my file - so I added that bit of code purely for this release and never tested it. I'll update the zip shortly.
[EDIT]
Zip updated.
MrLovellz
02-24-2005, 11:45 AM
Done that DR@M W@VR , but what exactly does it do lol ?
Oblivion Knight
02-24-2005, 11:49 AM
Done that DR?@M W?@V?R , but what exactly does it do lol ?Uncached templates add unnecessary queries to the addon. Instead of performing 7 queries, it runs 9. This has now been fixed in the zip.. :)
Big boards... stay away from this hack, it kills your server.
Oblivion Knight
02-24-2005, 03:21 PM
I can't imagine the query being overly intensive, but then again I'm no expert..
My board only has 300 members, and the microstats didn't show anything out of the ordinary.
Page generated in 0.09496593 seconds (42.80% PHP - 57.20% MySQL) with 7 queries
Total Time Spent Playing: 3m 2w 6d 19h 32m 43s
Total Plays: 33458
With around 200+ games.
It put too much pressure on my server, taking about 10 seconds for the results to show up.
Total Time Spent Playing: 3m 2w 6d 19h 32m 43s
Total Plays: 33458
With around 200+ games.
It put too much pressure on my server, taking about 10 seconds for the results to show up.
can you show us what comes in your footer?
Page generated ....................
can you show us what comes in your footer?
Page generated ....................
Err... dont have microstats installed and I've removed the hack. Sorry.
Oblivion Knight
02-25-2005, 07:33 PM
v1.3 has now been released, which should hopefully fix the issue with running this addon on large boards.. It was sent to M1th for him to test, but I never got a response - it has been tested on 2 other fairly active forums, both with positive results.
Sorry, was busy with things.
I have it installed as well and working great. :)
Good work, Andy!
Oblivion Knight
02-25-2005, 07:36 PM
That's good to hear.! :D
M1th, if you want the updated layout (check the new screenshot) - update the 2 added templates.
Thanks for the hack ..
Clicked install
That's good to hear.! :D
M1th, if you want the updated layout (check the new screenshot) - update the 2 added templates.
<img src="$stylevar[imgdir_arcade]/king$row.gif" alt="" />
Good one, though I'd suggest changing the image src to the above... mostly for those who remote host images. :)
SVTOA
02-26-2005, 02:35 AM
Well.. after doing the latest version, now I have 4 uncached templates. Will have to manually edit I guess...
SVTOA
02-26-2005, 02:47 AM
I can't imagine the query being overly intensive, but then again I'm no expert..
My board only has 300 members, and the microstats didn't show anything out of the ordinary.
Page generated in 0.09496593 seconds (42.80% PHP - 57.20% MySQL) with 7 queries
After manually editing the latest update, I get no uncached templates and
Page generated in 0.08542895 seconds (91.42% PHP - 8.58% MySQL) with 7 queries.
How come your ratio of php-to-MYSQL is so much different? Isn't 57% MYSQL kind of high???
Oblivion Knight
02-26-2005, 06:27 AM
Whoops.! As mentioned earlier in this thread, my arcade.php file is significantly different to the default. All of my templates are cached at the beginning of the file and I added a block of code to the arcade.php file to cater for the default arcade.php file, I just forgot to re-add it in the new version of the zip.. :ermm:
The zip has now been updated.
After manually editing the latest update, I get no uncached templates and
Page generated in 0.08542895 seconds (91.42% PHP - 8.58% MySQL) with 7 queries.
How come your ratio of php-to-MYSQL is so much different? Isn't 57% MYSQL kind of high???Those statistics were from 1.2.. ;) - It's now running at:
Page generated in 0.04567409 seconds (88.21% PHP - 11.79% MySQL) with 7 queries
Vevina
02-26-2005, 01:27 PM
Sweet installed .... Really easy for a blonde too :p
djjeffa
02-26-2005, 09:44 PM
Big boards... stay away from this hack, it kills your server.
question how do you tell what hacks kill your boards and whick dont?
PS great hack installed I have 13,000 members is that big lol
question how do you tell what hacks kill your boards and whick dont?
PS great hack installed I have 13,000 members is that big lol
You needn't worry about this hack anymore. The query has been greatly improved and it'll run good on any board. :)
As for your question, you can install the microstats hack to check the query stats on every page.
djjeffa
02-26-2005, 10:04 PM
You needn't worry about this hack anymore. The query has been greatly improved and it'll run good on any board. :)
As for your question, you can install the microstats hack to check the query stats on every page.
thanks fo rthe info
now to try to solve this other problem but i dont think its from this hack, the leaded list is not right but nor is the post bit here is what i have:
here it says im the champ http://www.djjeffa.com/vb//arcade.php?do=scores&name=spaceinvaders
but in my profile it says im not http://www.djjeffa.com/vb/arcade.php?do=stats&userid=3
now the thing is I did get the high score in a chalange so do you guys have any ideal why its not showing up?
the screen shoots are here https://vborg.vbsupport.ru/showpost.php?p=611918&postcount=3149
Oblivion Knight
02-26-2005, 11:28 PM
now to try to solve this other problem but i dont think its from this hack, the leaded list is not right but nor is the post bit here is what i have:
here it says im the champ http://www.djjeffa.com/vb//arcade.php?do=scores&name=spaceinvaders
but in my profile it says im not http://www.djjeffa.com/vb/arcade.php?do=stats&userid=3
now the thing is I did get the high score in a chalange so do you guys have any ideal why its not showing up?
the screen shoots are here https://vborg.vbsupport.ru/showpost.php?p=611918&postcount=3149If it is only Space Invaders that does this, try removing the game and re-installing it.. It's a strange issue indeed, and I've never come across it before.
thanks for the latest update... the hacks is really promising and stable...
neocorteqz
03-09-2005, 02:45 AM
Thanks for the hack, very nice work.
Page generated in 0.13486290 seconds (91.03% PHP - 8.97% MySQL) with 9 queries
one quick question, Are you planning on coding this for non vB pages? I installed webtemplates (https://vborg.vbsupport.ru/showthread.php?t=76422), and can't seem to get it to work right.
http://www.nemesisforums.net/view.php?pg=arcade_leader
Oblivion Knight
03-09-2005, 10:48 AM
I don't plan on doing this personally, since I don't have webtemplates installed..
Anyone else is free to adapt it though - and hopefully they'll share the code. :)
neocorteqz
03-09-2005, 05:11 PM
I don't plan on doing this personally, since I don't have webtemplates installed..
Anyone else is free to adapt it though - and hopefully they'll share the code. :)
I'll figure it out eventually. I usually just stublem apon things.
I was just wondering if you were possibly going to code it for a non vB page, then all i'd have to do is fill in theblanks. No worries though.. :)
Very Nice work on this. :)
Q-v-n-s-Q
03-10-2005, 05:49 PM
GJ, i love it
I installed this mod... the templates are really good, it blends in really well with the whole arcade... good job :)
Vevina
03-12-2005, 02:01 PM
is there a way of clearing the Top Scorers on the leader board .. ive set all my games score settings back to Zero but need to clear Top Scorers too ????
Vevina
03-12-2005, 02:07 PM
its ok finaly worked it out d'oh!
Chrissicom
03-13-2005, 09:56 AM
I can't imagine the query being overly intensive, but then again I'm no expert..
My board only has 300 members, and the microstats didn't show anything out of the ordinary.
Page generated in 0.09496593 seconds (42.80% PHP - 57.20% MySQL) with 7 queries
sweet hack I installed it :-)
Great hack. Easy to install, only a few minutes.
I did make two changes for myself
in Arcade.php I ordered by username ASC instead of userid ASC since that makes more sense to me.
In template arcade_kings_bit
I wanted to fix the plural Titles for when there was only 1 title
Find
$kings[count] Arcade Titles
Replace With
<if condition="$kings['count']==1">
$kings[count] Arcade Title
<else />
$kings[count] Arcade Titles
</if>
Thanks for the hack.
I also made this mod. What I wanted was if there was a tie for a certain place then everyone should get that trophy. So if there is a tie for first then both users should have a gold, there would then be no silver and the next prize would be bronze.
If there is a three way (or more tie) then they would all get gold and there would be no silver or bronze. I believe I have this working properly, but it is hard to tell for sure. So maybe some other users that have a tie for first, second, or third could test this.
Here is the whole mod for arcade.php
// ######################### ARCADE LEADER BOARD ###########################
if ($_GET['do'] == "lboard") {
$globaltemplates = array(
'ARCADE',
'arcade_header',
'arcade_kings',
'arcade_kings_bit'
);
require_once('./global.php');
require_once('./includes/functions_user.php');
require_once('./includes/functions_arcade.php');
$navbits = array("arcade.php?$session[sessionurl]" => "Arcade");
$navbits[""] = "Leader Board";
$highscorers = $DB_site->query("
SELECT COUNT(games.highscorerid) AS count, user.username, user.userid FROM " . TABLE_PREFIX . "games AS games
LEFT JOIN " . TABLE_PREFIX . "user AS user ON user.userid = games.highscorerid
WHERE user.userid IS NOT NULL
GROUP BY user.username, user.userid ORDER BY count DESC, user.username ASC LIMIT 10
");
$row = '0';
$awards = '0';
$leaders = '0';
while ($kings = $DB_site->fetch_array($highscorers)) {
$leaders++;
if ($awards<>$kings[count]){
$row=$leaders;
}
$awards=$kings[count];
eval('$listkings .= "' . fetch_template('arcade_kings_bit') . '";');
}
$DB_site->free_result($highscorers);
eval('$arcadebody = "' . fetch_template('arcade_kings') . '";');
}
Oblivion Knight
03-14-2005, 06:53 AM
in Arcade.php I ordered by username ASC instead of userid ASC since that makes more sense to me.It was done as userid because I felt that there should be some advantages to being an older member.. :) - It's all down to personal perference with that one.
The other 2 changes you've made may be integrated into 1.4 once tested and confirmed as working, you'll be given credit for this of course.
Sleepyk
03-25-2005, 12:07 AM
Real nice add-on worked easy
frankenberrie
04-18-2005, 03:34 PM
Very nice addition. Added to my Arcade!
BlackxRam
04-24-2005, 08:21 AM
Any way this will get adapted to work for the other arcade system and not V3acade?
Oblivion Knight
04-24-2005, 08:55 AM
Any way this will get adapted to work for the other arcade system and not V3acade?Not by me.. I have no plans to make the switch from v3arcade.
MauriceReed
04-24-2005, 12:52 PM
it would be an excellent addition to IBPRO tho...anyone up for having a bash at the conversion??
msimplay
04-24-2005, 01:38 PM
Not by me.. I have no plans to make the switch from v3arcade.
i second that i have no plans to move from v3arcade just yet :D
Lionel
04-24-2005, 01:41 PM
i second that i have no plans to move from v3arcade just yet :D
me third
marceb
04-27-2005, 05:58 PM
Thank you for this addon. Clicks install.
Is there a way to get the cups (gold,silver and bronze) into the users postbit. I have seen all the individual game awards in postbit, but i think that it is just clutter. The cups would be far better and more of a challenge for users to aim for.
iceytdot
05-10-2005, 04:30 AM
clicks install.... nice job just what i needed!
beansbaxter
05-28-2005, 10:15 AM
worked perfect!
Osiris2k
05-29-2005, 09:57 PM
one question
how do I add a template?
NVM, lol. do I ever feel stupid :)
Great HACK!
Casperddc
06-13-2005, 02:52 PM
Thank you for this addon. Clicks install.
Is there a way to get the cups (gold,silver and bronze) into the users postbit. I have seen all the individual game awards in postbit, but i think that it is just clutter. The cups would be far better and more of a challenge for users to aim for.
I'm looking for this too, as I'm sick of all the game awards showing in the postbit. To have it just show the top 3 awards in the postbit would be perfect. - any help?
* Casperddc clicks install
MorrisMcD
07-10-2005, 12:35 AM
Awesome hack..
:clicks install:
Prodimysterio
07-27-2005, 07:16 PM
This is really strange. Check out this error I receive when I attempt to click on "Leader Board" in my arcade:
Fatal error: Call to undefined function: print_no_permission() in forums/arcade.php on line 1390.
I looked up line 1390 and here it is literally:
}
Any clues here, because I'm totally lost...
Prodimysterio
07-27-2005, 07:19 PM
Gah, nevermind. It was a simple mistake on my behalf.
d'oh!
skipper1972
07-28-2005, 03:15 AM
um, ok.... I must be blind.... where the heck is the "add template" section in the CP? Every hack I ever installed added templates automatically... then I'd just add liens above or below in certain files........
Little help? Sorry for seemingly newbie question, never had to do this before, but with a game going on at site, need to get this going.
Thanks!
Marco van Herwaarden
07-28-2005, 03:50 AM
You will find an 'Add Template' option in the dropdown menu behind each style.
Warlord
07-30-2005, 07:46 PM
Nice mod, easy install.
Gutspiller
08-04-2005, 06:44 PM
You really show tell people to upload the arcade.php and images in your instructions.
Gutspiller
08-07-2005, 04:30 AM
When I remove a game from being displayed and tracked in the original V3Arcade mod it hides everything, but it still shows the icon and the stats for the game in the Stats of the player. Is that the leaderboard hack doing it or the original v3arcade hack? I don't want it to show up in there when I've hid it using the adminCP.
please let me know as this is a little annoying.
Oblivion Knight
08-07-2005, 09:08 AM
If it's doing that in the player stats, it will be the original v3arcade mod.
The leader board doesn't touch that particular section of code.
faast
08-07-2005, 04:27 PM
If it's doing that in the player stats, it will be the original v3arcade mod.
The leader board doesn't touch that particular section of code.
What if I remove the game completely? Will anything show up based on the ex-game?
Oblivion Knight
08-07-2005, 04:47 PM
What if I remove the game completely? Will anything show up based on the ex-game?Nope, the ranking count of the player who was champion of that game will be decreased by 1 automatically if it is removed from the database.. :)
faast
08-07-2005, 04:53 PM
Great work! Installed.
thephonemall
08-31-2005, 07:28 PM
Anyone know how I can fix this?
https://vborg.vbsupport.ru/
faast
09-01-2005, 03:53 AM
Anyone know how I can fix this?
http://www.thephonemall.net/images/leaderboardTEMP.gif
it's right..
there is a tie (ie more than 1 player has xx awards)
same here: www.makecommercefun.com
csidlernet
09-02-2005, 05:25 AM
ty *installs
alyster4k
09-07-2005, 03:21 AM
Thanks for the hack!
Anyone 'morphed' this into a block on vBadvanced CMPS yet? I'd like the leaderboard stats on my portal as well.
tuanluu
09-08-2005, 03:37 AM
will this work on 3.3.8 vb?
Marco van Herwaarden
09-08-2005, 05:08 AM
will this work on 3.3.8 vb?
Where did you download that version?
G-Unot
09-16-2005, 07:40 PM
This is very nice, and very nice to keep track.
*installed*
Da Chang Gang
09-16-2005, 08:01 PM
I'm installed it and all I get for the leader board is a blank page.
G-Unot
09-16-2005, 11:19 PM
then you must have done, something wrong in you arcade.php
sinoeu
10-09-2005, 07:13 PM
then you must have done, something wrong in you arcade.php
Is this hack ready for vb3.5?
HarryBO
11-06-2005, 01:17 PM
Nice Hack! It works fantastic.
vBulletin® v3.8.12 by vBS, Copyright ©2000-2024, vBulletin Solutions Inc.