Feature request #2655585 and bug in template RSS

This commit is contained in:
Leblanc Simon 2009-03-21 18:29:28 +00:00
commit 2d1675dd1d
6 changed files with 21 additions and 17 deletions

View file

@ -22,6 +22,12 @@ class STRIPIT_Cache
*/
var $template;
/**
* template name
* @var string
*/
var $template_name;
/**
* name of strip
* @var string
@ -57,6 +63,7 @@ class STRIPIT_Cache
{
$this->cache_folder = '';
$this->template = '';
$this->template_name = '';
$this->page = '';
$this->strip_folder = '';
$this->stats = array();
@ -69,6 +76,7 @@ class STRIPIT_Cache
*
* @param string $page Name of the strip for HTML or number of strip for RSS
* @param string $template Name of the template file
* @param string $template_name Name of the template
* @param string $strip_folder Name of the strip folder
* @param string $cache_folder Name of the folder where the cache file is save
* @param string $language The language to use
@ -76,15 +84,16 @@ class STRIPIT_Cache
* @access public
* @return bool True if all is OK, false else
*/
function init($page, $template, $strip_folder, $cache_folder, $language, $is_rss = false)
function init($page, $template, $template_name, $strip_folder, $cache_folder, $language, $is_rss = false)
{
$this->template_name = $template_name;
$this->_getName($page, $language, $is_rss);
$this->template = $template;
$this->strip_folder = $strip_folder;
$this->cache_data = '';
if (!empty($cache_folder)) {
$this->cache_folder = $this->template.'/'.$cache_folder;
if (!empty($cache_folder) && file_exists($cache_folder)) {
$this->cache_folder = $cache_folder;
} else {
$this->cache_folder = $this->template.'/cache';
}
@ -300,9 +309,9 @@ class STRIPIT_Cache
function _getName($page, $language, $is_rss)
{
if ($is_rss) {
$this->page = $page.'_'.$language.'_cache_rss.php';
$this->page = $page.'_'.$this->template_name.'_'.$language.'_cache_rss.php';
} else {
$this->page = $page.'_'.$language.'_cache_html.php';
$this->page = $page.'_'.$this->template_name.'_'.$language.'_cache_html.php';
}
}
}

View file

@ -93,11 +93,6 @@ class configuration
*/
var $use_cache = true;
/**
* cache folder (in the template folder)
*/
var $cache_folder = 'cache';
/**
* HTML template folder
*/

View file

@ -109,9 +109,9 @@ class gallery_manager
$template_folder = $this->general->template_folder.'/'.$this->general->template_name;
$strip_folder = $this->strip_manager->strips_path;
$cache_folder = $this->general->cache_folder;
$cache_folder = $this->strip_manager->options['compileDir'];
$language = $this->general->language;
if ($cache->init('gallery-'.$limit.'-'.$page, $template_folder, $strip_folder, $cache_folder, $language)) {
if ($cache->init('gallery-'.$limit.'-'.$page, $template_folder, $this->general->template_name, $strip_folder, $cache_folder, $language)) {
if ($cache->isInCache()) {
// the page is in cache, show cache
$cache->getCache();

View file

@ -110,8 +110,8 @@ class rss_manager
$template_folder = $this->general->template_folder.'/'.$this->general->template_rss;
$strip_folder = $this->strip_manager->strips_path;
$cache_folder = $this->general->cache_folder;
if ($cache->init($limit, $template_folder, $strip_folder, $cache_folder, '', true)) {
$cache_folder = $this->strip_manager->options['compileDir'];
if ($cache->init($limit, $template_folder, $this->general->template_rss, $strip_folder, $cache_folder, '', true)) {
if ($cache->isInCache()) {
// the page is in cache, show cache
$cache->getCache();

View file

@ -326,9 +326,9 @@ class strip_manager
$template_folder = $this->general->template_folder.'/'.$this->general->template_name;
$strip_folder = $this->strips_path;
$cache_folder = $this->general->cache_folder;
$cache_folder = $this->options['compileDir'];
$language = $this->general->language;
if ($cache->init($get_strip, $template_folder, $strip_folder, $cache_folder, $language)) {
if ($cache->init($get_strip, $template_folder, $this->general->template_name, $strip_folder, $cache_folder, $language)) {
if ($cache->isInCache()) {
// the page is in cache, show cache
$cache->getCache();

View file

@ -34,7 +34,7 @@
<description>
&lt;a
title=&quot;{lang.source_rss}&quot;
href=&quot;{general.url}/{strip.nav_base_url}{strip.current_id}<&quot;
href=&quot;{general.url}/{strip.nav_base_url}{strip.current_id}&quot;
&gt;
&lt;img src=&quot;{general.url}/{strip.img_src}&quot; alt=&quot;{general.text}&quot; /&gt;
&lt;/a&gt;