From 6f98eae87d5c260ee17205a47e70c6e88eebf4d3 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Fri, 13 Jul 2012 21:40:20 +0000 Subject: [PATCH] - web: after post to a thread, show a page of the most recent posts (but don't change user's sort prefs) svn path=/trunk/boinc/; revision=25872 --- checkin_notes | 10 +++++++++- html/user/forum_reply.php | 2 +- html/user/forum_thread.php | 19 +++++++++++-------- 3 files changed, 21 insertions(+), 10 deletions(-) diff --git a/checkin_notes b/checkin_notes index ce68ede338..b62b1e1661 100644 --- a/checkin_notes +++ b/checkin_notes @@ -4918,7 +4918,7 @@ David 12 July 2012 html/inc/ forum.inc -David 12 July 2012 +David 13 July 2012 - web: when posting to a thread, show a page of its most recent posts - feeder: add --by_batch option: interleaves jobs from different batches. From Jack Harris. @@ -4928,3 +4928,11 @@ David 12 July 2012 html/user/ forum_reply.php forum_user_posts.php + +David 13 July 2012 + - web: after post to a thread, show a page of the most recent posts + (but don't change user's sort prefs) + + html/user/ + forum_thread.php + forum_reply.php diff --git a/html/user/forum_reply.php b/html/user/forum_reply.php index 4e2489bd9a..2ab45c44c3 100644 --- a/html/user/forum_reply.php +++ b/html/user/forum_reply.php @@ -77,7 +77,7 @@ if ($content && (!$preview)){ $content, $parent_post_id, $logged_in_user, $forum, $thread, $add_signature ); - header('Location: forum_thread.php?id='.$thread->id); + header("Location: forum_thread.php?id=$thread->id&temp_sort_style=".CREATE_TIME_NEW); } } diff --git a/html/user/forum_thread.php b/html/user/forum_thread.php index dd97e6e59f..a1a60e49c3 100644 --- a/html/user/forum_thread.php +++ b/html/user/forum_thread.php @@ -25,6 +25,7 @@ require_once('../inc/news.inc'); $threadid = get_int('id'); $sort_style = get_int('sort', true); +$temp_sort_style = get_int('temp_sort_style', true); $start = get_int('start', true); $postid = get_int('postid', true); $filter = get_str('filter', true); @@ -70,14 +71,9 @@ if ($thread->hidden) { } $title = cleanup_title($thread->title); -if (!$sort_style) { - // get the sorting style from the user or a cookie - if ($logged_in_user){ - $sort_style = $logged_in_user->prefs->thread_sorting; - } else if (array_key_exists('sorting', $_COOKIE)) { - list($forum_style, $sort_style) = explode("|",$_COOKIE['sorting']); - } -} else { +if ($temp_sort_style) { + $sort_style = $temp_sort_style; +} else if ($sort_style) { if ($logged_in_user){ $logged_in_user->prefs->thread_sorting = $sort_style; $logged_in_user->prefs->update("thread_sorting=$sort_style"); @@ -89,6 +85,13 @@ if (!$sort_style) { implode("|", array($forum_style, $sort_style)), true ); +} else { + // get the sorting style from the user or a cookie + if ($logged_in_user){ + $sort_style = $logged_in_user->prefs->thread_sorting; + } else if (array_key_exists('sorting', $_COOKIE)) { + list($forum_style, $sort_style) = explode("|",$_COOKIE['sorting']); + } } if ($logged_in_user && $logged_in_user->prefs->jump_to_unread){