[ljcom] r4333: Allow certain pages to display ads when ...

Feb 16, 2007 20:47


Committer: henrylyneAllow certain pages to display ads when the user is not logged in.

U trunk/cgi-bin/adconfig.pl
U trunk/cgi-bin/ljcom.pl

Modified: trunk/cgi-bin/adconfig.pl
===================================================================
--- trunk/cgi-bin/adconfig.pl 2007-02-16 20:34:55 UTC (rev 4332)
+++ trunk/cgi-bin/adconfig.pl 2007-02-16 20:47:04 UTC (rev 4333)
@@ -124,6 +124,19 @@

%AD_BLOCKED_INTERESTS = map { ($_, 1) } @AD_BLOCKED_INTERESTS;

+ %SHOW_AD_LOGGED_OUT = (
+ '/allpics.bml' => 1,
+ '/interests.bml' => 1,
+ '/lostinfo.bml' => 1,
+ '/manage/settings/index.bml' => 1,
+ '/schools/index.bml' => 1,
+ '/site/index.bml' => 1,
+ '/site/search.bml' => 1,
+ '/tools/memadd.bml' => 1,
+ '/tools/memories.bml' => 1,
+ '/update.bml' => 1,
+ );
+
%AD_MAPPING = (
'/accountstatus.bml' => "App-Confirm",
'/affiliates.bml' => "App-Info-1column",

Modified: trunk/cgi-bin/ljcom.pl
===================================================================
--- trunk/cgi-bin/ljcom.pl 2007-02-16 20:34:55 UTC (rev 4332)
+++ trunk/cgi-bin/ljcom.pl 2007-02-16 20:47:04 UTC (rev 4333)
@@ -1622,6 +1622,8 @@
# use "app" context pages to read entries and post comments, so they are
# a bit of a special case.
if ($ctx eq 'app') {
+ my $uri = BML::get_uri();
+ $uri = $uri =~ /\/$/ ? "$uri/index.bml" : $uri;

# Most app pages only show ads if we have a remote user
if (LJ::isu($remote)) {
@@ -1641,6 +1643,10 @@
} elsif ($opts->{type} eq "App-Home") {
return 1 unless $LJ::DISABLED{homepagead_loggedout};

+ # If this pages is on the list to show ads when logged out
+ } elsif ($LJ::SHOW_AD_LOGGED_OUT{$uri}) {
+ return 1;
+
# Exception...
# Show an ad to a logged out user if they are viewing a journal page, styled in S1,
# if the journal owner is on plus

Previous post Next post
Up