By following these edits, the locked and moved topics will move to the bottom of the topiclist.
OPEN:
viewforum.php
FIND:
Code: Select all
// Grab just the sorted topic ids
$sql = SELECT t.topic_id
ADD AFTER (in-line):
Code: Select all
, t.topic_status
FIND:
Code: Select all
while ($row = $db->sql_fetchrow($result))
{
$topic_list[] = (int) $row['topic_id'];
}
REPLACE WITH:
Code: Select all
$closed_topics = $move_topics = array();
while ($row = $db->sql_fetchrow($result))
{
if ( $row['topic_status'] == ITEM_MOVED )
{
$move_topics[] = (int) $row['topic_id'];
}
elseif ( $row['topic_status'] == ITEM_LOCKED )
{
$closed_topics[] = (int) $row['topic_id'];
}
else
{
$topic_list[] = (int) $row['topic_id'];
}
}
$topic_list = array_merge($topic_list, $move_topics, $closed_topics);
To hold the moved topics, and let the closed ones only go to the bottom of the topiclist, use the following code (you should follow the code steps, and use the code below instead of the last "Replace With")
Code: Select all
$closed_topics = array();
while ($row = $db->sql_fetchrow($result))
{
if ( $row['topic_status'] == ITEM_LOCKED )
{
$closed_topics[] = (int) $row['topic_id'];
}
else
{
$topic_list[] = (int) $row['topic_id'];
}
}
$topic_list = array_merge($topic_list, $closed_topics);