We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c88e857 commit 5f72d45Copy full SHA for 5f72d45
1 file changed
client/main.php
@@ -1,10 +1,11 @@
1
<?php
2
- // Float pinned posts to the top.
3
- // If they share a pinned/unpinned status, later post comes to the top.
4
- // Otherwise, force pinned post to the top.
+ // Sort the threads array so that pinned posts float to the top.
+ // If the threads share a pinned status (both pinned or both not),
+ // then the thread with the later creation time floats to the top.
5
+ // Otherwise, the pinned thread is forced to the top.
6
function pinned_sort($thread_a,$thread_b) {
- if ($thread_a["pinned"]==$thread_b["pinned"]) {
7
- return (($thread_a["created"]>$thread_b["created"])? -1 : 1);
+ if ($thread_a["pinned"] == $thread_b["pinned"]) {
8
+ return (($thread_a["created"]<$thread_b["created"]) ? 1 : -1);
9
}
10
if ($thread_a["pinned"]) {
11
return -1;
0 commit comments