PDA

View Full Version : Disable Post Report Link for a forum


Lynne
21 May 2009, 21:17
If you want to NOT show the Post Report Link in one forum, forumid 'x', then you can write a simple plugin (change 'x' to be the forumid):

hook_location: postbit_display_complete
if ($this->forum['forumid'] == 'x')
{
$show['reportlink'] = false;
}That code will simply not show the link. However, if your users are smart enough to figure out the url to the report.php page and add in the post id, they will still be able to report it. So, to completely disable reporting in that forum, you may also add another plugin (change 'x' to be the forumid):

hook_location: report_start
if ($threadinfo['forumid'] == 'x')
{
print_no_permission();
}You could actually only add the second plugin and then the link to report the post will be there, but the user will get the No Permission message upon clicking it.

Come2Daddy
25 May 2009, 18:00
nice tips

thanks a lot

Arcade Fire
22 Jul 2009, 18:14
And...

Disable Post Report Link for a user, based on ['userid']...

How to be?

Thanks

Lynne
22 Jul 2009, 23:57
And...

Disable Post Report Link for a user, based on ['userid']...

How to be?

Thanks
You can try changing the condition to if ($vbulletin->userinfo['userid'] == x) instead. Try it on a test site and see.

Arcade Fire
27 Jul 2009, 16:27
Thanks Lynne

Works fine!!

compfix
29 Sep 2009, 02:07
This works great and thanks for the tip. I have one user who seems to want to use the 'report a post' to just to irk our mods. What I'd like to do is this:

if this person tries to report a post, I simply want it to go right back to the forum home page - 'not 'print no permission' message.


Do you have any suggestions.


Thanks


Rich

Lynne
29 Sep 2009, 03:17
You could just use a standard redirect (report_start hook location):
if ($vbulletin->userinfo['userid'] == x)
{
$vbulletin->url = 'index.php?' . $vbulletin->session->vars['sessionurl'];
eval(print_standard_redirect('Thank you for your report', false, true));
}

Change x to the userid of the user and then change 'Thank you for your report' to whatever redirect message you want displayed.

compfix
01 Oct 2009, 01:40
I put this in the report.php at this location

($hook = vBulletinHook::fetch_hook('report_start')) ? eval($hook) : false;
if+($vbulletin->userinfo['UserID'])+== 2637)
{
++++++++++++$vbulletin->url+=+'forum/index.php?'+.+$vbulletin->session->vars['sessionurl'];
++++++++++++eval(print_standard_redirect('Thank+you+for+your+report',+false,+tru e));
}+


And I get an error when I test it.

Am I putting it in the correct location?


Thanks for your help

--------------- Added 1254362474 at 1254362474 ---------------

disregard - I figured it out.. thanks for your help!

lm3a.net
04 Dec 2009, 07:57
it works great

thank u

M.C.
12 Mar 2015, 21:07
Sorry to lift it up... how to make it for several forums (for 4.2)?

if (in_array($foruminfo['forumid'], array(1,2,3)))

or

if (in_array($vbulletin->forum['forumid'], array(1,2,3)))

don't seems to work :(

Lynne
12 Mar 2015, 23:37
Sorry to lift it up... how to make it for several forums (for 4.2)?

if (in_array($foruminfo['forumid'], array(1,2,3)))

or

if (in_array($vbulletin->forum['forumid'], array(1,2,3)))

don't seems to work :(
You need to use the variable I used in the original post regarding this (for hook location postbit_display_complete), $this->forum['forumid']

if (in_array($this->forum['forumid'] , array(1,2,3)))