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
This commit is contained in:
rub
2007-01-15 00:09:14 +00:00
parent 3cef1e6895
commit 9362801a48
15 changed files with 148 additions and 64 deletions
+11 -13
View File
@@ -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);