summaryrefslogtreecommitdiff
path: root/lib/VNDB/DB/Tags.pm
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2009-03-14 17:22:27 +0100
committerYorhel <git@yorhel.nl>2009-03-14 17:23:04 +0100
commite483e8d3940dc61c40132aa71d66a4deb88c5134 (patch)
tree39db0bc78bfa9c4427517414d3be30e03514e92e /lib/VNDB/DB/Tags.pm
parentb9e28ab961cb432eedc84c261d0137688b696d68 (diff)
Expanded the tag list with a search, and more for use by non-tagmods
Diffstat (limited to 'lib/VNDB/DB/Tags.pm')
-rw-r--r--lib/VNDB/DB/Tags.pm5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/VNDB/DB/Tags.pm b/lib/VNDB/DB/Tags.pm
index 0268d8de..d4e817d7 100644
--- a/lib/VNDB/DB/Tags.pm
+++ b/lib/VNDB/DB/Tags.pm
@@ -21,7 +21,6 @@ sub dbTagGet {
);
$o{search} =~ s/%//g if $o{search};
- $o{state} = 1 if !defined $o{state} && !$o{id} && !$o{name};
my %where = (
$o{id} ? (
@@ -30,8 +29,10 @@ sub dbTagGet {
't.id <> ?' => $o{noid} ) : (),
$o{name} ? (
't.id = (SELECT id FROM tags LEFT JOIN tags_aliases ON id = tag WHERE lower(name) = ? OR lower(alias) = ? LIMIT 1)' => [ lc $o{name}, lc $o{name} ]) : (),
- defined $o{state} ? (
+ defined $o{state} && $o{state} != -1 ? (
't.state = ?' => $o{state} ) : (),
+ !defined $o{state} && !$o{id} && !$o{name} ? (
+ 't.state <> 1' => 1 ) : (),
$o{search} ? (
't.id IN (SELECT id FROM tags LEFT JOIN tags_aliases ON id = tag WHERE name ILIKE ? OR alias ILIKE ?)' => [ "%$o{search}%", "%$o{search}%" ] ) : (),
);