Log in

View Full Version : How To Hide Report Post Link From Certain Usergroups?


BENBOBBY
09-28-2009, 11:51 AM
Hi,

Probably an easy question, but cant seem to find an opition to hide the report post link from particular usergroups. I only want 4 usergroups to be able to report posts.

Or do I need to add some code to the postbit in order to do this?

Thanks.

Lynne
09-28-2009, 02:45 PM
This should help, just change the condition from the forumid to the usergroup id - Disable Post Report Link for a forum (https://vborg.vbsupport.ru/showthread.php?t=214226)

BENBOBBY
09-28-2009, 02:50 PM
Hi Lynne my saviour! I saw that thread already actually...just wondered if there was an offical way to do it from the usergroup options in AdminCP. I guess not!

Would it be something like:

if ($usergroup != '5,6,7')
{
$show['reportlink'] = false;
}

Is that the right syntax? How do you use OR opporators with vbulletin?

Lynne
09-28-2009, 03:39 PM
Probably....
if (is_member_of($vbulletin->userinfo, 5, 6, 7))
{
$show['reportlink'] = false;
}

BENBOBBY
09-28-2009, 05:43 PM
Thanks for the reply. Unfortuately that doesnt appear to work. :(

Should I try "usergroup" instead of "userinfo"?

snakes1100
09-28-2009, 05:48 PM
try:
usergroupid

Lynne
09-28-2009, 06:01 PM
Whoops.... you are using the postbit_display_complete hook, so try $this->registry->userinfo instead of $vbulletin->userinfo or even $vbulletin->userinfo['usergroupid'] instead... or even $this->registry->userinfo['usergroupid'].

BENBOBBY
09-29-2009, 09:47 AM
Thanks. That worked :)

ragtek
09-29-2009, 10:46 AM
as wrote in https://vborg.vbsupport.ru/showthread.php?t=214226 don't forget that this is not enought!
you could call the file direct;) report.php?p=1891910