adding keywords in the description of the picture

git-svn-id: http://piwigo.org/svn/trunk@51 68402e56-0260-453c-a942-63ccdbb3a9ee
This commit is contained in:
z0rglub
2003-07-28 21:30:19 +00:00
parent 5d4690ad7a
commit 6132e0daa6
+19 -1
View File
@@ -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&expand='.$_GET['expand'];
$url.= '&mode=OR&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'].' : ' );