holyandrew (holyandrew) wrote in changelog,
holyandrew
holyandrew
changelog

[livejournal] r22073: LJSUP-12319: We need to display social c...

Committer: akanashin
LJSUP-12319: We need to display social capital for users which turn off Ratings
U   trunk/htdocs/tools/endpoints/ctxpopup.bml
Modified: trunk/htdocs/tools/endpoints/ctxpopup.bml
===================================================================
--- trunk/htdocs/tools/endpoints/ctxpopup.bml	2012-05-28 06:35:36 UTC (rev 22072)
+++ trunk/htdocs/tools/endpoints/ctxpopup.bml	2012-05-28 07:16:27 UTC (rev 22073)
@@ -123,13 +123,22 @@
         my ($position, $first, $soc_capital);
 
         $position = LJ::PersonalStats::DB->fetch_raw('ratings', {
+            func => 'get_value',
+            what => $u->journaltype eq 'C' ? 'communities' : 'users',
+            journal_id => $u->userid,
+            by => 'friends_weight',
+            type => 0,
+            sup =>  LJ::SUP->is_sup_enabled($u) ? 1 : 0,
+        });
+
+        $soc_capital = LJ::PersonalStats::DB->fetch_raw('ratings', {
             func => 'get_authority',
             journal_id => $u->userid,
         });
 
-        if (ref $position eq 'HASH') {
+        if (ref $position eq 'HASH' && ( $u->journaltype eq 'C' || LJ::SUP->is_sup_enabled($u) )) {
             $first = $position->{result}->{position}!=0 ? 0 : 1;
-            $soc_capital = int($position->{result}->{authority}/1000);
+            $soc_capital = int($soc_capital->{result}->{authority}/1000);
             $soc_capital = $soc_capital < 10 ? BML::ml('.social_capital_less_that') : LJ::commafy($soc_capital);
 
             $ret{first}  = $first; 

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