]> 91.132.146.200 Git - insipid.git/commitdiff
manage empty bookmarks
authorBanana <banana@starscream.de>
Thu, 16 Jun 2011 07:01:30 +0000 (09:01 +0200)
committerBanana <banana@starscream.de>
Thu, 16 Jun 2011 07:01:30 +0000 (09:01 +0200)
insipid.cgi
lib/Insipid/Main.pm
lib/Insipid/Tags.pm

index 4b1cc792e4065a02d2299d1a4bb9ccc3ea9a7de8..6713da78533e3f3a1bde54c0d723b7b9856b1ffe 100755 (executable)
@@ -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($@);
index 2d85217ee5c64f16e76f681f0aa9720962bf28f8..507a67c888330dc9f55125d9e3116ba26a4da2dc 100755 (executable)
@@ -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;
 
index fae6374927e211421fe4c6f5f9b06eeb39bb9d85..0a5148dcca9553e98b2972565fe7b0de4902b698 100755 (executable)
@@ -139,8 +139,11 @@ sub tag_operations {
        print '</select>';
        print '<input type=hidden name="op" value="tags">';
        print '<input type=hidden name="doDelete" value="yes">';
-               print '<input type="submit" value="Delete and move" />';
+       print '<input type="submit" value="Delete and move" />';
        print '</form>';
+       
+       print '<h2>Show bookmarks without a tag</h2>';
+       print '<p><a href="'.$site_url.'/insipid.cgi?tag=empty">Show me the bookmarks</a></p>';
 }
 
 # Display the tag list.  Takes one parameter for the mode - 0 is for the