aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/viewforum.php
diff options
context:
space:
mode:
authorMeik Sievertsen <acydburn@phpbb.com>2007-03-03 17:41:21 +0000
committerMeik Sievertsen <acydburn@phpbb.com>2007-03-03 17:41:21 +0000
commitc93a40ed0c8d2570dfc82719a3b56590cf7a92f8 (patch)
treeb9cf8d7a9dbc4bfcaed7212e3d844c11ae3fce49 /phpBB/viewforum.php
parentb231c4234c513b3d9228306cf4c221e323456363 (diff)
downloadforums-c93a40ed0c8d2570dfc82719a3b56590cf7a92f8.tar
forums-c93a40ed0c8d2570dfc82719a3b56590cf7a92f8.tar.gz
forums-c93a40ed0c8d2570dfc82719a3b56590cf7a92f8.tar.bz2
forums-c93a40ed0c8d2570dfc82719a3b56590cf7a92f8.tar.xz
forums-c93a40ed0c8d2570dfc82719a3b56590cf7a92f8.zip
Fixing the following bugs:
#8444 (language dependent buttons no longer include the dimensions to allow bigger/smaller translated images) #8414 #8396 #8388 #8216 thanks to bartvb and kellanved for providing possible fixes... git-svn-id: file:///svn/phpbb/trunk@7114 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/viewforum.php')
-rw-r--r--phpBB/viewforum.php29
1 files changed, 21 insertions, 8 deletions
diff --git a/phpBB/viewforum.php b/phpBB/viewforum.php
index 58ee68a38e..1092bdb90f 100644
--- a/phpBB/viewforum.php
+++ b/phpBB/viewforum.php
@@ -405,20 +405,31 @@ $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, $sql_start);
+$result = $db->sql_query_limit($sql, $sql_limit);
$shadow_topic_list = array();
+
+// Total number of normal or sticky topics that have been retrieved
+$start_count = 0;
+
+// Number of normal or sticky topics that have been placed
$num_rows = 0;
+
while ($row = $db->sql_fetchrow($result))
{
- if ($row['topic_status'] == ITEM_MOVED)
+ $start_count++;
+
+ if ($start_count >= $sql_start)
{
- $shadow_topic_list[$row['topic_moved_id']] = $row['topic_id'];
- }
+ if ($row['topic_status'] == ITEM_MOVED)
+ {
+ $shadow_topic_list[$row['topic_moved_id']] = $row['topic_id'];
+ }
- $rowset[$row['topic_id']] = $row;
- $topic_list[] = $row['topic_id'];
- $num_rows++;
+ $rowset[$row['topic_id']] = $row;
+ $topic_list[] = $row['topic_id'];
+ $num_rows++;
+ }
}
$db->sql_freeresult($result);
@@ -427,7 +438,9 @@ 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);
- $result = $db->sql_query_limit($sql, $sql_limit - $num_rows, $sql_start);
+
+ // 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));
while ($row = $db->sql_fetchrow($result))
{