[dw-free] clean up cgi-bin/LJ/User.pm
[commit: http://hg.dwscoalition.org/dw-free/rev/1f3259efee9b]
http://bugs.dwscoalition.org/show_bug.cgi?id=1354
English-stripping
Patch by
kareila.
Files modified:
http://bugs.dwscoalition.org/show_bug.cgi?id=1354
English-stripping
Patch by
![[personal profile]](https://www.dreamwidth.org/img/silk/identity/user.png)
Files modified:
- bin/upgrading/en.dat
- cgi-bin/LJ/User.pm
-------------------------------------------------------------------------------- diff -r 6feb5a37adad -r 1f3259efee9b bin/upgrading/en.dat --- a/bin/upgrading/en.dat Sat Aug 08 12:55:53 2009 +0000 +++ b/bin/upgrading/en.dat Sat Aug 08 13:20:50 2009 +0000 @@ -2411,6 +2411,16 @@ s2theme.themename.default=(Unnamed - [[t s2theme.themename.notheme=(Layout Default) +search.user.journal=Journal: + +search.user.name=Name: + +search.user.nopic=no default userpic + +search.user.update.last=Updated [[time]] + +search.user.update.never=Never updated + setting.adultcontent.error.invalid=Invalid adult content setting. setting.adultcontent.label=Adult Content diff -r 6feb5a37adad -r 1f3259efee9b cgi-bin/LJ/User.pm --- a/cgi-bin/LJ/User.pm Sat Aug 08 12:55:53 2009 +0000 +++ b/cgi-bin/LJ/User.pm Sat Aug 08 13:20:50 2009 +0000 @@ -484,29 +484,6 @@ sub set_renamed { } -sub set_suspended { - my ($u, $who, $reason, $errref) = @_; - die "Not enough parameters for LJ::User::set_suspended call" unless $who and $reason; - - my $res = $u->set_statusvis('S'); - unless ($res) { - $$errref = "DB error while setting statusvis to 'S'" if ref $errref; - return $res; - } - - LJ::statushistory_add($u, $who, "suspend", $reason); - - LJ::run_hooks("account_cancel", $u); - - if (my $err = LJ::run_hook("cdn_purge_userpics", $u)) { - $$errref = $err if ref $errref and $err; - return 0; - } - - return $res; # success -} - - # set_statusvis only change statusvis parameter, all accompanied actions are done in set_* methods sub set_statusvis { my ($u, $statusvis) = @_; @@ -533,6 +510,29 @@ sub set_statusvis { # do update return LJ::update_user($u, { statusvis => $statusvis, raw => 'statusvisdate=NOW()' }); +} + + +sub set_suspended { + my ($u, $who, $reason, $errref) = @_; + die "Not enough parameters for LJ::User::set_suspended call" unless $who and $reason; + + my $res = $u->set_statusvis('S'); + unless ($res) { + $$errref = "DB error while setting statusvis to 'S'" if ref $errref; + return $res; + } + + LJ::statushistory_add($u, $who, "suspend", $reason); + + LJ::run_hooks("account_cancel", $u); + + if (my $err = LJ::run_hook("cdn_purge_userpics", $u)) { + $$errref = $err if ref $errref and $err; + return 0; + } + + return $res; # success } @@ -6895,7 +6895,8 @@ sub user_search_display { if (my $picid = $get_picid->($u)) { $ret .= "<img src='$LJ::USERPIC_ROOT/$picid/$u->{userid}' alt='$u->{user} userpic' style='border: 1px solid #000;' />"; } else { - $ret .= "<img src='$LJ::IMGPREFIX/nouserpic.png' alt='no default userpic' style='border: 1px solid #000;' width='100' height='100' />"; + $ret .= "<img src='$LJ::IMGPREFIX/nouserpic.png' alt='" . BML::ml( 'search.user.nopic' ); + $ret .= "' style='border: 1px solid #000;' width='100' height='100' />"; } $ret .= "</a>"; @@ -6906,25 +6907,26 @@ sub user_search_display { $ret .= "</td></tr><tr>"; if ($u->{name}) { - $ret .= "<td width='1%' style='font-size: smaller' valign='top'>Name:</td><td style='font-size: smaller'><a href='" . $u->profile_url . "'>"; + $ret .= "<td width='1%' style='font-size: smaller' valign='top'>" . BML::ml( 'search.user.name' ); + $ret .= "</td><td style='font-size: smaller'><a href='" . $u->profile_url . "'>"; $ret .= LJ::ehtml($u->{name}); $ret .= "</a>"; $ret .= "</td></tr><tr>"; } if (my $jtitle = $u->prop('journaltitle')) { - $ret .= "<td width='1%' style='font-size: smaller' valign='top'>Journal:</td><td style='font-size: smaller'><a href='" . $u->journal_base . "'>"; + $ret .= "<td width='1%' style='font-size: smaller' valign='top'>" . BML::ml( 'search.user.journal' ); + $ret .= "</td><td style='font-size: smaller'><a href='" . $u->journal_base . "'>"; $ret .= LJ::ehtml($jtitle) . "</a>"; $ret .= "</td></tr>"; } $ret .= "<tr><td colspan='2' style='text-align: left; font-size: smaller' class='lastupdated'>"; - if ($updated->{$u->{'userid'}} > 0) { - $ret .= "Updated "; - $ret .= LJ::ago_text(time() - $updated->{$u->{'userid'}}); - } else { - $ret .= "Never updated"; + if ( $updated->{$u->userid} > 0 ) { + $ret .= BML::ml( 'search.user.update.last', { time => LJ::ago_text( time() - $updated->{$u->userid} ) } ); + } else { + $ret .= BML::ml( 'search.user.update.never' ); } $ret .= "</td></tr>"; --------------------------------------------------------------------------------