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

[livejournal] r17766: LJSUP-7415. incorrect navigation

Committer: gprochaev
LJSUP-7415. incorrect navigation

U   trunk/cgi-bin/LJ/Widget/Browse.pm
Modified: trunk/cgi-bin/LJ/Widget/Browse.pm
===================================================================
--- trunk/cgi-bin/LJ/Widget/Browse.pm	2010-11-24 07:19:49 UTC (rev 17765)
+++ trunk/cgi-bin/LJ/Widget/Browse.pm	2010-11-24 07:25:08 UTC (rev 17766)
@@ -257,7 +257,8 @@
 
     # post paging: first, previouse, next, last pages.
     my ($post_page_first, $post_page_prev, $post_page_next, $post_page_last) = 4 x 0;
-    my $post_pages = int($post_count / $post_page_size) + 1;
+    my $post_pages = int($post_count / $post_page_size);
+    $post_pages += 1 if $post_count % $post_page_size;
     $post_page = 1 unless $post_page;
     if($post_page > 1) {
         $post_page_first = 1;
@@ -272,7 +273,8 @@
 
     # paging: first, previouse, next, last pages.
     my ($page_first, $page_prev, $page_next, $page_last) = 4 x 0;
-    my $pages = int($count / $page_size) + 1;
+    my $pages = int($count / $page_size);
+    $pages += 1 if $count % $page_size;
     $page = 1 unless $page;
     if($page > 1) {
         $page_first = 1;

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