diff options
author | nikrou <nikrou@piwigo.org> | 2009-11-29 14:06:16 +0000 |
---|---|---|
committer | nikrou <nikrou@piwigo.org> | 2009-11-29 14:06:16 +0000 |
commit | ad796f152f38a37c3c9be438ee9a79ba7b307ebd (patch) | |
tree | 4862e6895ff5bee4f38914d942cda31ffa66b7c1 /include/functions.inc.php | |
parent | c96097529e49943eddba78d70e23e38c0eac494d (diff) |
Feature_1255:
- bug fix : function pwg_db_get_recent_period_expression
- add extra fields for select based on "order by"
git-svn-id: http://piwigo.org/svn/trunk@4387 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to 'include/functions.inc.php')
-rw-r--r-- | include/functions.inc.php | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/include/functions.inc.php b/include/functions.inc.php index cbf47b50d..8a7c7285c 100644 --- a/include/functions.inc.php +++ b/include/functions.inc.php @@ -32,6 +32,18 @@ include_once( PHPWG_ROOT_PATH .'include/functions_url.inc.php' ); include_once( PHPWG_ROOT_PATH .'include/functions_plugins.inc.php' ); //----------------------------------------------------------- generic functions +function get_extra_fiels($order_by_fields) +{ + $fields = str_ireplace(array(' order by ', ' desc', ' asc'), + array('', '', ''), + $order_by_fields + ); + if (!empty($fields)) + { + $fields = ','.$fields; + } + return $fields; +} // The function get_moment returns a float value coresponding to the number // of seconds since the unix epoch (1st January 1970) and the microseconds |