vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin Tips & Tricks (https://vborg.vbsupport.ru/forumdisplay.php?f=239)
-   -   Disable Post Report Link for a forum (https://vborg.vbsupport.ru/showthread.php?t=214226)

Lynne 05-20-2009 10:00 PM

Disable Post Report Link for a forum
 
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
PHP Code:

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
PHP Code:

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 05-25-2009 04:00 PM

nice tips

thanks a lot

Arcade Fire 07-22-2009 04:14 PM

And...

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

How to be?

Thanks

Lynne 07-22-2009 09:57 PM

Quote:

Originally Posted by Arcade Fire (Post 1853622)
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 07-27-2009 02:27 PM

Thanks Lynne

Works fine!!

compfix 09-29-2009 12:07 AM

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 09-29-2009 01:17 AM

You could just use a standard redirect (report_start hook location):
PHP Code:

if ($vbulletin->userinfo['userid'] == x)
{
            
$vbulletin->url 'index.php?' $vbulletin->session->vars['sessionurl'];
            eval(
print_standard_redirect('Thank you for your report'falsetrue));


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

compfix 09-30-2009 11:40 PM

I put this in the report.php at this location
Code:

($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,+true));
}+

And I get an error when I test it.

Am I putting it in the correct location?


Thanks for your help

--------------- Added [DATE]1254362474[/DATE] at [TIME]1254362474[/TIME] ---------------

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

lm3a.net 12-04-2009 05:57 AM

it works great

thank u

M.C. 03-12-2015 07:07 PM

Sorry to lift it up... how to make it for several forums (for 4.2)?

PHP Code:

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

or

PHP Code:

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

don't seems to work :(


All times are GMT. The time now is 12:33 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01333 seconds
  • Memory Usage 1,744KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_code_printable
  • (5)bbcode_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete