From 4d261afbe612bb519b5458b1f4f72a5cc2e95c1b Mon Sep 17 00:00:00 2001 From: David Anderson Date: Mon, 18 Jul 2011 18:10:23 +0000 Subject: [PATCH] - web: tweak last checkin svn path=/trunk/boinc/; revision=23854 --- html/user/forum_user_posts.php | 28 +++++++++++++++++++++------- 1 file changed, 21 insertions(+), 7 deletions(-) diff --git a/html/user/forum_user_posts.php b/html/user/forum_user_posts.php index 3b963130f9..8532906b36 100644 --- a/html/user/forum_user_posts.php +++ b/html/user/forum_user_posts.php @@ -77,6 +77,7 @@ $n = 0; start_table(); $options = get_output_options($logged_in_user); +$show_next = false; foreach ($posts as $post) { $thread = BoincThread::lookup_id($post->thread); if (!$thread) continue; @@ -98,18 +99,31 @@ foreach ($posts as $post) { } } } - if ($n >= $offset && $n < $offset + $count) { - show_post_and_context($post, $thread, $forum, $options, $n+$offset+1); + if ($n == $offset + $count) { + $show_next = true; + break; + } + if ($n >= $offset) { + show_post_and_context($post, $thread, $forum, $options, $n+1); } $n++; } -echo "\n"; +echo "

\n"; -if ($n == $count) { +if ($offset) { + $x = $offset - $count; + echo " + Previous $count + + "; + if ($show_next) echo " | "; +} + +if ($show_next) { $offset += $count; - echo " -

- Next $count posts + echo " + Next $count + "; }