Topic search results in reverse order
When searching the forums by topic, the search results are sorted from oldest to newest, which is not as useful as the reverse. They are sorted correctly (more intuitively) when searching by comment.
E.g. http://forums.zotero.org/search/?PostBackAction=Search&Keywords=chicago&Type=Topics&btnSubmit=Search (i didn't mess with the URL :-) )
E.g. http://forums.zotero.org/search/?PostBackAction=Search&Keywords=chicago&Type=Topics&btnSubmit=Search (i didn't mess with the URL :-) )
This is an old discussion that has not been active in a long time. Before commenting here, you should strongly consider starting a new discussion instead. If you think the content of this discussion is still relevant, you can link to it from your new discussion.
--- Vanilla.Class.DiscussionManager.php (revision 1103)
+++ Vanilla.Class.DiscussionManager.php (working copy)
@@ -328,9 +328,11 @@
if ($RowsPerPage > 0) $s->AddLimit($FirstRecord, $RowsPerPage+1);
if ($this->Context->Configuration['ENABLE_WHISPERS'] && $this->Context->Session->User->Permission('PERMISSION_VIEW_ALL_WHISPERS')) {
$s->AddOrderBy(array('DateLastWhisper', 'DateLastActive'), array('t','t'), 'desc', 'greatest', 'coalesce', ', 0');
+ } else if ($this->Context->Configuration['ENABLE_WHISPERS']) {
+ $this->GetDiscussionWhisperFilter($s);
+ $s->AddOrderBy(array('DateLastActive', 'DateLastActive', 'DateLastActive'), array('tuwt','tuwf','t'), 'desc', 'greatest', 'coalesce', ', 0');
} else {
- $this->GetDiscussionWhisperFilter($s);
- if ($this->Context->Configuration['ENABLE_WHISPERS']) $s->AddOrderBy(array('DateLastActive', 'DateLastActive', 'DateLastActive'), array('tuwt','tuwf','t'), 'desc', 'greatest', 'coalesce', ', 0');
+ $s->AddOrderBy('DateLastActive', 't', 'desc');
}
return $this->Context->Database->Select($s, $this->Name, 'GetDiscussionSearch', 'An error occurred while retrieving search results.');