X-Git-Url: https://git.nubati.net/cgi-bin/gitweb.cgi?p=e-DoKo.git;a=blobdiff_plain;f=index.php;h=f5c3d3da4e66b491cd3b79c6ba03f045522a3150;hp=fa828daabfb498aba84c089247b07cc680ab1f40;hb=bcf82bbe699d28a45c44c9c18d96466713e81bef;hpb=44adf43ccb058fb76e7bdbb18917ca86a7f7ec29 diff --git a/index.php b/index.php index fa828da..f5c3d3d 100644 --- a/index.php +++ b/index.php @@ -94,7 +94,7 @@ if(myisset("new")) $ruleset = DB_get_ruleset_by_gameid($followup); /* just copy ruleset from old game, this way no manipulation is possible */ if($session) - mysql_query("INSERT INTO Game VALUES (NULL, NULL, '$randomNRstring', 'normal', NULL,NULL,'1','pre',". + mysql_query("INSERT INTO Game VALUES (NULL, NULL, '$randomNRstring', 'normal', NULL,NULL,'1','1','pre',". "'$ruleset','$session' ,NULL)"); else { @@ -102,12 +102,12 @@ if(myisset("new")) $max = DB_get_max_session(); $max++; mysql_query("UPDATE Game SET session='".$max."' WHERE id=".DB_quote_smart($followup)); - mysql_query("INSERT INTO Game VALUES (NULL, NULL, '$randomNRstring', 'normal', NULL,NULL,'1','pre',". + mysql_query("INSERT INTO Game VALUES (NULL, NULL, '$randomNRstring', 'normal', NULL,NULL,'1','1','pre',". "'$ruleset','$max' ,NULL)"); } } else - mysql_query("INSERT INTO Game VALUES (NULL, NULL, '$randomNRstring', 'normal', NULL,NULL,'1','pre', ". + mysql_query("INSERT INTO Game VALUES (NULL, NULL, '$randomNRstring', 'normal', NULL,NULL,'1','1','pre', ". "'$ruleset',NULL ,NULL)"); $game_id = mysql_insert_id(); @@ -1384,26 +1384,23 @@ else if(myisset("me")) while( $r = mysql_fetch_array($result,MYSQL_NUM)) $message .= " ".$r[0]." ".$r[1]."\n"; - /* check who wants to be CC'ed on the email */ - $h = array(); - $header = ""; + /* send out final email */ + $all = array(); + foreach($userids as $user) - { - $result = mysql_query("SELECT value from User_Prefs". - " WHERE user_id='$user' AND pref_key='ccemail'" ); - $r = mysql_fetch_array($result,MYSQL_NUM); - if($r && $r[0]=="yes") - $h[] = DB_get_email_by_userid($user); - } - if(sizeof($h)) - $header = "CC: ".join(",",$h)."\r\n"; - + $all[] = DB_get_email_by_userid($user); + $TO = implode(",",$all); + + $help = "\n\n (you can use reply all on this email to reach all the players.)\n"; + mymail($To,$EmailName."game over (game $gameid) part 1(2)",$message.$help); + foreach($userids as $user) { $To = DB_get_email_by_userid($user); $hash = DB_get_hash_from_gameid_and_userid($gameid,$user); - $mymessage = $message."Use this link to have a look at the game: ".$host."?me=".$hash."\n\n" ; - mymail($To,$EmailName."game over (game $gameid)",$mymessage,$header); + + $link = "Use this link to have a look at game $gameid: ".$host."?me=".$hash."\n\n" ; + mymail($To,$EmailName."game over (game $gameid) part 2(2)",$link); } } @@ -1521,6 +1518,24 @@ else if(myisset("me")) echo "Your cards were:
\n"; foreach($oldcards as $card) display_card($card,$PREF["cardset"]); + + $userids = DB_get_all_userid_by_gameid($gameid); + foreach($userids as $user) + { + $userhash = DB_get_hash_from_gameid_and_userid($gameid,$user); + + if($userhash!=$me) + { + echo "
"; + + $name = DB_get_name_by_userid($user); + $oldcards = DB_get_all_hand($userhash); + $oldcards = mysort($oldcards,$gametype); + echo "$name's cards were:
\n"; + foreach($oldcards as $card) + display_card($card,$PREF["cardset"]); + } + } } echo "\n"; @@ -1644,21 +1659,6 @@ else if(myisset("me")) $result = mysql_query("INSERT INTO User_Prefs VALUES(NULL,'$uid','cardset',".DB_quote_smart($setpref).")"); echo "Ok, changed you preferences for the cards.\n"; break; - case "ccemail": - $result = mysql_query("SELECT * from User_Prefs". - " WHERE user_id='$uid' AND pref_key='ccemail'" ); - if( mysql_fetch_array($result,MYSQL_NUM)) - if($PREF["ccemail"]=="yes") - $result = mysql_query("UPDATE User_Prefs SET value=".DB_quote_smart("no"). - " WHERE user_id='$uid' AND pref_key='ccemail'" ); - else - $result = mysql_query("UPDATE User_Prefs SET value=".DB_quote_smart("yes"). - " WHERE user_id='$uid' AND pref_key='ccemail'" ); - else - $result = mysql_query("INSERT INTO User_Prefs VALUES(NULL,'$uid','ccemail',".DB_quote_smart("yes").")"); - echo "Ok, changed you preferences for being CC'ed on emails.\n"; - break; - } } else /* output default user page */