holyandrew (holyandrew) wrote in changelog,
holyandrew
holyandrew
changelog

[livejournal] r21034: LJSUP-10988: Add position and social cap...

Committer: akanashin
LJSUP-10988: Add position and social capital to user profile
U   trunk/htdocs/userinfo.bml
Modified: trunk/htdocs/userinfo.bml
===================================================================
--- trunk/htdocs/userinfo.bml	2012-01-27 16:19:25 UTC (rev 21033)
+++ trunk/htdocs/userinfo.bml	2012-01-30 06:32:33 UTC (rev 21034)
@@ -3,6 +3,7 @@
 {
     use strict;
     use LJ::TimeUtil;
+    use LJ::PersonalStats::DB;
 
     use vars qw($title $windowtitle $body $head $bml_okay %GET);
 
@@ -655,6 +656,29 @@
     $body .= LJ::run_hook("userinfo_extra_user_details", user => $u);
     $body .= "</div>";
 
+    #LJSUP-10988: Add position and social capital to user profile
+    #==============================================================
+    if ($u->is_personal || $u->is_comm) {
+        my $position = LJ::PersonalStats::DB->fetch_raw('ratings', {
+            func => 'get_value',
+            what => $u->is_personal ? 'users' : 'communities',
+            journal_id => $u->userid,
+            by => 'friends_of',
+            type => 0,
+            sup => LJ::SUP->is_sup_enabled($u),
+        });
+        if (ref $position eq 'HASH') {
+            if ($position->{result}->{position} < 2000) {
+                $body .= "<br>" . 
+                         LJ::Lang::ml('ljcom.userinfo.account_rating', { rating_place => $position->{result}->{position}, 
+                                                                         url_user_rating => '/ratings/users/friends_of', 
+                                                                         soc_capital => $position->{result}->{value}}) . 
+                        "<br>";
+            }
+        }
+    }
+    #==============================================================
+
     my @view_links;
     my $entry_count = $u->number_of_posts;
     my $tagcount = scalar keys %{$u->tags};

Tags: akanashin, bml, holyandrew, livejournal
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