Go Back   vb.org Archive > Community Discussions > Modification Requests/Questions (Unpaid)
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 12-29-2010, 05:14 PM
James T Brock James T Brock is offline
 
Join Date: Sep 2004
Posts: 273
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Human Verification Manager per subforum

Right now I can enable and disable human verification manager on a per usergroup basis but how about adding the option on a SUBFORUM basis. I have one specific subforum where I would like this to be enabled so that users can't post new threads without first completing the CAPTCHA process. This is to prevent bots that like to spam one specific subforum I have.

Anyone want to take on this mod? Or know of a similar mod that I could use for this purpose?
Reply With Quote
  #2  
Old 12-29-2010, 06:21 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You could enable human verification for posting, then disable it for all but one forum by creating this plugin using hook location global_setup_complete:

Code:
if ((THIS_SCRIPT == 'newthread' AND $foruminfo['forumid'] != 2) OR
    (THIS_SCRIPT == 'newreply' AND $threadinfo['forumid'] != 2))
{
    $vbulletin->options['hvcheck'] &= ~($vbulletin->bf_misc_hvcheck['post']);
}

of course, change the 2's to the forum id where you want CAPTCHA.
Reply With Quote
  #3  
Old 12-29-2010, 08:43 PM
James T Brock James T Brock is offline
 
Join Date: Sep 2004
Posts: 273
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thank you sir! It works. Exactly what I wanted.
Reply With Quote
  #4  
Old 12-29-2010, 08:48 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I'm glad it works - but now that I think about it it seems kind of backwards the way I did it - you could probably check for that forum and set the bit (and not have to enable CAPTCHA for posting) instead of clearing the bit. Oh well.
Reply With Quote
  #5  
Old 12-31-2010, 11:21 AM
James T Brock James T Brock is offline
 
Join Date: Sep 2004
Posts: 273
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

How do I change the code to do it the way you just described? I just noticed that turning on the CAPTHA disables my quick reply box even in forums where it's not set to have the CAPTHA. Any help would be appreciated.
Reply With Quote
  #6  
Old 12-31-2010, 06:38 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Try this code instead:

PHP Code:

$hv_forums 
= array(123); // fset to forum ids where hv is required

if ((THIS_SCRIPT == 'newthread' AND in_array($foruminfo['forumid'], $hv_forums)) OR
    (
THIS_SCRIPT == 'showthread' AND in_array($threadinfo['forumid'], $hv_forums)) OR
    (
THIS_SCRIPT == 'newreply' AND in_array($threadinfo['forumid'], $hv_forums)))
{
    
$vbulletin->options['hvcheck'] |= ($vbulletin->bf_misc_hvcheck['post']);

Reply With Quote
  #7  
Old 01-01-2011, 10:33 AM
James T Brock James T Brock is offline
 
Join Date: Sep 2004
Posts: 273
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I actually couldn't get that second code to work at all. Not sure if there is a mistake in the script or something. I ended up taking the original code and adding the showthread bit from the second code to get the quick reply to come back...

PHP Code:
if ((THIS_SCRIPT == 'newthread' AND $foruminfo['forumid'] != XX) OR
    (
THIS_SCRIPT == 'showthread' AND $threadinfo['forumid'] != XX) OR
    (
THIS_SCRIPT == 'newreply' AND $threadinfo['forumid'] != XX))
{
    
$vbulletin->options['hvcheck'] &= ~($vbulletin->bf_misc_hvcheck['post']);

Reply With Quote
  #8  
Old 01-01-2011, 01:09 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

That's great - yeah, I was thinking once I figured out that I needed to add the showthread part that maybe that was the real cause of the quick reply problem. But I did test that second code I posted. Maybe it has something to do with hv settings - but as long as it's working for you it doesn't matter.
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 04:46 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.04233 seconds
  • Memory Usage 2,233KB
  • Queries Executed 13 (?)
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)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)bbcode_code
  • (2)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (8)post_thanks_box
  • (8)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (8)post_thanks_postbit_info
  • (8)postbit
  • (8)postbit_onlinestatus
  • (8)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_postinfo_query
  • fetch_postinfo
  • 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
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete