X-Git-Url: https://git.nubati.net/cgi-bin/gitweb.cgi?p=e-DoKo.git;a=blobdiff_plain;f=include%2Foutput.php;h=b0d3f4a87bbf70e0cd4560c368e40d7c0b9a4680;hp=161ef3a8746f1b824c74045d5d5cd1e4fb505041;hb=a83ac7d982fa4f9d49ac3e6dedac8b489f2f7baa;hpb=14e3ecf14c8b5cc2c1d89940ec61ca8d7a303326
diff --git a/include/output.php b/include/output.php
index 161ef3a..b0d3f4a 100644
--- a/include/output.php
+++ b/include/output.php
@@ -1,4 +1,23 @@
+ *
+ * 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
*/
@@ -7,21 +26,38 @@ if(!isset($HOST))
/* functions which only ouput html */
+function autoversion($file)
+{
+ /* changes the file name of e.g. css/style.css to css/style..css/js
+ * this way the browser can cache the file and will reload it if the file changed
+ * needs to have .htaccess set up correctly to link back to css/style.css */
+
+ /* only use it for file that have an absolut path */
+ if(!file_exists(dirname($_SERVER['SCRIPT_FILENAME']). '/' . $file))
+ return $file;
+
+ $md5 = md5_file(dirname($_SERVER['SCRIPT_FILENAME']). '/' . $file);
+ return preg_replace('{\\.([^./]+)$}', ".$md5.\$1", $file);
+}
+
+
function output_ask_for_new_game($playerA,$playerB,$playerC,$playerD,$oldgameid)
{
global $RULES;
echo "
\n\n
";
return;
}
@@ -32,86 +68,124 @@ function output_form_for_new_game($names)
* after we selected them to make sure that each name
* only shows up once
*/
-?>
- ';
+
}
function output_table($data,$caption="",$class="",$id="")
@@ -174,70 +248,92 @@ 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 "\n";
+ echo "\n";
else
- echo "\n";
+ echo "\n";
return;
}
function output_check_for_sickness($me,$mycards)
{
- ?>
-
Thanks for joining the game...
-
- do you want to play solo?
-
-
-
- '._('Thanks for joining the game').'... ';
+ echo '';
+ echo ' '._('Do you want to play solo?').'';
+ echo ' ';
+ echo ' ';
+
if(check_wedding($mycards))
{
- echo " yes";
- echo " no \n";
+ echo _('Do you want to call Wedding?');
+ echo ' '._('yes')."";
+ echo ' '._('no')." \n";
}
else
{
- echo " no \n";
+ echo " \n";
};
- echo "Do you have poverty?";
if(count_trump($mycards)<4)
{
- echo " yes";
- echo " no \n";
+ echo _('Do you want to call poverty?');
+ echo ' '._('yes')."";
+ echo ' '._('no')." \n";
}
else
{
- echo " no \n";
+ echo " \n";
};
- echo "Do you have too many nines?";
if(count_nines($mycards)>4)
{
- echo " yes";
- echo " no \n";
+ echo _('Do you want to call too many nines?');
+ echo ' '._('yes')."";
+ echo ' '._('no')." \n";
}
else
{
- echo " no \n";
+ echo " \n";
};
+ if($RULES['lowtrump']=='cancel' || $RULES['lowtrump']=='poverty')
+ {
+ if(check_low_trump($mycards))
+ {
+ if($RULES['lowtrump']=='cancel')
+ echo _('Do you want to call low trump (cancel game)?');
+ else
+ echo _('Do you want to call low trump (poverty)?');
+
+ echo ' '._('yes')."";
+ echo ' '._('no')." \n";
+ }
+ else
+ {
+ echo " \n";
+ };
+ }
+ else
+ echo " ";
+
echo "\n";
- echo "\n";
+ echo " \n";
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 "