vadvs (vadvs) wrote in changelog,
vadvs
vadvs
changelog

[livejournal] r18519: LJSUP-7961: Add ability to display defau...

Committer: vsukhanov
LJSUP-7961: Add ability to display default userpic of the user.
U   trunk/cgi-bin/cleanhtml.pl
Modified: trunk/cgi-bin/cleanhtml.pl
===================================================================
--- trunk/cgi-bin/cleanhtml.pl	2011-03-11 09:19:05 UTC (rev 18518)
+++ trunk/cgi-bin/cleanhtml.pl	2011-03-11 09:32:38 UTC (rev 18519)
@@ -407,6 +407,25 @@
                 next TOKEN;
             }
 
+            ## lj-userpic:
+            ##      <lj-userpic> - current journal's default userpic
+            ##      <lj-userpic remote> - remote user's default userpic
+            ##      <lj-userpic user="test"> - test's default userpic
+            if ($tag eq "lj-userpic"){
+                my $u = '';
+                if ($attr->{user}){
+                    $u = LJ::load_user($attr->{user});
+                } elsif ($attr->{remote}){
+                    $u = LJ::get_remote();
+                } else {
+                    my $cur_journal = LJ::Session->domain_journal;
+                    $u = LJ::load_user($cur_journal) if $cur_journal;
+                }
+
+                my $upic = ref $u ? $u->userpic : '';
+                $newdata .= $upic->imgtag if $upic;
+            }
+
             if ($tag eq "lj-wishlist") {
                 my $wishid = $attr->{wishid};
                 my $userid = $attr->{userid};

Tags: livejournal, pl, vadvs
Subscribe
  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 0 comments