From: Arun Persaud Date: Sat, 17 Jan 2009 04:58:05 +0000 (-0800) Subject: NEW FEATURE: add a link to the previous and next game in the session X-Git-Url: https://git.nubati.net/cgi-bin/gitweb.cgi?p=e-DoKo.git;a=commitdiff_plain;h=e7f6b5bf335e80c40219842829548b48569172a6 NEW FEATURE: add a link to the previous and next game in the session makes it easier to navigate through one session --- diff --git a/include/game.php b/include/game.php index 8d07b83..bb3202d 100644 --- a/include/game.php +++ b/include/game.php @@ -179,6 +179,7 @@ if($session) echo format_score_table_html($score,$myid); echo " \n"; $hashes = DB_get_hashes_by_session($session,$myid); + $next = NULL; $i = 1; foreach($hashes as $hash) { @@ -188,8 +189,24 @@ if($session) $lasthash=$hash; } $i--; + + if($j>1) + $previous = $hashes[$j-2]; + else + $previous = NULL; + if($j<$i) + $next = $hashes[$j]; + else + $next = NULL; + if(isset($_SESSION['id']) && $_SESSION['id']==$myid) - echo "This is game number $j of $i in session $session."; + { + if($previous) + echo "previous game    \n"; + echo "This is game number $j of $i in session $session.\n"; + if($next) + echo "   next game \n"; + } else echo "This is game number $j of $i in session $session."; echo "\n\n";