PDA

View Full Version : Javascript Popup on Highscore (optional)


Citizen
06-22-2010, 08:13 PM
Many games don't redirect to the highscores page when the scores are submitted. Lets add a javascript popup on highscore for mochimedia and gamersafe games.

Here's a nice GPL script:

http://colorpowered.com/colorbox/


Edit: we'll have these three options:

1. No redirect or notification
2. Redirect to highscore page after score is submitted
3. JS Popup on highscore is submitted

miro912
06-23-2010, 10:15 PM
you can use the callback-funktion from the mochibridge to load the highscore.php after a score is saving.
add over the line in the game.tpl

Mochi.addLeaderboardIntegration(options);
this:

options.callback = function (params) { setTimeout("location.href ={/literal}'./highscore.php?highscore={$aGame.game_id}'{literal}",3000); }
i use this on my site http://www.gamingplazza.de

Citizen
06-24-2010, 07:40 PM
Thanks, we'll go ahead and add three options then:

1. No redirect or notification
2. Redirect to highscore page after score is submitted
3. JS Popup on highscore is submitted

bigrossco
06-24-2010, 08:20 PM
great options, would love to have a redirect to highscore page after score submitted as this is much preferd by many gammers

arcade
07-30-2010, 05:54 PM
you can use the callback-funktion from the mochibridge to load the highscore.php after a score is saving.
add over the line in the game.tpl

Mochi.addLeaderboardIntegration(options);
this:

options.callback = function (params) { setTimeout("location.href ={/literal}'./highscore.php?highscore={$aGame.game_id}'{literal}",3000); }
i use this on my site http://www.gamingplazza.de

can you explain step by step ? i dont understand ...
thanks in advanced

miro912
07-30-2010, 08:38 PM
thats for the "old" SAA 1.3, the 1.4 sve the score in background and refresh the scores via ajax, no need to reload the page for 1.4