mirror of
https://github.com/Piwigo/Piwigo.git
synced 2026-08-10 02:33:02 +02:00
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:
+19
-1
@@ -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'].' : ' );
|
||||
|
||||
Reference in New Issue
Block a user