diff options
author | rvelices <rv-github@modusoptimus.com> | 2007-02-28 03:07:12 +0000 |
---|---|---|
committer | rvelices <rv-github@modusoptimus.com> | 2007-02-28 03:07:12 +0000 |
commit | ea56d7b2ac1d41ea19b5fb45843c839e30a0b37b (patch) | |
tree | 5f55c108b1a808867d44db2b6ebcf0ad573874b6 /include/functions_html.inc.php | |
parent | 30e259904cc38172b2b730455009455675f0d8f5 (diff) |
feature 657: permalinks for categories
git-svn-id: http://piwigo.org/svn/trunk@1866 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to '')
-rw-r--r-- | include/functions_html.inc.php | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/include/functions_html.inc.php b/include/functions_html.inc.php index dcb42cdb1..5612454b0 100644 --- a/include/functions_html.inc.php +++ b/include/functions_html.inc.php @@ -234,8 +234,8 @@ function create_navigation_bar( * returns the list of categories as a HTML string * * categories string returned contains categories as given in the input - * array $cat_informations. $cat_informations array must be an association - * of {category_id => array( id, name) }. If url input parameter is null, + * array $cat_informations. $cat_informations array must be an array + * of array( id=>?, name=>?, permalink=>?). If url input parameter is null, * returns only the categories name without links. * * @param array cat_informations @@ -251,10 +251,10 @@ function get_cat_display_name($cat_informations, $output = ''; $is_first = true; - foreach ($cat_informations as $id => $cat) + foreach ($cat_informations as $cat) { is_array($cat) or trigger_error( - 'get_cat_display_name wrong type for cat '.$id, E_USER_WARNING + 'get_cat_display_name wrong type for category ', E_USER_WARNING ); if ($is_first) { @@ -282,7 +282,7 @@ function get_cat_display_name($cat_informations, } else { - $output.= '<a href="'.PHPWG_ROOT_PATH.$url.$id.'">'; + $output.= '<a href="'.PHPWG_ROOT_PATH.$url.$cat['id'].'">'; $output.= $cat['name'].'</a>'; } } @@ -318,14 +318,10 @@ function get_cat_display_name_cache($uppercats, if (!isset($cache['cat_names'])) { $query = ' -SELECT id, name +SELECT id, name, permalink FROM '.CATEGORIES_TABLE.' ;'; - $result = pwg_query($query); - while ($row = mysql_fetch_assoc($result)) - { - $cache['cat_names'][$row['id']] = $row; - } + $cache['cat_names'] = hash_from_query($query, 'id'); } $output = ''; |