aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMeik Sievertsen <acydburn@phpbb.com>2009-07-27 09:56:31 +0000
committerMeik Sievertsen <acydburn@phpbb.com>2009-07-27 09:56:31 +0000
commit0cb565dc0c49edb871393cf4ec15fa193ce7fccb (patch)
tree4c79a8f7708c8265ce1ac13fb78511a827a184d3
parent63dc25e5b4596d0f00e4f1dff7fb232141e5227c (diff)
downloadforums-0cb565dc0c49edb871393cf4ec15fa193ce7fccb.tar
forums-0cb565dc0c49edb871393cf4ec15fa193ce7fccb.tar.gz
forums-0cb565dc0c49edb871393cf4ec15fa193ce7fccb.tar.bz2
forums-0cb565dc0c49edb871393cf4ec15fa193ce7fccb.tar.xz
forums-0cb565dc0c49edb871393cf4ec15fa193ce7fccb.zip
do not cache results from registered users...
git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9866 89ea8834-ac86-4346-8a33-228a782c2dd0
-rw-r--r--phpBB/feed.php19
1 files 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 &amp;
if (substr($link, -5) === '&amp;')
{
- $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))