Skip to content

Commit

Permalink
misc. thingys
Browse files Browse the repository at this point in the history
  • Loading branch information
pudge committed Feb 17, 2004
1 parent 7e9402f commit abf895b
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions plugins/Stats/Stats.pm
Expand Up @@ -1351,8 +1351,8 @@ sub countSfNetIssues {
#######################################################

sub getRelocatedLinksSummary {
my ($self,$options) = @_;
$options ||={};
my($self, $options) = @_;
$options ||= {};
my $limit = "limit $options->{limit}" if $options->{limit};
return $self->sqlSelectAllHashrefArray("query_string, count(query_string) as cnt","accesslog_temp_errors","op='relocate-undef' AND dat = '/relocate.pl'",
"GROUP by query_string order by cnt desc $limit");
Expand All @@ -1362,11 +1362,11 @@ sub getRelocatedLinksSummary {
# expects arrayref returned by getRelocatedLinksSummary

sub getRelocatedLinkHitsByType {
my ($self,$ls) = @_;
my($self, $ls) = @_;
my $summary;
foreach my $l(@$ls){
my ($id) = $l->{query_string} =~/id=([^&]*)/;
my $type = $self->sqlSelect("stats_type","links","id=".$self->sqlQuote($id));
foreach my $l (@$ls) {
my($id) = $l->{query_string} =~/id=([^&]*)/;
my $type = $self->sqlSelect("stats_type", "links", "id=" . $self->sqlQuote($id));
$summary->{$type} += $l->{cnt};
}
return $summary;
Expand All @@ -1375,27 +1375,27 @@ sub getRelocatedLinkHitsByType {
########################################################
# expects arrayref returned by getRelocatedLinksSummary
sub getRelocatedLinkHitsByUrl {
my ($self,$ls) = @_;
my($self, $ls) = @_;
my $top_links = [];
foreach my $l(@$ls){
my ($id) = $l->{query_string} =~/id=([^&]*)/;
foreach my $l (@$ls) {
my($id) = $l->{query_string} =~/id=([^&]*)/;
my $url = $self->sqlSelect("url","links","id=".$self->sqlQuote($id));
push @$top_links, { url => $url, count => $l->{cnt}} ;
push @$top_links, { url => $url, count => $l->{cnt} };
}
return $top_links;
}

########################################################

sub getSubscribersWithRecentHits {
my ($self) = @_;
my($self) = @_;
return $self->sqlSelectColArrayref("uid", "users_hits", "hits_paidfor > hits_bought and lastclick >= date_sub(now(), interval 3 day)", "order by uid");
}

########################################################

sub getSubscriberCrawlers {
my ($self,$uids) = @_;
my($self, $uids) = @_;
return [] unless @$uids;
my $uid_list = join(',',@$uids);
return $self->sqlSelectAllHashrefArray("uid, count(*) as cnt", "accesslog_temp",
Expand Down

0 comments on commit abf895b

Please sign in to comment.