[livejournal] r11006: New confirmation pages, all of which hav...

Apr 10, 2007 22:59


Committer: janineNew confirmation pages, all of which have box ads, cprod/tip widgets, and the Getting Started widget.

http://rt.livejournal.org/Ticket/Display.html?id=3688

U branches/r5/htdocs/community/members.bml
U branches/r5/htdocs/community/settings.bml
U branches/r5/htdocs/friends/add.bml
U branches/r5/htdocs/friends/edit.bml
U branches/r5/htdocs/friends/editgroups.bml
U branches/r5/htdocs/manage/comments/index.bml
U branches/r5/htdocs/manage/profile/index.bml
U branches/r5/htdocs/manage/settings/index.bml
U branches/r5/htdocs/tools/memadd.bml
U branches/r5/htdocs/update.bml

Modified: branches/r5/htdocs/community/members.bml
===================================================================
--- branches/r5/htdocs/community/members.bml 2007-04-10 22:54:55 UTC (rev 11005)
+++ branches/r5/htdocs/community/members.bml 2007-04-10 22:59:49 UTC (rev 11006)
@@ -8,15 +8,22 @@

LJ::set_active_crumb('commmembers');

- return LJ::server_down_html() if $LJ::SERVER_DOWN;
+ my $print_with_ad = sub {
+ my $str = shift;

+ my $ad_func_2col = LJ::ad_display( type => 'app', orient => 'BML-App-Func-2column' );
+ return $str . $ad_func_2col;
+ };
+
+ return $print_with_ad->(LJ::server_down_html()) if $LJ::SERVER_DOWN;
+
my $ret;

# get remote
my $remote = LJ::get_remote();
unless ($remote) {
$ret .= "";
- return $ret;
+ return $print_with_ad->($ret);
}

my $cname = $GET{'comm'};
@@ -26,7 +33,7 @@
my $c = LJ::load_user($cname);
unless ($c) {
$ret .= "";
- return $ret;
+ return $print_with_ad->($ret);
}

# make sure it is a comm
@@ -34,7 +41,7 @@
$ret .= " LJ::ljuser($c) });
$ret .= " p?>";
- return $ret;
+ return $print_with_ad->($ret);
}

my $cid = $c->{'userid'};
@@ -44,7 +51,7 @@
$ret .= BML::ml('.error.noaccess',
{ 'comm' => LJ::ljuser($cname, { 'type' => 'C' }) });
$ret .= " p?>";
- return $ret;
+ return $print_with_ad->($ret);
}

my @allattribs = ('member', 'post', 'preapprove', 'moderate', 'admin');
@@ -54,7 +61,7 @@
# saving a form submission
if ($POST{'action:update'}) {
# validate form auth
- return ""
+ return $print_with_ad->("")
unless LJ::check_form_auth();

my @userids = split(',', $POST{'ids'});
@@ -122,7 +129,7 @@
# insert authactions row
push @to_add, [ $target, \@attr ];
}
- return LJ::bad_input(@add_errors) if @add_errors;
+ return $print_with_ad->(LJ::bad_input(@add_errors)) if @add_errors;

# now do the additions if any were needed
my @fail;
@@ -149,7 +156,7 @@
push @bad, BML::ml('.error.unknown', { user => LJ::ljuser($_->[0]) });
}
}
- return LJ::bad_input(@bad);
+ return $print_with_ad->(LJ::bad_input(@bad));
}

# initialize lists of users to update and delete
@@ -203,7 +210,7 @@
", must have at least one maintainer. " .
"Please " .
"go back
and add a maintainer. p?>";
- return $ret;
+ return $print_with_ad->($ret);
}

# delete members
@@ -387,7 +394,8 @@
push @msgs, LJ::ljuser($users{$id}) . ":
    $str
" if $str;
}

