mirror of
https://github.com/Piwigo/Piwigo.git
synced 2026-03-28 17:42:57 +01:00
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
65 lines
1.6 KiB
PHP
65 lines
1.6 KiB
PHP
<?php
|
|
|
|
$where =
|
|
get_sql_condition_FandF
|
|
(
|
|
array
|
|
(
|
|
'forbidden_categories' => 'ic.category_id',
|
|
'visible_categories' => 'ic.category_id',
|
|
'visible_images' => 'i.id'
|
|
),
|
|
''
|
|
);
|
|
$list = implode(',', $final);
|
|
if ( $where !== '' and $list !== '' )
|
|
{
|
|
$where .= ' AND ';
|
|
}
|
|
$where .= ( $list == '') ? '' :
|
|
'i.`id` IN ('. $list .')';
|
|
$query='
|
|
SELECT DISTINCT (i.`id`),
|
|
i.`path` , i.`file` , i.`date_available` ,
|
|
i.`date_creation`, i.`tn_ext` , i.`name` ,
|
|
i.`filesize` , i.`storage_category_id` , i.`average_rate`,
|
|
i.`comment` , i.`author` , i.`hit` ,i.`width` ,
|
|
i.`height`
|
|
FROM `'.IMAGES_TABLE.'` AS i
|
|
INNER JOIN `'.IMAGE_CATEGORY_TABLE.'`
|
|
AS ic ON i.`id` = ic.`image_id`
|
|
WHERE '. $where .'
|
|
';
|
|
/* recent = Date_available desc order */
|
|
$query .= ' ORDER BY i.`date_available` DESC, RAND() DESC ';
|
|
$query .= ' LIMIT 0 , '. $limit .';';
|
|
// echo $query . '<br />';
|
|
$result = pwg_query( $query );
|
|
|
|
$template->assign_vars(
|
|
array(
|
|
'TITLE' => 'recent',
|
|
)
|
|
);
|
|
$template->assign_block_vars(
|
|
'row', array()
|
|
);
|
|
$template->assign_block_vars(
|
|
'row.Normal',
|
|
array(
|
|
'WIDTH'=> 682,
|
|
'HEIGH'=> 682,
|
|
'URL'=> 'http://www.monsite.com/pwg/galleries/shared/cat/image.jpg',
|
|
)
|
|
);
|
|
$template->assign_block_vars(
|
|
'row',
|
|
array(
|
|
'ID'=> 22,
|
|
'CAPTION'=> 'L\'image que je veux',
|
|
'DATE'=> '18/12/2006',
|
|
'COMMENT'=> 'Voila voili voilou ! Voila voili voilou !',
|
|
)
|
|
);
|
|
?>
|