- web: don't try to update thread last-read-time if not logged in

svn path=/trunk/boinc/; revision=25870
This commit is contained in:
David Anderson 2012-07-12 22:43:23 +00:00
parent 52b72d620e
commit 1b8e8fbb7f
2 changed files with 16 additions and 8 deletions

View File

@ -4895,7 +4895,7 @@ Charlie 12 July 2012
BuildMacWrapper.sh
David 12 July 2012
- web: make "jump to first unread" for with pagination
- web: make "jump to first unread" work with pagination
html/
inc/
@ -4911,3 +4911,9 @@ David 12 July 2012
forum.inc
user/
forum_thread.php
David 12 July 2012
- web: don't try to update thread last-read-time if not logged in
html/inc/
forum.inc

View File

@ -401,7 +401,7 @@ function show_posts(
$headings = array(array(tra("Author"),"authorcol"), array(tra("Message"),""));
start_forum_table($headings, "id=\"thread\" cellspacing=0");
$latest_post_shown = 0;
$latest_shown_timestamp = 0;
foreach ($posts as $post) {
if ($num_skipped < $start) {
$num_skipped++;
@ -416,8 +416,8 @@ function show_posts(
);
$n = ($n+1)%2;
if ($post->timestamp > $latest_post_shown) {
$latest_post_shown = $post->timestamp;
if ($post->timestamp > $latest_shown_timestamp) {
$latest_shown_timestamp = $post->timestamp;
}
$num_shown++;
}
@ -430,10 +430,12 @@ function show_posts(
echo "<script>function jumpToUnread(){};</script>";
}
if (!$forum_log || $latest_post_shown > $forum_log->timestamp) {
BoincForumLogging::replace(
$logged_in_user->id, $thread->id, $latest_post_shown
);
if ($logged_in_user) {
if (!$forum_log || $latest_shown_timestamp > $forum_log->timestamp) {
BoincForumLogging::replace(
$logged_in_user->id, $thread->id, $latest_shown_timestamp
);
}
}
}