Skip to content

Commit

Permalink
Hooks for plugins/Subscribe to do its thing (or not, if it's not
Browse files Browse the repository at this point in the history
installed).
  • Loading branch information
jamiemccarthy committed Nov 30, 2001
1 parent bd6f341 commit fdf4d7d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
10 changes: 6 additions & 4 deletions Slash/Apache/Log/Log.pm
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,13 @@ sub UserLog {
return if !$user or !$user->{uid} or $user->{is_anon};
my $slashdb = getCurrentDB();

$slashdb->setUser($user->{uid}, {
-hits => 'hits +1'
});
my $user_update = { -hits => 'hits+1' };
my $subscribe = getObject('Slash::Subscribe');
if ($subscribe and $subscribe->buyingThisPage($r)) {
$user_update->{-hits_bought} = 'hits_bought+1';
}
$slashdb->setUser($user->{uid}, $user_update);


return OK;
}

Expand Down
7 changes: 6 additions & 1 deletion Slash/Utility/Anchor/Anchor.pm
Original file line number Diff line number Diff line change
Expand Up @@ -299,9 +299,14 @@ sub ssiFoot {

########################################################
sub getAd {
my($num, $log) = @_; #$_[0] || 1;
my($num, $log) = @_;
$num ||= 1;

my $subscribe = getObject('Slash::Subscribe');
if ($subscribe and $subscribe->buyingThisPage()) {
return "\n<!-- subscriber, no ad -->\n";
}

unless ($ENV{SCRIPT_NAME}) {
$log = $log ? " Slash::createLog('$log');" : "";
return <<EOT;
Expand Down

0 comments on commit fdf4d7d

Please sign in to comment.