X-Git-Url: https://git.nubati.net/cgi-bin/gitweb.cgi?p=e-DoKo.git;a=blobdiff_plain;f=include%2Ffunctions.php;h=64c3e8bdc20cd00c3f5838e586797d51a9cdef74;hp=250450657a068a588916d50331729d9c764b78be;hb=1829c4b57884b84b5ef6cb54a031a62ce53005fa;hpb=08583506b9bdb4ef2d30bad9752c960f20fe54b6 diff --git a/include/functions.php b/include/functions.php index 2504506..64c3e8b 100644 --- a/include/functions.php +++ b/include/functions.php @@ -86,6 +86,21 @@ define("GAME_RECOVERY", 8); define("GAME_REMINDER", 9); define("GAME_NEW", 10); +/* define possible status for showing cards */ + +define("CARDS_EMPTY", 0); /* show player's hand*/ +define("CARDS_SHOW", 1); /* show player's hand*/ +define("CARDS_MYTURN", 2); /* show radiobuttons for cards that can be played*/ +define("CARDS_EXCHANGE", 3); /* do we need to return cards to our partner in poverty?*/ +define("CARDS_GAMEOVER_ME", 4); /* show all cards from everyone*/ +define("CARDS_GAMEOVER", 5); /* show all cards from everyone (looking at someone else's game)*/ + + /* cards_status: SHOW show our hand + * MYTURN show radiobutton for cards that can be played + * EXCHANGE do we need to return cards to our partner in poverty? + * GAMEOVER show all cards from everyone + */ + function mymail($uid,$gameid=0,$type,$message) { global $EmailName,$WIKI; @@ -103,40 +118,40 @@ function mymail($uid,$gameid=0,$type,$message) switch($type) { case GAME_CANCELED: - $subject.="Game $game canceled"; + $subject.=sprintf(_("Game %s canceled"),$game); break; case GAME_CANCELED_POVERTY: - $subject.="Game $game canceled (poverty not resolved)"; + $subject.=sprintf(_("Game %s canceled (poverty not resolved)"),$game); break; case GAME_CANCELED_TIMEOUT: - $subject.="Game $game canceled (timed out)"; + $subject.=sprintf(_("Game %s canceled (timed out)"),$game); break; case GAME_YOUR_TURN: - $subject.="A card has been played in game $game"; + $subject.=sprintf(_("A card has been played in game %s"),$game); break; case GAME_READY: - $subject.="Ready, set, go... (game $game)"; + $subject.=sprintf(_("Ready, set, go... (game %s)"),$game); break; case GAME_POVERTY: - $subject.="Poverty (game $game)"; + $subject.=sprintf(_("Poverty (game %s)"),$game); break; case GAME_DPOVERTY: - $subject.="Double poverty (game $game)"; + $subject.=sprintf(_("Double poverty (game %s)"),$game); break; case GAME_OVER: - $subject.="Game over (game $game)"; + $subject.=sprintf(_("Game over (game %s)"),$game); break; case GAME_RECOVERY: - $subject.="Recovery"; + $subject.=_("Recovery"); break; case GAME_REMINDER: - $subject.="Reminder: game $game it's your turn"; + $subject.=sprintf(_("Reminder: game %s it's your turn"),$game); break; case GAME_NEW: - $subject.="You are invited to a game of DoKo (game $game)"; + $subject.=sprintf(_("You are invited to a game of DoKo (game %s)"),$game); break; default: - $subject.="Problem with email, contact admin (errorcode $gameid)"; + $subject.=sprintf(_("Problem with email, contact admin (errorcode %d)"),$gameid); } /* standard goodbye */ @@ -956,7 +971,7 @@ function can_call($what,$hash) return 0; } -function display_table () +function display_table_begin () { global $gameid, $GT, $debug,$INDEX,$defaulttimezone,$session; global $RULES,$GAME,$gametype; @@ -976,10 +991,57 @@ function display_table () "WHERE Hand.game_id='".$gameid."' ". "ORDER BY position ASC"); - echo "