From 19fac9a26490bb833e6cd1bd179bb6b7fb0160d8 Mon Sep 17 00:00:00 2001 From: Banana Date: Thu, 16 Jun 2011 09:01:30 +0200 Subject: [PATCH] manage empty bookmarks --- insipid.cgi | 3 --- lib/Insipid/Main.pm | 12 +++++++++++- lib/Insipid/Tags.pm | 5 ++++- 3 files changed, 15 insertions(+), 5 deletions(-) diff --git a/insipid.cgi b/insipid.cgi index 4b1cc79..6713da7 100755 --- a/insipid.cgi +++ b/insipid.cgi @@ -53,9 +53,6 @@ if($@) { print STDERR "Creating database\n"; - #print STDERR Dumper(\%INC); - #delete $INC{'Insipid/Database.pm'}; - # This means that a database connection was established but the # tables were not found. undef($@); diff --git a/lib/Insipid/Main.pm b/lib/Insipid/Main.pm index 2d85217..507a67c 100755 --- a/lib/Insipid/Main.pm +++ b/lib/Insipid/Main.pm @@ -856,7 +856,17 @@ sub show_bookmarks { # Join the tag tables only when necessary - if (url_param('tag') =~ / /) { + if(url_param('tag') eq "empty") { + + # allow this action only for logged in users + check_access(); + + $sql = $sql." left join $tbl_bookmark_tags on + ($tbl_bookmarks.id = + $tbl_bookmark_tags.bookmark_id) + WHERE $tbl_bookmark_tags.bookmark_id IS NULL"; + } + elsif (url_param('tag') =~ / /) { my @tags = split(/ /, url_param('tag')); my $icount = 1; diff --git a/lib/Insipid/Tags.pm b/lib/Insipid/Tags.pm index fae6374..0a5148d 100755 --- a/lib/Insipid/Tags.pm +++ b/lib/Insipid/Tags.pm @@ -139,8 +139,11 @@ sub tag_operations { print ''; print ''; print ''; - print ''; + print ''; print ''; + + print '

Show bookmarks without a tag

'; + print '

Show me the bookmarks

'; } # Display the tag list. Takes one parameter for the mode - 0 is for the -- 2.39.5