From 42abf4c57664d2596872d437f70b95193f9a5d18 Mon Sep 17 00:00:00 2001 From: plegall Date: Sun, 2 Apr 2006 22:26:19 +0000 Subject: 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 --- search_rules.php | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'search_rules.php') 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( -- cgit v1.2.3