aboutsummaryrefslogtreecommitdiffstats
path: root/include/section_init.inc.php
diff options
context:
space:
mode:
authorrub <rub@piwigo.org>2007-01-15 00:09:14 +0000
committerrub <rub@piwigo.org>2007-01-15 00:09:14 +0000
commit9362801a48c6e88fcc9bd56e69ba044f718c6b74 (patch)
tree5c05741cb7262fc51d6c6ad6b6b2bd8c44e0353f /include/section_init.inc.php
parent3cef1e6895ed3daeb398980b22cab1c1edefa3c3 (diff)
There are no filter enabled if filter configuration is empty (no icon, no functions, ...)
New system for the filter page configuration View mode flat_recent_cat becomes flat_cat (recent period is removed because global filter is sufficient) Recent period of global filter must be defined "after" start parameter (default value is $user['recent_period']). git-svn-id: http://piwigo.org/svn/trunk@1722 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to '')
-rw-r--r--include/section_init.inc.php24
1 files changed, 11 insertions, 13 deletions
diff --git a/include/section_init.inc.php b/include/section_init.inc.php
index cb963f3e1..a1535668a 100644
--- a/include/section_init.inc.php
+++ b/include/section_init.inc.php
@@ -278,11 +278,11 @@ while (isset($tokens[$i]))
$page['start'] = $matches[1];
}
- if ('categories'==$page['section'] and
- preg_match('/^flat_recent_cat-(\d+)/', $tokens[$i], $matches))
+ if ('categories' == $page['section'] and
+ 'flat_cat' == $tokens[$i])
{
// indicate a special list of images
- $page['flat_recent_cat'] = $matches[1];
+ $page['flat_cat'] = true;
}
if (preg_match('/^(posted|created)/', $tokens[$i] ))
@@ -364,7 +364,7 @@ if ('categories' == $page['section'])
'title' =>
get_cat_display_name($result['name'], '', false),
'thumbnails_include' =>
- (($result['nb_images'] > 0) or (isset($page['flat_recent_cat'])))
+ (($result['nb_images'] > 0) or (isset($page['flat_cat'])))
? 'include/category_default.inc.php'
: 'include/category_cats.inc.php'
)
@@ -374,12 +374,12 @@ if ('categories' == $page['section'])
{
$page['title'] = $lang['no_category'];
$page['thumbnails_include'] =
- (isset($page['flat_recent_cat']))
+ (isset($page['flat_cat']))
? 'include/category_default.inc.php'
: 'include/category_cats.inc.php';
}
- if (isset($page['flat_recent_cat']))
+ if (isset($page['flat_cat']))
{
$page['title'] = $lang['recent_pics_cat'].' : '.$page['title'] ;
}
@@ -389,7 +389,7 @@ if ('categories' == $page['section'])
(!isset($page['chronology_field'])) and
(
(isset($page['category'])) or
- (isset($page['flat_recent_cat']))
+ (isset($page['flat_cat']))
)
)
{
@@ -398,7 +398,7 @@ if ('categories' == $page['section'])
$conf[ 'order_by' ] = ' ORDER BY '.$result['image_order'];
}
- if (isset($page['flat_recent_cat']))
+ if (isset($page['flat_cat']))
{
// flat recent categories mode
$query = '
@@ -408,10 +408,8 @@ FROM '.IMAGES_TABLE.' AS i
INNER JOIN '.IMAGE_CATEGORY_TABLE.' AS ic ON i.id = ic.image_id
INNER JOIN '.CATEGORIES_TABLE.' AS c ON ic.category_id = c.id
WHERE
- date_available > SUBDATE(
- CURRENT_DATE,INTERVAL '.$page['flat_recent_cat'].' DAY)'.
- (isset($page['category']) ? '
- AND uppercats REGEXP \'(^|,)'.$page['category'].'(,|$)\'' : '' ).'
+ '.(isset($page['category']) ? '
+ uppercats REGEXP \'(^|,)'.$page['category'].'(,|$)\'' : '1=1' ).'
'.$forbidden.'
;';
@@ -712,7 +710,7 @@ SELECT id,file
// add meta robots noindex, nofollow to avoid unnecesary robot crawls
$page['meta_robots']=array();
-if ( isset($page['chronology_field']) or isset($page['flat_recent_cat'])
+if ( isset($page['chronology_field']) or isset($page['flat_cat'])
or 'list'==$page['section'] or 'recent_pics'==$page['section'] )
{
$page['meta_robots']=array('noindex'=>1, 'nofollow'=>1);