X-Git-Url: https://git.nubati.net/cgi-bin/gitweb.cgi?p=e-DoKo.git;a=blobdiff_plain;f=index.php;h=e58bae69b437e6bb81b01607e4c4dbe28d8d8bb3;hp=e33b49b48624a4572cbf7f4b111f446f0360acf6;hb=15e85c12f9392246845f5c611f5faafe8660a9e2;hpb=63908b2063ccdeb9690b9c685cf1a1eb41ef2e59 diff --git a/index.php b/index.php index e33b49b..e58bae6 100644 --- a/index.php +++ b/index.php @@ -63,7 +63,17 @@ else if( myisset("PlayerA", "PlayerB","PlayerC","PlayerD" )) if(myisset("followup") ) { $followup= $_REQUEST["followup"]; - mysql_query("INSERT INTO Game VALUES (NULL, NULL, '$randomNRstring', 'normal', NULL,'1','pre','$followup' ,NULL)"); + $session = DB_get_session_by_gameid($followup); + if($session) + mysql_query("INSERT INTO Game VALUES (NULL, NULL, '$randomNRstring', 'normal', NULL,'1','pre','$session' ,NULL)"); + else + { + /* get max session */ + $max = DB_get_max_session(); + $max++; + mysql_query("INSERT INTO Game VALUES (NULL, NULL, '$randomNRstring', 'normal', NULL,'1','pre','$max' ,NULL)"); + mysql_query("UPDATE Game SET session='".$max."' WHERE id=".DB_quote_smart($followup)); + } } else mysql_query("INSERT INTO Game VALUES (NULL, NULL, '$randomNRstring', 'normal', NULL,'1','pre', NULL ,NULL)"); @@ -824,20 +834,19 @@ else if(myisset("me")) echo "

\n"; - echo "

and these are your games that are already done:
\n"; + echo "

and these are your games that are already done:
Game: \n"; $result = mysql_query("SELECT hash,game_id from Hand WHERE user_id='$uid' AND status='gameover'" ); while( $r = mysql_fetch_array($result,MYSQL_NUM)) - echo "game #".$r[1]."
"; + echo "#".$r[1]." , "; echo "

\n"; $names = DB_get_all_names(); echo "

registered players:
\n"; foreach ($names as $name) - echo "$name
\n"; + echo "$name, \n"; echo "

\n"; - echo "

Want to start a new game? remember 4 names from the list above and visit ". - "this page.

"; + echo "

Want to start a new game? Visit this page.

"; } else {