MyBB Community Forums

Full Version: Can posts auto alphabetize?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Im using my forum as a source of artwork.
When posting, it will be done by full name and I wanted to know if no matter when the post is made, could it shift itself and alphabetize.

I have seen this done with Invision over at The Extensions Mirror when anyone posts an extension, but not sure if it a hack or already a setting.
Open forumdisplay.php and find
$query = $db->query("SELECT t.*, $ratingadd i.name AS iconname, i.path AS iconpath, t.username AS threadusername, u.username FROM ".TABLE_PREFIX."threads t LEFT JOIN ".TABLE_PREFIX."icons i ON (i.iid = t.icon) LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid = t.uid) WHERE t.fid='$fid' $visibleonly $datecutsql ORDER BY t.sticky DESC, $sortfield $sortordernow LIMIT $start, $perpage");
and replace with
// Begin t.subjectSort mod
if($fid == "1")
{
$query = $db->query("SELECT t.*, $ratingadd i.name AS iconname, i.path AS iconpath, t.username AS threadusername, u.username FROM ".TABLE_PREFIX."threads t LEFT JOIN ".TABLE_PREFIX."icons i ON (i.iid = t.icon) LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid = t.uid) WHERE t.fid='$fid' $visibleonly $datecutsql ORDER BY t.sticky DESC, t.subject ASC LIMIT $start, $perpage");
}
else
{
$query = $db->query("SELECT t.*, $ratingadd i.name AS iconname, i.path AS iconpath, t.username AS threadusername, u.username FROM ".TABLE_PREFIX."threads t LEFT JOIN ".TABLE_PREFIX."icons i ON (i.iid = t.icon) LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid = t.uid) WHERE t.fid='$fid' $visibleonly $datecutsql ORDER BY t.sticky DESC, $sortfield $sortordernow LIMIT $start, $perpage");
}
// End t.subjectSort mod
and change if($fid == "1") to the forum id that you want to sort alphabeticly!

I had made this mod for MyBB RC4, and the code above is adapted for PR2, but I havn't actually packaged yet. I will soon.
EXCELENT!
Thanks a bunch.This will be such a big help for me.

Is it possible to add a few forums to that?
Im not all that good at PHP, so guessing
if($fid == "4")
could be set
if($fid == "4,5,9")

?