X-Git-Url: https://git.nubati.net/cgi-bin/gitweb.cgi?p=e-DoKo.git;a=blobdiff_plain;f=include%2Foutput.php;h=92c301fff98f0bd8559d8d4c3accf3c57e39921a;hp=9c4316c8c35fdf9485f5433f6164e7d2e692b892;hb=cc143e38299d3dd3981efd81972c0e0df4df1462;hpb=768bf4fe0ece26aa1f24e5f248e675337ee55b2b diff --git a/include/output.php b/include/output.php index 9c4316c..92c301f 100644 --- a/include/output.php +++ b/include/output.php @@ -1,5 +1,5 @@ +/* Copyright 2006, 2007, 2008, 2009, 2010, 2011, 2012 Arun Persaud * * This file is part of e-DoKo. * @@ -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 ''; @@ -202,12 +234,15 @@ 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 "
\"".DB_get_card_name($card)."\"
\n"; + echo "\n"; else - echo "
\"".DB_get_card_name($card-1)."\"
\n"; + echo "\n"; return; } @@ -219,14 +254,14 @@ function output_check_for_sickness($me,$mycards) echo ''; echo ' '._('Do you want to play solo?').''; echo ' '; echo '
'; @@ -293,60 +328,60 @@ function output_check_for_sickness($me,$mycards) function output_form_calls($me,$myparty) { - $highstart = ""; - $highend = ""; + $highstart = ' '; + $highend = ''; $tmp = can_call(120,$me); if( $tmp ) { if($tmp==2) echo $highstart; if($myparty=='re') - echo "re (120):"; + echo ' re (120):'; else if ($myparty=='contra') - echo "contra (120):"; + echo ' contra (120):'; else - echo " re/contra (120):"; - echo " "; + echo ' re/contra (120):'; + echo ' '; if($tmp==2) echo $highend; - echo "
\n"; + echo "\n"; } - $tmp = can_call(90,$me); + $tmp = can_call(90,$me); if( $tmp ) { if($tmp==2) echo $highstart; - echo " 90:". - " "; + echo ' 90:'. + ' '; if($tmp==2) echo $highend; - echo "
\n"; + echo "\n"; } $tmp = can_call(60,$me); if( $tmp ) { if($tmp==2) echo $highstart; - echo " 60:". - " "; + echo ' 60:'. + ' '; if($tmp==2) echo $highend; - echo "
\n"; + echo "\n"; } $tmp = can_call(30,$me); if( $tmp ) { if($tmp==2) echo $highstart; - echo " 30:". - " "; + echo ' 30:'. + ' '; if($tmp==2) echo $highend; - echo "
\n"; + echo "\n"; } $tmp = can_call(0,$me); if( $tmp ) { if($tmp==2) echo $highstart; - echo " 0:". - " "; + echo ' 0:'. + ' '; if($tmp==2) echo $highend; - echo "
\n". - " no call:". - "
"; + echo "\n". + ' no call:'. + ' '."\n"; } } @@ -368,31 +403,29 @@ function output_header() { global $REV; ?> - - + + e-Doko - - - - + + + + + + + + -
+
'._('Welcome to E-Doko').' '; ?> -
+ "; @@ -401,23 +434,21 @@ function output_header() function output_footer() { - global $REV,$PREF; + global $REV, $PREF, $INDEX; echo "
\n\n"; - echo "
\n"; - echo "

copyright 2006,2007,2008,2009,2010 Arun Persaud, Lance Thornton(graphics), Jeff Zerger(database support)
\n". + echo "

\n"; + echo "

copyright 2006-2012 Arun Persaud, et al.
\n". " Verwendung der [deutschen] Kartenbilder mit Genehmigung
der Spielkartenfabrik Altenburg GmbH,(c) ASS Altenburger
\n". " - ASS Altenburger Spielkarten - Spielkartenfabrik Altenburg GmbH
\n". " a Carta Mundi Company Email: info@spielkarten.com Internet: www.spielkarten.com

\n"; - echo "

See the latest changes \n". + echo "

See the latest changes \n". " via git
or download the source via
\n'git clone http://nubati.net/git/e-DoKo.git'
\n". " \n". - " \"Green\n". + " \"Green\n". "

\n"; - echo "\n"; - echo "
\n"; - + echo "\n\n"; echo "\n"; echo "\n"; @@ -454,15 +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"; - } - else - { - echo "\n
\n"; - echo ""._('login')."\n"; - echo "
\n"; + echo "
"._('last login').": ".date("r",$unixtime)."
\n\n"; } return; } @@ -546,13 +571,13 @@ function output_password_recovery($email,$password) Password recovery - + - + - + @@ -570,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; } @@ -653,6 +678,19 @@ function output_exchanged_cards() $show=1; for($mypos=1;$mypos<5;$mypos++) { + /* output comments */ + if($mypos==2) + { + /* display all comments on the top right (card1)*/ + $comments = DB_get_pre_comment($gameid); + /* display card */ + echo "
\n"; + /* display comments */ + foreach( $comments as $comment ) + echo " ".$comment[1].": ".$comment[0]."\n"; + echo "
\n"; /* end div card */ + } + $usersick = DB_get_sickness_by_pos_and_gameid($mypos,$gameid); if($usersick!=NULL || $mypos==$povertypos1 || $mypos==$partnerpos1 ||