X-Git-Url: https://git.nubati.net/cgi-bin/gitweb.cgi?p=e-DoKo.git;a=blobdiff_plain;f=include%2Foutput.php;h=96ab1140789bf9a55f0ce595b76e1ca12905dacb;hp=df1d69a7ff179c16cbe62852d310b0ad1c374785;hb=e9a0778e2270c200bdb77034a56c7c613606d737;hpb=cc95c662be086f71697755fe6939ff4840fe25b1 diff --git a/include/output.php b/include/output.php index df1d69a..96ab114 100644 --- a/include/output.php +++ b/include/output.php @@ -53,48 +53,80 @@ function output_form_for_new_game($names) * after we selected them to make sure that each name * only shows up once */ + + /* delete players name, since he will be on position D anyway */ + unset($copy_names[array_search($_SESSION["name"],$copy_names)]); + srand((float) microtime() * 10000000); + + echo '
'; echo '

'._('Select players (Remember: you need to be one of the players)').'

'; - echo '
'; - echo ' table'; - /* ask player for names */ + echo '
'; - $i=0; + 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
\n"; - /* delete players name, since he will be on position D anyway */ - unset($copy_names[array_search($_SESSION["name"],$copy_names)]); + echo '
'; - srand((float) microtime() * 10000000); - foreach( array("PlayerA","PlayerB","PlayerC","PlayerD") as $player) + $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
\n"; - echo "
\n"; - $i++; - echo " \n
\n"; + echo ' table'; + $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
\n"; + + echo '
'; + $rand = $_SESSION["name"]; + echo "
\n"; + $i++; + echo " \n
\n"; + + /* ask player for names */ echo '
'; echo ''; @@ -376,48 +408,16 @@ function output_header() e-Doko + - - + + @@ -438,19 +438,17 @@ function output_footer() echo "
\n\n"; echo "\n"; - + echo "\n\n"; echo "\n"; echo "\n"; @@ -487,9 +485,9 @@ function output_status() echo " | "._('wiki/bugs')."\n"; echo " | "._('atom')."\n"; echo " |    "._('logout')."\n"; - echo "\n"; + echo "\n\n"; - echo "
"._('last login').": ".date("r",$unixtime)."
\n"; + echo "
"._('last login').": ".date("r",$unixtime)."
\n\n"; } return; } @@ -597,10 +595,10 @@ function output_user_notes($userid,$gameid,$userstatus) echo "
"._('Personal notes').":
\n"; $notes = DB_get_notes_by_userid_and_gameid($userid,$gameid); foreach($notes as $note) - echo "$note
\n"; + echo " $note
\n"; if($userstatus!='gameover') - echo "\n"; - echo "
\n"; + echo " \n"; + echo "\n\n"; return; }