aboutsummaryrefslogtreecommitdiffstats
path: root/picture.php
diff options
context:
space:
mode:
authorrvelices <rv-github@modusoptimus.com>2007-02-16 03:06:41 +0000
committerrvelices <rv-github@modusoptimus.com>2007-02-16 03:06:41 +0000
commitd9b6ce8e875128e0bcac16c09db67636370856d0 (patch)
treeff3c20b659c1bde4df2d122d622ba7702f324a65 /picture.php
parentbbc2dc24191681c863badea1e04b08cf44e46dc5 (diff)
- adviser mode: added check on admin profile page and removed 2 read-only TAG_INPUT_ENABLED
- simplified tag code in picture.php - reduced size of dark/theme.css by combining selectors with identical content git-svn-id: http://piwigo.org/svn/trunk@1827 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to 'picture.php')
-rw-r--r--picture.php37
1 files changed, 9 insertions, 28 deletions
diff --git a/picture.php b/picture.php
index 7df5113b3..3d258fb32 100644
--- a/picture.php
+++ b/picture.php
@@ -748,41 +748,22 @@ $infos['INFO_VISITS'] = $picture['current']['hit'];
$infos['INFO_FILE'] = $picture['current']['file'];
// tags
-$query = '
-SELECT id, name, url_name
- FROM '.IMAGE_TAG_TABLE.'
- INNER JOIN '.TAGS_TABLE.' ON tag_id = id
- WHERE image_id = '.$page['image_id'].'
-;';
-$result = pwg_query($query);
-
-if (mysql_num_rows($result) > 0)
+$tags = get_common_tags( array($page['image_id']), -1);
+if ( count($tags) )
{
- $tags = array();
- $tag_names = array();
-
- while ($row = mysql_fetch_array($result))
+ $infos['INFO_TAGS'] = '';
+ foreach ($tags as $num => $tag)
{
- array_push(
- $tags,
- '<a href="'
+ $infos['INFO_TAGS'] .= $num ? ' ,' : '';
+ $infos['INFO_TAGS'] .= '<a href="'
.make_index_url(
array(
- 'tags' => array(
- array(
- 'id' => $row['id'],
- 'url_name' => $row['url_name'],
- ),
- )
+ 'tags' => array($tag)
)
)
- .'">'.$row['name'].'</a>'
- );
- array_push( $tag_names, $row['name'] );
+ .'">'.$tag['name'].'</a>';
}
-
- $infos['INFO_TAGS'] = implode(', ', $tags);
- $header_infos['INFO_TAGS'] = implode(', ', $tag_names);
+ $header_infos['INFO_TAGS'] = strip_tags($infos['INFO_TAGS']);
}
else
{