mirror of
https://github.com/Piwigo/Piwigo.git
synced 2026-06-02 04:15:05 +02:00
Feature Issue ID 0000601: Filter all public pages with only recent elements
It's a finalized version. Obsolete code of draft are removed. You can filter categories and images with recent date period on your screen selection. In the future, filter could be easy done on other type data (plugin?) You can flat categories and sub-categories with a recent date period of your choice. Next, perhaps, a panel to choice recent date for the 2 features. On draft, there have problem with MySql 5, be careful! Css problem not resolved: - Menu "Categories" is bad centered - Icon on dark too on the top git-svn-id: http://piwigo.org/svn/trunk@1677 68402e56-0260-453c-a942-63ccdbb3a9ee
This commit is contained in:
+32
-21
@@ -216,13 +216,16 @@ $template->assign_block_vars(
|
||||
|
||||
$query = '
|
||||
SELECT id,name,uppercats,global_rank
|
||||
FROM '.CATEGORIES_TABLE;
|
||||
if ($user['forbidden_categories'] != '')
|
||||
{
|
||||
$query.= '
|
||||
WHERE id NOT IN ('.$user['forbidden_categories'].')';
|
||||
}
|
||||
$query.= '
|
||||
FROM '.CATEGORIES_TABLE.'
|
||||
'.get_sql_condition_FandF
|
||||
(
|
||||
array
|
||||
(
|
||||
'forbidden_categories' => 'id',
|
||||
'visible_categories' => 'id'
|
||||
),
|
||||
'WHERE'
|
||||
).'
|
||||
;';
|
||||
display_select_cat_wrapper($query, array(@$_GET['cat']), $blockname, true);
|
||||
|
||||
@@ -308,13 +311,17 @@ SELECT COUNT(DISTINCT(id))
|
||||
AND '.$page['cat_clause'].'
|
||||
AND '.$page['author_clause'].'
|
||||
AND '.$page['keyword_clause'].'
|
||||
AND '.$page['status_clause'];
|
||||
if ($user['forbidden_categories'] != '')
|
||||
{
|
||||
$query.= '
|
||||
AND category_id NOT IN ('.$user['forbidden_categories'].')';
|
||||
}
|
||||
$query.= '
|
||||
AND '.$page['status_clause'].'
|
||||
'.get_sql_condition_FandF
|
||||
(
|
||||
array
|
||||
(
|
||||
'forbidden_categories' => 'category_id',
|
||||
'visible_categories' => 'category_id',
|
||||
'visible_images' => 'ic.image_id'
|
||||
),
|
||||
'AND'
|
||||
).'
|
||||
;';
|
||||
list($counter) = mysql_fetch_row(pwg_query($query));
|
||||
|
||||
@@ -354,13 +361,17 @@ SELECT com.id AS comment_id
|
||||
AND '.$page['cat_clause'].'
|
||||
AND '.$page['author_clause'].'
|
||||
AND '.$page['keyword_clause'].'
|
||||
AND '.$page['status_clause'];
|
||||
if ($user['forbidden_categories'] != '')
|
||||
{
|
||||
$query.= '
|
||||
AND category_id NOT IN ('.$user['forbidden_categories'].')';
|
||||
}
|
||||
$query.= '
|
||||
AND '.$page['status_clause'].'
|
||||
'.get_sql_condition_FandF
|
||||
(
|
||||
array
|
||||
(
|
||||
'forbidden_categories' => 'category_id',
|
||||
'visible_categories' => 'category_id',
|
||||
'visible_images' => 'ic.image_id'
|
||||
),
|
||||
'AND'
|
||||
).'
|
||||
GROUP BY comment_id
|
||||
ORDER BY '.$page['sort_by'].' '.$page['sort_order'];
|
||||
if ('all' != $page['items_number'])
|
||||
|
||||
Reference in New Issue
Block a user