X-Git-Url: https://git.nubati.net/cgi-bin/gitweb.cgi?p=e-DoKo.git;a=blobdiff_plain;f=output.php;h=1adc1a77b74b29a28accd55185ed9e4a8b1b6726;hp=d20d725af1fe1873da2bf9353868133ec0c8fbf9;hb=05f7ac67471127a9fd6cae5bf06d92452992e677;hpb=0dd96314cb0fc3d40502d87f354c6fd61f35a3cd diff --git a/output.php b/output.php index d20d725..1adc1a7 100644 --- a/output.php +++ b/output.php @@ -2,87 +2,45 @@ /* functions which only ouput html */ -function display_status($gametype) +function output_user_settings() { - echo "
"; - echo " Gametype: $gametype"; - echo "
\n"; - - return; -} + global $PREF; -function display_news() -{ - global $wiki; - echo "
\n". - " Please hit shift+reload.

\n". - " The server now keeps score... (only from now on)

". - " If you find more bugs, please list them in the wiki.\n
\n"; - return; -} + echo "
\n"; + echo "

Settings

\n"; + echo "Change password
"; + + echo "
Card set
\n"; + if( $PREF["cardset"] == "english" ) + echo "Change to German cards
"; + else + echo "Change to English cards
"; + + echo "
Email
\n"; + if( $PREF["email"] == "emailaddict" ) + echo "Change to non-addicted mode (emails for each move)
"; + else + echo "Change to addicted mode (minimal amount of emails)
"; -function output_link_to_user_page($email,$password) -{ - echo "
\n"; - echo "
\n"; - echo " \n"; - echo " \n"; - echo " \n"; - echo "
\n"; echo "
\n"; - - return; -} -function output_register() -{ - echo "IMPORTANT: passwords are going over the net as clear text, so pick an easy password. No need to pick anything complicated here ;)

"; - echo "TODO: convert timezone into a menu
\n"; - echo "TODO: figure out a way to handle passwords
\n"; - ?> -
-
- Register - - - - - - - - - - - - - - - -
- -
-
-
-\n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; + echo " \n"; echo " \n"; echo " \n"; - echo "\n"; return; } @@ -93,85 +51,98 @@ function output_form_for_new_game($names)

Players

Please select four players (or use the randomly pre-selected names)

+ +
+ table \n"; - foreach($names as $name) { - if($name==$rand) + srand((float) microtime() * 10000000); + $randkey = array_rand($names); + $rand = $names[$randkey]; + echo "
\n"; + $i++; + echo " Name: \n \n
\n"; } - echo " \n"; - unset($names[$randkey]); - } -?> -

Rules

- -

ten of hearts: +?> +

+

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): +

Schweinchen (both foxes), only in normal games or silent solos:

+ +
  • + first one normal, second one becomes highest (call during the game)
  • +
  • + second one become highest only in case re/contra was announced (not working yet) +
  • + +

    +

    Call Re/Contra, etc.: +

    -
    \n"; + echo "\"".DB_get_card_name($card)."\"\n"; else - echo "\"".card_to_name($card-1)."\"\n"; + echo "\"".DB_get_card_name($card-1)."\"\n"; return; } -function display_link_card($card) +function display_link_card($card,$dir="english",$type="card") { if( $card/2 - (int)($card/2) == 0.5) - echo "\"\"\n"; + echo "
    \"".DB_get_card_name($card)."\"
    \n"; else - echo "\"\"\n"; + echo "
    \"".DB_get_card_name($card-1)."\"
    \n"; return; } -function check_for_sickness($me,$mycards) +function output_check_for_sickness($me,$mycards) { ?> -

    Solo will work, but the first player will not change. Nothing else implemented.

    - -
    +
    Thanks for joining the game...
    - do you want to play solo? + do you want to play solo? +
    - "; @@ -197,7 +168,7 @@ function check_for_sickness($me,$mycards) echo " no
    \n"; }; - echo "do you have poverty?"; + echo "Do you have poverty?"; if(count_trump($mycards)<4) { echo " yes"; @@ -208,7 +179,7 @@ function check_for_sickness($me,$mycards) echo " no
    \n"; }; - echo "do you have too many nines?"; + echo "Do you have too many nines?"; if(count_nines($mycards)>4) { echo " yes"; @@ -222,38 +193,81 @@ function check_for_sickness($me,$mycards) echo "\n"; echo "\n"; - echo "\n"; + echo "
    \n"; return; } -function check_want_to_play($me) +function output_form_calls($me) +{ + 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:". + "
    "; +} + + +function output_check_want_to_play($me) { ?> -
    - Do you want to play a game of DoKo? +
    + Do you want to play a game of DoKo?
    yes no
    - - - only on my turn
    -*/ +\n"; echo "\n"; - echo "\n"; - echo " \n"; + echo "\n"; + echo "
    \n"; return; } -function output_home_page() +function output_home_page($pre,$game,$done,$avgtime) { ?>

    If you want to play a game of Doppelkopf, you found the right place ;)

    -

    Please register, in case you haven't done yet
    + 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:

    @@ -261,11 +275,15 @@ function output_home_page() Login - + + - + + - + + +
    @@ -285,12 +303,12 @@ function output_header() e-Doko - +