From e7f6b5bf335e80c40219842829548b48569172a6 Mon Sep 17 00:00:00 2001 From: Arun Persaud Date: Fri, 16 Jan 2009 20:58:05 -0800 Subject: [PATCH] NEW FEATURE: add a link to the previous and next game in the session makes it easier to navigate through one session --- include/game.php | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) 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"; -- 2.25.1