diff options
author | Andreas Fischer <bantu@phpbb.com> | 2009-12-11 14:46:06 +0000 |
---|---|---|
committer | Andreas Fischer <bantu@phpbb.com> | 2009-12-11 14:46:06 +0000 |
commit | c207c530b770385f1b8f5003d38ebe87e95f1dba (patch) | |
tree | 9202e46f5efc1c87c72d4ee6be2fd2b5efc303e8 /phpBB/feed.php | |
parent | Add another layer of abstraction. (diff) | |
download | phpbb-c207c530b770385f1b8f5003d38ebe87e95f1dba.tar.gz phpbb-c207c530b770385f1b8f5003d38ebe87e95f1dba.tar.bz2 phpbb-c207c530b770385f1b8f5003d38ebe87e95f1dba.zip |
Bring back caching.
git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@10316 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/feed.php')
-rw-r--r-- | phpBB/feed.php | 39 |
1 files changed, 21 insertions, 18 deletions
diff --git a/phpBB/feed.php b/phpBB/feed.php index 83875f5843..e644afe642 100644 --- a/phpBB/feed.php +++ b/phpBB/feed.php @@ -443,7 +443,7 @@ class phpbb_feed_base /** * Default cache time of entries in seconds */ - var $cache_time = 0; + var $cache_time = 90; /** * Separator for title elements to separate items (for example forum / topic) @@ -460,6 +460,14 @@ class phpbb_feed_base */ function phpbb_feed_base() { + global $user; + + // Disable cache if it is not a guest or a bot but a registered user + if ($this->cache_time && !empty($user) && $user->data['is_registered']) + { + $this->cache_time = 0; + } + $this->set_keys(); } @@ -562,18 +570,6 @@ class phpbb_feed_base { global $db, $cache; - // Disable cache if it is not a guest or a bot but a registered user - if ($this->cache_time) - { - global $user; - - // We check this here because we call get_item() quite often - if (!empty($user) && $user->data['is_registered']) - { - $this->cache_time = 0; - } - } - if (!$this->cache_time) { if (empty($this->result)) @@ -699,11 +695,6 @@ class phpbb_feed extends phpbb_feed_base { trigger_error('NO_TOPIC'); } - - if (!$auth->acl_get('f_read', $this->forum_id)) - { - trigger_error('SORRY_AUTH_READ'); - } } else if ($this->forum_id) { @@ -719,11 +710,18 @@ class phpbb_feed extends phpbb_feed_base { trigger_error('NO_FORUM'); } + } + // Topic/Forum feed + if ($this->topic_id || $this->forum_id) + { if (!$auth->acl_get('f_read', $this->forum_id)) { trigger_error('SORRY_AUTH_READ'); } + + // Disable caching + $this->cache_time = 0; } } @@ -933,6 +931,11 @@ class phpbb_feed_forums extends phpbb_feed_base class phpbb_feed_news extends phpbb_feed_base { + /** + * Longer cache time for the news feed + */ + var $cache_time = 180; + function set_keys() { global $config; |