1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-07-31 22:10:45 +02:00

[feature/soft-delete] Add get_visibility_sql_forums based on global

The resulting query is 4-times faster, as the forum_id IN () arrays are
smaller and we need less AND/OR to build the hole query. The main difference
between those two functions is, that this one takes an array of included ids and
the _global one takes an array of excluded ids.

PHPBB3-9657
This commit is contained in:
Joas Schilling
2012-08-30 18:07:00 +02:00
parent df83f22b71
commit 1c043254c0
2 changed files with 50 additions and 7 deletions

View File

@@ -751,16 +751,11 @@ class phpbb_feed_overall extends phpbb_feed_post_base
return false;
}
// m_approve forums
$fid_m_approve = $this->get_moderator_approve_forums();
$sql_m_approve = (!empty($fid_m_approve)) ? 'OR ' . $db->sql_in_set('forum_id', $fid_m_approve) : '';
// Determine topics with recent activity
$sql = 'SELECT topic_id, topic_last_post_time
FROM ' . TOPICS_TABLE . '
WHERE ' . $db->sql_in_set('forum_id', $forum_ids) . '
AND topic_moved_id = 0
AND ' . phpbb_content_visibility::get_visibility_sql_global('topic') . '
WHERE topic_moved_id = 0
AND ' . phpbb_content_visibility::get_visibility_sql_forums('topic', $forum_ids) . '
ORDER BY topic_last_post_time DESC';
$result = $db->sql_query_limit($sql, $this->num_items);