- $ret .= "";
+ my $ad_box = LJ::ad_display( type => 'app', orient => 'BML-App-Confirm', below_ad => LJ::CProd->full_box_for($remote, width => 300) );
+ $ret .= $ad_box . "";
if (@msgs) {
$ret .= "\n
    ";
    $ret .= "
  • $_
  • \n" foreach @msgs;
    @@ -408,6 +416,7 @@
    }
    $ret .= "" unless @msgs || @invited;
    $ret .= " "href='" . BML::get_uri() . "?comm=$cname'"}) . " p?>";
    + $ret .= LJ::Widget::GettingStarted->render;

    return $ret;

    @@ -566,7 +575,7 @@

    $ret .= $navbar;

    - return $ret;
    + return $print_with_ad->($ret);

    }
    _code?>

    Modified: branches/r5/htdocs/community/settings.bml
    ===================================================================
    --- branches/r5/htdocs/community/settings.bml 2007-04-10 22:54:55 UTC (rev 11005)
    +++ branches/r5/htdocs/community/settings.bml 2007-04-10 22:59:49 UTC (rev 11006)
    @@ -33,16 +33,23 @@
    my $ret;
    my %errors;

    + my $print_with_ad = sub {
    + my $str = shift;
    +
    + my $ad_full_width = LJ::ad_display( type => 'app', orient => 'BML-App-Func-1column' );
    + return $ad_full_width . $str;
    + };
    +
    my $remote = LJ::get_remote();

    unless ($remote) {
    $ret .= "";
    - return $ret;
    + return $print_with_ad->($ret);
    }

    unless ($remote->{'journaltype'} eq 'P') {
    $ret .= "";
    - return $ret;
    + return $print_with_ad->($ret);
    }

    my $mode = "modify";
    @@ -50,7 +57,7 @@

    if (LJ::did_post())
    {
    - return ""
    + return $print_with_ad->("")
    unless LJ::check_form_auth();

    my $sth;
    @@ -129,6 +136,7 @@
    LJ::set_rel($cu->{'userid'}, $remote->{'userid'}, 'M');
    }

    + $ret .= LJ::ad_display( type => 'app', orient => 'BML-App-Confirm', below_ad => LJ::CProd->full_box_for($remote, width => 300) );
    $ret .= "";
    if ($mode eq 'create') {
    $ret .= "";
    @@ -140,6 +148,8 @@
    $ret .= "
  • $ML{'.label.comminfo'}
  • "
    . BML::ml('.label.managepage', { 'aopts' => 'href="/community/manage.bml"' }) . "
p?>";

+ $ret .= LJ::Widget::GettingStarted->render;
+
return $ret;
}
}
@@ -168,7 +178,7 @@
}
unless ($c->{'journaltype'} eq 'C') {
$ret = "";
- return $ret;
+ return $print_with_ad->($ret);
}
my $dbr = LJ::get_db_reader();
($info{'membership'},$info{'postlevel'}) =
@@ -268,7 +278,7 @@
($mode eq 'create' ? "$ML{'.button.createcommunity'}" : "$ML{'.button.changecommunity'}") .
"' /> standout?>";

- return $ret;
+ return $print_with_ad->($ret);

_code?>

Modified: branches/r5/htdocs/friends/add.bml
===================================================================
--- branches/r5/htdocs/friends/add.bml 2007-04-10 22:54:55 UTC (rev 11005)
+++ branches/r5/htdocs/friends/add.bml 2007-04-10 22:59:49 UTC (rev 11006)
@@ -3,6 +3,13 @@

use vars qw($body $title $windowtitle %GET %POST);

+ my $print_with_ad = sub {
+ my $str = shift;
+
+ my $ad_box = LJ::ad_display( type => 'app', orient => 'BML-App-Confirm' );
+ return $ad_box . $str;
+ };
+
my $head = \$_[1]->{'head'};

my $remote = LJ::get_remote();
@@ -16,14 +23,14 @@
unless ($remote)
{
$title = $ML{'.error1.title'};
- $body = "";
+ $body = $print_with_ad->("");
return;
}

