From dd381431b2707eb3a44ea0de271b2d87036000f5 Mon Sep 17 00:00:00 2001 From: Banana Date: Thu, 16 Feb 2012 09:47:48 +0100 Subject: [PATCH] bookmarks by domain search and some stats information --- ChangeLog | 2 +- lib/Insipid/Main.pm | 14 +++++++++++++- lib/Insipid/Stats.pm | 6 +++--- 3 files changed, 17 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 9351daa..b10131e 100755 --- a/ChangeLog +++ b/ChangeLog @@ -1,7 +1,7 @@ version 1.1 - * duplicate / potential match url search * older and newer link at the top no working * bug with path to the jquery.js file + * some statistics version 1.0 () + jumpin.banana diff --git a/lib/Insipid/Main.pm b/lib/Insipid/Main.pm index 583f349..a8c34d5 100755 --- a/lib/Insipid/Main.pm +++ b/lib/Insipid/Main.pm @@ -921,9 +921,19 @@ sub show_bookmarks { } + # search by domain + if(defined(url_param('bydomain'))) { + my $sparm = url_param('bydomain'); + $sql = "$sql where ($tbl_bookmarks.url like ?)"; + $sparm =~ s/\%//; + $sparm = "\%$sparm\%"; + push(@parms, $sparm); + } + + # Search if ($query ne "") { - if ( (get_option("public_searches") eq "yes") + if ( (get_option("public_searches") eq "yes") || (logged_in() eq 1)) { my $sparm = $query; if (length($sparm) > 2) { @@ -946,6 +956,8 @@ sub show_bookmarks { $sql = "$sql offset $offset"; } + #print $sql; + $sth = $dbh->prepare($sql); $sth->execute(@parms); diff --git a/lib/Insipid/Stats.pm b/lib/Insipid/Stats.pm index 0da2bcc..58d173a 100644 --- a/lib/Insipid/Stats.pm +++ b/lib/Insipid/Stats.pm @@ -33,6 +33,7 @@ use Insipid::Util; require Exporter; use URI; +use URI::Escape; use Data::Dumper; @@ -75,13 +76,12 @@ sub findSimilarities { if(%domains) { - - print ""; print ""; #for(sort keys %domains) { foreach (reverse sort { $domains{$a} <=> $domains{$b} } keys %domains ) { - print ""; + + print ""; } print "
DomainCount
$_$domains{$_}
$_$domains{$_}
"; } -- 2.39.5