aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/feed.php
diff options
context:
space:
mode:
authorAndreas Fischer <bantu@phpbb.com>2010-01-12 01:18:33 +0000
committerAndreas Fischer <bantu@phpbb.com>2010-01-12 01:18:33 +0000
commit7462724a2488881e50006ce8815bebbd71ff5618 (patch)
tree60013a30bb8366957ed29acc3cc10d533d7f1566 /phpBB/feed.php
parent35dc866cf522c1b95b532fd79af4117ff3699b22 (diff)
downloadforums-7462724a2488881e50006ce8815bebbd71ff5618.tar
forums-7462724a2488881e50006ce8815bebbd71ff5618.tar.gz
forums-7462724a2488881e50006ce8815bebbd71ff5618.tar.bz2
forums-7462724a2488881e50006ce8815bebbd71ff5618.tar.xz
forums-7462724a2488881e50006ce8815bebbd71ff5618.zip
m_approve array can be empty
git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@10404 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/feed.php')
-rw-r--r--phpBB/feed.php8
1 files changed, 6 insertions, 2 deletions
diff --git a/phpBB/feed.php b/phpBB/feed.php
index f21d8dfe63..22778b66fa 100644
--- a/phpBB/feed.php
+++ b/phpBB/feed.php
@@ -742,13 +742,17 @@ class phpbb_feed_overall extends phpbb_feed_post_base
// Add global forum id
$forum_ids[] = 0;
+ // 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 (topic_approved = 1
- OR ' . $db->sql_in_set('forum_id', $this->get_moderator_approve_forums()) . ')
+ ' . $sql_m_approve . ')
ORDER BY topic_last_post_time DESC';
$result = $db->sql_query_limit($sql, $this->num_items);
@@ -784,7 +788,7 @@ class phpbb_feed_overall extends phpbb_feed_post_base
),
'WHERE' => $db->sql_in_set('p.topic_id', $topic_ids) . '
AND (p.post_approved = 1
- OR ' . $db->sql_in_set('p.forum_id', $this->get_moderator_approve_forums()) . ')
+ ' . str_replace('forum_id', 'p.forum_id', $sql_m_approve) . ')
AND p.post_time >= ' . $min_post_time . '
AND u.user_id = p.poster_id',
'ORDER_BY' => 'p.post_time DESC',