From: arun Date: Fri, 12 Jan 2007 14:49:15 +0000 (+0000) Subject: added email to all players, in case someone cancled the game at the beginning X-Git-Url: https://git.nubati.net/cgi-bin/gitweb.cgi?p=e-DoKo.git;a=commitdiff_plain;h=b8227ddb12516d5bdb0db8a3ec46083b02caee79;ds=sidebyside added email to all players, in case someone cancled the game at the beginning --- diff --git a/functions.php b/functions.php index e4f7c60..ec7dfac 100644 --- a/functions.php +++ b/functions.php @@ -156,7 +156,6 @@ function get_winner($p,$mode) $c3 = $p[3]; $c4 = $p[4]; - /* first card is better than all the rest */ if( compare_cards($c1,$c2,$mode) && compare_cards($c1,$c3,$mode) && compare_cards($c1,$c4,$mode) ) return 1; diff --git a/index.php b/index.php index 605a94b..36b59ef 100644 --- a/index.php +++ b/index.php @@ -152,15 +152,16 @@ else if(myisset("me")) { if($_REQUEST["in"] == "no") { - echo "TODO: email everyone that the game has been canceled.
"; - /*something like need to modify for DB backend - for($i=0;$i<4;$i++) - { - $message = "Hello ".$player[$hash[$i]]["name"].",\n\n". - "the game has been canceled due to the request of one of the players.\n"; - mymail($player[$hash[$i]]["email"],"[DoKo-Debug] the game has been canceled",$message); - } - */ + $message = "Hello, \n\n". + "the game has been canceled due to the request of one of the players.\n"; + + $userids = DB_get_all_userid_by_gameid($gameid); + foreach($userids as $user) + { + $To = DB_get_email_by_userid($user); + mymail($To,"[DoKo] game over",$message); + } + /* delete everything from the dB */ DB_cancel_game($me); }