Sorting topics on last post but locked topics on the bottom

Started by Kris, April 13, 2004, 11:38:53 AM

Previous topic - Next topic

Kris

What do I alter in the query in MessageIndex.php ?

I'd like to get the topiclist like default but with the locked topics all down at the end of the page.

Chris Cromer

Open MessageIndex.php and look for:
ORDER BY
" . (!empty($modSettings['enableStickyTopics']) ? 't.isSticky' . ($fake_ascending ? '' : ' DESC') . ',
' : '') . $_REQUEST['sort'] . ($ascending ? '' : ' DESC') . "


and replace it with this:
ORDER BY
" . (!empty($modSettings['enableStickyTopics']) ? 't.isSticky' . ($fake_ascending ? '' : ' DESC') . ',
' : '') . $_REQUEST['sort'] . ($ascending ? '' : ' DESC') . ',
t.locked ASC' . "
Chris Cromer

"I was here, here I was, was I here, sure I was" - The little voice in my head.

Kris


Chris Cromer

Found the problem, replace it with this instead:
ORDER BY
" . (!empty($modSettings['enableStickyTopics']) ? 't.isSticky' . ($fake_ascending ? '' : ' DESC') . ',
t.locked ASC,
' : '') . $_REQUEST['sort'] . ($ascending ? '' : ' DESC') . "


And this time it's tested to work.
Chris Cromer

"I was here, here I was, was I here, sure I was" - The little voice in my head.

Kris

Chris,

Will test tonight when I can access the code ;)
Thanks!

Kris


Advertisement: