1
0
mirror of https://github.com/php/web-php.git synced 2026-03-24 07:12:16 +01:00

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

This commit is contained in:
Sherif Ramadan
2012-12-13 22:20:44 -05:00
parent d2524744a9
commit 1341f83e1d

View File

@@ -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;
}
}
}
}