MyBB Community Forums

Full Version: Moving locked topics to bottom
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I tried this but that moves all the locked topics (even if they're sticky). I want the sticky ones to stay in their section.

Is there a mod or anything to do this?

Done it. It is a core edit.

forumdisplay.php
Find:
$query = $db->query("
		SELECT t.*, {$ratingadd}t.username AS threadusername, u.username
		FROM ".TABLE_PREFIX."threads t
		LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid = t.uid)
		WHERE t.fid='$fid' $tuseronly $tvisibleonly $datecutsql2
		ORDER BY  t.sticky DESC, {$t}{$sortfield} $sortordernow $sortfield2
		LIMIT $start, $perpage
	");

Replace with:
	$query = $db->query("
		SELECT t.*, {$ratingadd}t.username AS threadusername, u.username
		FROM ".TABLE_PREFIX."threads t
		LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid = t.uid)
		WHERE t.fid='$fid' $tuseronly $tvisibleonly $datecutsql2
		ORDER BY t.sticky DESC, t.closed ASC, {$t}{$sortfield} $sortordernow $sortfield2
		LIMIT $start, $perpage
	");