aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/viewtopic.php
diff options
context:
space:
mode:
authorDhruv Goel <dhruv.goel92@gmail.com>2014-08-29 20:44:01 +0530
committerDhruv Goel <dhruv.goel92@gmail.com>2014-08-29 20:44:01 +0530
commit6d9c0a76df2ab2b55b8f863a412f0fcf10599196 (patch)
tree8d1c346db0ae10982086a145b3323232d70aeaf8 /phpBB/viewtopic.php
parentcbbef46c6cd3d453019779db0d6ef700cf11762b (diff)
parente5e45f860b798c955f1817001f07aabcbccbabcf (diff)
downloadforums-6d9c0a76df2ab2b55b8f863a412f0fcf10599196.tar
forums-6d9c0a76df2ab2b55b8f863a412f0fcf10599196.tar.gz
forums-6d9c0a76df2ab2b55b8f863a412f0fcf10599196.tar.bz2
forums-6d9c0a76df2ab2b55b8f863a412f0fcf10599196.tar.xz
forums-6d9c0a76df2ab2b55b8f863a412f0fcf10599196.zip
Merge pull request #2865 from marc1706/ticket/12966
[ticket/12966] Sort posts by post_id in addition to sorting by post_time
Diffstat (limited to 'phpBB/viewtopic.php')
-rw-r--r--phpBB/viewtopic.php6
1 files changed, 3 insertions, 3 deletions
diff --git a/phpBB/viewtopic.php b/phpBB/viewtopic.php
index c2faffca85..20fea19f7c 100644
--- a/phpBB/viewtopic.php
+++ b/phpBB/viewtopic.php
@@ -94,7 +94,7 @@ if ($view && !$post_id)
AND " . $phpbb_content_visibility->get_visibility_sql('post', $forum_id) . "
AND post_time > $topic_last_read
AND forum_id = $forum_id
- ORDER BY post_time ASC";
+ ORDER BY post_time ASC, post_id ASC";
$result = $db->sql_query_limit($sql, 1);
$row = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
@@ -146,7 +146,7 @@ if ($view && !$post_id)
AND topic_moved_id = 0
AND topic_last_post_time $sql_condition {$row['topic_last_post_time']}
AND " . $phpbb_content_visibility->get_visibility_sql('topic', $row['forum_id']) . "
- ORDER BY topic_last_post_time $sql_ordering";
+ ORDER BY topic_last_post_time $sql_ordering, topic_last_post_id $sql_ordering";
$result = $db->sql_query_limit($sql, 1);
$row = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
@@ -388,7 +388,7 @@ if (!isset($topic_tracking_info))
$limit_days = array(0 => $user->lang['ALL_POSTS'], 1 => $user->lang['1_DAY'], 7 => $user->lang['7_DAYS'], 14 => $user->lang['2_WEEKS'], 30 => $user->lang['1_MONTH'], 90 => $user->lang['3_MONTHS'], 180 => $user->lang['6_MONTHS'], 365 => $user->lang['1_YEAR']);
$sort_by_text = array('a' => $user->lang['AUTHOR'], 't' => $user->lang['POST_TIME'], 's' => $user->lang['SUBJECT']);
-$sort_by_sql = array('a' => array('u.username_clean', 'p.post_id'), 't' => 'p.post_time', 's' => array('p.post_subject', 'p.post_id'));
+$sort_by_sql = array('a' => array('u.username_clean', 'p.post_id'), 't' => array('p.post_time', 'p.post_id'), 's' => array('p.post_subject', 'p.post_id'));
$join_user_sql = array('a' => true, 't' => false, 's' => false);
$s_limit_days = $s_sort_key = $s_sort_dir = $u_sort_param = '';