diff options
-rw-r--r-- | CHANGELOG | 3 | ||||
-rw-r--r-- | phpfspot.class.php | 3 | ||||
-rw-r--r-- | phpfspot_cfg.php.dist | 16 |
3 files changed, 20 insertions, 2 deletions
@@ -6,8 +6,9 @@ phpfspot (1.6) F-Spot does. * feature, date-input appears now as one field instead of seperates for year, month and day. + * feature, make sort-order pre-configurable in phpfspot_cfg.php - -- Andreas Unterkircher <unki@netshadow.at> Sat, 25 May 2008 11:00:00 +0100 + -- Andreas Unterkircher <unki@netshadow.at> Fri, 20 Jun 2008 19:40:00 +0100 phpfspot (1.5) diff --git a/phpfspot.class.php b/phpfspot.class.php index d39356a..d7a76c3 100644 --- a/phpfspot.class.php +++ b/phpfspot.class.php @@ -227,8 +227,9 @@ class PHPFSPOT { if(!isset($_SESSION['tag_condition'])) $_SESSION['tag_condition'] = 'or'; + /* if sort-order has not been set yet, get the one specified in the config */ if(!isset($_SESSION['sort_order'])) - $_SESSION['sort_order'] = 'date_desc'; + $_SESSION['sort_order'] = $this->cfg->sort_order; if(!isset($_SESSION['searchfor_tag'])) $_SESSION['searchfor_tag'] = ''; diff --git a/phpfspot_cfg.php.dist b/phpfspot_cfg.php.dist index a04a422..4eec27c 100644 --- a/phpfspot_cfg.php.dist +++ b/phpfspot_cfg.php.dist @@ -122,6 +122,22 @@ class PHPFSPOT_CFG { /* user friendly URLs */ var $user_friendly_url = false; + /* default sort order - possible values are: + + date_asc => sort by date ascending (17.1, 18.1, 19.1, ...) + date_desc => sort by date descending (19.1, 18.1, 17.1, ...) + name_asc => sort by name ascending (alphabetical) + name_desc => sort by name descending (alphabetical) + tags_asc => sort by tag ascending (alphabetical) + tags_desc => sort by tag descending (alphabetical) + rate_asc => sort by rate value ascending (1, 2, 3, 4, 5) + rate_desc => sort by rate value descending (5, 4, 3, 2, 1) + + Attention: Rate value is available beginning with F-Spot version 0.4.1 + + */ + var $sort_order = "tags_asc"; + public function __construct() { |