Committer: akanashin
LJSUP-12323: Display entries only from users with social capital more than 10U 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}};