diff --git a/include/functions_html.inc.php b/include/functions_html.inc.php index 969bb48be..3bc9a4706 100644 --- a/include/functions_html.inc.php +++ b/include/functions_html.inc.php @@ -610,4 +610,52 @@ function page_not_found($msg, $alternate_url=null) .$msg.'', 5 ); } + +/* returns the title to be displayed above thumbnails on tag page + */ +function get_tags_content_title() +{ + global $page; + $title = count($page['tags']) > 1 ? l10n('Tags') : l10n('Tag'); + $title.= ' '; + + for ($i=0; $i0 ? ' + ' : ''; + + $title.= + '' + .$page['tags'][$i]['name'] + .''; + + if ( count($page['tags'])>2 ) + { + $other_tags = $page['tags']; + unset ( $other_tags[$i] ); + $title.= + 'x' + .''; + } + + } + return $title; +} ?> diff --git a/include/section_init.inc.php b/include/section_init.inc.php index 9db071714..7e3f87cfe 100644 --- a/include/section_init.inc.php +++ b/include/section_init.inc.php @@ -193,7 +193,7 @@ SELECT name, url_name, id } $result = pwg_query($query); $tag_infos = array(); - while ($row = mysql_fetch_array($result)) + while ($row = mysql_fetch_assoc($result)) { $tag_infos[ $row['id'] ] = $row; array_push($page['tags'], $row );//we loose given tag order; is it important? @@ -410,29 +410,7 @@ SELECT image_id ); } - $title = count($page['tags']) > 1 ? l10n('Tags') : l10n('Tag'); - $title.= ' '; - - $tag_num = 1; - foreach ($page['tag_ids'] as $tag_id) - { - $title.= - ($tag_num++ > 1 ? ' + ' : '') - .'' - .$tag_infos[$tag_id]['name'] - .''; - } + $title = get_tags_content_title(); $page = array_merge( $page, diff --git a/language/en_UK.iso-8859-1/common.lang.php b/language/en_UK.iso-8859-1/common.lang.php index 7bdd0c97e..7a1772bfd 100644 --- a/language/en_UK.iso-8859-1/common.lang.php +++ b/language/en_UK.iso-8859-1/common.lang.php @@ -543,6 +543,7 @@ $lang['register'] = 'register'; $lang['register_page_title'] = 'Registration'; $lang['register_title'] = 'Registration'; $lang['remember_me'] = 'Auto login'; +$lang['remove this tag'] = 'remove this tag from the list'; $lang['representative'] = 'representative'; $lang['reset'] = 'Reset'; $lang['return to homepage'] = 'return to homepage'; diff --git a/language/fr_FR.iso-8859-1/common.lang.php b/language/fr_FR.iso-8859-1/common.lang.php index b71766a60..84f19a473 100644 --- a/language/fr_FR.iso-8859-1/common.lang.php +++ b/language/fr_FR.iso-8859-1/common.lang.php @@ -542,6 +542,7 @@ $lang['register'] = 's\'enregistrer'; $lang['register_page_title'] = 'Enregistrement'; $lang['register_title'] = 'Enregistrement'; $lang['remember_me'] = 'Connexion auto'; +$lang['remove this tag'] = 'enlever ce tag de la liste'; $lang['representative'] = 'représentant'; $lang['reset'] = 'Annuler'; $lang['return to homepage'] = 'retour à la page d\'accueil';