diff options
author | mistic100 <mistic@piwigo.org> | 2011-07-01 13:19:35 +0000 |
---|---|---|
committer | mistic100 <mistic@piwigo.org> | 2011-07-01 13:19:35 +0000 |
commit | 9c0cfb008446eaa0f3fc3cffc71e5bebe5d02710 (patch) | |
tree | 51ca4ce3db4a304b134eaaafc4471564d20b8a0d /include | |
parent | c97377ea8700519ef7cbad77269ec533ddcad287 (diff) |
feature:2317 move order config to Admin->Config->Options
new GUI interface for simple paterns
in GUI, order_by and order_by_inside_category are merged (not un DB)
users can define special paterns with $conf['order_by_custom'] and $conf['order_by_inside_category_custom']
git-svn-id: http://piwigo.org/svn/trunk@11587 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to '')
-rw-r--r-- | include/common.inc.php | 21 | ||||
-rw-r--r-- | include/config_default.inc.php | 28 |
2 files changed, 25 insertions, 24 deletions
diff --git a/include/common.inc.php b/include/common.inc.php index 6081220e6..f28a27eb6 100644 --- a/include/common.inc.php +++ b/include/common.inc.php @@ -106,6 +106,17 @@ if (isset($conf['local_dir_site'])) { @include(PHPWG_ROOT_PATH.PWG_LOCAL_DIR. 'config/config.inc.php'); } + +// that's for migration from 2.2, will be deprecated in 2.4 +if (isset($conf['order_by'])) +{ + $conf['order_by_custom'] = $conf['order_by']; +} +if (isset($conf['order_by_inside_category'])) +{ + $conf['order_by_inside_category_custom'] = $conf['order_by_inside_category']; +} + include(PHPWG_ROOT_PATH .'include/dblayer/functions_'.$conf['dblayer'].'.inc.php'); if(isset($conf['show_php_errors']) && !empty($conf['show_php_errors'])) @@ -143,6 +154,16 @@ if (!$conf['check_upgrade_feed']) load_plugins(); +// users can have defined a custom order pattern, incompatible with GUI form +if (isset($conf['order_by_custom'])) +{ + $conf['order_by'] = $conf['order_by_custom']; +} +if (isset($conf['order_by_inside_category_custom'])) +{ + $conf['order_by_inside_category'] = $conf['order_by_inside_category_custom']; +} + include(PHPWG_ROOT_PATH.'include/user.inc.php'); if (in_array( substr($user['language'],0,2), array('fr','it','de','es','pl','hu','ru','nl') ) ) diff --git a/include/config_default.inc.php b/include/config_default.inc.php index 5ee7c4406..f6f02be99 100644 --- a/include/config_default.inc.php +++ b/include/config_default.inc.php @@ -43,35 +43,15 @@ // | misc | // +-----------------------------------------------------------------------+ -// order_by : how to change the order of display for images in a category ? +// order_by_custom and order_by_inside_category_custom : for non common pattern +// you can define special ORDER configuration // -// There are several fields that can order the display : -// -// - date_available : the date of the adding to the gallery -// - file : the name of the file -// - id : element identifier -// - date_creation : date of element creation -// -// Once you've chosen which field(s) to use for ordering, you must chose the -// ascending or descending order for each field. examples : -// -// 1. $conf['order_by'] = " order by date_available desc, file asc"; -// will order pictures by date_available descending & by filename ascending -// -// 2. $conf['order_by'] = " order by file asc"; -// will only order pictures by file ascending without taking into account -// the date_available -$conf['order_by'] = ' ORDER BY date_available DESC, file ASC, id ASC'; +// $conf['order_by_custom'] = ' ORDER BY date_available DESC, file ASC, id ASC'; // order_by_inside_category : inside a category, images can also be ordered // by rank. A manually defined rank on each image for the category. // -// In addition to fields of #images table, you can use the -// #image_category.rank column -// -// $conf['order_by_inside_category'] = ' ORDER BY rank'; -// will sort images by the manually defined rank of images in this album. -$conf['order_by_inside_category'] = $conf['order_by']; +// $conf['order_by_inside_category_custom'] = $conf['order_by_custom']; // file_ext : file extensions (case sensitive) authorized $conf['file_ext'] = array('jpg','JPG','jpeg','JPEG', |