summaryrefslogtreecommitdiffstats
path: root/include/game.php
diff options
context:
space:
mode:
authorArun Persaud <arun@nubati.net>2008-10-18 16:55:40 -0700
committerArun Persaud <arun@nubati.net>2008-10-18 16:55:40 -0700
commitc3b1dec40c80f8a18f0102505c9f47a2b0d1b335 (patch)
tree10ac2083a6599f18a4e1e41803ba967a0a343c5a /include/game.php
parent567f0d615194566c629887a315cd864bbe84fde9 (diff)
downloade-DoKo-c3b1dec40c80f8a18f0102505c9f47a2b0d1b335.tar.gz
e-DoKo-c3b1dec40c80f8a18f0102505c9f47a2b0d1b335.tar.bz2
e-DoKo-c3b1dec40c80f8a18f0102505c9f47a2b0d1b335.zip
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 <arun@nubati.net>
Diffstat (limited to 'include/game.php')
-rw-r--r--include/game.php23
1 files 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