diff options
author | Meik Sievertsen <acydburn@phpbb.com> | 2007-03-06 11:22:43 +0000 |
---|---|---|
committer | Meik Sievertsen <acydburn@phpbb.com> | 2007-03-06 11:22:43 +0000 |
commit | 1070cf800fd9a101a50bb89fe9c6571e5651ef72 (patch) | |
tree | da751649a5484e749504f1479eeb8416babd6267 /phpBB | |
parent | 770e35d27ea490bb8ce27759531dff9dc85b4382 (diff) | |
download | forums-1070cf800fd9a101a50bb89fe9c6571e5651ef72.tar forums-1070cf800fd9a101a50bb89fe9c6571e5651ef72.tar.gz forums-1070cf800fd9a101a50bb89fe9c6571e5651ef72.tar.bz2 forums-1070cf800fd9a101a50bb89fe9c6571e5651ef72.tar.xz forums-1070cf800fd9a101a50bb89fe9c6571e5651ef72.zip |
ok, try to fix a bug introduced by fixing bug #8388
git-svn-id: file:///svn/phpbb/trunk@7133 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB')
-rw-r--r-- | phpBB/viewforum.php | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/phpBB/viewforum.php b/phpBB/viewforum.php index b5b04c6a00..6b21d014b3 100644 --- a/phpBB/viewforum.php +++ b/phpBB/viewforum.php @@ -405,7 +405,8 @@ $sql_array = array( // the number of stickies are not known $sql = $db->sql_build_query('SELECT', $sql_array); $sql = str_replace('{SQL_TOPIC_TYPE}', ($store_reverse) ? POST_NORMAL : POST_STICKY, $sql); -$result = $db->sql_query_limit($sql, $sql_limit); + +$result = ($store_reverse) ? $db->sql_query_limit($sql, $sql_limit, $sql_start) : $db->sql_query_limit($sql, $sql_limit); $shadow_topic_list = array(); @@ -419,7 +420,7 @@ while ($row = $db->sql_fetchrow($result)) { $start_count++; - if ($start_count >= $sql_start) + if ((!$store_reverse && $start_count >= $sql_start) || $store_reverse) { if ($row['topic_status'] == ITEM_MOVED) { @@ -439,8 +440,15 @@ if ($num_rows < $sql_limit) $sql = $db->sql_build_query('SELECT', $sql_array); $sql = str_replace('{SQL_TOPIC_TYPE}', ($store_reverse) ? POST_STICKY : POST_NORMAL, $sql); - // Start at $sql_start - number of sticky topics on the previous page ($start_count - $num_rows) - $result = $db->sql_query_limit($sql, $sql_limit - $num_rows, $sql_start - ($start_count - $num_rows)); + if (!$store_reverse) + { + // Start at $sql_start - number of sticky topics on the previous page ($start_count - $num_rows) + $result = $db->sql_query_limit($sql, $sql_limit - $num_rows, $sql_start - ($start_count - $num_rows)); + } + else + { + $result = $db->sql_query_limit($sql, $sql_limit - $num_rows, $sql_start); + } while ($row = $db->sql_fetchrow($result)) { |