From 17379610c939d05372dd2fe38cf8e88d3c9aaa8f Mon Sep 17 00:00:00 2001 From: Carly Ho Date: Sat, 27 Jan 2024 14:50:26 -0600 Subject: [PATCH] more fiddling with user levels --- cgi-bin/DW/Logic/ProfilePage.pm | 5 ++++- cgi-bin/LJ/Global/Img.pm | 35 +++++++++++++++++++++++++++++++++ cgi-bin/LJ/User/Display.pm | 5 ++++- 3 files changed, 43 insertions(+), 2 deletions(-) diff --git a/cgi-bin/DW/Logic/ProfilePage.pm b/cgi-bin/DW/Logic/ProfilePage.pm index 9e47d2476..946e25f52 100644 --- a/cgi-bin/DW/Logic/ProfilePage.pm +++ b/cgi-bin/DW/Logic/ProfilePage.pm @@ -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; diff --git a/cgi-bin/LJ/Global/Img.pm b/cgi-bin/LJ/Global/Img.pm index a508cab1e..505cddbed 100644 --- a/cgi-bin/LJ/Global/Img.pm +++ b/cgi-bin/LJ/Global/Img.pm @@ -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, diff --git a/cgi-bin/LJ/User/Display.pm b/cgi-bin/LJ/User/Display.pm index 2cfcaba41..21fefbf51 100644 --- a/cgi-bin/LJ/User/Display.pm +++ b/cgi-bin/LJ/User/Display.pm @@ -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;