PDA

View Full Version : Mini Mods - Hide Infraction Link For Moderators If They Are Not Moderating The Forum


orban
08-14-2006, 10:00 PM
Create a new plugin:

Product: vBulletin
Hook Location: postbit_display_complete
Title: Hide Infraction Link For Moderators If They Are Not Moderating The Forum
Execution Order: 5
Plugin PHP Code:
if ($this->registry->userinfo['permissions']['usergroupid'] == 7 AND !can_moderate($this->thread['forumid']))
{
$show['infractionlink'] = false;
} Plugin is Active: Yes

That's it.


You might want to adjust the 7 if your moderator usergroup id isn't 7.

Note that this only hides the link and doesn't prevent them manually going to the URL.

y2krazy
08-15-2006, 10:00 PM
<font color="red">*y2krazy clicks install.</font>

orban
08-15-2006, 10:01 PM
Really weird this isn't build it, makes absolutely no sense to be honest.

BCC
08-16-2006, 06:19 AM
/me Clicks Install

Thanks, Cant this Be Built? and Uploaded as an .xml File?

orban
08-16-2006, 06:24 AM
Added an .xml file. I thought because it's so small there's no need for one, but oh well. :D

cynix2
08-16-2006, 03:47 PM
hey i made this
https://vborg.vbsupport.ru/showthread.php?t=124125
cuz i was trying for the same thing you are
hope you dont mind that i borrowed your plugin, if you'd like i'll list you as a co-writer/supporter

orban
08-16-2006, 03:51 PM
Sure, I don't mind.

Great spot, didn't look quite in it, because I trust my mods, but they were just annoyed by the button in every post (so I removed that one).

cynix2
08-16-2006, 05:25 PM
my mods are a little power hungry

Paul M
08-16-2006, 06:16 PM
Why do you have the usergroup test in there ?

Acido
08-17-2006, 05:00 AM
This is not working if the user have Moderator as additional usergroup. Please, can you help me with code for "is member of" or something like?
I can't get the correct sentence.

Thanx!

orban
08-17-2006, 08:27 AM
You can probably leave it out, now that I think about it.

Just go with

if (!can_moderate($this->thread['forumid']))
{
$show['infractionlink'] = false;
}

Acido
08-17-2006, 08:41 AM
You can probably leave it out, now that I think about it.

Just go with

if (!can_moderate($this->thread['forumid']))
{
$show['infractionlink'] = false;
}

That work's perfect to my needs.
Big thanx!:)

cynix2
08-17-2006, 07:39 PM
yeah i left it out for the product i released, it should also check additional usergroups