{'user'} eq $user ? $remote : LJ::load_user($user); unless ($u) { $body = ""; return; } $u->preload_props("opt_blockrobots", "adult_content", "admin_content_flag") if $u->is_visible; if (!$u->is_visible || $u->should_block_robots) { $head .= LJ::robot_meta_tags(); } my $ad = LJ::get_ads({ location => 'bml.allpics', ljadwrapper => 1, journalu => $u }); $body .= "
" 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 if ($GET{viewall} && LJ::check_priv($remote, 'canview', 'suspended')) { LJ::statushistory_add($u->{'userid'}, $remote->{'userid'}, "viewall", "allpics: $u->{'user'}, statusvis: " . $u->statusvis); } else { if ($u->is_suspended) { $title = $ML{'error.suspended.title'}; $body = " LJ::ljuser($u), 'sitename' => $LJ::SITENAME }) . " p?>"; return; } if ($u->is_deleted) { $title = $ML{'error.deleted.title'}; $body = " LJ::ljuser($u) }) . " p?>"; return; } if ($u->is_expunged) { $title = $ML{'error.purged.title'}; $body = " LJ::ljuser($u) }) . " p?>"; return; } } # redirect renamed users if ($u->{'journaltype'} eq "R") { LJ::load_user_props($u, "renamedto"); return BML::redirect("$LJ::SITEROOT/allpics.bml?user=$u->{'renamedto'}") if $u->{'renamedto'}; } my ($can_manage, $getextra); if ($remote) { $can_manage = LJ::can_manage($remote, $u->{'userid'}); $getextra = $can_manage && $remote->{'user'} ne $u->{'user'} ? "?authas=$u->{'user'}" : ''; } #### show pictures my $info = LJ::get_userpic_info($u, {'load_comments' => 1, 'load_urls' => 1}); my %keywords = (); while (my ($kw, $pic) = each %{$info->{'kw'}}) { LJ::text_out(\$kw); push @{$keywords{$pic->{'picid'}}}, $kw; } my %comments = (); while (my ($pic, $comment) = each %{$info->{'comment'}}) { LJ::text_out(\$comment); $comments{$pic} = $comment; } my $piccount = 0; my @pics; my $defaultpicid = $u ? $u->{'defaultpicid'} : undef; # allow support to view inactive userpics for debugging my $view_inactive = $GET{inactive} && (LJ::check_priv($remote, "supportviewscreened") || LJ::check_priv($remote, "supporthelp")); $view_inactive ||= $can_manage; push @pics, $info->{'pic'}->{$u->{'defaultpicid'}} if $defaultpicid; push @pics, map { $info->{'pic'}->{$_} } sort { $a <=> $b } grep { $_ != $defaultpicid && ($info->{'pic'}->{$_}->{'state'} eq 'N' || $view_inactive) && $info->{'pic'}->{$_}->{'state'} ne 'X' } keys %{$info->{'pic'}}; foreach my $pic (@pics) { if ($piccount++ == 0) { $body .= " LJ::ljuser($u),}); my $hook_text = LJ::run_hook('allpics_upsell_text', $u, $getextra); if ($hook_text eq "") { $body .= ' ' . BML::ml('.edit4', {'aopts' => "href='$LJ::SITEROOT/editpics.bml$getextra'"}); } else { $body .= $hook_text; } } else { $body .= BML::ml('.pics2', {'user' => LJ::ljuser($u), 'aopts' => "href='$LJ::SITEROOT/manage/subscriptions/user.bml?journal=$u->{user}'"}); } $body .= " p?>| ";
my ($apre, $apost);
if ($pic->{'url'}) {
$apre = "";
$apost = "";
}
$body .= "$apre | ";
if ($u->{'defaultpicid'} == $pic->{'picid'}) {
$body .= "$ML{'.default'} "; } if ($view_inactive && $pic->{'state'} eq 'I') { $body .= "[$ML{'userpic.inactive'}] " . LJ::help_icon('userpic_inactive') . " "; } if ($eh_keywords) { $body .= "$ML{'.keywords'} $eh_keywords "; } # Comments my $eh_comments = $comments{$pic->{'picid'}}; if ($eh_comments) { LJ::CleanHTML::clean(\$eh_comments, { 'wordlength' => 40, 'addbreaks' => 0, 'tablecheck' => 1, 'mode' => 'deny', }); $body .= "$eh_comments\n"; } $body .= " | ";
if ($piccount % 2 == 1) {
$body .= ""; } else { $body .= " | "; } $body .= " |