Joined: May 22, 2003 Posts: 23945 Location: NSW, Australia
Posted: Thu Jun 23, 2005 10:12 am Post subject: pnFlashGames for PHPNuke v0.5++ (VIP) Testers needed!
Hi VIP Members,
- New Search Function
- Sort Functions
- My Settings (members only)
Im hoping some of you may want to test the new v0.5++ version which im going to release to all very soon.. I just want to make sure there are no huge bugs..
Hi FH,
You may want to check my post regarding saving scores that already exist. It seems score field is part of a unique key, thus when the same score is already recorded, your score wont save. This means that you cant have two (or more) scores of 1000 in the same game.
BTW, I am using PHPNUKE 7.8 patched and pnflashgames 0.4.
I may have found where the problem is...
I found the ff lines in index.php in module folder for Flash_games, as well as in the oldcomponent.php.
I commented out those specific to double scores. My reasoning being is, if i played 2 hrs and it happened that I tied the score of the first placer, I will not get a credit for that??? At least give me the second place ...
Code:
// check if user has already got this score in the database
$sql2 = "SELECT * FROM ".$prefix."_flashgames_hiscores WHERE gid=$game_id and playerscore=$player_score";
$count = 0;
$result = $db->sql_query($sql2);
if(sql_num_rows($result, $db) > 0) {
// identical score found so display error that game not saved
echo "&opSuccess=false&error=notloggedin&endvar=1";
die();
}else{
// no score found for user so save this score
sql_query("INSERT INTO $prefix"._flashgames_hiscores." (hid,gid,gamename,playername,playerscore,date) VALUES ('','$game_id','$game_name', '$player_name','$player_score','$date')", $dbi);
}
Code:
// check if user has already got this score in the database
$sql2 = "SELECT * FROM ".$prefix."_flashgames_hiscores WHERE gid=$game_id and playerscore=$player_score";
$count = 0;
//$result = $db->sql_query($sql2);
//if(sql_num_rows($result, $db) > 0) {
// identical score found so display error that game not saved
//echo "&opSuccess=false&error=notloggedin&endvar=1";
// die();
//}else{
// no score found for user so save this score
sql_query("INSERT INTO $prefix"._flashgames_hiscores." (hid,gid,gamename,playername,playerscore,date) VALUES ('','$game_id','$game_name', '$player_name','$player_score','$date')", $dbi);
//}
usapmaster Xbox-HQ User
Joined: Apr 26, 2005 Posts: 17
Posted: Fri Oct 07, 2005 8:50 pm Post subject:
I know am playing around.. I revised the query statement to foolproof saving of scores...there is a possibility that the same game's score maybe submitted more than once.
Now my flashgames can record same scores!
Code:
// check if user has already got this score in the database
//$sql2 = "SELECT * FROM ".$prefix."_flashgames_hiscores WHERE gid=$game_id and playerscore=$player_score";
$sql2 = "SELECT * FROM ".$prefix."_flashgames_hiscores WHERE gid=$game_id and playerscore=$player_score and playername=$player_name and date=$date";
usapmaster Xbox-HQ User
Joined: Apr 26, 2005 Posts: 17
Posted: Fri Oct 07, 2005 8:52 pm Post subject:
I know am playing around.. I revised the query statement to foolproof saving of scores...there is a possibility that the same game's score maybe submitted more than once.
Now my flashgames can record same scores! Make sure to edit your codes using notepad. I think wordpad is messing it up.
Code:
// check if user has already got this score in the database
//$sql2 = "SELECT * FROM ".$prefix."_flashgames_hiscores WHERE gid=$game_id and playerscore=$player_score";
$sql2 = "SELECT * FROM ".$prefix."_flashgames_hiscores WHERE gid=$game_id and playerscore=$player_score and playername=$player_name and date=$date";
forahobby Administrator
Joined: May 22, 2003 Posts: 23945 Location: NSW, Australia
Posted: Sat Oct 08, 2005 3:17 am Post subject:
Quote:
You may want to check my post regarding saving scores that already exist. It seems score field is part of a unique key, thus when the same score is already recorded, your score wont save. This means that you cant have two (or more) scores of 1000 in the same game.
BTW, I am using PHPNUKE 7.8 patched and pnflashgames 0.4.
Why would you want more then one score..?? Especially since its the same points.. The hiscores chart would look ugly becausse you would just see the same user over and over which i think is silly.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You cannot download files in this forum