aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/feed.php
diff options
context:
space:
mode:
authorAndreas Fischer <bantu@phpbb.com>2010-01-12 00:24:39 +0000
committerAndreas Fischer <bantu@phpbb.com>2010-01-12 00:24:39 +0000
commitaa14d12abb0bb7c441a426d2a8a346c0f4a56686 (patch)
tree311755820c2e7df300bea60fd47aafc1cdf25394 /phpBB/feed.php
parent2be2a2eb63338767948271bf01b1116fe775a7ed (diff)
downloadforums-aa14d12abb0bb7c441a426d2a8a346c0f4a56686.tar
forums-aa14d12abb0bb7c441a426d2a8a346c0f4a56686.tar.gz
forums-aa14d12abb0bb7c441a426d2a8a346c0f4a56686.tar.bz2
forums-aa14d12abb0bb7c441a426d2a8a346c0f4a56686.tar.xz
forums-aa14d12abb0bb7c441a426d2a8a346c0f4a56686.zip
Actually use the new method.
git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@10401 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/feed.php')
-rw-r--r--phpBB/feed.php25
1 files changed, 17 insertions, 8 deletions
diff --git a/phpBB/feed.php b/phpBB/feed.php
index b527d7c20e..b11a0fd386 100644
--- a/phpBB/feed.php
+++ b/phpBB/feed.php
@@ -512,15 +512,27 @@ class phpbb_feed_base
function get_readable_forums()
{
global $auth;
+ static $forum_ids;
+
+ if (!isset($forum_ids))
+ {
+ $forum_ids = array_keys($auth->acl_getf('f_read'));
+ }
- return array_keys($auth->acl_getf('f_read'));
+ return $forum_ids;
}
- function get_m_approve_forums()
+ function get_moderator_approve_forums()
{
global $auth;
+ static $forum_ids;
- return array_keys($auth->acl_getf('m_approve'));
+ if (!isset($forum_ids))
+ {
+ $forum_ids = array_keys($auth->acl_getf('m_approve'));
+ }
+
+ return $forum_ids;
}
function get_excluded_forums()
@@ -730,15 +742,12 @@ class phpbb_feed_overall extends phpbb_feed_post_base
// Add global forum id
$forum_ids[] = 0;
- // Forums with m_approve
- $m_approve_fids = array_keys($auth->acl_getf('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_approved = 1
- OR ' . $db->sql_in_set('forum_id', $m_approve_fids) . ')
+ OR ' . $db->sql_in_set('forum_id', $this->get_moderator_approve_forums()) . ')
ORDER BY topic_last_post_time DESC';
$result = $db->sql_query_limit($sql, $this->num_items);
@@ -773,7 +782,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', $m_approve_fids) . ')
+ OR ' . $db->sql_in_set('p.forum_id', $this->get_moderator_approve_forums()) . ')
AND p.post_time >= ' . $topic_last_post_time . '
AND u.user_id = p.poster_id',
'ORDER_BY' => 'p.post_time DESC',