diff options
author | arun <arun@nubati.net> | 2007-02-03 05:13:42 +0000 |
---|---|---|
committer | arun <arun> | 2007-02-03 05:13:42 +0000 |
commit | 14e087ec31455a9d1780ffbf6a2cf883d9b6bfc5 (patch) | |
tree | 475aae10ac3472ed214634969818ef61a861a455 /index.php | |
parent | 15e85c12f9392246845f5c611f5faafe8660a9e2 (diff) | |
download | e-DoKo-14e087ec31455a9d1780ffbf6a2cf883d9b6bfc5.tar.gz e-DoKo-14e087ec31455a9d1780ffbf6a2cf883d9b6bfc5.tar.bz2 e-DoKo-14e087ec31455a9d1780ffbf6a2cf883d9b6bfc5.zip |
only ask for a new game in a session, if it was the latest game
Diffstat (limited to 'index.php')
-rw-r--r-- | index.php | 19 |
1 files changed, 16 insertions, 3 deletions
@@ -782,9 +782,22 @@ else if(myisset("me")) while( $r = mysql_fetch_array($result,MYSQL_NUM)) echo " FINAL SCORE: ".$r[0]." ".$r[1]."<br />"; - /* suggest a new game with the same people in it, just rotated once */ - $names = DB_get_all_names_by_gameid($gameid); - output_ask_for_new_game($names[1],$names[2],$names[3],$names[0],$gameid); + + $session = DB_get_session_by_gameid($gameid); + $result = mysql_query("SELECT id,create_date FROM Game". + " WHERE session=$session". + " ORDER BY create_date DESC". + " LIMIT 1"); + $r=-1; + if($result) + $r = mysql_fetch_array($result,MYSQL_NUM); + + if(!$session || $gameid==$r) + { + /* suggest a new game with the same people in it, just rotated once */ + $names = DB_get_all_names_by_gameid($gameid); + output_ask_for_new_game($names[1],$names[2],$names[3],$names[0],$gameid); + } } break; default: |