1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-05-07 08:05:25 +02:00

- 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
This commit is contained in:
Meik Sievertsen 2008-01-05 15:44:31 +00:00
parent 3b29db4545
commit a4633d8ac0
2 changed files with 31 additions and 25 deletions

View File

@ -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');

View File

@ -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'],
'WHERE' => $db->sql_in_set('t.topic_id', $topic_list),
);
// 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);
// For storing shadow topics
$shadow_topic_list = array();
while ($row = $db->sql_fetchrow($result))
{
if ($row['topic_status'] == ITEM_MOVED)
{
$shadow_topic_list[$row['topic_moved_id']] = $row['topic_id'];
}
$rowset[$row['topic_id']] = $row;
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'],
'WHERE' => $db->sql_in_set('t.topic_id', $topic_list),
);
// 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))
{
if ($row['topic_status'] == ITEM_MOVED)
{
$shadow_topic_list[$row['topic_moved_id']] = $row['topic_id'];
}
$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))