summaryrefslogtreecommitdiffstats
path: root/include/game.php
diff options
context:
space:
mode:
authorArun Persaud <arun@nubati.net>2009-01-16 20:58:05 -0800
committerArun Persaud <arun@nubati.net>2009-01-16 20:58:05 -0800
commite7f6b5bf335e80c40219842829548b48569172a6 (patch)
tree7982257fe210ee5ac8dfa241682735da908848b1 /include/game.php
parent617c9d49a2445bd39f2d18274462a29d8e533353 (diff)
downloade-DoKo-e7f6b5bf335e80c40219842829548b48569172a6.tar.gz
e-DoKo-e7f6b5bf335e80c40219842829548b48569172a6.tar.bz2
e-DoKo-e7f6b5bf335e80c40219842829548b48569172a6.zip
NEW FEATURE: add a link to the previous and next game in the session
makes it easier to navigate through one session
Diffstat (limited to 'include/game.php')
-rw-r--r--include/game.php19
1 files changed, 18 insertions, 1 deletions
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 " </div>\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 <a href=\"{$INDEX}?action=game&amp;me=$lasthash\">$i</a> in session $session.";
+ {
+ if($previous)
+ echo "<a href=\"{$INDEX}?action=game&amp;me=$previous\">previous game</a>&nbsp;&nbsp;&nbsp; \n";
+ echo "This is game number $j of <a href=\"{$INDEX}?action=game&amp;me=$lasthash\">$i</a> in session $session.\n";
+ if($next)
+ echo "&nbsp;&nbsp;&nbsp;<a href=\"{$INDEX}?action=game&amp;me=$next\">next game</a> \n";
+ }
else
echo "This is game number $j of $i in session $session.";
echo "\n</div>\n";