From: Arun Persaud Date: Sat, 18 Oct 2008 23:55:40 +0000 (-0700) Subject: CLEANUP: reduced emails at the end of the game X-Git-Url: https://git.nubati.net/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c3b1dec40c80f8a18f0102505c9f47a2b0d1b335;p=e-DoKo.git CLEANUP: reduced emails at the end of the game only sent out one email with links for everyone in it. This is now possible, since it's ok for other people to visit games from another player. Signed-off-by: Arun Persaud --- diff --git a/include/game.php b/include/game.php index afe6144..7109c11 100644 --- a/include/game.php +++ b/include/game.php @@ -1759,27 +1759,26 @@ switch($mystatus) $message .= "Score Table:\n"; $message .= format_score_table_ascii($score); + $message .= "Use these links to have a look at game ".DB_format_gameid($gameid).": \n" /* send out final email */ $all = array(); - foreach($userids as $user) - $all[] = DB_get_email('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 ".DB_format_gameid($gameid).") part 1(2)",$message.$help); - foreach($userids as $user) { - $To = DB_get_email('userid',$user); + $all[] = DB_get_email('userid',$user); + + /* add links for all players */ $hash = DB_get_hash_from_gameid_and_userid($gameid,$user); + $name = DB_get_name('userid',$user); - $link = "Use this link to have a look at game ".DB_format_gameid($gameid).": ". - $HOST.$INDEX."?action=game&me=".$hash."\n\n" ; - if( DB_get_email_pref_by_uid($user) != 'emailaddict' ) - mymail($To,$EmailName."game over (game ".DB_format_gameid($gameid).") part 2(2)",$link); + $link = "$name: ".$HOST.$INDEX."?action=game&me=".$hash."\n" ; + $message .= $link; } + $To = implode(",",$all); + + $message .= "\n\n (you can use reply all on this email to reach all the players.)\n"; + mymail($To,$EmailName."Game over (game ".DB_format_gameid($gameid).") ",$message); } } else