Update of /cvsroot/phpwebsite-comm/modules/article/inc
In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv23134/inc
Modified Files:
runtime_categorized.php runtime_chronological.php
Log Message:
Fixed caching of homepage summary display for visitors
Index: runtime_chronological.php
===================================================================
RCS file: /cvsroot/phpwebsite-comm/modules/article/inc/runtime_chronological.php,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -d -r1.13 -r1.14
*** runtime_chronological.php 21 Aug 2008 20:17:19 -0000 1.13
--- runtime_chronological.php 18 Nov 2008 05:08:55 -0000 1.14
***************
*** 1,5 ****
<?php
/**
! * This is the code to display articles on the homepage grouped by categories.
*
* @version $Id$
--- 1,5 ----
<?php
/**
! * This is the code to display articles on the homepage in chronological order.
*
* @version $Id$
***************
*** 11,15 ****
$cachekey = 'ChronologicalArticleHeadlines';
! $s = PHPWS_Cache::get($cachekey);
if (empty($s)) {
/* Load records to display */
--- 11,16 ----
$cachekey = 'ChronologicalArticleHeadlines';
! if (!Current_User::isLogged())
! $s = PHPWS_Cache::get($cachekey);
if (empty($s)) {
/* Load records to display */
***************
*** 61,70 ****
$GLOBALS['AMcategoryIdx'] = $idx;
}
! /* Cache this so we don't have to do it for awhile */
! $s = serialize(array('result' => $result, 'AMcategoryIdx' => $idx));
! $lifetime = 86400; // number of seconds until cache refresh
! // default is set in CACHE_LIFETIME in the
! // config/core/config.php file
! PHPWS_Cache::save($cachekey, $s, $lifetime);
}
else {
--- 62,73 ----
$GLOBALS['AMcategoryIdx'] = $idx;
}
! /* Cache this for unlogged users so we don't have to do it for awhile */
! if (!Current_User::isLogged()) {
! $s = serialize(array('result' => $result, 'AMcategoryIdx' => $idx));
! $lifetime = 86400; // number of seconds until cache refresh
! // default is set in CACHE_LIFETIME in the
! // config/core/config.php file
! PHPWS_Cache::save($cachekey, $s, $lifetime);
! }
}
else {
Index: runtime_categorized.php
===================================================================
RCS file: /cvsroot/phpwebsite-comm/modules/article/inc/runtime_categorized.php,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** runtime_categorized.php 21 Aug 2008 20:17:19 -0000 1.10
--- runtime_categorized.php 18 Nov 2008 05:08:55 -0000 1.11
***************
*** 1,5 ****
<?php
/**
! * This is the code to display articles on the homepage in chronological order.
*
* @version $Id$
--- 1,5 ----
<?php
/**
! * This is the code to display articles on the homepage grouped by categories.
*
* @version $Id$
***************
*** 9,13 ****
*/
$cachekey = 'CategorizedArticleHeadlines';
! $s = PHPWS_Cache::get($cachekey);
if (empty($s)) {
$category_index = Categories::getCategories('list');
--- 9,14 ----
*/
$cachekey = 'CategorizedArticleHeadlines';
! if (!Current_User::isLogged())
! $s = PHPWS_Cache::get($cachekey);
if (empty($s)) {
$category_index = Categories::getCategories('list');
***************
*** 45,54 ****
$cat_arr[] = $a;
}
! /* Cache this so we don't have to do it for awhile */
! $s = serialize(array('content' => $content, 'cat_arr' => $cat_arr));
! $lifetime = 86400; // number of seconds until cache refresh
! // default is set in CACHE_LIFETIME in the
! // config/core/config.php file
! PHPWS_Cache::save($cachekey, $s, $lifetime);
}
else {
--- 46,57 ----
$cat_arr[] = $a;
}
! /* Cache this for unlogged users so we don't have to do it for awhile */
! if (!Current_User::isLogged()) {
! $s = serialize(array('content' => $content, 'cat_arr' => $cat_arr));
! $lifetime = 86400; // number of seconds until cache refresh
! // default is set in CACHE_LIFETIME in the
! // config/core/config.php file
! PHPWS_Cache::save($cachekey, $s, $lifetime);
! }
}
else {
|