MyBB Community Forums

Full Version: A way to tweak order of forums in a category?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi, I want to change order of forums in one category by their number of posts in each forum.
If there isn't a plugin for this, which file should I modify for this? Thanks!
There is no plugin for this, but I suppose you would need to edit or hijack (with a plugin) every place where build_forumbits() is called.

I think there are two places, the index.pgp and forumdisplay.php files. Modify the forum chache built for the function to use, like in the following line:
https://github.com/mybb/mybb/blob/4ae73b...x.php#L405
$fcache[$forum['pid']][$forum['disporder']][$forum['fid']] = $forum;

Should probably something along the lines of:
$fcache[$forum['pid']][$forum['posts']][$forum['fid']] = $forum;

But $forum['posts'] doesn't take into account subforums count, I personally dislike and don't recommend using subforums.

There is at least another place where forums are build, the user control panel forum subscription page, but I'm unsure about how that is built and why it doesn't uses the same function as other places. But I suppose you can do without that or similar places.
Thank you very much!