unless ($user && $userid)
{
$title = $ML{'Error'};
- $body = BML::ml('.error2.text2', {'aopts' => "href='$LJ::SITEROOT/friends/edit.bml'"});
+ $body = $print_with_ad->(BML::ml('.error2.text2', {'aopts' => "href='$LJ::SITEROOT/friends/edit.bml'"}));
return;
}

@@ -31,19 +38,19 @@
{
unless (LJ::did_post()) {
$title = $ML{'Error'};
- $body = " p?>";
+ $body = $print_with_ad->(" p?>");
return;
}

unless (LJ::check_form_auth()) {
$title = $ML{'Error'};
- $body = "";
+ $body = $print_with_ad->("");
return;
}

unless ($remote->{'userid'} == $POST{'remid'}) {
$title = $ML{'Error'};
- $body = "";
+ $body = $print_with_ad->("");
return;
}

@@ -75,6 +82,8 @@

if ($res{'success'} eq "OK")
{
+ $body = LJ::ad_display( type => 'app', orient => 'BML-App-Confirm', below_ad => LJ::CProd->full_box_for($remote, width => 300) );
+
if ($POST{'action:delete'}) {
$title = $ML{'.remove.title'};
$body .= "";
} else {
$title = $ML{'.add.title'};
- $body = "";
+ $body .= "";

$body .= " LJ::ljuser($u) }) . " p?>";
$body .= "";
}
+
+ $body .= LJ::Widget::GettingStarted->render;
} else {
$title = $ML{'Error'};
- $body = "";
+ $body = $print_with_ad->("");
}
return;
}
@@ -125,7 +136,7 @@
# return an error if user being added isn't visible
unless ($u->is_visible) {
$title = $ML{'Error'};
- $body = " LJ::ljuser($user)}) . " p?>";
+ $body = $print_with_ad->(" LJ::ljuser($user)}) . " p?>");
return;
}
my $icon = $u->large_journal_icon;
@@ -456,6 +467,7 @@

$body .= "";
+ $body = $print_with_ad->($body);

return;

Modified: branches/r5/htdocs/friends/edit.bml
===================================================================
--- branches/r5/htdocs/friends/edit.bml 2007-04-10 22:54:55 UTC (rev 11005)
+++ branches/r5/htdocs/friends/edit.bml 2007-04-10 22:59:49 UTC (rev 11006)
@@ -17,25 +17,32 @@

LJ::set_active_crumb('editfriends');

- return LJ::server_down_html()
+ my $print_with_ad = sub {
+ my $str = shift;
+
+ my $ad_full_width = LJ::ad_display( type => 'app', orient => 'BML-App-Func-1column' );
+ return $ad_full_width . $str;
+ };
+
+ return $print_with_ad->(LJ::server_down_html())
if $LJ::SERVER_DOWN;

- return ""
+ return $print_with_ad->("")
unless LJ::text_in(\%POST);

my $remote = LJ::get_remote();
- return ""
+ return $print_with_ad->("")
unless $remote;

my $authas = $GET{'authas'} || $remote->user;
my $getextra = $authas ne $remote->user ? "?authas=$authas" : '';

my $u = LJ::get_authas_user($authas);
- return LJ::bad_input($ML{'error.invalidauth'})
+ return $print_with_ad->(LJ::bad_input($ML{'error.invalidauth'}))
unless $u;
return BML::redirect("$LJ::SITEROOT/community/members.bml?comm=$u->{'user'}")
if $u->is_community;
- return LJ::bad_input($ML{'.error.badjournaltype'})
+ return $print_with_ad->(LJ::bad_input($ML{'.error.badjournaltype'}))
unless $u->is_person || $u->is_shared || $u->is_identity;

my $ret;
@@ -222,13 +229,13 @@
$ret .= "\n";
$ret .= "\n";

- return $ret;
+ return $print_with_ad->($ret);
}

