Changeset 51


Ignore:
Timestamp:
Jul 28, 2003, 11:30:19 PM (21 years ago)
Author:
z0rglub
Message:

adding keywords in the description of the picture

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/picture.php

    r42 r51  
    3636$cat_directory = $page['cat_dir']; // by default
    3737//------------------------------------- main picture information initialization
    38 $query = 'SELECT id,date_available,comment,hit';
     38$query = 'SELECT id,date_available,comment,hit,keywords';
    3939$query.= ',author,name,file,date_creation,filesize,width,height,cat_id';
    4040$query.= ' FROM '.PREFIX_TABLE.'images';
     
    5757$page['height']         = $row['height'];
    5858$page['cat_id']         = $row['cat_id'];
     59$page['keywords']       = $row['keywords'];
    5960// retrieving the number of the picture in its category (in order)
    6061$query = 'SELECT id';
     
    398399$vtp->setVar( $handle, 'info_line.content', $poids.' KB' );
    399400$vtp->closeSession( $handle, 'info_line' );
     401// keywords
     402if ( $page['keywords'] != '' )
     403{
     404  $vtp->addSession( $handle, 'info_line' );
     405  $vtp->setVar( $handle, 'info_line.name', $lang['keywords'].' : ' );
     406  $keywords = explode( ',', $page['keywords'] );
     407  $content = '';
     408  $url = './category.php?cat=search&expand='.$_GET['expand'];
     409  $url.= '&mode=OR&search=';
     410  foreach ( $keywords as $i => $keyword ) {
     411    $local_url = add_session_id( $url.$keyword );
     412    if ( $i > 0 ) $content.= ',';
     413    $content.= '<a href="'.$local_url.'">'.$keyword.'</a>';
     414  }
     415  $vtp->setVar( $handle, 'info_line.content', $content );
     416  $vtp->closeSession( $handle, 'info_line' );
     417}
    400418// number of visits
    401419$vtp->addSession( $handle, 'info_line' );
Note: See TracChangeset for help on using the changeset viewer.