holyandrew (holyandrew) wrote in changelog,
holyandrew
holyandrew
changelog

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

Committer: akanashin
LJSUP-12323: Display entries only from users with social capital more than 10
U   trunk/cgi-bin/ljcom.pl
U   trunk/htdocs/stats/latest.bml
Modified: trunk/cgi-bin/ljcom.pl
===================================================================
--- trunk/cgi-bin/ljcom.pl	2012-05-25 13:15:58 UTC (rev 12014)
+++ trunk/cgi-bin/ljcom.pl	2012-05-28 06:50:19 UTC (rev 12015)
@@ -1092,16 +1092,25 @@
         ));
     }
 
-    push @$joblist, TheSchwartz::Job->new_from_array("LJ::Worker::LatestPosts", {
-        'timepost' => time(),
-        'journalid' => $uo->{'userid'},
-        'posterid' => $up->{'userid'},
-        'itemid' => $arg->{'itemid'},
-        'anum' => $arg->{'anum'},
-        'security' => $security,
-        'img' => $img,
-        'taglist' => $arg->{'props'}->{'taglist'},
-    });
+    ## Display latest entries only from users with social capital more than 10
+    my $position = LJ::PersonalStats::DB->fetch_raw('ratings', { func => 'get_authority', journal_id => $up->{'userid'}});
+    my $soc_capital = 0;
+    if (ref $position eq 'HASH') {
+        $soc_capital = int($position->{result}->{authority}/1000);
+    } 
+    
+    if ($soc_capital > 10) { 
+        push @$joblist, TheSchwartz::Job->new_from_array("LJ::Worker::LatestPosts", {
+            'timepost' => time(),
+            'journalid' => $uo->{'userid'},
+            'posterid' => $up->{'userid'},
+            'itemid' => $arg->{'itemid'},
+            'anum' => $arg->{'anum'},
+            'security' => $security,
+            'img' => $img,
+            'taglist' => $arg->{'props'}->{'taglist'},
+        });
+    }
 
     if ($security eq "public") {
         push @$joblist, TheSchwartz::Job->new_from_array("LJ::Worker::AtomStreamInject", {

Modified: trunk/htdocs/stats/latest.bml
===================================================================
--- trunk/htdocs/stats/latest.bml	2012-05-25 13:15:58 UTC (rev 12014)
+++ trunk/htdocs/stats/latest.bml	2012-05-28 06:50:19 UTC (rev 12015)
@@ -59,19 +59,6 @@
         # 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->{journalu}->{userid});
-        if ($u) {
-            my $position = LJ::PersonalStats::DB->fetch_raw('ratings', { func => 'get_authority', journal_id => $u->userid});
-
-            my $soc_capital = 0;
-            if (ref $position eq 'HASH') {
-                $soc_capital = int($position->{result}->{authority}/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, pl
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