diff --git a/admin/themes/default/template/configuration_search.tpl b/admin/themes/default/template/configuration_search.tpl index cacc5760f..f5e542241 100644 --- a/admin/themes/default/template/configuration_search.tpl +++ b/admin/themes/default/template/configuration_search.tpl @@ -89,7 +89,13 @@ for(const filter_name of filters_names){ disabled {/if} > - {ucfirst(str_replace('_', ' ', $filter_name))|translate} + {if $filter_name == 'words'} + {'Search for words'|translate} + {else if $filter_name == 'file_size'} + {'Filesize'|translate} + {else} + {ucfirst(str_replace('_', ' ', $filter_name))|translate} + {/if}
$filt_conf){ if(isset($filt_conf['access'])) { diff --git a/include/search_filters.inc.php b/include/search_filters.inc.php index c4ae7f024..adf8c3b65 100644 --- a/include/search_filters.inc.php +++ b/include/search_filters.inc.php @@ -6,7 +6,15 @@ // | file that was distributed with this source code. | // +-----------------------------------------------------------------------+ -$filters_views = unserialize($conf['filters_views']); +if (isset($conf['filters_views'])) +{ + $filters_views = unserialize($conf['filters_views']); +} +else +{ + $filters_views = unserialize('a:14:{s:5:"words";a:2:{s:6:"access";s:9:"everybody";s:7:"default";b:1;}s:4:"tags";a:2:{s:6:"access";s:9:"everybody";s:7:"default";b:0;}s:9:"post_date";a:2:{s:6:"access";s:9:"everybody";s:7:"default";b:0;}s:13:"creation_date";a:2:{s:6:"access";s:9:"everybody";s:7:"default";b:1;}s:5:"album";a:2:{s:6:"access";s:9:"everybody";s:7:"default";b:1;}s:6:"author";a:2:{s:6:"access";s:9:"everybody";s:7:"default";b:0;}s:8:"added_by";a:2:{s:6:"access";s:9:"everybody";s:7:"default";b:0;}s:9:"file_type";a:2:{s:6:"access";s:9:"everybody";s:7:"default";b:0;}s:5:"ratio";a:2:{s:6:"access";s:9:"everybody";s:7:"default";b:0;}s:6:"rating";a:2:{s:6:"access";s:9:"everybody";s:7:"default";b:0;}s:9:"file_size";a:2:{s:6:"access";s:9:"everybody";s:7:"default";b:0;}s:6:"height";a:2:{s:6:"access";s:9:"everybody";s:7:"default";b:0;}s:5:"width";a:2:{s:6:"access";s:9:"everybody";s:7:"default";b:0;}s:17:"last_filters_conf";b:1;}'); +} + $template->assign('display_filter', $filters_views); // we add isset($page['search_details']) in this condition because it only diff --git a/search.php b/search.php index 7792db5ad..c7391b3f7 100644 --- a/search.php +++ b/search.php @@ -30,7 +30,15 @@ $search = array( // list of filters in user preferences // allwords, cat, tags, author, added_by, filetypes, date_posted, date_created, ratios, ratings (if rating is allowed in this Piwigo), height, width //import the conf for the filters -$filters_conf = unserialize($conf['filters_views']); +if (isset($conf['filters_views'])) +{ + $filters_conf = unserialize($conf['filters_views']); +} +else +{ + $filters_conf = unserialize('a:14:{s:5:"words";a:2:{s:6:"access";s:9:"everybody";s:7:"default";b:1;}s:4:"tags";a:2:{s:6:"access";s:9:"everybody";s:7:"default";b:0;}s:9:"post_date";a:2:{s:6:"access";s:9:"everybody";s:7:"default";b:0;}s:13:"creation_date";a:2:{s:6:"access";s:9:"everybody";s:7:"default";b:1;}s:5:"album";a:2:{s:6:"access";s:9:"everybody";s:7:"default";b:1;}s:6:"author";a:2:{s:6:"access";s:9:"everybody";s:7:"default";b:0;}s:8:"added_by";a:2:{s:6:"access";s:9:"everybody";s:7:"default";b:0;}s:9:"file_type";a:2:{s:6:"access";s:9:"everybody";s:7:"default";b:0;}s:5:"ratio";a:2:{s:6:"access";s:9:"everybody";s:7:"default";b:0;}s:6:"rating";a:2:{s:6:"access";s:9:"everybody";s:7:"default";b:0;}s:9:"file_size";a:2:{s:6:"access";s:9:"everybody";s:7:"default";b:0;}s:6:"height";a:2:{s:6:"access";s:9:"everybody";s:7:"default";b:0;}s:5:"width";a:2:{s:6:"access";s:9:"everybody";s:7:"default";b:0;}s:17:"last_filters_conf";b:1;}'); +} + //change the name of the keys so that they can be used with this part of the program $filters_conf = array_combine (