fix for prev/next for those poor souls not using server side sorting. Just because...
authorjmunro <jmunro@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Sun, 6 Oct 2002 23:29:14 +0000 (23:29 +0000)
committerjmunro <jmunro@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Sun, 6 Oct 2002 23:29:14 +0000 (23:29 +0000)
git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@3781 7612ce4b-ef26-0410-bec9-ea0150e637f0

src/read_body.php

index d9a7fbe7904df7ba2a646b691e4b52dc75091890..fca049e62e2b156e4bbfd443db85bf9e3b232bea 100644 (file)
@@ -52,20 +52,14 @@ function findNextMessage($passed_id) {
             }
         }
     } else {
-        if ($sort == 6) {
-            if ($passed_id != 1) {
-                $result = $passed_id - 1;
-            }
-        } else {
-            if (is_array($msort)) {
-                for (reset($msort); ($key = key($msort)), (isset($key)); next($msort)) {
-                    if ($passed_id == $msgs[$key]['ID']) {
-                        next($msort);
-                        $key = key($msort);
-                        if (isset($key)){
-                            $result = $msgs[$key]['ID'];
-                            break;
-                        }
+        if (is_array($msort)) {
+            for (reset($msort); ($key = key($msort)), (isset($key)); next($msort)) {
+                if ($passed_id == $msgs[$key]['ID']) {
+                    next($msort);
+                    $key = key($msort);
+                    if (isset($key)){
+                        $result = $msgs[$key]['ID'];
+                        break;
                     }
                 }
             }
@@ -95,21 +89,14 @@ function findPreviousMessage($numMessages, $passed_id) {
             }
         }
     } else {
-        if ($sort == 6) {
-            if ($passed_id != $numMessages) {
-                $result = $passed_id + 1;
-            }
-        } else {
-            if (is_array($msort)) {
-                for (reset($msort); ($key = key($msort)), (isset($key)); next($msort)) {
-                    if ($passed_id == $msgs[$key]['ID']) {
-                        prev($msort);
-                        $key = key($msort);
-                        if (isset($key)) {
-                            //echo $msort[$key];   /* Why again were we echoing here? */
-                            $result = $msgs[$key]['ID'];
-                            break;
-                        }
+        if (is_array($msort)) {
+            for (reset($msort); ($key = key($msort)), (isset($key)); next($msort)) {
+                if ($passed_id == $msgs[$key]['ID']) {
+                    prev($msort);
+                    $key = key($msort);
+                    if (isset($key)) {
+                        $result = $msgs[$key]['ID'];
+                        break;
                     }
                 }
             }