[dw-free] Strip ad-related code from the codebase
[commit: http://hg.dwscoalition.org/dw-free/rev/83b7fff60cef]
http://bugs.dwscoalition.org/show_bug.cgi?id=137
Begin the adectomy (Denise's word).
Patch by
denise.
http://bugs.dwscoalition.org/show_bug.cgi?id=137
Begin the adectomy (Denise's word).
Patch by
![[staff profile]](https://www.dreamwidth.org/img/silk/identity/user_staff.png)
-------------------------------------------------------------------------------- diff -r 65640a046783 -r 83b7fff60cef htdocs/allpics.bml --- a/htdocs/allpics.bml Fri Feb 20 09:46:36 2009 +0000 +++ b/htdocs/allpics.bml Fri Feb 20 09:52:05 2009 +0000 @@ -21,8 +21,6 @@ $head .= LJ::robot_meta_tags(); } - my $ad = LJ::get_ads({ location => 'bml.allpics', ljadwrapper => 1, journalu => $u }); - $body .= "<div class='ad-sidebar'>$ad</div>" if $ad; # no need for viewsome, due to the fact that none of this is private anyway. just # allow anybody with any version of viewall to see userpics for non-V statusvis users diff -r 65640a046783 -r 83b7fff60cef htdocs/community/members.bml --- a/htdocs/community/members.bml Fri Feb 20 09:46:36 2009 +0000 +++ b/htdocs/community/members.bml Fri Feb 20 09:52:05 2009 +0000 @@ -8,14 +8,7 @@ body<= LJ::set_active_crumb('commmembers'); - my $print_with_ad = sub { - my $str = shift; - - my $ad_func_2col = LJ::get_ads({ location => 'bml.community.members/error', ljadwrapper => 1 }); - return $str . $ad_func_2col; - }; - - return $print_with_ad->(LJ::server_down_html()) if $LJ::SERVER_DOWN; + return LJ::server_down_html() if $LJ::SERVER_DOWN; my $ret; @@ -23,7 +16,7 @@ body<= my $remote = LJ::get_remote(); unless ($remote) { $ret .= "<?needlogin?>"; - return $print_with_ad->($ret); + return $ret; } # old GET arg @@ -42,7 +35,7 @@ body<= my $c = LJ::load_user($cname); unless ($c) { $ret .= "<?h1 $ML{'Error'} h1?><?p $ML{'.error.nocomm'} p?>"; - return $print_with_ad->($ret); + return $ret; } # make sure it is a comm @@ -50,7 +43,7 @@ body<= $ret .= "<?h1 $ML{'Error'} h1?><?p "; $ret .= BML::ml('.error.notcomm', { 'user' => LJ::ljuser($c) }); $ret .= " p?>"; - return $print_with_ad->($ret); + return $ret; } my $cid = $c->{'userid'}; @@ -60,7 +53,7 @@ body<= $ret .= BML::ml('.error.noaccess', { 'comm' => LJ::ljuser($cname, { 'type' => 'C' }) }); $ret .= " p?>"; - return $print_with_ad->($ret); + return $ret; } $ret .= LJ::maintainer_linkbar($c, "members"); @@ -72,7 +65,7 @@ body<= # saving a form submission if ($POST{'action:update'}) { # validate form auth - return $print_with_ad->("<?h1 $ML{'Error'} h1?><?p $ML{'error.invalidform'} p?>") + return "<?h1 $ML{'Error'} h1?><?p $ML{'error.invalidform'} p?>" unless LJ::check_form_auth(); my @userids = split(',', $POST{'ids'}); @@ -157,7 +150,7 @@ body<= # insert authactions row push @to_add, [ $target, \@attr ]; } - return $print_with_ad->(LJ::bad_input(@add_errors)) if @add_errors; + return LJ::bad_input(@add_errors) if @add_errors; # now do the additions if any were needed my @fail; @@ -184,7 +177,7 @@ body<= push @bad, BML::ml('.error.unknown', { user => LJ::ljuser($_->[0]) }); } } - return $print_with_ad->(LJ::bad_input(@bad)); + return LJ::bad_input(@bad); } # initialize lists of users to update and delete @@ -239,7 +232,7 @@ body<= ", must have at least one maintainer. " . "Please <a href='" . BML::get_uri() . "?authas=$cname'>" . "go back</a> and add a maintainer. p?>"; - return $print_with_ad->($ret); + return $ret; } # delete members @@ -424,17 +417,6 @@ Regards, push @msgs, LJ::ljuser($users{$id}) . ":<ul>$str</ul>" if $str; } - my $ad_box = LJ::get_ads({ - location => 'bml.community.members/main', - ljadwrapper => 1, - below_ad => LJ::CProd->full_box_for($remote, width => 300), - }); - $ret .= $ad_box . "<?h1 $ML{'.success.header'} h1?>"; - if (@msgs) { - $ret .= "<?p $ML{'.success.message2'} p?>\n<ul>"; - $ret .= "<li>$_</li>\n" foreach @msgs; - $ret .= "</ul>"; - } if (@invited) { $ret .= "<?p "; $ret .= BML::ml('.success.invited2', @@ -598,7 +580,7 @@ Regards, $ret .= $navbar; - return $print_with_ad->($ret); + return $ret; } _code?> diff -r 65640a046783 -r 83b7fff60cef htdocs/community/settings.bml --- a/htdocs/community/settings.bml Fri Feb 20 09:46:36 2009 +0000 +++ b/htdocs/community/settings.bml Fri Feb 20 09:52:05 2009 +0000 @@ -33,23 +33,17 @@ body<= my $ret; my %errors; - my $print_with_ad = sub { - my $str = shift; - - my $ad_full_width = LJ::get_ads({ location => 'bml.community.settings/error', ljadwrapper => 1 }); - return $ad_full_width . $str; - }; my $remote = LJ::get_remote(); unless ($remote) { $ret .= "<?needlogin?>"; - return $print_with_ad->($ret); + return $ret; } unless ($remote->{'journaltype'} eq 'P') { $ret .= "<?h1 $ML{'Error'} h1?><?p $ML{'.error.maintainertype'} p?>"; - return $print_with_ad->($ret); + return $ret; } my $mode = "modify"; @@ -61,7 +55,7 @@ body<= if (LJ::did_post()) { - return $print_with_ad->("<?h1 $ML{'Error'} h1?><?p $ML{'error.invalidform'} p?>") + return "<?h1 $ML{'Error'} h1?><?p $ML{'error.invalidform'} p?>" unless LJ::check_form_auth(); my $sth; @@ -167,11 +161,6 @@ body<= $cu->invalidate_directory_record; $ret .= LJ::maintainer_linkbar($cu, "settings"); - $ret .= LJ::get_ads({ - location => 'bml.community.settings/main', - ljadwrapper => 1, - below_ad => LJ::CProd->full_box_for($remote, width => 300), - }); $ret .= "<?h1 $ML{'.success'} h1?>"; if ($mode eq 'create') { $ret .= "<?p $ML{'.label.commcreated'} p?>"; @@ -216,7 +205,7 @@ body<= unless ($c->{'journaltype'} eq 'C') { $ret .= "<?h1 $ML{'Error'} h1?><?p $ML{'.error.notcomm'} p?>"; - return $print_with_ad->($ret); + return $ret; } my $dbr = LJ::get_db_reader(); ($info{'membership'},$info{'postlevel'}) = @@ -340,7 +329,7 @@ body<= ($mode eq 'create' ? "$ML{'.button.createcommunity'}" : "$ML{'.button.changecommunity2'}") . "' /> standout?></div></form>"; - return $print_with_ad->($ret); + return $ret; } _code?> diff -r 65640a046783 -r 83b7fff60cef htdocs/editjournal.bml --- a/htdocs/editjournal.bml Fri Feb 20 09:46:36 2009 +0000 +++ b/htdocs/editjournal.bml Fri Feb 20 09:52:05 2009 +0000 @@ -52,7 +52,6 @@ body<= my %opts = @_; my %res = %$ref; - my $show_ad = $opts{show_ad} ? 1 : 0; $ret .= "<table style='width: 100%;'><tr><td>"; my %props = (); @@ -102,11 +101,7 @@ body<= $ret .= "</td></tr></table>\n"; } - $ret .= "</td>"; - my $ad = LJ::get_ads({ location => 'bml.editjournal', ljadwrapper => 1 }); - if ($ad && $show_ad) { - $ret .= "<td valign='top'>$ad</td>"; - } + $ret .= "</td>"; $ret .= "</tr></table>"; return $ret; @@ -289,11 +284,6 @@ body<= $result .= "</ul></div>"; $result .= "</td>"; - my $ad = LJ::get_ads({ location => 'bml.editjournal', ljadwrapper => 1 }); - if ($ad) { - $result .= "<td valign='top' style='width: 300px;'>$ad</td>"; - } - $result .= "</tr></table>"; return $result; @@ -380,10 +370,6 @@ body<= $ret .= LJ::entry_form($entry, \$$head, \$onload); $ret .= "</form></div>"; $ret .= "</td>"; - my $ad = LJ::get_ads({ location => 'bml.editjournal', ljadwrapper => 1 }); - if ($ad) { - $ret .= "<td valign='top' style='width: 300px;'>$ad</td>"; - } $ret .= "</tr></table>"; @@ -557,10 +543,6 @@ body<= $ret .= $entry_chooser->(\%res); } - my $ad = LJ::get_ads({ location => 'bml.editjournal', ljadwrapper => 1 }); - if ($ad) { - $ret .= "</td><td valign='top'>$ad"; - } $ret .= "</td></tr></table>"; diff -r 65640a046783 -r 83b7fff60cef htdocs/talkpost.bml --- a/htdocs/talkpost.bml Fri Feb 20 09:46:36 2009 +0000 +++ b/htdocs/talkpost.bml Fri Feb 20 09:52:05 2009 +0000 @@ -364,16 +364,6 @@ body<= my $qotd = 0; $qotd = $entry->prop("qotdid") if $entry; - my $ad = LJ::get_ads({ - location => 'bml.talkpost.ebox', - journalu => $u, - interests_extra => $qotd ? { qotd => $qotd } : {} - }); - if ($ad) { - $ret .= $ad; - $ret .= "<hr width='100%' size='2' align='center' />"; - } - my $jarg = "journal=$u->{'user'}&"; my $readurl = LJ::Talk::talkargs($talkurl, $stylemine, $formatlight); @@ -407,11 +397,6 @@ body<= 'stylemine' => $GET{'style'} eq "mine", 'form' => \%FORM, 'do_captcha' => LJ::Talk::Post::require_captcha_test($remote, $u, $FORM{body}, $ditemid)}); - my $ad = LJ::get_ads({ location => 'bml.talk.bottom', journalu => $u, }); - if ($ad) { - $ret .= "<hr width='100%' size='2' align='center' />"; - $ret .= qq[<div style='width:728px; margin: auto;'>$ad</div>]; - } BML::noparse(); return $ret; diff -r 65640a046783 -r 83b7fff60cef htdocs/talkread.bml --- a/htdocs/talkread.bml Fri Feb 20 09:46:36 2009 +0000 +++ b/htdocs/talkread.bml Fri Feb 20 09:52:05 2009 +0000 @@ -392,17 +392,6 @@ my $old_url = 0; my $qotd = 0; $qotd = $entry->prop("qotdid") if $entry; - my $ad = LJ::get_ads ({ - location => 'bml.talkread.ebox', - nowrap => 1, - journalu => $u, - interests_extra => $qotd ? { qotd => $qotd } : {} - }); - - if ($ad) { - $ret .= $ad; - $ret .= "<hr width='100%' size='2' align='center' />"; - } my $view_arg = $GET{'view'} || ""; my $flat_mode = ($view_arg =~ /\bflat\b/); @@ -834,11 +823,6 @@ my $old_url = 0; $ret .= "</p>"; } - my $ad = LJ::get_ads({ location => 'bml.talk.bottom', journalu => $u, }); - if ($ad) { - $ret .= "<hr width='100%' size='2' align='center' />" if $showmultiform && $multiform_selects; - $ret .= qq[<div style='width: 768px; margin: auto;'>$ad</div>]; - } } $ret .= "</form>"; --------------------------------------------------------------------------------