From: Andrew DeFaria Date: Thu, 18 Jan 2018 19:51:17 +0000 (-0800) Subject: Added hit_count X-Git-Url: https://defaria.com/gitweb/?a=commitdiff_plain;h=8af32b28b56662686b6ceb59f2e00dc19cfc7a33;p=clearscm.git Added hit_count --- diff --git a/maps/bin/MAPSDB.pm b/maps/bin/MAPSDB.pm index d4405f9..ed0460c 100644 --- a/maps/bin/MAPSDB.pm +++ b/maps/bin/MAPSDB.pm @@ -2,7 +2,7 @@ ################################################################################# # # File: $RCSfile: MAPSDB.pm,v $ -# Revision: $Revision: 1.1 $ +# Revision: $Revision: 1.1 $ # Description: MAPS Database routines # Author: Andrew@DeFaria.com # Created: Fri Nov 29 14:17:21 2002 @@ -213,8 +213,8 @@ sub CheckOnList ($$;$) { $update //= 1; - my $status = 0; - my $rule; + my $status = 0; + my ($rule, $hit_count); my $statement = "select pattern, domain, comment, sequence, hit_count from list where userid = '$userid' and type = '$listtype'"; @@ -227,7 +227,7 @@ sub CheckOnList ($$;$) { while (my @row = $sth->fetchrow_array) { last if !@row; - my $hit_count = pop (@row); + $hit_count = pop (@row); my $sequence = pop (@row); my $comment = pop (@row); my $domain = pop (@row); @@ -274,7 +274,7 @@ sub CheckOnList ($$;$) { $sth->finish; - return ($status, $rule); + return ($status, $rule, $hit_count); } # CheckOnList sub CleanEmail ($) { diff --git a/maps/bin/detail.cgi b/maps/bin/detail.cgi index 646f51e..b4c3e90 100755 --- a/maps/bin/detail.cgi +++ b/maps/bin/detail.cgi @@ -174,17 +174,17 @@ sub PrintTable { foreach my $sender (ReturnSenders $userid, $type, $next, $lines, $date) { my @msgs = ReturnMessages $userid, $sender; my @msgs2 = @msgs; + my $onlist; + my $rule = 'none'; + my $hit_count = 0; - my ($onlist, $rule); - $rule = 'none'; - - ($onlist, $rule) = OnWhitelist $sender, $userid, 0; + ($onlist, $rule, $hit_count) = OnWhitelist $sender, $userid, 0; unless ($onlist) { - ($onlist, $rule) = OnBlacklist $sender, 0; + ($onlist, $rule, $hit_count) = OnBlacklist $sender, 0; unless ($onlist) { - ($onlist, $rule) = OnNulllist $sender, 0; + ($onlist, $rule, $hit_count) = OnNulllist $sender, 0; } # unless } # unless @@ -195,7 +195,7 @@ sub PrintTable { if ($rule =~ /(\w+):(\d+)/) { my $list = $1; my $sequence = $2 - 1; - my $link = "$list:$2"; + my $link = "$list:$2/$hit_count"; $rule =~ s/\w+:\d+/$link/; } # if