aboutsummaryrefslogtreecommitdiffstats
path: root/picture.php
diff options
context:
space:
mode:
authorz0rglub <z0rglub@piwigo.org>2003-07-28 21:30:19 +0000
committerz0rglub <z0rglub@piwigo.org>2003-07-28 21:30:19 +0000
commit6132e0daa602ba94479d670217b25b92269b463f (patch)
treec342695ead73123785f73a18d0381111ab7a9b06 /picture.php
parent5d4690ad7a2c53c9c138fdf955d634a0f5709545 (diff)
adding keywords in the description of the picture
git-svn-id: http://piwigo.org/svn/trunk@51 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to '')
-rw-r--r--picture.php20
1 files changed, 19 insertions, 1 deletions
diff --git a/picture.php b/picture.php
index 01ff49db1..d447a33a8 100644
--- a/picture.php
+++ b/picture.php
@@ -35,7 +35,7 @@ $query.= ';';
initialize_category( 'picture' );
$cat_directory = $page['cat_dir']; // by default
//------------------------------------- main picture information initialization
-$query = 'SELECT id,date_available,comment,hit';
+$query = 'SELECT id,date_available,comment,hit,keywords';
$query.= ',author,name,file,date_creation,filesize,width,height,cat_id';
$query.= ' FROM '.PREFIX_TABLE.'images';
$query.= $page['where'];
@@ -56,6 +56,7 @@ $page['filesize'] = $row['filesize'];
$page['width'] = $row['width'];
$page['height'] = $row['height'];
$page['cat_id'] = $row['cat_id'];
+$page['keywords'] = $row['keywords'];
// retrieving the number of the picture in its category (in order)
$query = 'SELECT id';
$query.= ' FROM '.PREFIX_TABLE.'images';
@@ -397,6 +398,23 @@ $vtp->addSession( $handle, 'info_line' );
$vtp->setVar( $handle, 'info_line.name', $lang['filesize'].' : ' );
$vtp->setVar( $handle, 'info_line.content', $poids.' KB' );
$vtp->closeSession( $handle, 'info_line' );
+// keywords
+if ( $page['keywords'] != '' )
+{
+ $vtp->addSession( $handle, 'info_line' );
+ $vtp->setVar( $handle, 'info_line.name', $lang['keywords'].' : ' );
+ $keywords = explode( ',', $page['keywords'] );
+ $content = '';
+ $url = './category.php?cat=search&amp;expand='.$_GET['expand'];
+ $url.= '&amp;mode=OR&amp;search=';
+ foreach ( $keywords as $i => $keyword ) {
+ $local_url = add_session_id( $url.$keyword );
+ if ( $i > 0 ) $content.= ',';
+ $content.= '<a href="'.$local_url.'">'.$keyword.'</a>';
+ }
+ $vtp->setVar( $handle, 'info_line.content', $content );
+ $vtp->closeSession( $handle, 'info_line' );
+}
// number of visits
$vtp->addSession( $handle, 'info_line' );
$vtp->setVar( $handle, 'info_line.name', $lang['visited'].' : ' );