Fix for paginator, 1 * 0.75 evaluates as 0. 1 * 3/4 evaluates as 0.75
authorstekkel <stekkel@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Wed, 1 Oct 2003 16:40:15 +0000 (16:40 +0000)
committerstekkel <stekkel@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Wed, 1 Oct 2003 16:40:15 +0000 (16:40 +0000)
git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@5817 7612ce4b-ef26-0410-bec9-ea0150e637f0

functions/mailbox_display.php

index c15e3bea4e5f857cfb42e5038641e7842401914c..aad15500edb990ca36078edc489672e2a3bf5ea8 100644 (file)
@@ -1108,8 +1108,8 @@ function get_paginator_str($box, $start_msg, $end_msg, $num_msgs,
             /* Adjust if the first and second quarters intersect. */
             } else if (($cur_pg - $q2_pgs - ceil($q2_pgs/3)) <= $q1_pgs) {
                 $extra_pgs = $q2_pgs;
-                $extra_pgs -= ceil(($cur_pg - $q1_pgs - 1) * 0.75);
-                $q2_pgs = ceil(($cur_pg - $q1_pgs - 1) * 0.75);
+                $extra_pgs -= ceil(($cur_pg - $q1_pgs - 1) * 3/4);
+                $q2_pgs = ceil(($cur_pg - $q1_pgs - 1) * 3/4);
                 $q3_pgs += ceil($extra_pgs / 2);
                 $q4_pgs += floor($extra_pgs / 2);
 
@@ -1124,8 +1124,8 @@ function get_paginator_str($box, $start_msg, $end_msg, $num_msgs,
             /* Adjust if the third and fourth quarter intersect. */
             } else if (($cur_pg + $q3_pgs + 1) >= ($tot_pgs - $q4_pgs + 1)) {
                 $extra_pgs = $q3_pgs;
-                $extra_pgs -= ceil(($tot_pgs - $cur_pg - $q4_pgs) * 0.75);
-                $q3_pgs = ceil(($tot_pgs - $cur_pg - $q4_pgs) * 0.75);
+                $extra_pgs -= ceil(($tot_pgs - $cur_pg - $q4_pgs) * 3/4);
+                $q3_pgs = ceil(($tot_pgs - $cur_pg - $q4_pgs) * 3/4);
                 $q1_pgs += floor($extra_pgs / 2);
                 $q2_pgs += ceil($extra_pgs / 2);
             }