madeon (madeon) wrote in changelog,
madeon
madeon
changelog

[livejournal] r20412: LJSUP-9999: Usual posts probles are solv...

Committer: sbelyaev
LJSUP-9999: Usual posts probles are solved.
U   trunk/cgi-bin/LJ/S2/RecentPage.pm
Modified: trunk/cgi-bin/LJ/S2/RecentPage.pm
===================================================================
--- trunk/cgi-bin/LJ/S2/RecentPage.pm	2011-10-24 08:58:52 UTC (rev 20411)
+++ trunk/cgi-bin/LJ/S2/RecentPage.pm	2011-10-24 09:34:07 UTC (rev 20412)
@@ -75,11 +75,17 @@
     
     # calculate recent entries count
     my $has_sticky = $u->has_sticky_entry;
-    my $delayed_entries_count = LJ::DelayedEntry->get_entries_count($u);
-    my $usual_skip =  $delayed_entries_count - $skip > $itemshow ? 
-                                            $skip - $delayed_entries_count + $has_sticky :
-                                            $skip ? $skip : 0;
+    my $delayed_entries_count = 0;
+    my $usual_skip = $skip;     
+
     if (LJ::is_enabled("delayed_entries")) {
+        $delayed_entries_count = LJ::DelayedEntry->get_entries_count($u);
+        $usual_skip -= $delayed_entries_count;
+
+        if ($usual_skip < 0 ) {
+            $usual_skip = $skip ? $has_sticky : 0;
+        }
+
         if (!$skip) {
             $delayed_entries = LJ::DelayedEntry->get_entries_by_journal($u, $skip, $itemshow - $has_sticky);
         } elsif ( $skip) {

Tags: livejournal, madeon, pm, sbelyaev
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