MyBB Community Forums

Full Version: Ignore private forums posts and topics in index statistics
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello,
I've used phpBB for years now, but am interested in running a MyBB forum.

I use a custom bit of code for phpBB which allows me to make the private forums even more private.

The code stops the posts and topics in specified forums being counted in the index statistics, giving the illusion that there are no private forums - the way I like it!

Here is the code:
$sql = 'SELECT forum_id, forum_posts, forum_topics
        FROM ' . FORUMS_TABLE . '
        WHERE ' . $db->sql_in_set('forum_id', array(FORUM_ID, FORUM_ID2));
$result = $db->sql_query($sql);
$hidden_posts = 0;
$hidden_topics = 0;
while ($row = $db->sql_fetchrow($result))
{
    $hidden_posts += $row['forum_posts'];
    $hidden_topics += $row['forum_topics'];
}
$db->sql_freeresult($result);
$total_posts   = $config['num_posts'] - $hidden_posts;
$total_topics   = $config['num_topics'] - $hidden_topics;

Where you see "FORUM_ID, FORUM_ID2" is where you place each of the forum ID's of the forums you want ignored, separated by the comma.

My question:
Is this possible to achieve on MyBB. If so, could somebody point me in the right direction, please? I'm looking at getting the board started tomorrow, so it would be great to know this code, or a new code will do the trick.

Thanks

Anybody have any ideas?
MyBB reads the stats from cache so you either stop reading from cache and calculate the stats on the fly or change the way stats are calculated before they're cached: function update_stats in inc/functions.php
Hello,
I'm sorry but I'd have no idea how to go ahead doing this, would you know?
I do know. If you want to do it, you need to learn PHP or hire someone to alter it for you.
Hello,
So it wouldn't be something as easy as placing and altering the custom code. Is it something a support team member can help with?
I don't think so. It requires a re-write of that function I told you.
OK, how much in USD$ would you charge for this work? When complete is it likely to conflict with any plugins? I have a lot installed to my board.
Perfect, thank you Omar G.

In regards to post count, that's another issue I've thought about. Is there a way to disable the post count per forum?

Cheers

Oh, found it in the forum options.

Many thanks Smile