From c3b1dec40c80f8a18f0102505c9f47a2b0d1b335 Mon Sep 17 00:00:00 2001 From: Arun Persaud Date: Sat, 18 Oct 2008 16:55:40 -0700 Subject: [PATCH] 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 --- include/game.php | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) 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 -- 2.25.1