X-Git-Url: https://git.nubati.net/cgi-bin/gitweb.cgi?p=e-DoKo.git;a=blobdiff_plain;f=include%2Foutput.php;h=06eb8de66dd02945609b8dc6c92fe5a91fd1f6d2;hp=4f4a5b6ff3c493053b4e8a61338c19ab8995a320;hb=6e7ed2d202da016b9a74256371369cc41201df2e;hpb=4fc2c543112c4734b71272b1e4a1392406d63455
diff --git a/include/output.php b/include/output.php
index 4f4a5b6..06eb8de 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,36 +26,12 @@ 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)
{
+ $copy_names = $names; /* local copy, so that we can delete names from it
+ * after we selected them to make sure that each name
+ * only shows up once
+ */
?>
-
Players
-
Please select four players (or use the randomly pre-selected names)
-
Remember: you need to be one of the players ;)
-
+
+
Rules
+
Gameplay-related
+
Ten of hearts:
+
+
+
+
Schweinchen (both foxes), only in normal games or silent solos:
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:
-
\n";
- };
return;
}
-
function output_password_recovery($email,$password)
{
?>
@@ -432,4 +517,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;
+
+ /* 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')
+ 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 "