Simple Machines Community Forum

Customizing SMF => SMF Coding Discussion => Topic started by: Kris on April 13, 2004, 11:38:53 AM

Title: Sorting topics on last post but locked topics on the bottom
Post by: Kris on April 13, 2004, 11:38:53 AM
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.
Title: Re: Sorting topics on last post but locked topics on the bottom
Post by: Chris Cromer on April 13, 2004, 12:14:07 PM
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' . "
Title: Re: Sorting topics on last post but locked topics on the bottom
Post by: Kris on April 13, 2004, 12:44:03 PM
Chris,

Don't see any difference in the display...  ???
Title: Re: Sorting topics on last post but locked topics on the bottom
Post by: Chris Cromer on April 13, 2004, 01:14:15 PM
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.
Title: Re: Sorting topics on last post but locked topics on the bottom
Post by: Kris on April 14, 2004, 03:06:52 AM
Chris,

Will test tonight when I can access the code ;)
Thanks!
Title: Re: Sorting topics on last post but locked topics on the bottom
Post by: Kris on April 14, 2004, 01:04:11 PM
Quote from: Kris on April 14, 2004, 03:06:52 AM
Chris,

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

And works :)