diff options
author | plegall <plg@piwigo.org> | 2006-04-02 22:26:19 +0000 |
---|---|---|
committer | plegall <plg@piwigo.org> | 2006-04-02 22:26:19 +0000 |
commit | 42abf4c57664d2596872d437f70b95193f9a5d18 (patch) | |
tree | a1262b8601d5ac5b04b5b2e71af52c453712b9df /search_rules.php | |
parent | 68ed2ea617ede199a0e2f15fdd4886095ae600cb (diff) |
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.
git-svn-id: http://piwigo.org/svn/trunk@1119 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to 'search_rules.php')
-rw-r--r-- | search_rules.php | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/search_rules.php b/search_rules.php index 6e6900e90..51ccaf2c0 100644 --- a/search_rules.php +++ b/search_rules.php @@ -83,6 +83,34 @@ if (isset($search['fields']['allwords'])) ); } +if (isset($search['fields']['tags'])) +{ + $template->assign_block_vars( + 'tags', + array( + 'LIST_INTRO' => ($search['fields']['tags']['mode'] == 'AND') + ? l10n('All tags must match') + : l10n('At least one tag must match') + ) + ); + + $query = ' +SELECT name + FROM '.TAGS_TABLE.' + WHERE id IN ('.implode(',', $search['fields']['tags']['words']).') +;'; + $result = pwg_query($query); + while ($row = mysql_fetch_array($result)) + { + $template->assign_block_vars( + 'tags.tag', + array( + 'NAME' => $row['name'], + ) + ); + } +} + if (isset($search['fields']['author'])) { $template->assign_block_vars( |