Feature request #2655585 and bug in template RSS
This commit is contained in:
parent
7bf047bc9c
commit
2d1675dd1d
6 changed files with 21 additions and 17 deletions
|
|
@ -22,6 +22,12 @@ class STRIPIT_Cache
|
||||||
*/
|
*/
|
||||||
var $template;
|
var $template;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* template name
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
|
var $template_name;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* name of strip
|
* name of strip
|
||||||
* @var string
|
* @var string
|
||||||
|
|
@ -57,6 +63,7 @@ class STRIPIT_Cache
|
||||||
{
|
{
|
||||||
$this->cache_folder = '';
|
$this->cache_folder = '';
|
||||||
$this->template = '';
|
$this->template = '';
|
||||||
|
$this->template_name = '';
|
||||||
$this->page = '';
|
$this->page = '';
|
||||||
$this->strip_folder = '';
|
$this->strip_folder = '';
|
||||||
$this->stats = array();
|
$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 $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 of the template file
|
||||||
|
* @param string $template_name Name of the template
|
||||||
* @param string $strip_folder Name of the strip folder
|
* @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 $cache_folder Name of the folder where the cache file is save
|
||||||
* @param string $language The language to use
|
* @param string $language The language to use
|
||||||
|
|
@ -76,15 +84,16 @@ class STRIPIT_Cache
|
||||||
* @access public
|
* @access public
|
||||||
* @return bool True if all is OK, false else
|
* @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->_getName($page, $language, $is_rss);
|
||||||
$this->template = $template;
|
$this->template = $template;
|
||||||
$this->strip_folder = $strip_folder;
|
$this->strip_folder = $strip_folder;
|
||||||
$this->cache_data = '';
|
$this->cache_data = '';
|
||||||
|
|
||||||
if (!empty($cache_folder)) {
|
if (!empty($cache_folder) && file_exists($cache_folder)) {
|
||||||
$this->cache_folder = $this->template.'/'.$cache_folder;
|
$this->cache_folder = $cache_folder;
|
||||||
} else {
|
} else {
|
||||||
$this->cache_folder = $this->template.'/cache';
|
$this->cache_folder = $this->template.'/cache';
|
||||||
}
|
}
|
||||||
|
|
@ -300,9 +309,9 @@ class STRIPIT_Cache
|
||||||
function _getName($page, $language, $is_rss)
|
function _getName($page, $language, $is_rss)
|
||||||
{
|
{
|
||||||
if ($is_rss) {
|
if ($is_rss) {
|
||||||
$this->page = $page.'_'.$language.'_cache_rss.php';
|
$this->page = $page.'_'.$this->template_name.'_'.$language.'_cache_rss.php';
|
||||||
} else {
|
} else {
|
||||||
$this->page = $page.'_'.$language.'_cache_html.php';
|
$this->page = $page.'_'.$this->template_name.'_'.$language.'_cache_html.php';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -93,11 +93,6 @@ class configuration
|
||||||
*/
|
*/
|
||||||
var $use_cache = true;
|
var $use_cache = true;
|
||||||
|
|
||||||
/**
|
|
||||||
* cache folder (in the template folder)
|
|
||||||
*/
|
|
||||||
var $cache_folder = 'cache';
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* HTML template folder
|
* HTML template folder
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -109,9 +109,9 @@ class gallery_manager
|
||||||
|
|
||||||
$template_folder = $this->general->template_folder.'/'.$this->general->template_name;
|
$template_folder = $this->general->template_folder.'/'.$this->general->template_name;
|
||||||
$strip_folder = $this->strip_manager->strips_path;
|
$strip_folder = $this->strip_manager->strips_path;
|
||||||
$cache_folder = $this->general->cache_folder;
|
$cache_folder = $this->strip_manager->options['compileDir'];
|
||||||
$language = $this->general->language;
|
$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()) {
|
if ($cache->isInCache()) {
|
||||||
// the page is in cache, show cache
|
// the page is in cache, show cache
|
||||||
$cache->getCache();
|
$cache->getCache();
|
||||||
|
|
|
||||||
4
rss.php
4
rss.php
|
|
@ -110,8 +110,8 @@ class rss_manager
|
||||||
|
|
||||||
$template_folder = $this->general->template_folder.'/'.$this->general->template_rss;
|
$template_folder = $this->general->template_folder.'/'.$this->general->template_rss;
|
||||||
$strip_folder = $this->strip_manager->strips_path;
|
$strip_folder = $this->strip_manager->strips_path;
|
||||||
$cache_folder = $this->general->cache_folder;
|
$cache_folder = $this->strip_manager->options['compileDir'];
|
||||||
if ($cache->init($limit, $template_folder, $strip_folder, $cache_folder, '', true)) {
|
if ($cache->init($limit, $template_folder, $this->general->template_rss, $strip_folder, $cache_folder, '', true)) {
|
||||||
if ($cache->isInCache()) {
|
if ($cache->isInCache()) {
|
||||||
// the page is in cache, show cache
|
// the page is in cache, show cache
|
||||||
$cache->getCache();
|
$cache->getCache();
|
||||||
|
|
|
||||||
|
|
@ -326,9 +326,9 @@ class strip_manager
|
||||||
|
|
||||||
$template_folder = $this->general->template_folder.'/'.$this->general->template_name;
|
$template_folder = $this->general->template_folder.'/'.$this->general->template_name;
|
||||||
$strip_folder = $this->strips_path;
|
$strip_folder = $this->strips_path;
|
||||||
$cache_folder = $this->general->cache_folder;
|
$cache_folder = $this->options['compileDir'];
|
||||||
$language = $this->general->language;
|
$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()) {
|
if ($cache->isInCache()) {
|
||||||
// the page is in cache, show cache
|
// the page is in cache, show cache
|
||||||
$cache->getCache();
|
$cache->getCache();
|
||||||
|
|
|
||||||
|
|
@ -34,7 +34,7 @@
|
||||||
<description>
|
<description>
|
||||||
<a
|
<a
|
||||||
title="{lang.source_rss}"
|
title="{lang.source_rss}"
|
||||||
href="{general.url}/{strip.nav_base_url}{strip.current_id}<"
|
href="{general.url}/{strip.nav_base_url}{strip.current_id}"
|
||||||
>
|
>
|
||||||
<img src="{general.url}/{strip.img_src}" alt="{general.text}" />
|
<img src="{general.url}/{strip.img_src}" alt="{general.text}" />
|
||||||
</a>
|
</a>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue