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:
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user