X-Git-Url: https://git.nubati.net/cgi-bin/gitweb.cgi?p=e-DoKo.git;a=blobdiff_plain;f=include%2Fgame.php;h=fb807c74ed4533da18ccdc4da77e2f8c159e9e14;hp=7109c11e1ca3560aa25ee7e4db88056b0a1fb1ce;hb=11882439a450641bf0d4dd048775d0bdfb592642;hpb=c3b1dec40c80f8a18f0102505c9f47a2b0d1b335 diff --git a/include/game.php b/include/game.php index 7109c11..fb807c7 100644 --- a/include/game.php +++ b/include/game.php @@ -109,7 +109,15 @@ if( $mystatus!='gameover' ) if($note != '') DB_insert_note($note,$gameid,$myid); }; -output_user_notes($myid,$gameid,$mystatus); + +/* make sure that we don't show the notes to the wrong person + * (e.g. other people looking at an old game) + */ +if( $mystatus != 'gameover' || + ( $mystatus == 'gameover' && + isset($_SESSION['id']) && + $myid == $_SESSION['id'])) + output_user_notes($myid,$gameid,$mystatus); /* handle calls */ if(myisset('call') && $_REQUEST['call'] == '120' && can_call(120,$me)) @@ -131,41 +139,41 @@ if($session) switch($RULES['dullen']) { case 'none': - echo "\"not\n"; break; + echo " \"not\n"; break; case 'firstwins': - echo "\"ten\n"; break; + echo " \"ten\n"; break; case 'secondwins': - echo "\"second\n"; break; + echo " \"second\n"; break; } switch($RULES['schweinchen']) { case 'none': - echo "\"no\n"; break; case 'both': - echo "\"two\n"; break; case 'second': - echo "\"second\n"; break; case 'secondaftercall': - echo "\"second\n"; break; } switch($RULES['call']) { case '1st-own-card': - echo "\"1st-own-card\"\n"; break; + echo " \"1st-own-card\"\n"; break; case '5th-card': - echo "\"5th-card\"\n"; break; + echo " \"5th-card\"\n"; break; case '9-cards': - echo "\"9-cards\"\n"; break; + echo " \"9-cards\"\n"; break; } - echo "
\n"; + echo "
\n"; echo " 10ofhearts : {$RULES['dullen']}
\n"; echo " schweinchen: {$RULES['schweinchen']}
\n"; echo " call: {$RULES['call']}
\n"; - echo "
\n
\n"; + echo " \n \n"; echo "
Score \n"; $score = generate_score_table($session); echo format_score_table_html($score,$myid); @@ -184,7 +192,7 @@ if($session) echo "This is game number $j of $i in session $session."; else echo "This is game number $j of $i in session $session."; - echo "
\n"; + echo "\n\n"; } /* display the table and the names */ @@ -1759,7 +1767,7 @@ switch($mystatus) $message .= "Score Table:\n"; $message .= format_score_table_ascii($score); - $message .= "Use these links to have a look at game ".DB_format_gameid($gameid).": \n" + $message .= "\nUse these links to have a look at game ".DB_format_gameid($gameid).": \n"; /* send out final email */ $all = array(); @@ -1937,10 +1945,24 @@ switch($mystatus) default: myerror("error in testing the status"); } -/* output left menu */ -display_user_menu(); -/* output right menu */ +/* output other games where it is the users turn + * make sure that the people looking at old games don't see the wrong games here + */ +if( $mystatus != 'gameover' ) + display_user_menu($myid); +else if( $mystatus == 'gameover' && + isset($_SESSION['id']) ) + { + display_user_menu($_SESSION['id']); + } +else + { + echo "
\n"; + echo "It's your turn in these games:
\n"; + echo "Please log in to see this information.\n"; + echo "
\n"; + } /* display rule set for this game */ echo "
\n";