Go Back   vb.org Archive > vBulletin Article Depository > Read An Article > vBulletin Tips & Tricks
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Disable Post Report Link for a forum
Lynne's Avatar
Lynne
Join Date: Sep 2004
Posts: 41,180

 

California/Idaho
Show Printable Version Email this Page Subscription
Lynne Lynne is offline 05-20-2009, 10:00 PM

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.
Reply With Quote
  #2  
Old 05-25-2009, 04:00 PM
Come2Daddy Come2Daddy is offline
 
Join Date: May 2008
Posts: 128
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

nice tips

thanks a lot
Reply With Quote
  #3  
Old 07-22-2009, 04:14 PM
Arcade Fire's Avatar
Arcade Fire Arcade Fire is offline
 
Join Date: May 2008
Location: Menorca, Spain
Posts: 132
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

And...

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

How to be?

Thanks
Reply With Quote
  #4  
Old 07-22-2009, 09:57 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Arcade Fire View Post
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.
Reply With Quote
  #5  
Old 07-27-2009, 02:27 PM
Arcade Fire's Avatar
Arcade Fire Arcade Fire is offline
 
Join Date: May 2008
Location: Menorca, Spain
Posts: 132
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks Lynne

Works fine!!
Reply With Quote
  #6  
Old 09-29-2009, 12:07 AM
compfix compfix is offline
 
Join Date: Apr 2007
Posts: 4
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #7  
Old 09-29-2009, 01:17 AM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #8  
Old 09-30-2009, 11:40 PM
compfix compfix is offline
 
Join Date: Apr 2007
Posts: 4
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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!
Reply With Quote
  #9  
Old 12-04-2009, 05:57 AM
lm3a.net's Avatar
lm3a.net lm3a.net is offline
 
Join Date: May 2009
Posts: 134
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

it works great

thank u
Reply With Quote
  #10  
Old 03-12-2015, 07:07 PM
M.C. M.C. is offline
 
Join Date: Jan 2002
Posts: 463
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 06:26 AM.


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.04442 seconds
  • Memory Usage 2,299KB
  • Queries Executed 23 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)bbcode_code
  • (5)bbcode_php
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_article
  • (1)navbar
  • (4)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (9)postbit
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete