Commit:    cd6db536b08a4f70cc43c9bf30e4262dd82722a3
Author:    Sherif Ramadan <[email protected]>         Thu, 13 Dec 2012 22:20:44 
-0500
Parents:   91f6bf75c16bd4ef12e0fd49f476b0a4cf0eb903
Branches:  master

Link:       
http://git.php.net/?p=web/php.git;a=commitdiff;h=cd6db536b08a4f70cc43c9bf30e4262dd82722a3

Log:
Updated the notes sorting function. Enhanced sorting results based on multiple 
criteria.

Changed paths:
  M  include/shared-manual.inc


Diff:
diff --git a/include/shared-manual.inc b/include/shared-manual.inc
index 8058c4e..75c0ec2 100644
--- a/include/shared-manual.inc
+++ b/include/shared-manual.inc
@@ -701,16 +701,24 @@ function manual_notes_sort($a, $b)
                if ($voteA === 0 && $c === 1 && $voteB <= 0.30 && $d >= 4) 
return -1;
                return 1;
        }
-       // Votes of equal amounts are sorted in descending order by date
+       // Votes of equal amounts are sorted based on the overall rating and in 
descending order by date
        else {
-               if ($a['xwhen'] > $b['xwhen']) {
-                       return -1;
+               if ($c > $d) {
+                 return -1;
                }
-               elseif ($a['xwhen'] < $b['xwhen']) {
-                       return 1;
+               elseif ($c < $d) {
+                 return 1;
                }
                else {
-                       return 0;
+                       if ($a['xwhen'] > $b['xwhen']) {
+                               return -1;
+                       }
+                       elseif ($a['xwhen'] < $b['xwhen']) {
+                               return 1;
+                       }
+                       else {
+                               return 0;
+                       }
                }
        }
 }


--
PHP Webmaster List Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to