aboutsummaryrefslogtreecommitdiffstats
path: root/include/functions_url.inc.php
diff options
context:
space:
mode:
authorrvelices <rv-github@modusoptimus.com>2007-02-28 03:07:12 +0000
committerrvelices <rv-github@modusoptimus.com>2007-02-28 03:07:12 +0000
commitea56d7b2ac1d41ea19b5fb45843c839e30a0b37b (patch)
tree5f55c108b1a808867d44db2b6ebcf0ad573874b6 /include/functions_url.inc.php
parent30e259904cc38172b2b730455009455675f0d8f5 (diff)
feature 657: permalinks for categories
git-svn-id: http://piwigo.org/svn/trunk@1866 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to 'include/functions_url.inc.php')
-rw-r--r--include/functions_url.inc.php18
1 files changed, 15 insertions, 3 deletions
diff --git a/include/functions_url.inc.php b/include/functions_url.inc.php
index b96ed82b7..04e0b32d1 100644
--- a/include/functions_url.inc.php
+++ b/include/functions_url.inc.php
@@ -336,10 +336,22 @@ function make_section_in_url($params)
'make_section_in_url category name not set', E_USER_WARNING
);
- $section_string.= '/category/'.$params['category']['id'];
- if ( $conf['category_url_style']=='id-name' )
+ array_key_exists('permalink', $params['category']) or trigger_error(
+ 'make_section_in_url category permalink not set', E_USER_WARNING
+ );
+
+ $section_string.= '/category/';
+ if ( empty($params['category']['permalink']) )
+ {
+ $section_string.= $params['category']['id'];
+ if ( $conf['category_url_style']=='id-name' )
+ {
+ $section_string.= '-'.str2url($params['category']['name']);
+ }
+ }
+ else
{
- $section_string.= '-'.str2url($params['category']['name']);
+ $section_string.= $params['category']['permalink'];
}
}