X-Git-Url: https://git.nubati.net/cgi-bin/gitweb.cgi?p=e-DoKo.git;a=blobdiff_plain;f=include%2Fgame.php;h=16359ed033362fa43f2e8ead81378b8e0acc5b2b;hp=79cdfa6fef32aa623ba5fa13399250a5f65255dc;hb=2d296b5743e2f2a07816f08e42d9ee1828e26a67;hpb=f11c2bcac54384c4154324e4c72a2b62af35995c
diff --git a/include/game.php b/include/game.php
index 79cdfa6..16359ed 100644
--- a/include/game.php
+++ b/include/game.php
@@ -57,6 +57,9 @@ $playid = DB_get_current_playid($gameid); /* might be -1 at beginning of the g
/* get prefs and save them in a variable*/
$PREF = DB_get_PREF(isset($_SESSION['id'])?$_SESSION['id']:$myid);
+/* set language chosen in preferences */
+$_SESSION['language'] = $PREF['language'];
+set_language($PREF['language']);
/* get rule set for this game */
$RULES = DB_get_RULES($gameid);
@@ -68,7 +71,10 @@ $GT = $gametype;
if($gametype=='solo')
{
$gametype = DB_get_solo_by_gameid($gameid);
- $GT = $gametype.' '.$GT;
+ if($gametype=='silent')
+ $GT = 'normal';
+ else
+ $GT = $gametype.' '.$GT;
}
/* do we need to worry about Schweinchen?
@@ -145,29 +151,29 @@ if( myisset('call') )
{
$result = DB_query("UPDATE Hand SET point_call='120' WHERE hash='$me' ");
if($myparty=='re')
- $commentCall = "Re";
+ $commentCall = 'Re';
else if($myparty=='contra')
- $commentCall = "Contra";
+ $commentCall = 'Contra';
}
else if($_REQUEST['call'] == '90' && can_call(90,$me))
{
$result = DB_query("UPDATE Hand SET point_call='90' WHERE hash='$me' ");
- $commentCall = "No 90";
+ $commentCall = 'No 90';
}
else if($_REQUEST['call'] == '60' && can_call(60,$me))
{
$result = DB_query("UPDATE Hand SET point_call='60' WHERE hash='$me' ");
- $commentCall = "No 60";
+ $commentCall = 'No 60';
}
else if($_REQUEST['call'] == '30' && can_call(30,$me))
{
$result = DB_query("UPDATE Hand SET point_call='30' WHERE hash='$me' ");
- $commentCall = "No 30";
+ $commentCall = 'No 30';
}
else if($_REQUEST['call'] == '0' && can_call(0,$me))
{
$result = DB_query("UPDATE Hand SET point_call='0' WHERE hash='$me' ");
- $commentCall = "Zero";
+ $commentCall = 'Zero';
}
}
@@ -227,38 +233,38 @@ if($session)
switch($RULES['dullen'])
{
case 'none':
- echo " \n"; break;
case 'firstwins':
- echo " \n"; break;
case 'secondwins':
- echo " \n"; break;
}
switch($RULES['schweinchen'])
{
case 'none':
- echo " \n"; break;
case 'both':
- echo " \n"; break;
case 'second':
- echo " \n"; break;
case 'secondaftercall':
- echo " \n"; break;
}
switch($RULES['call'])
{
case '1st-own-card':
- echo " \n"; break;
+ echo ' \n"; break;
case '5th-card':
- echo " \n"; break;
+ echo ' \n"; break;
case '9-cards':
- echo " \n"; break;
+ echo ' \n"; break;
}
echo "
\n";
echo ' '._('10ofhearts').": {$RULES['dullen']} \n";
@@ -284,13 +290,13 @@ if($session)
foreach($finalscore as $user=>$value)
{
$name = DB_get_name('userid',$user);
- echo " ".substr($name,0,2).": $value ";
+ echo ' '.substr($name,0,2).": $value ";
}
}
else
{
/* first game, no score yet */
- echo " ";
+ echo ' ';
}
/* output all games for the score table */
@@ -323,7 +329,7 @@ if($session)
/* check for solo, add game type to session number */
echo " Game $session.$j";
- if($GT !='normal')
+ if($gamestatus != 'pre' && $GT !='normal' )
echo " ($GT)";
if(isset($_SESSION['id']) && $_SESSION['id']==$myid)
{
@@ -331,9 +337,10 @@ if($session)
echo " "._('previous')." \n";
if($next)
echo " "._('next')." \n";
+
+ if($j != $i )
+ echo " "._('last')." \n";
}
- if($j != $i )
- echo " last \n";
echo "\n
\n";
}
@@ -360,7 +367,7 @@ switch($mystatus)
case 'check':
/* output sickness of other playes, in case they already selected and are sitting in front of the current player */
echo "\n
\n"; /* end div trick, end li trick , end tricks*/
/* end displaying sickness */
@@ -374,7 +381,7 @@ switch($mystatus)
$mygametype = DB_get_gametype_by_gameid($gameid);
- echo "
\n\n\n"; /* end div trick, end li trick , end ul tricks */
}
/* end output pre-game trick */
@@ -389,13 +396,13 @@ switch($mystatus)
$mygamesolo = DB_get_solo_by_gameid($gameid);
if($mygametype != 'normal') /* only show when needed */
if(!( $mygametype == 'solo' && $mygamesolo == 'silent') )
- echo "
\n";
$trickNR++;
}
/* if game is over, also output link to Score tab */
if($mystatus=='gameover' && DB_get_game_status_by_gameid($gameid)=='gameover' )
- echo "