From: arun Date: Tue, 21 Nov 2006 18:37:47 +0000 (+0000) Subject: fixed some bugs, pages should be xhtml now, sent out email to recover link X-Git-Url: https://git.nubati.net/cgi-bin/gitweb.cgi?p=e-DoKo.git;a=commitdiff_plain;h=d5233803bcd19376ea074e27205a77a0148880ac fixed some bugs, pages should be xhtml now, sent out email to recover link --- diff --git a/index.php b/index.php index ff9af46..6406837 100644 --- a/index.php +++ b/index.php @@ -4,18 +4,19 @@ e-Doko - + +

Welcome to E-Doko

- +

"; + echo "\"".card_to_name($card)."\""; else - echo ""; + echo "\"".card_to_name($card-1)."\""; return; } - function display_link_card($card,$me) + +function display_link_card($card,$me) { if( $card/2 - (int)($card/2) == 0.5) - echo ""; + echo "\"".card_to_name($card)."\""; else - echo ""; + echo "\"".card_to_name($card-1)."\""; return; } @@ -409,7 +411,9 @@ if( isset($_REQUEST["PlayerA"]) && /* send out email, check for error with email */ $message = "\n". - "you are invited to play a game of DoKo.\n". + "you are invited to play a game of DoKo (that is to debug the program ;).\n". + "Place comments and bug reports here:\n". + "http://wiki.nubati.net/index.php?title=EmailDoko\n\n". "The whole round would consist of the following players:\n". "$PlayerA\n". "$PlayerB\n". @@ -472,16 +476,16 @@ if(sizeof($lines)<2)

no game in progress, please input 4 names and email addresses, please make sure that the addresses are correct!

Name: - Email:
+ Email:
Name: - Email:
+ Email:
Name: - Email:
+ Email:
Name: - Email:
+ Email:
@@ -553,8 +557,8 @@ if(sizeof($lines)<2) for($i=0;$i<4;$i++) { $message = "Hello ".$player[$hash[$i]]["name"].",\n\n". - "the game has been cancled due to the request of one of the players.\n"; - mymail($player[$hash[$i]]["email"],"[DoKo] the game has been cancled",$message); + "the game has been canceled due to the request of one of the players.\n"; + mymail($player[$hash[$i]]["email"],"[DoKo-Debug] the game has been canceled",$message); } $output = fopen("status.txt","w"); if($output) @@ -700,7 +704,7 @@ if(sizeof($lines)<2) $message = "you're in. once everyone has filled out the form,". "the game will start and you'll get an eamil on your turn\n"; - mymail($player[$c]["email"],"[DoKo] the game will start soon",$message); + mymail($player[$c]["email"],"[DoKo-debug] the game will start soon",$message); $player[$c]["option"].="s"; save_status(); @@ -711,10 +715,10 @@ if(sizeof($lines)<2) parse_status(); if($game["init"]==4) -3 { + { $message = "The game can start now, it's your turn, please use this link to play a card:\n". $host."?me=".$hash[$game["startplayer"]]."\n"; - mymail($player[$hash[$game["startplayer"]]]["email"],"[DoKo] let's go",$message); + mymail($player[$hash[$game["startplayer"]]]["email"],"[DoKo-debug] let's go",$message); } } @@ -722,13 +726,13 @@ if(sizeof($lines)<2) if($game["init"]==4) { /* check for sickness*/ - /***** someone has 5 nines and no one is playing solo=> cancel game */ + /***** someone has 5 nines and no one is playing solo=> cance5Al game */ if($game["nines"]>=0 && $game["solo-who"]<0) { $message = $player[$hash[$game["poverty"]]]["nines"]." has more than 4 nines. Game aborted!\n"; for($i=0;$i<4;$i++) { - mymail($player[$hash[$i]]["email"],"[DoKo] the game has been canceled",$message); + mymail($player[$hash[$i]]["email"],"[DoKo-debug] the game has been canceled",$message); } $output = fopen("status.txt","w"); if($output) @@ -739,7 +743,38 @@ if(sizeof($lines)<2) /* who is requesting this*/ if(!isset($_REQUEST["me"])) - echo "a game is in progress, but you are not playing"; + { + if(!isset($_REQUEST["recovery"])) + { + echo "a game is in progress, but you are not playing.
"; + echo "In case you are playing, but lost your email or can't access the game anymore, please input your email here:
"; +?> +
+ recorvery:
+ +
+=0) + { + $message = "Please try this link: ".$host."?me=".$hash[$ok]."\n". + "\n if this doesn't work, contact the admin.\n"; + mymail($recovery,"[DoKo-Debug] recovery ",$message); + echo "email has been sent."; + } + else + { + echo "can't find this email address, sorry."; + }; + } + } else { $me = $_REQUEST["me"]; @@ -823,14 +858,19 @@ if(sizeof($lines)<2) $message = " Hello ".$player[$hash[$i]]["name"].",\n\n"; if($i==$mynext) - $message .= "it's your turn now.\n"; + { + $message .= "it's your turn now.\n". + "Use this link to play a card: ".$host."?me=".$hash[$i]."\n\n" ; + } $message .= $player[$me]["name"]. "has played the following card ".card_to_name($card)."\n"; - if($game["solo-who"]<=0) + if($game["solo-who"]>=0) $message.= $player[$hash[$game["solo-who"]]]." is playing a ".$game["solo-what"]." solo!\n"; - mymail($player[$hash[$i]]["email"],"[DoKo] a card has been played",$message); - echo " next player
"; + mymail($player[$hash[$i]]["email"],"[DoKo-debug] a card has been played",$message); + + if($debug) + echo " next player
"; } } } @@ -920,6 +960,6 @@ who won? } ?> - +