Version: , by jonty
Developer Last Online: Nov 2021
Version: Unknown
Rating:
Released: 05-25-2010
Last Update: Never
Installs: 0
No support by the author.
After altering index.php to enable scores to be saved, we had an issue with 'notice' messages appearing at the top of the index.php page.
From what i can make out, this is just a warning that variables havent been set or don't exist.
The reason some sites get it and others dont, is that you can turn this off in php.ini if you have access.
I didn't really want to mess about with the .ini file, so I've set a few checks in the script for index.php.
Works for us, hope it works for you too.
This is replacement code for the code in the "INFO - vbadvanced or another Portal.txt" document
case "saveGame":
$_GET['do'] = "pnFSaveGame";
break;
case "loadGame":
$_GET['do'] = "pnFLoadGame";
break;
case "loadGameScores":
$gid = $vbulletin->input->clean_gpc('p', 'gid', TYPE_INT);
$uid= $vbulletin->userinfo['userid'];
$game = $db->query_first("SELECT * FROM " . TABLE_PREFIX . "games_scores WHERE mid=$uid AND gid = $gid ORDER BY score DESC LIMIT 0,1");
$scores = $game[score];
if($scores != false)
{
//Return true
print "&opSuccess=true&gameScores=$scores&endvar=1"; //send endvar to keep opSuccess separate from all other output from PostNuke
}
else
{
print "&opSuccess=false&error=Error&endvar=1";
}
break;
}
}
might do the trick
(I'm not sure if php processes the whole conditional (in which case it might fail) or if it just process the first part (in which case it should work).
I did do this code replacement trying to fix the problem below with no luck.
What is interesting is that the error messages have disappeared and I don't get the security token error...but... the only games on my arcade that save their score are the ones that come with the mod. Every other game I have loaded... 52 at the moment... will play and seem to work, but when you finish the game and submit the score, the screen just stays blank and the screen never changes.
I will investigate this new issue and see what I can find.
But again... thank you very much for your work. :up:
Yes! This worked! You are a gentleman and a scholar!
I did do this code replacement trying to fix the problem below with no luck.
What is interesting is that the error messages have disappeared and I don't get the security token error...but... the only games on my arcade that save their score are the ones that come with the mod. Every other game I have loaded... 52 at the moment... will play and seem to work, but when you finish the game and submit the score, the screen just stays blank and the screen never changes.
I will investigate this new issue and see what I can find.
But again... thank you very much for your work. :up:
i got that and discovered it was the v32 versions of the games that froze, but the v2 games were ok.
I'll amend the first script with the changes that worked. :up: