Changeset 300 for branches/release-1_3


Ignore:
Timestamp:
Jan 19, 2004, 12:46:57 AM (21 years ago)
Author:
gweltas
Message:

Favorite management

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/release-1_3/picture.php

    r290 r300  
    493493$vtp->closeSession( $handle, 'info_line' );
    494494//------------------------------------------------------- favorite manipulation
    495 if ( $page['cat'] != 'fav' and !$user['is_the_guest'] )
     495if ( !$user['is_the_guest'] )
     496{
     497  // verify if the picture is already in the favorite of the user
     498  $query = 'SELECT COUNT(*) AS nb_fav FROM '.PREFIX_TABLE.'favorites WHERE image_id = '.$page['id'];
     499  $query.= ' AND user_id = '.$user['id'].';';
     500  $result = mysql_query( $query );
     501  $row = mysql_fetch_array( $result );
     502  if (!$row['nb_fav'])
    496503{
    497504  $url = './picture.php?cat='.$page['cat'].'&image_id='.$page['id'];
     
    511518  $vtp->closeSession( $handle, 'favorite' );
    512519}
    513 if ( $page['cat'] == 'fav' )
     520else
    514521{
    515522  $url = './picture.php?cat='.$page['cat'].'&image_id='.$page['id'];
     
    522529  $vtp->setVar( $handle, 'favorite.alt','[ '.$lang['del_favorites_alt'].' ]' );
    523530  $vtp->closeSession( $handle, 'favorite' );
     531}
    524532}
    525533//------------------------------------ admin link for information modifications
Note: See TracChangeset for help on using the changeset viewer.