Index: /extensions/SmartAlbums/admin.php =================================================================== --- /extensions/SmartAlbums/admin.php (revision 11379) +++ /extensions/SmartAlbums/admin.php (revision 11380) @@ -12,5 +12,4 @@ $conf['SmartAlbums'] = array( 'update_on_upload' => $_POST['update_on_upload'], - 'update_on_login' => $_POST['update_on_login'], ); @@ -22,5 +21,4 @@ 'SMART_PATH' => SMART_PATH, 'update_on_upload' => $conf['SmartAlbums']['update_on_upload'], - 'update_on_login' => $conf['SmartAlbums']['update_on_login'], )); Index: /extensions/SmartAlbums/include/functions.inc.php =================================================================== --- /extensions/SmartAlbums/include/functions.inc.php (revision 11379) +++ /extensions/SmartAlbums/include/functions.inc.php (revision 11380) @@ -42,8 +42,7 @@ /* * Make associations for all SmartAlbums - * Called with invalidate_user_cache and/or on admin login - * @param string login (not mandatory) - */ -function smart_make_all_associations($login = false) + * Called with invalidate_user_cache + */ +function smart_make_all_associations() { global $conf; @@ -51,10 +50,5 @@ if (!is_array($conf['SmartAlbums'])) $conf['SmartAlbums'] = unserialize($conf['SmartAlbums']); - if ( !$login AND !defined('SMART_NOT_UPDATE') AND $conf['SmartAlbums']['update_on_upload'] != 'false' ) - continue; - else if ( is_string($login) AND is_admin() AND $conf['SmartAlbums']['update_on_login'] != 'false' ) - continue; - else - return; + if ( defined('SMART_NOT_UPDATE') OR $conf['SmartAlbums']['update_on_upload'] == 'false' ) return; /* get categories with smart filters */ @@ -69,10 +63,4 @@ $smart_cats = array_from_query($query, 'id'); array_map('smart_make_associations', $smart_cats); - - if (is_string($login)) - { - define('SMART_NOT_UPDATE', 1); - invalidate_user_cache(); - } } @@ -178,7 +166,25 @@ else if ($filter['type'] == 'date') { - if ($filter['cond'] == 'the') $where[] = 'date_available BETWEEN "'.$filter['value'].' 00:00:00" AND "'.$filter['value'].' 23:59:59"'; - else if ($filter['cond'] == 'before') $where[] = 'date_available < "'.$filter['value'].' 00:00:00"'; - else if ($filter['cond'] == 'after') $where[] = 'date_available > "'.$filter['value'].' 23:59:59"'; + switch ($filter['cond']) + { + case 'the': + $where[] = 'date_available BETWEEN "'.$filter['value'].' 00:00:00" AND "'.$filter['value'].' 23:59:59"'; + break; + case 'before': + $where[] = 'date_available < "'.$filter['value'].' 00:00:00"'; + break; + case 'after': + $where[] = 'date_available > "'.$filter['value'].' 23:59:59"'; + break; + case 'the_crea': + $where[] = 'date_creation BETWEEN "'.$filter['value'].' 00:00:00" AND "'.$filter['value'].' 23:59:59"'; + break; + case 'before_crea': + $where[] = 'date_creation < "'.$filter['value'].' 00:00:00"'; + break; + case 'after_crea': + $where[] = 'date_creation > "'.$filter['value'].' 23:59:59"'; + break; + } } // limit Index: /extensions/SmartAlbums/include/index.php =================================================================== --- /extensions/SmartAlbums/include/index.php (revision 11380) +++ /extensions/SmartAlbums/include/index.php (revision 11380) @@ -0,0 +1,30 @@ + Index: /extensions/SmartAlbums/include/init_cat_modify.php =================================================================== --- /extensions/SmartAlbums/include/init_cat_modify.php (revision 11379) +++ /extensions/SmartAlbums/include/init_cat_modify.php (revision 11380) @@ -79,7 +79,10 @@ ), 'date' => array( - 'the' => l10n('Added the'), - 'before' => l10n('Added before the'), - 'after' => l10n('Added after the'), + 'the' => l10n('Added on'), + 'before' => l10n('Added before'), + 'after' => l10n('Added after'), + 'the_crea' => l10n('Created on'), + 'before_crea' => l10n('Created before'), + 'after_crea' => l10n('Created after'), ), 'limit' => array('limit' => 'limit'), // second filter not used Index: /extensions/SmartAlbums/index.php =================================================================== --- /extensions/SmartAlbums/index.php (revision 11380) +++ /extensions/SmartAlbums/index.php (revision 11380) @@ -0,0 +1,30 @@ + Index: /extensions/SmartAlbums/language/en_UK/plugin.lang.php =================================================================== --- /extensions/SmartAlbums/language/en_UK/plugin.lang.php (revision 11379) +++ /extensions/SmartAlbums/language/en_UK/plugin.lang.php (revision 11380) @@ -11,7 +11,10 @@ $lang['None of these tags'] = 'None of these tags'; $lang['Only these tags'] = 'Only these tags'; -$lang['Added the'] = 'Added the'; -$lang['Added before the'] = 'Added before the'; -$lang['Added after the'] = 'Added after the'; +$lang['Added on'] = 'Added on'; +$lang['Added before'] = 'Added before'; +$lang['Added after'] = 'Added after'; +$lang['Created on'] = 'Created on'; +$lang['Created before'] = 'Created before'; +$lang['Created after'] = 'Created after'; $lang['%d photo'] = '%d photo'; $lang['%d photos'] = '%d photos'; @@ -24,5 +27,4 @@ $lang['Regenerate photos list of all SmartAlbums'] = 'Regenerate photos list of all SmartAlbums'; $lang['Update albums on file upload'] = 'Update albums on file upload'; -$lang['Update albums when an admin logins'] = 'Update albums when an admin logins'; ?> Index: /extensions/SmartAlbums/language/fr_FR/plugin.lang.php =================================================================== --- /extensions/SmartAlbums/language/fr_FR/plugin.lang.php (revision 11379) +++ /extensions/SmartAlbums/language/fr_FR/plugin.lang.php (revision 11380) @@ -11,7 +11,10 @@ $lang['None of these tags'] = 'Aucun des tags'; $lang['Only these tags'] = 'Seulement les tags'; -$lang['Added the'] = 'Ajouté le'; -$lang['Added before the'] = 'Ajouté avant le'; -$lang['Added after the'] = 'Ajouté après le'; +$lang['Added on'] = 'Ajouté le'; +$lang['Added before'] = 'Ajouté avant le'; +$lang['Added after'] = 'Ajouté après le'; +$lang['Created on'] = 'Créé le'; +$lang['Created before'] = 'Créé avant le'; +$lang['Created after'] = 'Créé après le'; $lang['%d photo'] = '%d photo'; $lang['%d photos'] = '%d photos'; @@ -24,5 +27,4 @@ $lang['Regenerate photos list of all SmartAlbums'] = 'Régénérer les photos de tous les SmartAlbums'; $lang['Update albums on file upload'] = 'Mettre à jour les albums après la mise en ligne d\'un fichier'; -$lang['Update albums when an admin logins'] = 'Mettre à jour les albums quand un admin se connecte'; ?> Index: /extensions/SmartAlbums/main.inc.php =================================================================== --- /extensions/SmartAlbums/main.inc.php (revision 11379) +++ /extensions/SmartAlbums/main.inc.php (revision 11380) @@ -17,5 +17,4 @@ add_event_handler('invalidate_user_cache', 'smart_make_all_associations'); -add_event_handler('login_success', 'smart_make_all_associations'); include_once(SMART_PATH.'include/functions.inc.php'); Index: /extensions/SmartAlbums/maintain.inc.php =================================================================== --- /extensions/SmartAlbums/maintain.inc.php (revision 11379) +++ /extensions/SmartAlbums/maintain.inc.php (revision 11380) @@ -26,5 +26,4 @@ \''.serialize(array( 'update_on_upload' => false, - 'update_on_login' => false, ) ).'\', @@ -47,5 +46,4 @@ \''.serialize(array( 'update_on_upload' => false, - 'update_on_login' => false, ) ).'\', Index: /extensions/SmartAlbums/template/admin.tpl =================================================================== --- /extensions/SmartAlbums/template/admin.tpl (revision 11379) +++ /extensions/SmartAlbums/template/admin.tpl (revision 11380) @@ -12,9 +12,4 @@ -