more fiddling with user levels

This commit is contained in:
Carly Ho 2024-01-27 14:50:26 -06:00
parent 243ee02144
commit 17379610c9
3 changed files with 43 additions and 2 deletions

View File

@ -83,6 +83,9 @@ sub userpic {
my $user = $u->user;
my $remote = $self->{remote};
my $ret = {};
my $ps = DW::Pay::get_paid_status( $self, no_cache => 1 );
my $level = $LJ::CAP{ $ps->{typeid} }->{_account_type};
my $img = '/silk/identity/'.$self->{$level}.'png';
# syndicated accounts have a very simple thing
if ( $u->is_syndicated ) {
@ -95,7 +98,7 @@ sub userpic {
$ret->{userpic} = $up->url;
}
elsif ( $u->is_personal ) {
$ret->{userpic} = "$LJ::IMGPREFIX/profile_icons/user.png";
$ret->{userpic} = $img;
$ret->{alt_text} = _profile_ml('.userpic.user.alt');
$ret->{width} = 100;
$ret->{height} = 100;

View File

@ -403,6 +403,41 @@ $img{'id_user'} = {
alt => 'img.id_user',
};
$img{'id_starlight'} = {
src => '/silk/identity/starlight.png',
width => 16,
height => 16,
alt => 'img.id_starlight',
};
$img{'id_golden'} = {
src => '/silk/identity/golden.png',
width => 16,
height => 16,
alt => 'img.id_golden',
};
$img{'id_mastermind'} = {
src => '/silk/identity/mastermind.png',
width => 16,
height => 16,
alt => 'img.id_mastermind',
};
$img{'id_bejeweled'} = {
src => '/silk/identity/bejeweled.png',
width => 16,
height => 16,
alt => 'img.id_bejeweled',
};
$img{'id_staff'} = {
src => '/silk/identity/staff.png',
width => 16,
height => 16,
alt => 'img.id_staff',
};
$img{'id_community-24'} = {
src => '/silk/24x24/community.png',
width => 24,

View File

@ -608,6 +608,9 @@ sub ljuser {
my $journal_url = $opts->{'journal_url'} || '';
my $display_class = $opts->{no_ljuser_class} ? "" : " class='ljuser'";
my $profile;
my $ps = DW::Pay::get_paid_status( $self, no_cache => 1 );
my $level = $LJ::CAP{ $ps->{typeid} }->{_account_type};
my $imguser = '/silk/identity/'.$self->{$level}.'png';
my $make_tag = sub {
my ( $fil, $url, $x, $y, $type ) = @_;
@ -655,7 +658,7 @@ sub ljuser {
unless ( $u && isu($u) ) {
$user = LJ::canonical_username($user);
$profile = "$LJ::SITEROOT/profile?user=$user";
return $make_tag->( 'silk/identity/user.png', "$LJ::SITEROOT/profile?user=$user", 17 );
return $make_tag->( $imguser, "$LJ::SITEROOT/profile?user=$user", 17 );
}
$profile = $u->profile_url;