\n";
/* show score */
@@ -239,7 +239,7 @@ if($session)
if($finalscore)
{
- echo "Score: \n";
+ echo _('Score').": \n";
foreach($finalscore as $user=>$value)
{
$name = DB_get_name('userid',$user);
@@ -283,10 +283,10 @@ if($session)
if(isset($_SESSION['id']) && $_SESSION['id']==$myid)
{
if($previous)
- echo "previous game \n";
+ echo ""._('previous game')." \n";
echo "This is game number $j of $i in session $session.\n";
if($next)
- echo " next game \n";
+ echo " "._('next game')." \n";
}
else
echo "This is game number $j of $i in session $session.";
@@ -428,7 +428,7 @@ switch($mystatus)
output_check_for_sickness($me,$mycards);
- echo "
Your cards are: \n";
+ echo '
'._('Your cards are').": \n";
foreach($mycards as $card)
display_card($card,$PREF['cardset']);
echo "
\n";
@@ -450,7 +450,7 @@ switch($mystatus)
echo "
You selected more than one sickness, please go back ".
"and answer the question again.
";
- echo "
Your cards are: \n";
+ echo '
'._('Your cards are').": \n";
foreach($mycards as $card)
display_card($card,$PREF['cardset']);
echo "
\n";
@@ -491,27 +491,27 @@ switch($mystatus)
else if($_REQUEST['wedding'] == 'yes')
{
/* silent solo is set further down */
- echo "Ok, you don't want to play a silent solo...wedding was chosen. \n";
+ echo _("Ok, you don't want to play a silent solo...wedding was chosen.")." \n";
DB_set_sickness_by_hash($me,'wedding');
}
else if($_REQUEST['poverty'] == 'yes')
{
- echo "Don't think you can win with just a few trump...? ok, poverty chosen \n";
+ echo _("Don't think you can win with just a few trump...? Ok, poverty chosen.")." \n";
DB_set_sickness_by_hash($me,'poverty');
}
else if($_REQUEST['nines'] == 'yes')
{
- echo "What? You just don't want to play a game because you have a few nines? Well, if no one".
- " is playing solo, this game will be canceled. \n";
+ echo _("What? You just don't want to play a game because you have a few nines? Well, if no one".
+ " is playing solo, this game will be canceled.")." \n";
DB_set_sickness_by_hash($me,'nines');
}
else if($_REQUEST['lowtrump'] == 'yes')
{
if($RULES['lowtrump']=='cancel')
- echo "What? You just don't want to play a game because you have low trump? Well, if no one".
- " is playing solo, this game will be canceled. \n";
+ echo _("What? You just don't want to play a game because you have low trump? Well, if no one".
+ " is playing solo, this game will be canceled.")." \n";
else
- echo "Don't think you can win with low trumps...? ok, poverty chosen . \n";
+ echo _("Don't think you can win with low trumps...? Ok, poverty chosen.")." . \n";
DB_set_sickness_by_hash($me,'lowtrump');
}
@@ -531,7 +531,7 @@ switch($mystatus)
$mycards = DB_get_hand($me);
$mycards = mysort($mycards,$gametype);
- /* output sickness of other playes, in case the already selected and are sitting in front of the current player */
+ /* output sickness of other playes, in case they already selected and are sitting in front of the current player */
echo "\n
Checking if someone else selected solo, nines, wedding or poverty.
";
+ echo '
'._('Checking if someone else selected solo, nines, wedding or poverty.').'
';
/* check if everyone has reached this stage */
$userids = DB_get_all_userid_by_gameid($gameid);
@@ -573,10 +573,10 @@ switch($mystatus)
if(!$ok)
{
- echo "
This step can only be handled after everyone finished the last step. ".
- "Seems like this is not the case, so you need to wait a bit... ".
- "you will get an email once that is the case, please use the link in ".
- "that email to continue the game.
";
+ echo '
'._('This step can only be handled after everyone finished the last step. '.
+ 'Seems like this is not the case, so you need to wait a bit... '.
+ 'you will get an email once that is the case, please use the link in '.
+ 'that email to continue the game.').'
';
/* display cards, if player was just at the init-phase he will still see the cards from there
* we can put this one here, since the last player to finish the init state won't get here and
@@ -585,7 +585,7 @@ switch($mystatus)
if($mystatus=='check')
{
/* show cards */
- echo "
Your cards are: \n";
+ echo '
'._('Your cards are').": \n";
foreach($mycards as $card)
display_card($card,$PREF['cardset']);
echo "
\n";
@@ -598,7 +598,7 @@ switch($mystatus)
* are playing, in case there are any solos this already
* will have the correct information in it */
- echo "
Ok, everyone is done... figuring out what kind of game we are playing.
";
+ echo '
'._('Ok, everyone is done... figuring out what kind of game we are playing.').'
';
$gametype = DB_get_gametype_by_gameid($gameid);
$startplayer = DB_get_startplayer_by_gameid($gameid);
@@ -712,7 +712,7 @@ switch($mystatus)
$gametype = 'wedding';
};
/* now the gametype is set correctly in the database */
- echo "
Got it :)
";
+ echo '
'._('Got it').' :)
';
/* loop over all players, set re/contra if possible and start the game if possible */
$userids = DB_get_all_userid_by_gameid($gameid);
@@ -901,10 +901,10 @@ switch($mystatus)
/* check if user need to give more cards back */
if( ($myparty=='re' || $myparty=='contra') && count($mycards)>12)
{
- echo "
you need to get rid of a few cards
\n";
+ echo '
'._('You need to get rid of a few cards')."
\n";
$type='exchange';
- echo "
Your cards are: \n";
+ echo '
'._('Your cards are').": \n";
foreach($mycards as $card)
display_link_card($card,$PREF['cardset'],$type);
echo " \n";
@@ -968,7 +968,7 @@ switch($mystatus)
echo "No way \n";
echo "
\n";
- echo "
Your cards are: \n";
+ echo '
'._('Your cards are').": \n";
foreach($mycards as $card)
display_card($card,$PREF['cardset']);
echo "
\n";
@@ -1230,13 +1230,13 @@ switch($mystatus)
/* has the game started? No, then just wait here...*/
if($gamestatus == 'pre')
{
- echo "
You finished the setup, but not everyone else finished it... ".
- "You need to wait for the others. Just wait for an email.
";
+ echo '
'._('You finished the setup, but not everyone else finished it... '.
+ 'You need to wait for the others. Just wait for an email.').'
\n";
- /* get information so show the cards that have been handed over in a poverty game */
- output_exchanged_cards();
+ /* get information so show the cards that have been handed over in a poverty game */
+ output_exchanged_cards();
- echo "
\n
\n"; /* end div trick, end li trick */
- }
+ echo "
\n
\n"; /* end div trick, end li trick */
+ }
/* output tricks */
while($r = DB_fetch_array($result))
@@ -1332,14 +1334,14 @@ switch($mystatus)
if($trick!=$lasttrick)
{
/* start of an old trick? */
- echo "
\n";
echo "\n"; /* end ul tricks*/
$mycards = DB_get_hand($me);
@@ -1988,6 +1990,39 @@ switch($mystatus)
if(have_suit($mycards,$firstcard))
$followsuit = 1;
+ /* count how many cards we can play, so that we can pre-select it if there is only one */
+ $howmanycards = 0;
+ foreach($mycards as $card)
+ {
+ if($howmanycards>1)
+ break;
+
+ /* display only cards that the player is allowed to play as links, the rest just display normal
+ * also check if we have both schweinchen, in that case only display on of them as playable
+ */
+ if( ($followsuit && !same_type($card,$firstcard)) ||
+ ( (int)($card)==19 &&
+ !$GAME['schweinchen-first'] &&
+ ( $RULES['schweinchen']=='second' ||
+ ( $RULES['schweinchen']=='secondaftercall' &&
+ (DB_get_call_by_hash($GAME['schweinchen-who']) ||
+ DB_get_partner_call_by_hash($GAME['schweinchen-who']) )
+ )
+ ) &&
+ $GAME['schweinchen-who']==$me &&
+ in_array($gametype,array('normal','wedding','trump','silent'))
+ )
+ )
+ continue;
+ else
+ $howmanycards++;
+ }
+
+ if($howmanycards==1)
+ $howmanycards=1;
+ else
+ $howmanycards=0;
+
foreach($mycards as $card)
{
/* display only cards that the player is allowed to play as links, the rest just display normal
@@ -2008,7 +2043,7 @@ switch($mystatus)
)
display_card($card,$PREF['cardset']);
else
- display_link_card($card,$PREF['cardset']);
+ display_link_card($card,$PREF['cardset'],$type='card',$selected=$howmanycards);
}
}
else if($mystatus=='play' )
@@ -2061,7 +2096,7 @@ switch($mystatus)
/* check if game is over, display results */
if(DB_get_game_status_by_gameid($gameid)=='play')
{
- echo "The game is over for you.. other people still need to play though";
+ echo _('The game is over for you... other people still need to play though');
}
break;
default:
@@ -2095,41 +2130,51 @@ else
echo "
\n";
}
-/* display rule set for this game */
+/*
+ * display gameinfo: re/contra, comment-box, play-card button, games played by others
+ */
+
echo "
\n";
+/* get time from the last action of the game */
+$r = DB_query_array("SELECT mod_date from Game WHERE id='$gameid' " );
+$gameend = time() - strtotime($r[0]);
+
+/* comment box */
+if($gamestatus == 'play' || $gameend < 60*60*24*7)
+ {
+ echo ' '._('A short comment').":\n";
+ }
+
+/* re-contra */
if($gamestatus == 'play' )
{
$myparty = DB_get_party_by_hash($me);
output_form_calls($me,$myparty);
}
-/* get time from the last action of the game */
-$r = DB_query_array("SELECT mod_date from Game WHERE id='$gameid' " );
-$gameend = time() - strtotime($r[0]);
+/* play-card button */
if($gamestatus == 'play' || $gameend < 60*60*24*7)
{
- echo " \n"._('A short comment').":\n";
+ echo " \n";
}
-echo "\n";
-
/* has this hand been played by others? */
$other_game_ids = DB_played_by_others($gameid);
if(sizeof($other_game_ids)>0 && $mystatus=='gameover')
{
$mypos = DB_get_pos_by_hash($me);
- echo "
See how other played the same hand: \n";
+ echo "
See how other played the same hand: \n";
foreach($other_game_ids as $id)
{
$otherhash = DB_get_hash_from_game_and_pos($id,$mypos);
$othername = DB_get_name('hash',$otherhash);
- echo "$othername ";
+ echo " $othername ";
}
- echo "