';
+
+ echo "
\n";
+ $randkey = array_rand($copy_names);
+ $rand = $copy_names[$randkey];
+ /* delete this name from the list of possible names */
+ unset($copy_names[$randkey]);
+ echo "
\n";
+ foreach($names as $name)
{
- srand((float) microtime() * 10000000);
- $randkey = array_rand($names);
- $rand = $names[$randkey];
- echo "\n";
- $i++;
- echo " Name: \n \n";
- foreach($names as $name)
+ if($name==$rand)
+ echo " $name \n";
+ else
+ echo " $name \n";
+ }
+ echo " \n
\n";
+
+ echo ' ';
+
+ $randkey = array_rand($copy_names);
+ $rand = $copy_names[$randkey];
+ /* delete this name from the list of possible names */
+ unset($copy_names[$randkey]);
+ echo "
\n";
+ echo " \n";
+ foreach($names as $name)
+ {
+ if($name==$rand)
+ echo " $name \n";
+ else
+ echo " $name \n";
+ }
+ echo " \n
\n";
+
+ echo '
';
+ $randkey = array_rand($copy_names);
+ $rand = $copy_names[$randkey];
+ /* delete this name from the list of possible names */
+ unset($copy_names[$randkey]);
+ echo "
\n";
+ echo " \n";
+ foreach($names as $name)
+ {
+ if($name==$rand)
+ echo " $name \n";
+ else
+ echo " $name \n";
+ }
+ echo " \n
\n";
+
+ echo '
';
+ $rand = $_SESSION["name"];
+ echo " \n";
+ echo " \n";
+ foreach($names as $name)
+ {
+ if($name==$rand)
+ echo " $name \n";
+ else
+ echo " $name \n";
+ }
+ echo " \n
\n";
+
+ /* ask player for names */
+
+ echo ' ';
+ echo '';
+ echo '
'._('Rules').' ';
+ echo '
'._('Gameplay-related').' ';
+ echo '
'._('Ten of hearts').': ';
+ echo '
';
+ echo ' ';
+ echo ' '._('just normal non-trump').' ';
+ echo ' '._('first ten of hearts wins the trick').' ';
+ echo ' '.('second ten of hearts wins the trick').' ';
+ echo ' ';
+ echo '
';
+ echo '
'._('Schweinchen (both foxes), only in normal games or silent solos').': ';
+ echo '
';
+ echo ' ';
+ echo ' '._('none').' ';
+ echo ' '._('both become highest trump (automatic call at beginning of the game)').' ';
+ echo ' '._('first one normal, second one becomes highest (call during the game)').' ';
+ echo ' ',_('second one become highest only in case re/contra was announced');
+ echo ' ';
+ echo ' ';
+ echo '
';
+ echo '
'._('Call Re/Contra, etc.').': ';
+ echo '
';
+ echo ' ';
+ echo ' '._('Can call re/contra on the first own card played, 90 on the second, etc.').' ';
+ echo ' '._('Can call re/contra until 5th card is played, 90 until 9th card is played, etc.').' ';
+ echo ' '._('Can call re/contra until 5th card is played, 90 if player still has 9 cards, etc.').' ';
+ echo ' ';
+ echo '
';
+ echo '
'._('Low trump').' ';
+ echo '
';
+ echo ' '._('Player can\'t trump a fox, that is none of his trump is higher than a fox.');
+ echo ' ';
+ echo ' '._('The trump will be treated as poverty and offered to another player.').' ';
+ echo ' '._('The game will be canceled unless there is a solo.').' ';
+ echo ' '._('Bad luck, the player needs to play a normal game.').' ';
+ echo ' ';
+ echo '
';
+ echo '
'._('Scoring-related').' ';
+ echo '
'._('(not yet implemented)').' ';
+ echo '
';
+ echo ' ';
+
+}
+
+function output_table($data,$caption="",$class="",$id="")
+{
+
+ $HTML = "\n
\n";
+
+ $i=0;
+
+ if($caption!="")
+ $HTML .= " $caption \n";
+
+ foreach($data as $record)
+ {
+ if(!$i)
+ $HTML .= " \n \n";
+ else
{
- if($name==$rand)
- {
- echo " $name \n";
- }
+ if($i==1) $HTML .= " \n";
+ $HTML .= " ";
+ }
+ foreach($record as $point)
+ {
+ if($i)
+ $HTML .= " $point ";
else
- echo " $name \n";
+ $HTML .= " $point ";
+ }
+
+ if(!$i)
+ $HTML .= " \n \n";
+ else
+ {
+ $HTML .= " \n";
}
- echo " \n\n";
+ $i++;
}
-?>
-
- Rules
- Some areas are grayed out which means that the rule is not implemented yet and therefore cannot be selected
- Ten of hearts:
-
-
- Schweinchen (both foxes), only in normal games or silent solos:
-
-
- Call Re/Contra, etc.:
-
-
-
-
-\n
\n";
+
+ return $HTML;
}
function display_card($card,$dir="english")
@@ -126,7 +240,7 @@ function display_card($card,$dir="english")
/* cards are only availabl for the odd values, e.g. 1.png, 3.png, ...
* convert even cards to the matching odd value */
- if( $card/2 - (int)($card/2) == 0.5)
+ if( $card/2 - (int)($card/2) == 0.5 || $card == 0)
echo "
\n";
else
echo "
\n";
@@ -134,214 +248,192 @@ function display_card($card,$dir="english")
return;
}
-function display_link_card($card,$dir="english",$type="card")
+function display_link_card($card,$dir="english",$type="card", $selected=0)
{
+ if($selected)
+ $selected = 'checked="checked"';
+
if( $card/2 - (int)($card/2) == 0.5)
- echo "
\n";
+ echo "
\n";
else
- echo "
\n";
+ echo "
\n";
return;
}
function output_check_for_sickness($me,$mycards)
{
- ?>
-
Thanks for joining the game...
-
- do you want to play solo?
-
- No
- trumpless
- trump
- queen
- jack
- club
- spade
- heart
-
-
-
- '._('Thanks for joining the game').'... ';
+ echo '';
+ echo ' '._('Do you want to play solo?').'';
+ echo ' ';
+ echo ' '.'No'.' ';
+ echo ' '._('trumpless').' ';
+ echo ' '._('trump').' ';
+ echo ' '._('queen').' ';
+ echo ' '._('jack').' ';
+ echo ' '._('club').' ';
+ echo ' '._('spade').' ';
+ echo ' '._('heart').' ';
+ echo ' ';
+ echo ' ';
+
if(check_wedding($mycards))
{
- echo " yes ";
- echo " no \n";
+ echo _('Do you want to call Wedding?');
+ echo ' '._('yes')." ";
+ echo ' '._('no')." \n";
}
else
{
- echo " no \n";
+ echo " \n";
};
- echo "Do you have poverty?";
if(count_trump($mycards)<4)
{
- echo " yes ";
- echo " no \n";
+ echo _('Do you want to call poverty?');
+ echo ' '._('yes')." ";
+ echo ' '._('no')." \n";
}
else
{
- echo " no \n";
+ echo " \n";
};
- echo "Do you have too many nines?";
if(count_nines($mycards)>4)
{
- echo " yes ";
- echo " no \n";
+ echo _('Do you want to call too many nines?');
+ echo ' '._('yes')." ";
+ echo ' '._('no')." \n";
}
else
{
- echo " no \n";
+ echo " \n";
};
+ if($RULES['lowtrump']=='cancel' || $RULES['lowtrump']=='poverty')
+ {
+ if(check_low_trump($mycards))
+ {
+ if($RULES['lowtrump']=='cancel')
+ echo _('Do you want to call low trump (cancel game)?');
+ else
+ echo _('Do you want to call low trump (poverty)?');
+
+ echo ' '._('yes')." ";
+ echo ' '._('no')." \n";
+ }
+ else
+ {
+ echo " \n";
+ };
+ }
+ else
+ echo " ";
+
echo " \n";
- echo " \n";
+ echo " \n";
echo "
\n";
return;
}
-function output_form_calls($me)
+function output_form_calls($me,$myparty)
{
- if( can_call(120,$me) )
- echo " re/contra (120):".
- "
";
- if( can_call(90,$me) )
- echo " 90:".
- "
";
- if( can_call(60,$me) )
- echo " 60:".
- "
";
- if( can_call(30,$me) )
- echo " 30:".
- "
";
- if( can_call(0,$me) )
- echo " 0:".
- "
".
- " no call:".
- "
";
-}
+ $highstart = '
';
+ $highend = ' ';
+ $tmp = can_call(120,$me);
+ if( $tmp )
+ {
+ if($tmp==2) echo $highstart;
+ if($myparty=='re')
+ echo ' re (120):';
+ else if ($myparty=='contra')
+ echo ' contra (120):';
+ else
+ echo ' re/contra (120):';
+ echo '
';
+ if($tmp==2) echo $highend;
+ echo "\n";
+ }
+ $tmp = can_call(90,$me);
+ if( $tmp )
+ {
+ if($tmp==2) echo $highstart;
+ echo ' 90:'.
+ '
';
+ if($tmp==2) echo $highend;
+ echo "\n";
+ }
+ $tmp = can_call(60,$me);
+ if( $tmp )
+ {
+ if($tmp==2) echo $highstart;
+ echo ' 60:'.
+ '
';
+ if($tmp==2) echo $highend;
+ echo "\n";
+ }
+ $tmp = can_call(30,$me);
+ if( $tmp )
+ {
+ if($tmp==2) echo $highstart;
+ echo ' 30:'.
+ '
';
+ if($tmp==2) echo $highend;
+ echo "\n";
+ }
+ $tmp = can_call(0,$me);
+ if( $tmp )
+ {
+ if($tmp==2) echo $highstart;
+ echo ' 0:'.
+ '
';
+ if($tmp==2) echo $highend;
+ echo "\n".
+ ' no call:'.
+ '
'."\n";
+ }
+}
function output_check_want_to_play($me)
{
- ?>
-
- Do you want to play a game of DoKo?
- yes
- no
-';
+ echo ' '._('Do you want to play a game of DoKo?').' ';
+ echo ' '._('yes').' ';
+ echo ' '._('no').' ';
echo " \n";
echo "\n";
- echo " \n";
+ echo " \n";
echo "
\n";
return;
}
-function output_home_page($pre,$game,$done,$avgtime)
-{
- global $WIKI;
-
- echo"
If you want to play a game of Doppelkopf, you found the right place ;)".
- " For more information please visit our wiki .
";
-
- if($pre == 0)
- echo "
At the moment there are no games that are being started ";
- else if($pre==1)
- echo "
At the moment there is one games that is being started ";
- else
- echo "
At the moment there are $pre games that are being started ";
-
- echo "and ";
-
- if($game==0)
- echo "zero games that are ongoing. ";
- else if($game==1)
- echo "one game that is ongoing. ";
- else
- echo "$game games that are ongoing. ";
-
- echo " \n";
-
- if($done==0)
- echo "No game has been completed on this server.
";
- else if($done==1)
- echo "One game has been completed on this server. ";
- else
- echo "$done games have been completed on this server. Average time of a game: $avgtime days";
-?>
-
-
Please register , in case you have not done that yet
- or login with you email-address or name and password here:
-
-
-
-
-
-
+
+
e-Doko
-
-
-
-
+
+
+
+
" />
+
" />
+
"/>
+
-
";
@@ -350,22 +442,27 @@ function output_header()
function output_footer()
{
- global $REV,$PREF;
+ global $REV, $PREF, $INDEX;
echo "
\n\n";
- echo "\n";
+ echo "\n\n";
+
+ echo '';
+ echo '';
+ echo '';
+ echo '';
+ echo '';
+ echo '';
echo "\n";
echo "\n";
@@ -373,30 +470,113 @@ function output_footer()
return;
}
-function output_status()
+function output_navbar()
{
- global $defaulttimezone;
- if(isset($_SESSION["name"]))
- {
- $name = $_SESSION["name"];
+ global $defaulttimezone, $INDEX, $WIKI, $RSS;
- /* logout info */
- echo "\n
\n";
+ if(isset($_SESSION['name']))
+ {
+ $name = $_SESSION['name'];
+ $email = DB_get_email('name',$name);
+
+ /* last logon time */
+ $myid = DB_get_userid('name',$name);
+ $zone = DB_get_user_timezone($myid);
+
+ $time = DB_get_user_timestamp($myid);
+ date_default_timezone_set($defaulttimezone);
+ $unixtime = strtotime($time);
+ date_default_timezone_set($zone);
+
+ /* rss token */
+ $token = get_user_token($myid);
+
+ /* logout info */
+ echo "\n
\n\n";
+ }
+ return;
+}
- /* last logon time */
- $myid = DB_get_userid("name",$name);
- $zone = DB_get_user_timezone($myid);
+function output_select_timezone($name,$timezone="")
+{
+ $Tzone = array ("Pacific/Apia" => "Apia", /*UTC-11*/
+ "Pacific/Honolulu" => "Honolulu", /*UTC-10*/
+ "America/Anchorage" => "Anchorage", /*UTC-9*/
+ "America/Vancouver" => "Berkeley", /*UTC-8*/
+ "America/Phoenix" => "Phoenix", /*UTC-7*/
+ "America/Chicago" => "Chicago", /*UTC-6*/
+ "America/New_York" => "New York", /*UTC-5*/
+ "America/Santiago" => "Santiago", /*UTC-4*/
+ "America/Buenos_Aires" => "Buenos Aires", /*UTC-3*/
+ "Atlantic/South_Georgia" => "Fernando de Noronha", /*UTC-2*/
+ "Atlantic/Azores" => "Azores", /*UTC-1"*/
+ "Europe/London" => "London", /*UTC*/
+ "Europe/Berlin" => "Berlin", /*UTC+1*/
+ "Africa/Cairo" => "Cairo", /*UTC+2*/
+ "Europe/Moscow" => "Moscow", /*UTC+3*/
+ "Asia/Tehran" => "Tehran", /*UTC+3:30*/
+ "Asia/Dubai" => "Dubai", /*UTC+4*/
+ "Asia/Karachi" => "Karachi", /*UTC+5*/
+ "Asia/Calcutta" => "Delhi", /*UTC+5:30*/
+ "Asia/Kathmandu" => "Kathmandu", /*UTC+5:45*/
+ "Asia/Dhaka" => "Dhaka", /*UTC+6*/
+ "Asia/Rangoon" => "Yangon", /*UTC+6:30*/
+ "Asia/Bangkok" => "Bangkok", /*UTC+7*/
+ "Asia/Hong_Kong" => "Beijing", /*UTC+8*/
+ "Asia/Tokyo" => "Tokyo", /*UTC+9*/
+ "Australia/Darwin" => "Darwin", /*UTC+9:30*/
+ "Australia/Sydney" => "Sydney", /*UTC+10*/
+ "Asia/Magadan" => "Magadan", /*UTC+11*/
+ "Pacific/Auckland" => "Wellington" ); /*UTC+12*/
+
+ echo "
\n";
- $time = DB_get_user_timestamp($myid);
- date_default_timezone_set($defaulttimezone);
- $unixtime = strtotime($time);
- date_default_timezone_set($zone);
+ return;
+}
+
+function output_select_language($name,$language="")
+{
+ $LOCALE = array ("English" => "en",
+ "Deutsch" => "de" );
+
+ echo "
\n";
- };
return;
}
@@ -414,13 +594,13 @@ function output_password_recovery($email,$password)