holyandrew� (holyandrew) wrote in changelog,
holyandrew�
holyandrew
changelog

[ljcom] r12010: LJSUP-12323: Display entries only from u...

Committer: akanashin
LJSUP-12323: Display entries only from users with social capital more than 10
U   trunk/htdocs/stats/latest.bml
Modified: trunk/htdocs/stats/latest.bml
===================================================================
--- trunk/htdocs/stats/latest.bml	2012-05-25 09:00:23 UTC (rev 12009)
+++ trunk/htdocs/stats/latest.bml	2012-05-25 10:52:10 UTC (rev 12010)
@@ -61,22 +61,17 @@
 
         ## Display entries only from users with social capital more than 10
         my $u = LJ::load_userid($p->{journalid});
-        my $position = LJ::PersonalStats::DB->fetch_raw('ratings', {
-            func => 'get_authority',
-            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,
-        });
+        if ($u) {
+            my $position = LJ::PersonalStats::DB->fetch_raw('get_authority', {journal_id => $u->userid});
 
-        my $soc_capital = 0;
-        if (ref $position eq 'HASH') {
-                $soc_capital = int($position->{result}->{value}/1000);
-        } 
+            my $soc_capital = 0;
+            if (ref $position eq 'HASH') {
+                $soc_capital = int($position->{result}->{authority}/1000);
+            } 
         
-        next if $soc_capital < 10; 
-
+            next if $soc_capital < 10; 
+        }
+        
         my $url = LJ::journal_base($uj) . "/$p->{'ditemid'}.html";
         my ($subject, $body) = @{$rawposts->{text}{$id}};
 

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