From 0cb565dc0c49edb871393cf4ec15fa193ce7fccb Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Mon, 27 Jul 2009 09:56:31 +0000 Subject: [PATCH] do not cache results from registered users... git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9866 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/feed.php | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/phpBB/feed.php b/phpBB/feed.php index 33549bcc56..ffce19746d 100644 --- a/phpBB/feed.php +++ b/phpBB/feed.php @@ -10,7 +10,6 @@ * MOD Author Profile: http://www.phpbb.com/community/memberlist.php?mode=viewprofile&u=345763 * MOD Author Homepage: http://www.mssti.com/phpbb3/ * -* @note remove cache if Authentication gets added **/ /** @@ -221,7 +220,7 @@ function feed_append_sid($url, $params) // Now the only thing remaining could be an empty & if (substr($link, -5) === '&') { - $link = substr($link, 0, -5); + $link = substr($link, 0, -5); } return $link; @@ -417,7 +416,7 @@ class phpbb_feed /** * Default setting for last x days */ - var $sort_days = 100; + var $sort_days = 30; /** * Default cache time of entries in seconds @@ -585,7 +584,7 @@ class phpbb_feed $post_ids = array(); - // Search for topics in last 7 days + // Search for topics in last X days $last_post_time_sql = ($this->sort_days) ? ' AND t.topic_last_post_time > ' . (time() - ($this->sort_days * 24 * 3600)) : ''; // Fetch latest post, grouped by topic... @@ -713,6 +712,18 @@ class phpbb_feed { 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))