wisest owl (wisest_owl) wrote in changelog,
wisest owl
wisest_owl
changelog

[livejournal] r19287: LJSUP-9102. Minor fixes

Committer: gprochaev
LJSUP-9102. Minor fixes

U   trunk/cgi-bin/LJ/Browse.pm
Modified: trunk/cgi-bin/LJ/Browse.pm
===================================================================
--- trunk/cgi-bin/LJ/Browse.pm	2011-06-15 08:04:51 UTC (rev 19286)
+++ trunk/cgi-bin/LJ/Browse.pm	2011-06-15 08:06:10 UTC (rev 19287)
@@ -984,15 +984,16 @@
 
         ## Load found posts ordered by timecreate
         my @found_posts = ();
+        my %comms_hash = map { $_ => 1 } @$comms;
         foreach my $post (@$posts) {
-            next unless grep { $post->{journalid} eq $_ } @$comms;
+            next unless $comms_hash{$post->{journalid}};
             my $post_ids = $dbh->selectall_arrayref (
-                "SELECT journalid, jitemid, UNIX_TIMESTAMP(timecreate) AS timecreate
+                "SELECT journalid, jitemid, UNIX_TIMESTAMP(timecreate) AS timecreate_unix
                     FROM category_recent_posts 
                     WHERE journalid = ? 
                         AND jitemid = ? 
                         AND is_deleted = 0 
-                    LIMIT $limit", 
+                    ", 
                 { Slice => {} }, $post->{journalid}, $post->{jitemid}
             );
             push @found_posts, @$post_ids if $post_ids;
@@ -1009,7 +1010,7 @@
             }
             map { LJ::Entry->new ($_->{journalid}, jitemid => $_->{jitemid}) }      ## Create LJ::Entry object
             grep { $_->{journalid} }                                                ## remove SEO posts
-            sort { $b->{'timecreate'} <=> $a->{'timecreate'} }
+            sort { $b->{'timecreate_unix'} <=> $a->{'timecreate_unix'} }
             @found_posts;
     } else {
         if ($comm_list) {

Tags: livejournal, pm, wisest-owl
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