# if they did a post, then process their changes
if (LJ::did_post()) {
- return LJ::bad_input($ML{'error.invalidform'})
+ return $print_with_ad->(LJ::bad_input($ML{'error.invalidform'}))
unless LJ::check_form_auth();

my %request = ();
@@ -251,24 +258,23 @@
LJ::do_request(\%request, \%response, { 'noauth' => 1, 'u' => $u });

if ($response{'success'} eq "OK") {
- $ret = "";
- $ret .= "";
- $ret .= "$ML{'.success.fromhere'}";
+ $ret .= LJ::Widget::GettingStarted->render;

- $ret .= "";
- $ret .= LJ::CProd->full_box_for($u, width => 300);
- $ret .= " p?>";
return $ret;
} else {
- return "
  • $response{'errmsg'} p?>\n";
    + return $print_with_ad->("
  • $response{'errmsg'} p?>\n");
    }
    }

    - return $ML{'error.unknownmode'};
    + return $print_with_ad->($ML{'error.unknownmode'});
    }
    _code?>
    <=body

    Modified: branches/r5/htdocs/friends/editgroups.bml
    ===================================================================
    --- branches/r5/htdocs/friends/editgroups.bml 2007-04-10 22:54:55 UTC (rev 11005)
    +++ branches/r5/htdocs/friends/editgroups.bml 2007-04-10 22:59:49 UTC (rev 11006)
    @@ -8,9 +8,16 @@
    $title = $ML{'.title'};
    $body = "";

    + my $print_with_ad = sub {
    + my $str = shift;
    +
    + my $ad_box = LJ::ad_display( type => 'app', orient => 'BML-App-Confirm' );
    + return $ad_box . $str;
    + };
    +
    my $err = sub {
    $title = $ML{'Error'};
    - $body = LJ::bad_input(@_);
    + $body = $print_with_ad->(LJ::bad_input(@_));
    return;
    };

    @@ -21,19 +28,19 @@
    delete $POST{'list_out'};

    unless (LJ::text_in(\%POST)) {
    - $body = "";
    + $body = $print_with_ad->("");
    return;
    }

    my $remote = LJ::get_remote();
    unless ($remote) {
    - $body = "";
    + $body = $print_with_ad->("");
    return;
    }

    my $authas = $GET{'authas'} || $remote->{'user'};
    my $u = LJ::get_authas_user($authas);
    - return $err->($ML{'error.invalidauth'})
    + return $print_with_ad->($err->($ML{'error.invalidauth'}))
    unless $u;

    # extra arguments for get requests
    @@ -41,7 +48,7 @@

    if ($POST{'mode'} eq "save") {
    unless (LJ::check_form_auth()) {
    - $body = "";
    + $body = $print_with_ad->("");
    return;
    }

    @@ -55,9 +62,12 @@
    });

    if ($res{'success'} eq "OK") {
    + $body .= LJ::ad_display( type => 'app', orient => 'BML-App-Confirm', below_ad => LJ::CProd->full_box_for($remote, width => 300) );
    $body .= "";
    + $body .= LJ::Widget::GettingStarted->render;
    } else {
    $body .= "";
    + $body = $print_with_ad->($body);
    }
    return;
    }
    @@ -439,6 +449,7 @@
    $body .= " p?>";
    $body .= "";

    + $body = $print_with_ad->($body);
    return;
    }
    _code?> 'app', orient => 'BML-App-Full-Width' );
    + return $ad_full_width . $str;
    + };
    +
    + return $print_with_ad->(LJ::server_down_html()) if $LJ::SERVER_DOWN;
    +
    my $remote = LJ::get_remote();
    - return LJ::bad_input("You must be logged in to edit your profile.")
    + return $print_with_ad->(LJ::bad_input("You must be logged in to edit your profile."))
    unless $remote;

    my $authas = $GET{'authas'} || $remote->{'user'};
    my $u = LJ::get_authas_user($authas);
    - return LJ::bad_input("You could not be authenticated as the specified user.")
    + return $print_with_ad->(LJ::bad_input("You could not be authenticated as the specified user."))
    unless $u;

    - return $LJ::MSG_READONLY_USER if $u->readonly;
    + return $print_with_ad->($LJ::MSG_READONLY_USER) if $u->readonly;

    # extra arguments for get requests
    my $getextra = $authas ne $remote->{'user'} ? "?authas=$authas" : '';
    @@ -162,7 +169,7 @@
    $ret .= "\n";
    $ret .= "\n";

    - return $ret;
    + return $print_with_ad->($ret);
    }

    @@ -171,10 +178,10 @@
    ###

    if (LJ::did_post()) {
    - return "" unless LJ::check_form_auth();
    + return $print_with_ad->("") unless LJ::check_form_auth();

    $POST{'unban'} =~ s/\0/,/g;
    - return "" unless LJ::text_in(\%POST);
    + return $print_with_ad->("") unless LJ::text_in(\%POST);

    my $dbh = LJ::get_db_writer();
    # setup what we're gonna update in the user table:
    @@ -222,12 +229,14 @@
    # tell the user all is well
    my $base = $u->journal_base;
    my $profile_url = $u->profile_url;
    - return "\n" .
    - "";
    + my $ad_box = LJ::ad_display( type => 'app', orient => 'BML-App-Confirm', below_ad => LJ::CProd->full_box_for($remote, width => 300) );
    + return $ad_box . "\n" .
    + "" .
    + LJ::Widget::GettingStarted->render;
    }

    # should never happen
    - return "";
    + return $print_with_ad->("");

    }
    _code?>

    Modified: branches/r5/htdocs/manage/profile/index.bml
    ===================================================================
    --- branches/r5/htdocs/manage/profile/index.bml 2007-04-10 22:54:55 UTC (rev 11005)
    +++ branches/r5/htdocs/manage/profile/index.bml 2007-04-10 22:59:49 UTC (rev 11006)
    @@ -11,10 +11,22 @@
    use strict;
    use vars qw(%POST %GET $head);

    - return LJ::server_down_html() if $LJ::SERVER_DOWN;
    + # We only show one ad on a page, so if this
    + # hook returns an ad use that instead of the one
    + # defined by the page
    + my $ad_override = LJ::run_hook('identity_section_ad');

    + my $print_with_ad = sub {
    + my $str = shift;
    +
    + my $ad_full_width = LJ::ad_display( type => 'app', orient => 'BML-App-Full-Width' );
    + return $ad_override ? $str : $ad_full_width . $str;
    + };
    +
    + return $print_with_ad->(LJ::server_down_html()) if $LJ::SERVER_DOWN;
    +
    my $remote = LJ::get_remote();
    - return LJ::bad_input("You must be logged in to edit your profile.")
    + return $print_with_ad->(LJ::bad_input("You must be logged in to edit your profile."))
    unless $remote;

    if ($remote->underage) {
    @@ -23,10 +35,10 @@

    my $authas = $GET{'authas'} || $remote->{'user'};
    my $u = LJ::get_authas_user($authas);
    - return LJ::bad_input("You could not be authenticated as the specified user.")
    + return $print_with_ad->(LJ::bad_input("You could not be authenticated as the specified user."))
    unless $u;

    - return $LJ::MSG_READONLY_USER if $u->readonly;
    + return $print_with_ad->($LJ::MSG_READONLY_USER) if $u->readonly;

    # extra arguments for get requests
    my $getextra = $authas ne $remote->{'user'} ? "?authas=$authas" : '';
    @@ -74,7 +86,6 @@
    LJ::load_codes({ "country" => \%countries, "state" => \%states });

    - my $ad .= LJ::ads( type => 'app', orient => 'BML-App-Confirm' );
    ###
    ### no post, show edit form
    ###
    @@ -122,7 +133,7 @@
    $ret .= LJ::help_icon('upic_keywords');
    $ret .= "$ML{'.userpic.change'} p?>\n";
    $ret .= "";
    - $ret .= "$ad" if $ad;
    + $ret .= "$ad_override" if $ad_override;
    $ret .= "\n";

    # name
    @@ -441,7 +452,7 @@
    $ret .= "\n";
    $ret .= "\n";

    - return $ret;
    + return $print_with_ad->($ret);
    }

    @@ -450,9 +461,9 @@
    ###

    if (LJ::did_post()) {
    - return "" unless LJ::check_form_auth();
    + return $print_with_ad->("") unless LJ::check_form_auth();

    - return "" unless LJ::text_in(\%POST);
    + return $print_with_ad->("") unless LJ::text_in(\%POST);

    my @errors = ();

    @@ -550,7 +561,7 @@
    }
    }

    - return LJ::bad_input(@errors) if @errors;
    + return $print_with_ad->(LJ::bad_input(@errors)) if @errors;

    ### no errors

    @@ -722,12 +733,12 @@
    my @interrors = ();

    # Don't bother validating the interests if there are already too many
    - return LJ::bad_input( BML::ml('error.interest.excessive', { intcount => $intcount }) ) if $intcount > 150;
    + return $print_with_ad->(LJ::bad_input( BML::ml('error.interest.excessive', { intcount => $intcount }) )) if $intcount > 150;

    # Clean interests, and make sure they're valid
    my @valid_ints = LJ::validate_interest_list(\@interrors, @ints);
    if (@interrors > 0) {
    - return LJ::bad_input( map { BML::ml(@$_) } @interrors );
    + return $print_with_ad->(LJ::bad_input( map { BML::ml(@$_) } @interrors ));
    }

    LJ::set_interests($u, \%interests, \@valid_ints);
    @@ -755,20 +766,18 @@
    # tell the user all is well
    my $base = $u->journal_base;
    my $profile_url = $u->profile_url;
    - return "\n" .
    - "\n\n" .
    - "" .
    - "" .
    - "" .
    - "" . $ad .
    - LJ::CProd->full_box_for($remote, width => 300) .
    - "";
    + my $ad_box = LJ::ad_display( type => 'app', orient => 'BML-App-Confirm', below_ad => LJ::CProd->full_box_for($remote, width => 300) );
    + return $ad_box . "\n" .
    + "" .
    + "" .
    + "" .
    + LJ::Widget::GettingStarted->render;
    }

    # should never happen
    - return "";
    + return $print_with_ad->("");

    }
    _code?>

    Modified: branches/r5/htdocs/manage/settings/index.bml
    ===================================================================
    --- branches/r5/htdocs/manage/settings/index.bml 2007-04-10 22:54:55 UTC (rev 11005)
    +++ branches/r5/htdocs/manage/settings/index.bml 2007-04-10 22:59:49 UTC (rev 11006)
    @@ -11,8 +11,15 @@
    use strict;
    use vars qw(%POST %GET $head);

    - return LJ::server_down_html() if $LJ::SERVER_DOWN;
    + my $print_with_ad = sub {
    + my $str = shift;

    + my $ad_full_width = LJ::ad_display( type => 'app', orient => 'BML-App-Full-Width' );
    + return $ad_full_width . $str;
    + };
    +
    + return $print_with_ad->(LJ::server_down_html()) if $LJ::SERVER_DOWN;
    +
    my $remote = LJ::get_remote();

    # these need to be declared out here, due to scoping issues
    @@ -24,10 +31,10 @@
    if ($remote) {
    $authas = $GET{'authas'} || $remote->{'user'};
    $u = LJ::get_authas_user($authas);
    - return LJ::bad_input("You could not be authenticated as the specified user.")
    + return $print_with_ad->(LJ::bad_input("You could not be authenticated as the specified user."))
    unless $u;

    - return $LJ::MSG_READONLY_USER if $u->readonly;
    + return $print_with_ad->($LJ::MSG_READONLY_USER) if $u->readonly;

    # extra arguments for get requests
    $getextra = $authas ne $remote->{'user'} ? "?authas=$authas" : '';
    @@ -353,7 +360,7 @@
    $ret .= "\n";
    $ret .= "\n";

    - return $ret;
    + return $print_with_ad->($ret);
    }

    @@ -362,9 +369,9 @@
    ###

    if (LJ::did_post()) {
    - return "" unless !$remote || LJ::check_form_auth();
    + return $print_with_ad->("") unless !$remote || LJ::check_form_auth();

    - return "" unless LJ::text_in(\%POST);
    + return $print_with_ad->("") unless LJ::text_in(\%POST);

    # set language
    if (exists $POST{'lang'}) {
    @@ -486,7 +493,9 @@
    }

    # tell the user all is well
    - my $ret;
    + my $cprod = $remote ? LJ::CProd->full_box_for($remote, width => 300) : "";
    + my $ad_box = LJ::ad_display( type => 'app', orient => 'BML-App-Confirm', below_ad => $cprod );
    + my $ret = $ad_box;
    $ret .= "\n";
    $ret .= "\n";
    $ret .= "\n";
    + $ret .= LJ::Widget::GettingStarted->render;
    return $ret;

    }

    # should never happen
    - return "";
    + return $print_with_ad->("");

    }
    _code?>

    Modified: branches/r5/htdocs/tools/memadd.bml
    ===================================================================
    --- branches/r5/htdocs/tools/memadd.bml 2007-04-10 22:54:55 UTC (rev 11005)
    +++ branches/r5/htdocs/tools/memadd.bml 2007-04-10 22:59:49 UTC (rev 11006)
    @@ -9,9 +9,16 @@
    $title = $ML{'.title'};
    $body = "";

    + my $print_with_ad = sub {
    + my $str = shift;
    +
    + my $ad_box = LJ::ad_display( type => 'app', orient => 'BML-App-Confirm' );
    + return $ad_box . $str;
    + };
    +
    my $err = sub {
    $title = "Error";
    - $body = LJ::bad_input(@_);
    + $body = $print_with_ad->(LJ::bad_input(@_));
    return;
    };

    @@ -23,7 +30,7 @@

    my $remote = LJ::get_remote();
    unless ($remote) {
    - $body = "";
    + $body = $print_with_ad->("");
    return;
    }

    @@ -87,7 +94,7 @@

    unless ($ju && $itemid) {
    $title = $ML{'Error'};
    - $body = $ML{'error.nojournal'};
    + $body = $print_with_ad->($ML{'error.nojournal'});
    return;
    }

    @@ -112,6 +119,7 @@
    $body .= "\n";
    }

    + $body = $print_with_ad->($body);
    return;
    }
    my $subject = LJ::get_logtext2($ju, $itemid)->{$log->{jitemid}}[0];
    @@ -140,7 +148,7 @@
    my $exist_kw = LJ::Memories::get_keywords($memoryu);
    unless ($exist_kw) {
    $title = $ML{'Error'};
    - $body = "Error fetching existing keywords.";
    + $body = $print_with_ad->("Error fetching existing keywords.");
    return;
    }

    @@ -168,7 +176,7 @@
    LJ::Memories::delete_by_id($memoryu, $memory->{memid});
    LJ::Memories::updated_keywords($memoryu);
    $title = $ML{'Error'};
    - $body = $ML{'.error.entry_deleted'};
    + $body = $print_with_ad->($ML{'.error.entry_deleted'});
    return;
    }

    @@ -176,7 +184,7 @@
    elsif (!$log || ($jid && $log->{'anum'} != $anum))
    {
    $title = $ML{'Error'};
    - $body = $ML{'error.noentry'};
    + $body = $print_with_ad->($ML{'error.noentry'});
    return;
    }
    else
    @@ -252,34 +260,36 @@
    $body .= LJ::html_submit(undef, $ML{'.form.reset'}, {type => 'reset'}) if defined $memory;
    $body .= "";

    + $body = $print_with_ad->($body);
    return;
    }

    if ($POST{'mode'} eq "save")
    {
    - return " $ML{'error.invalidform'}" unless LJ::check_form_auth();
    + return $print_with_ad->(" $ML{'error.invalidform'}") unless LJ::check_form_auth();

    my $dbh = LJ::get_db_writer();

    if (! $POST{'des'}) {
    # then we're deleting.
    unless (LJ::check_form_auth()) {
    - $body = "";
    + $body = $print_with_ad->("");
    return;
    }
    if (defined $memory) {
    LJ::Memories::delete_by_id($memoryu, $memory->{memid});
    LJ::Memories::updated_keywords($memoryu);
    $title = $ML{'.title.deleted'};
    - $body = "(" $memory->{'des'} }) .
    - "p?>";
    + "p?>");
    return;
    } else {
    $title = $ML{'Error'};
    $body = "";
    + $body = $print_with_ad->($body);
    return;
    }
    }
    @@ -295,7 +305,7 @@
    }
    if (scalar(@keywords) > 5) {
    $title = $ML{'Error'};
    - $body = "";
    + $body = $print_with_ad->("");
    return;
    }
    @keywords = grep { $_ } map { s/\s\s+/ /g; LJ::trim($_); } @keywords;
    @@ -306,8 +316,8 @@
    foreach my $kw (@keywords) {
    if (length($kw) > 40) {
    $title = $ML{'Error'};
    - $body = " LJ::ehtml($kw) }) . "p?>";
    + $body = $print_with_ad->(" LJ::ehtml($kw) }) . "p?>");
    return;
    }

    @@ -318,7 +328,7 @@

    unless (exists $secopts{$POST{'security'}}) {
    $title = $ML{'Error'};
    - $body = $ML{'.error.invalid_security'};
    + $body = $print_with_ad->($ML{'.error.invalid_security'});
    return;
    }

    @@ -337,7 +347,8 @@
    LJ::Memories::updated_keywords($memoryu) if $needflush;

    $title = $ML{'.title.added'};
    - $body = "";
    + $body = LJ::ad_display( type => 'app', orient => 'BML-App-Confirm', below_ad => LJ::CProd->full_box_for($remote, width => 300) );
    + $body .= "";
    $body .= "";

    my $entry = LJ::Entry->new($ju, jitemid => $itemid);
    @@ -348,11 +359,13 @@
    $body .= "
  • $ML{'.body.added.next.friends'}
  • ";
    $body .= "";

    + $body .= LJ::Widget::GettingStarted->render;
    +
    return;
    }

    $title = $ML{'Error'};
    - $body = $ML{'error.unknownmode'};
    + $body = $print_with_ad->($ML{'error.unknownmode'});

    return;
    _code?>

    Modified: branches/r5/htdocs/update.bml
    ===================================================================
    --- branches/r5/htdocs/update.bml 2007-04-10 22:54:55 UTC (rev 11005)
    +++ branches/r5/htdocs/update.bml 2007-04-10 22:59:49 UTC (rev 11006)
    @@ -403,18 +403,15 @@
    "
  • $ML{'.success.links.memories'}
  • " .
    "
  • $ML{'.success.links.tags'}
  • " .
    "";
    +
    + $$body .= LJ::Widget::GettingStarted->render;
    }

    $$body .= "";

    {

    - my $ad = LJ::ads( type => 'app', orient => 'BML-App-Confirm' );
    - if ($ad) {
    - $$body .= "$ad";
    - } else {
    - $$body .= LJ::CProd->full_box_for($u, width => 300);
    - }
    + $$body .= LJ::ad_display( type => 'app', orient => 'BML-App-Confirm', below_ad => LJ::CProd->full_box_for($u, width => 300) );
    }

    $$body .= "";

    Previous post Next post
    Up