holyandrew (holyandrew) wrote in changelog,
holyandrew
holyandrew
changelog

[ljcom] r12009: 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:02 UTC (rev 12008)
+++ trunk/htdocs/stats/latest.bml	2012-05-25 09:00:23 UTC (rev 12009)
@@ -59,6 +59,24 @@
         # this sucks, but we can't load users here.
         next if $rawposts->{prop}{$id}{unknown8bit};
 
+        ## 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,
+        });
+
+        my $soc_capital = 0;
+        if (ref $position eq 'HASH') {
+                $soc_capital = int($position->{result}->{value}/1000);
+        } 
+        
+        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