diff options
author | Arun Persaud <arun@nubati.net> | 2011-03-20 00:40:54 -0700 |
---|---|---|
committer | Arun Persaud <apersaud@lbl.gov> | 2011-03-20 00:40:54 -0700 |
commit | 08583506b9bdb4ef2d30bad9752c960f20fe54b6 (patch) | |
tree | f8fac0f7b889afccf3bc0d3b30fd523c0ff2ee07 /include/game.php | |
parent | 455372db985024563b26bfa5af9c91b2a8e53c06 (diff) | |
download | e-DoKo-08583506b9bdb4ef2d30bad9752c960f20fe54b6.tar.gz e-DoKo-08583506b9bdb4ef2d30bad9752c960f20fe54b6.tar.bz2 e-DoKo-08583506b9bdb4ef2d30bad9752c960f20fe54b6.zip |
CLEANUP: added gameid to mymail and generate subject line in mymail directly
this way it will be easier to add translation and also to add the gameid into the database for the digest
Diffstat (limited to 'include/game.php')
-rw-r--r-- | include/game.php | 35 |
1 files changed, 12 insertions, 23 deletions
diff --git a/include/game.php b/include/game.php index d691c7f..0ef5a3e 100644 --- a/include/game.php +++ b/include/game.php @@ -344,8 +344,7 @@ switch($mystatus) $userids = DB_get_all_userid_by_gameid($gameid); foreach($userids as $user) { - $subject = 'Game '.DB_format_gameid($gameid).' canceled'; - mymail($user,$subject,$message); + mymail($user,$gameid,GAME_CANCELED,$message); } /* update game status */ @@ -394,7 +393,7 @@ switch($mystatus) $message = "It's your turn now in game ".DB_format_gameid($gameid).".\n". "Use this link to go the game: ".$HOST.$INDEX."?action=game&me=".$hash."\n\n" ; - mymail($who,"Ready, set, go... (game ".DB_format_gameid($gameid).") ",$message); + mymail($who, $gameid, GAME_READY,$message); */ } } @@ -669,8 +668,7 @@ switch($mystatus) $userids = DB_get_all_userid_by_gameid($gameid); foreach($userids as $user) { - $subject = 'Game '.DB_format_gameid($gameid).' canceled'; - mymail($user,$subject,$message); + mymail($user,$gameid, GAME_CANCELED, $message); } echo "</div>\n"; /* end div message */ @@ -807,8 +805,7 @@ switch($mystatus) /* email startplayer */ $message = "It's your turn now in game ".DB_format_gameid($gameid).".\n". "Use this link to play a card: ".$HOST.$INDEX."?action=game&me=".$hash."\n\n" ; - $subject = 'Ready, set, go... (game '.DB_format_gameid($gameid).')'; - mymail($who,$subject,$message); + mymail($who,$gameid,GAME_READY,$message); } } else @@ -833,8 +830,7 @@ switch($mystatus) /* email player for poverty */ $message = "Poverty: It's your turn now in game ".DB_format_gameid($gameid).".\n". "Use this link to play a card: ".$HOST.$INDEX."?action=game&me=".$whohash."\n\n" ; - $subject = 'Poverty (game '.DB_format_gameid($gameid).') '; - mymail($whoid,$subject,$message); + mymail($whoid,$gameid,GAME_POVERTY,$message); } } } @@ -939,8 +935,7 @@ switch($mystatus) /* email startplayer */ $message = "It's your turn now in game ".DB_format_gameid($gameid).".\n". "Use this link to play a card: ".$HOST.$INDEX."?action=game&me=".$hash."\n\n" ; - $subject = 'Ready, set, go... (game '.DB_format_gameid($gameid).') '; - mymail($who,$subject,$message); + mymail($who,$gameid,GAME_READY,$message); } } else @@ -1023,8 +1018,7 @@ switch($mystatus) $userids = DB_get_all_userid_by_gameid($gameid); foreach($userids as $user) { - $subject = 'Game '.DB_format_gameid($gameid).' canceled (poverty not resolved)'; - mymail($user,$subject,$message); + mymail($user, $gameid, GAME_CANCELED_POVERTY, $message); } /* update game status */ @@ -1044,8 +1038,7 @@ switch($mystatus) $message = "Someone has poverty, it's your turn to decide, if you want to take the trump. Please visit:". " ".$HOST.$INDEX."?action=game&me=".$userhash."\n\n" ; - $subject = 'Poverty (game '.DB_format_gameid($gameid).')'; - mymail($userid,$subject,$message); + mymail($userid,$gameid, GAME_POVERTY, $message); } } else @@ -1136,8 +1129,7 @@ switch($mystatus) $message = "Two people have poverty, it's your turn to decide, if you want to take the trump. Please visit:". " ".$HOST.$INDEX."?action=game&me=".$userhash."\n\n" ; - $subject = 'Double poverty (game '.DB_format_gameid($gameid).')'; - mymail($userid,$subject,$message); + mymail($userid,$gameid, GAME_DPOVERTY, $message); } } echo "<div class=\"message\">Please, <a href=\"$INDEX?action=game&me=$me\">continue</a> here.</div>\n"; @@ -1210,8 +1202,7 @@ switch($mystatus) /* email startplayer) */ $message = "It's your turn now in game ".DB_format_gameid($gameid).".\n". "Use this link to play a card: ".$HOST.$INDEX."?action=game&me=".$hash."\n\n" ; - $subject = 'Ready, set, go... (game '.DB_format_gameid($gameid).')'; - mymail($who,$subject,$message); + mymail($who,$gameid, GAME_READY, $message); } } } @@ -1664,8 +1655,7 @@ switch($mystatus) "Use this link to play a card: ".$HOST.$INDEX."?action=game&me=".$next_hash."\n\n" ; if( DB_get_email_pref_by_uid($who)!='emailaddict' ) { - $subject = 'A card has been played in game '.DB_format_gameid($gameid); - mymail($who,$subject,$message); + mymail($who,$gameid, GAME_YOUR_TURN, $message); } } else /* send out final email */ @@ -1907,8 +1897,7 @@ switch($mystatus) $message .= $link; } $message .= "\n\n (you can use reply all on this email to reach all the players.)\n\n"; - $subject = ' Game over (game '.DB_format_gameid($gameid).') '; - mymail($userids,$subject,$message); + mymail($userids,$gameid, GAME_OVER, $message); } } else |