Update of /cvsroot/phpslash/phpslash-ft/class
In directory usw-pr-cvs1:/tmp/cvs-serv4657/phpslash-ft/class
Modified Files:
Story.class
Log Message:
related links cache uses correct language and skin
Index: Story.class
===================================================================
RCS file: /cvsroot/phpslash/phpslash-ft/class/Story.class,v
retrieving revision 1.23
retrieving revision 1.24
diff -C2 -d -r1.23 -r1.24
*** Story.class 2001/12/07 18:40:27 1.23
--- Story.class 2001/12/07 21:23:25 1.24
***************
*** 241,257 ****
/* story html, and related links html, can be cached inside the db.
This may save a db call or a template parse.
! Set these local variables here and not a site-wide "variable",
! because the idea is to speed up story display, and these variables
! have no meaning elsewhere. saveStory clears the cache.
*/
$cache_ary = unserialize($ary["topic_cache"]);
! $cache_ary[story][expire] = 0; // default to no story cache
! $cache_ary[related][expire] = 3600; // cache related links one hour
! // always set related_expire >= story_expire
$name_mod = $argv_ary["section"] . $argv_ary["topic"] . $argv_ary["author"] . $argv_ary["mode"];
! $story_name = "story" . $name_mod;
$cache_ary[$story_name][expire] = $cache_ary[story][expire];
--- 241,264 ----
/* story html, and related links html, can be cached inside the db.
This may save a db call or a template parse.
! saveStory clears the cache.
*/
+ $related_name = basename($this->psl['languagefile']) . $this->psl['skin'] ."related";
+
$cache_ary = unserialize($ary["topic_cache"]);
! $cache_ary[$story_name][expire] = 0; // default to no story cache
! $cache_ary[$related_name][expire] = 0; // default to no related cache
+ // override from config.php3
+ if( $this->psl['expirestory']) {
+ $cache_ary[story][expire] = $this->psl['expirestory'];
+ }
+ if( $this->psl['expirerelated']) {
+ $cache_ary[$related_name][expire] = $this->psl['expirerelated'];
+ }
+
$name_mod = $argv_ary["section"] . $argv_ary["topic"] . $argv_ary["author"] . $argv_ary["mode"];
! $story_name = basename($this->psl['languagefile']) . $this->psl['skin'] ."story" . $name_mod;
$cache_ary[$story_name][expire] = $cache_ary[story][expire];
***************
*** 284,293 ****
if( $mode == full) {
/* set Related Links here */
! $related = $this->cacheStory($cache_ary, "related");
if( $related == "") {
$related = $this->getRelated($ary);
! if( $cache_ary[related][expire] > 0) {
! $cache_ary[related][cache] = $related;
! $cache_ary[related][update] = time();
}
}
--- 291,300 ----
if( $mode == full) {
/* set Related Links here */
! $related = $this->cacheStory($cache_ary, $related_name);
if( $related == "") {
$related = $this->getRelated($ary);
! if( $cache_ary[$related_name][expire] > 0) {
! $cache_ary[$related_name][cache] = $related;
! $cache_ary[$related_name][update] = time();
}
}
***************
*** 356,360 ****
} elseif( $mode == "full") {
! $related = $this->cacheStory($cache_ary, "related");
$this->template->set_var(array(
TITLE => $ary["title"],
--- 363,367 ----
} elseif( $mode == "full") {
! $related = $this->cacheStory($cache_ary, $related_name);
$this->template->set_var(array(
TITLE => $ary["title"],
|