MyBB Central

Full Version: Label a forum private?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi guys,

Looking for a hack or some help to get this sorted.

I need a forum to be labelled "private" for certain usergroups. I know I can block people from viewing a forum once they click on it, but I actually want it labelled "private" in the forum index view.

You can see the original thread here

If anyone can help me out with this, it would be very handy.
I believe you do this by setting the "can view threads" to no. You just need to find the right permissions in mybb.
Ya that will effectively block them from viewing threads, but it doesnt label the forum, check out the link posted and the image I posted at the start. In VBulletin you can display "Private" in the "Last Post" column. Thats what I need. If a forum is private for certain usergroups. They shouldnt be able to see the title of posts, and username of people posting in it....Always thought that was a bit strange.
This can't be done as far as I can see without a core file change.

Inside inc/function_forumlist.php

Find this:
Code:
            // This forum has a password, and the user isn't authenticated with it - hide post information
            $hideinfo = false;
            if($forum['password'] != '' && $mybb->cookies['forumpass'][$forum['fid']] != md5($mybb->user['uid'].$forum['password']))
            {
                $hideinfo = true;
            }
Change to this:

Code:
            // This forum has a password, and the user isn't authenticated with it - hide post information
            $hideinfo = false;
            if($forum['password'] != '' && $mybb->cookies['forumpass'][$forum['fid']] != md5($mybb->user['uid'].$forum['password']) || $permissions['canviewthreads'] !=1)
            {
                $hideinfo = true;
            }
Hi Labrocca, that got me close Smile

Now it looks like...

[Image: columndisplay.jpg]

What im after is something along the lines of..

[Image: columndisplay2.jpg]

I think we are really close, just need to modify the output.

I appreciate your help with this.
Well I made a bug report about this at Mybb and they took my fix for next release.

So your additional changes won't fly.
Not sure what you mean? How is this a bug?
Because "canviewthreads" should disable the viewing of threads for users without permissions including the titles. Like I said...I make a bug report. They fixed it for next update. That's the best I can do for you.