MyBB Community Forums

Full Version: Show unmoderated posts / threads in header?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Example:

User CP Mod CP (1) (4)

So I don't have to click Mod CP when I visit the site to check for new moderated posts if none exist.

And when clicking on a number, have it lead directly to moderation queue as opposed to Mod CP home.

Possible?
Yes, I have a plugin that does this - it is configured for only admins though.

You need to put <!--unapp--> where you want the span to show.
How to mod this so it includes other usergroups? I've Googled for the appropriate syntax, but no dice. Maybe my search semantics are off.

if($mybb->user['usergroup']==4)
which user groups did you want? You could try this:

if($mybb->usergroup['canmodcp'] == 1)
Basically I want to be able to say

if($mybb->user['usergroup']==4) . But include another GID in there.

Example:

if($mybb->user['usergroup']==4 or ==3 or ==2) but obviously that syntax isn't correct. I feel sorry for PHP newbies (myself). I thought this is a simple question, but Google is useless. Maybe I'm using incorrect semantics when searching.

Okay. Your above solution worked fine, but still interested in the syntax for this.

I have another issue though. It's showing unmoderated (1) | (0), but there are no unmoderated posts or threads. I have recently done a rebuild/recount as well. Is this plugin using {$unapproved_posts} and {$unapproved_threads} for the numbers?

EDIT: Hmmm... Okay. I see it is. Very strange.

Hmm... interesting. I did another count rebuild and it seems to have cleared up. Prior to this, if clicking Mod CP, it would show 'nothing in mod queue', but the counter from the plugin was showing (1) | (0)
so is it all working for you?

Your code could be
if($mybb->user['usergroup']==4 || $mybb->user['usergroup']==3)

But that wont take additional groups into account. Neither will canmodcp as far as I know.
It's working except that I needed to recount and rebuild to get it to not show (1) | (0), which is odd because in ModCP home, it said nothing waiting to be moderated... Seems they use the same variables (your plugin and modCP)... It's why I find it odd.

What do you mean it wont take additional groups into account? Can you explain that further? if canmodcp=1 seems to be working (users without modcp access are not seeing the (3) | (2), but users who have the authorization are seeing it)
What I mean is, that if a user has a (Primary) usergroup of member and an additional usergroup of admin or moderator it probably wont show for them, because it is based on usergroup (Primary), not additional usergroups.

Not tested for that of course. I just made this plugin for my personal use rather than for distribution (hence no release thread etc) and shared it with you because you asked about it.
Okay. Great. Now I understand. Well the users who need it have primary group as Super Mod.. Thanks for this. It's excellent. Will save me at least 30 clicks a day Smile

Now just need to add the call to GoMobile.