From: Arun Persaud Date: Sun, 2 Mar 2008 02:07:05 +0000 (-0800) Subject: FEATURE: add score table to email at the end of the game X-Git-Url: https://git.nubati.net/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=73a6f86691f53d8eb6339b5bb5e9156822cc7e54;p=e-DoKo.git FEATURE: add score table to email at the end of the game the last 4 lines of the score table are now added to the email that is being send out at the end of a game. Signed-off-by: Arun Persaud --- diff --git a/index.php b/index.php index 0036433..4b5ca5c 100644 --- a/index.php +++ b/index.php @@ -1743,6 +1743,38 @@ else if(myisset("me")) $message .= " Total Points (from the Re point of view): $Tpoint\n"; $message .= "\n"; + $session = DB_get_session_by_gameid($gameid); + $score = generate_score_table($session); + /* convert html to ascii */ + $score = str_replace("
\n\n \n","",$score); + $score = str_replace("\n","",$score); + $score = str_replace(array("","",""),array("","\n","","|"),$score); + $score = str_replace("
","
\n","",$score); + $score = explode("\n",$score); + + $header = array_slice($score,0,1); + $header = explode("|",$header[0]); + for($i=0;$i5) $header.= " ... \n"; + + if(sizeof($score)>5) $score = array_slice($score,-5,5); + for($i=0;$i