aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMeik Sievertsen <acydburn@phpbb.com>2008-01-05 15:44:31 +0000
committerMeik Sievertsen <acydburn@phpbb.com>2008-01-05 15:44:31 +0000
commita4633d8ac09f50aceb9e5568baff59de61508bc8 (patch)
treee6fc6eb9986c70f50584b0740bf2bbdb91b2c6f1
parent3b29db45459f562abe975ba5f450141b67546f71 (diff)
downloadforums-a4633d8ac09f50aceb9e5568baff59de61508bc8.tar
forums-a4633d8ac09f50aceb9e5568baff59de61508bc8.tar.gz
forums-a4633d8ac09f50aceb9e5568baff59de61508bc8.tar.bz2
forums-a4633d8ac09f50aceb9e5568baff59de61508bc8.tar.xz
forums-a4633d8ac09f50aceb9e5568baff59de61508bc8.zip
- version jump
- take empty topic_list into account as well as re-enabling for an empty get_forum_ids git-svn-id: file:///svn/phpbb/trunk@8304 89ea8834-ac86-4346-8a33-228a782c2dd0
-rw-r--r--phpBB/install/schemas/schema_data.sql2
-rw-r--r--phpBB/viewforum.php48
2 files changed, 28 insertions, 22 deletions
diff --git a/phpBB/install/schemas/schema_data.sql b/phpBB/install/schemas/schema_data.sql
index 81b0805a8d..a3cea370e1 100644
--- a/phpBB/install/schemas/schema_data.sql
+++ b/phpBB/install/schemas/schema_data.sql
@@ -213,7 +213,7 @@ INSERT INTO phpbb_config (config_name, config_value) VALUES ('topics_per_page',
INSERT INTO phpbb_config (config_name, config_value) VALUES ('tpl_allow_php', '0');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('upload_icons_path', 'images/upload_icons');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('upload_path', 'files');
-INSERT INTO phpbb_config (config_name, config_value) VALUES ('version', '3.0.1-dev');
+INSERT INTO phpbb_config (config_name, config_value) VALUES ('version', '3.1.0');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('warnings_expire_days', '90');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('warnings_gc', '14400');
diff --git a/phpBB/viewforum.php b/phpBB/viewforum.php
index cb9b125400..7b8a909b46 100644
--- a/phpBB/viewforum.php
+++ b/phpBB/viewforum.php
@@ -405,7 +405,7 @@ else if (empty($active_forum_ary['exclude_forum_id']))
else
{
$get_forum_ids = array_diff($active_forum_ary['forum_id'], $active_forum_ary['exclude_forum_id']);
- $sql_where = $db->sql_in_set('t.forum_id', $get_forum_ids);
+ $sql_where = (sizeof($get_forum_ids)) ? $db->sql_in_set('t.forum_id', $get_forum_ids) : 't.forum_id = ' . $forum_id;
}
// Grab just the sorted topic ids
@@ -417,38 +417,44 @@ $sql = 'SELECT t.topic_id
$sql_limit_time
ORDER BY t.topic_type " . ((!$store_reverse) ? 'DESC' : 'ASC') . ', ' . $sql_sort_order;
$result = $db->sql_query_limit($sql, $sql_limit, $sql_start);
+
while ($row = $db->sql_fetchrow($result))
{
$topic_list[] = (int) $row['topic_id'];
}
$db->sql_freeresult($result);
-// SQL array for obtaining topics/stickies
-$sql_array = array(
- 'SELECT' => $sql_array['SELECT'],
- 'FROM' => $sql_array['FROM'],
- 'LEFT_JOIN' => $sql_array['LEFT_JOIN'],
+// For storing shadow topics
+$shadow_topic_list = array();
- 'WHERE' => $db->sql_in_set('t.topic_id', $topic_list),
-);
+if (sizeof($topic_list))
+{
+ // SQL array for obtaining topics/stickies
+ $sql_array = array(
+ 'SELECT' => $sql_array['SELECT'],
+ 'FROM' => $sql_array['FROM'],
+ 'LEFT_JOIN' => $sql_array['LEFT_JOIN'],
-// If store_reverse, then first obtain topics, then stickies, else the other way around...
-// Funnily enough you typically save one query if going from the last page to the middle (store_reverse) because
-// the number of stickies are not known
-$sql = $db->sql_build_query('SELECT', $sql_array);
-$result = $db->sql_query($sql);
+ 'WHERE' => $db->sql_in_set('t.topic_id', $topic_list),
+ );
-$shadow_topic_list = array();
-while ($row = $db->sql_fetchrow($result))
-{
- if ($row['topic_status'] == ITEM_MOVED)
+ // If store_reverse, then first obtain topics, then stickies, else the other way around...
+ // Funnily enough you typically save one query if going from the last page to the middle (store_reverse) because
+ // the number of stickies are not known
+ $sql = $db->sql_build_query('SELECT', $sql_array);
+ $result = $db->sql_query($sql);
+
+ while ($row = $db->sql_fetchrow($result))
{
- $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;
+ $rowset[$row['topic_id']] = $row;
+ }
+ $db->sql_freeresult($result);
}
-$db->sql_freeresult($result);
// If we have some shadow topics, update the rowset to reflect their topic information
if (sizeof($shadow_topic_list))