From: Meik S. <acy...@ph...> - 2009-07-27 09:56:59
|
Author: acydburn Date: Mon Jul 27 10:56:31 2009 New Revision: 9866 Log: do not cache results from registered users... Modified: branches/phpBB-3_0_0/phpBB/feed.php Modified: branches/phpBB-3_0_0/phpBB/feed.php ============================================================================== *** branches/phpBB-3_0_0/phpBB/feed.php (original) --- branches/phpBB-3_0_0/phpBB/feed.php Mon Jul 27 10:56:31 2009 *************** *** 10,16 **** * 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 **/ /** --- 10,15 ---- *************** *** 221,227 **** // Now the only thing remaining could be an empty & if (substr($link, -5) === '&') { ! $link = substr($link, 0, -5); } return $link; --- 220,226 ---- // Now the only thing remaining could be an empty & if (substr($link, -5) === '&') { ! $link = substr($link, 0, -5); } return $link; *************** *** 417,423 **** /** * Default setting for last x days */ ! var $sort_days = 100; /** * Default cache time of entries in seconds --- 416,422 ---- /** * Default setting for last x days */ ! var $sort_days = 30; /** * Default cache time of entries in seconds *************** *** 585,591 **** $post_ids = array(); ! // Search for topics in last 7 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... --- 584,590 ---- $post_ids = array(); ! // 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,718 **** --- 712,729 ---- { 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)) |