X-Git-Url: https://git.nubati.net/cgi-bin/gitweb.cgi?p=e-DoKo.git;a=blobdiff_plain;f=include%2Foutput.php;h=bbdc99f1e0d09b7f3b809e37a0f3a9559adceea1;hp=16376031c8d94a6f61f1e6de92ab405d97a9138e;hb=a76008b94138f041b5a8f2426a55d59142152d02;hpb=09515348107d9aab7823a12d31b082a2ebb75555
diff --git a/include/output.php b/include/output.php
index 1637603..bbdc99f 100644
--- a/include/output.php
+++ b/include/output.php
@@ -1,5 +1,24 @@
+ *
+ * This file is part of e-DoKo.
+ *
+ * e-DoKo is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * e-DoKo is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with e-DoKo. If not, see .
+ *
+ */
+
+/* make sure that we are not called from outside the scripts,
* use a variable defined in config.php to check this
*/
if(!isset($HOST))
@@ -7,118 +26,167 @@ if(!isset($HOST))
/* functions which only ouput html */
-function output_user_settings()
-{
- global $PREF;
-
- echo "
\n";
-
- return;
-}
-
function output_ask_for_new_game($playerA,$playerB,$playerC,$playerD,$oldgameid)
{
global $RULES;
- echo "Do you want to continue playing?(This will start a new game, with the next person as dealer.)\n";
+ echo "
\n\n
";
return;
}
function output_form_for_new_game($names)
{
-?>
-
Players
-
Please select four players (or use the randomly pre-selected names)
-
Remember: you need to be one of the players ;)
-
-';
+ echo '';
+ echo '
'._('Rules').'
';
+ echo '
'._('Gameplay-related').'
';
+ echo '
'._('Ten of hearts').':
';
+ echo '
';
+ echo ' ';
+ echo '
';
+ echo '
'._('Schweinchen (both foxes), only in normal games or silent solos').':
';
+ echo '
';
+ echo ' ';
+ echo '
';
+ echo '
'._('Call Re/Contra, etc.').':
';
+ echo '
';
+ 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 '
- 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 "
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
-
-
-
+
+
+
+
+
+
+
+
+
+
-
-
Welcome to E-Doko (beta)
-
+
+ '._('Welcome to E-Doko').' ';
+?>
+
";
@@ -350,22 +435,22 @@ function output_header()
function output_footer()
{
- global $REV,$PREF;
+ global $REV, $PREF, $INDEX;
echo "\n\n";
- echo "\n";
+ echo "\n";
echo "\n";
echo "\n";
@@ -375,28 +460,103 @@ function output_footer()
function output_status()
{
- global $defaulttimezone;
- if(isset($_SESSION["name"]))
- {
- $name = $_SESSION["name"];
+ global $defaulttimezone, $INDEX, $WIKI, $RSS;
+
+ if(isset($_SESSION['name']))
+ {
+ $name = $_SESSION['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
@@ -432,4 +592,183 @@ function output_password_recovery($email,$password)
\ No newline at end of file
+
+function output_user_notes($userid,$gameid,$userstatus)
+{
+ echo "
\n";
+
+ return;
+}
+
+function output_robotproof($i)
+{
+ switch($i)
+ {
+ case 0:
+ return "6*7=";
+ case 1:
+ return "5*7=";
+ case 2:
+ return "4*7=";
+ case 3:
+ return "3*7=";
+ case 4:
+ return "2*7=";
+ }
+}
+
+function output_exchanged_cards()
+{
+ /* in a poverty game this function will output the exchanged cards
+ * players in the team will see the cards, the other team will see
+ * the backside of cards
+ */
+
+ /* need some information about the game */
+ global $gameid,$mygametype, $PREF,$me,$mystatus, $RULES;
+
+ /* some variables to track where the people with poverty are sitting */
+ $partnerpos1 = 0;
+ $povertypos1 = 0;
+ $partnerpos2 = 0;
+ $povertypos2 = 0;
+
+ /* only need to do it in a poverty game, this might not be needed, but
+ * just to make sure everything is ok
+ */
+ if($mygametype == 'poverty' || $mygametype=='dpoverty')
+ {
+ /* find out who has poverty */
+ for($mypos=1;$mypos<5;$mypos++)
+ {
+ $usersick = DB_get_sickness_by_pos_and_gameid($mypos,$gameid);
+ if($usersick == 'poverty' || ($RULES['lowtrump']=='poverty' && $usersick=='lowtrump'))
+ if($povertypos1)
+ $povertypos2 = $mypos;
+ else
+ $povertypos1 = $mypos;
+ }
+ /* get hash and exchanged cards for all involved */
+ $povertyhash1 = DB_get_hash_from_game_and_pos($gameid,$povertypos1);
+ $partnerhash1 = DB_get_partner_hash_by_hash($povertyhash1);
+
+ $povertycards1 = DB_get_exchanged_cards($povertyhash1);
+ $partnercards1 = DB_get_exchanged_cards($partnerhash1);
+
+ $partnerpos1 = DB_get_pos_by_hash($partnerhash1);
+ if($povertypos2)
+ {
+ $povertyhash2 = DB_get_hash_from_game_and_pos($gameid,$povertypos2);
+ $partnerhash2 = DB_get_partner_hash_by_hash($povertyhash2);
+
+ $povertycards2 = DB_get_exchanged_cards($povertyhash2);
+ $partnercards2 = DB_get_exchanged_cards($partnerhash2);
+
+ $partnerpos2 = DB_get_pos_by_hash($partnerhash2);
+ }
+ }
+
+ /* output the cards
+ * go through all positions, check that position has cards that need to be shown and
+ * show those cards
+ */
+ $show=1;
+ for($mypos=1;$mypos<5;$mypos++)
+ {
+ $usersick = DB_get_sickness_by_pos_and_gameid($mypos,$gameid);
+ if($usersick!=NULL ||
+ $mypos==$povertypos1 || $mypos==$partnerpos1 ||
+ $mypos==$povertypos2 || $mypos==$partnerpos2 )
+ {
+ /* figure out if we gave trump back */
+ $trump_back1=0;
+ if($povertypos2)
+ foreach($povertycards1 as $card)
+ {
+ if(is_trump($card))
+ {
+ $trump_back1=1;
+ break;
+ }
+ }
+ $trump_back2=0;
+ if($povertypos2)
+ foreach($povertycards2 as $card)
+ {
+ if(is_trump($card))
+ {
+ $trump_back2=1;
+ break;
+ }
+ }
+
+ /* output vorbehalt */
+ echo "