aboutsummaryrefslogtreecommitdiffstats
path: root/index.php
diff options
context:
space:
mode:
authorrvelices <rv-github@modusoptimus.com>2006-04-04 00:35:12 +0000
committerrvelices <rv-github@modusoptimus.com>2006-04-04 00:35:12 +0000
commitf33fdc91b2a5cb4ce0681df52b37ca5781660503 (patch)
treeb6e1d6653e5bd8f35b8d2bb016c173653a3abcf5 /index.php
parent42abf4c57664d2596872d437f70b95193f9a5d18 (diff)
fix: sql query erros when: no items for the selected tag, search returns
no result, caddie is empty fix: tag cloud was showing least used tags fix: strip html tags from head/title element on the page (tag index page title contained <a>...) improvement: added 5 tag levels in css for "ready to use" tags fix: corrected png icon calendar_created.png for IE fix: english language for nbm git-svn-id: http://piwigo.org/svn/trunk@1120 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to 'index.php')
-rw-r--r--index.php36
1 files changed, 15 insertions, 21 deletions
diff --git a/index.php b/index.php
index 784832623..4ca48385d 100644
--- a/index.php
+++ b/index.php
@@ -110,15 +110,7 @@ include(PHPWG_ROOT_PATH.'include/page_header.php');
$template->set_filenames( array('index'=>'index.tpl') );
//-------------------------------------------------------------- category title
-if (isset($page['category']))
-{
- $template_title = get_cat_display_name( $page['cat_name'], '', false );
-}
-else
-{
- $template_title = $page['title'];
-}
-
+$template_title = $page['title'];
if (isset($page['cat_nb_images']) and $page['cat_nb_images'] > 0)
{
$template_title.= ' ['.$page['cat_nb_images'].']';
@@ -225,9 +217,13 @@ if (count($conf['links']) > 0)
if ('tags' == $page['section'])
{
$template->assign_block_vars('tags', array());
-
+
// display tags associated to currently tagged items, less current tags
- $query = '
+ $tags = array();
+
+ if ( !empty($page['items']) )
+ {
+ $query = '
SELECT tag_id, name, url_name, count(*) counter
FROM '.IMAGE_TAG_TABLE.'
INNER JOIN '.TAGS_TABLE.' ON tag_id = id
@@ -236,13 +232,11 @@ SELECT tag_id, name, url_name, count(*) counter
GROUP BY tag_id
ORDER BY name ASC
;';
- $result = pwg_query($query);
-
- $tags = array();
-
- while($row = mysql_fetch_array($result))
- {
- array_push($tags, $row);
+ $result = pwg_query($query);
+ while($row = mysql_fetch_array($result))
+ {
+ array_push($tags, $row);
+ }
}
$tags = add_level_to_tags($tags);
@@ -276,16 +270,16 @@ SELECT tag_id, name, url_name, count(*) counter
)
)
),
-
+
'NAME' => $tag['name'],
-
+
'TITLE' => l10n('See pictures linked to this tag only'),
'TITLE_ADD' => sprintf(
l10n('%d pictures are also linked to current tags'),
$tag['counter']
),
-
+
'CLASS' => 'tagLevel'.$tag['level']
)
);