Ignore:
Timestamp:
04/03/06 00:26:19 (14 years ago)
Author:
plg
Message:

improvement: tags replace keywords. Better data model, less
limitations. Each image can be associated to as many tag as needed. Tags can
contain non ASCII characters. Oriented navigation with tags by association.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/search_rules.php

    r1113 r1119  
    8484} 
    8585 
     86if (isset($search['fields']['tags'])) 
     87{ 
     88  $template->assign_block_vars( 
     89    'tags', 
     90    array( 
     91      'LIST_INTRO' => ($search['fields']['tags']['mode'] == 'AND') 
     92        ? l10n('All tags must match') 
     93        : l10n('At least one tag must match') 
     94      ) 
     95    ); 
     96 
     97  $query = ' 
     98SELECT name 
     99  FROM '.TAGS_TABLE.' 
     100  WHERE id IN ('.implode(',', $search['fields']['tags']['words']).') 
     101;'; 
     102  $result = pwg_query($query); 
     103  while ($row = mysql_fetch_array($result)) 
     104  { 
     105    $template->assign_block_vars( 
     106      'tags.tag', 
     107      array( 
     108        'NAME' => $row['name'], 
     109        ) 
     110      ); 
     111  } 
     112} 
     113 
    86114if (isset($search['fields']['author'])) 
    87115{ 
Note: See TracChangeset for help on using the changeset viewer.