Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 06-14-2008, 02:59 AM
veenuisthebest's Avatar
veenuisthebest veenuisthebest is offline
 
Join Date: Mar 2008
Location: India
Posts: 1,416
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default How do I implement human verification on my custom page

Hii..

I was looking for how to implement vB's default human verification on my custom page.
Then I found this in one of the pages of vB.

PHP Code:
require_once(DIR '/includes/class_humanverify.php');
        
$verify =& vB_HumanVerify::fetch_library($vbulletin);
        
$human_verify $verify->output_token(); 
if (!
$verify->verify_token($vbulletin->GPC['humanverify']))
{
standard_error(fetch_error($verify->fetch_error()));

and then simply adding $human_verify at the desired location in the template. This works just perfect BUT even the correct entered captcha is giving error saying "Incorrect String entered."

There must be some minor mistake I am making.. any help is much appreciated !!
Reply With Quote
  #2  
Old 06-14-2008, 06:31 AM
Dismounted's Avatar
Dismounted Dismounted is offline
 
Join Date: Jun 2005
Location: Melbourne, Australia
Posts: 15,047
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

In the ASKING stage, add:
PHP Code:
require_once(DIR '/includes/class_humanverify.php');
$verify =& vB_HumanVerify::fetch_library($vbulletin);
$human_verify $verify->output_token(); 
Use $human_verify in your template. Then in the verifying stage, add:
PHP Code:
$vbulletin->input->clean_gpc('r''humanverify'TYPE_ARRAY);

require_once(
DIR '/includes/class_humanverify.php');
$verify =& vB_HumanVerify::fetch_library($vbulletin);

if (!
$verify->verify_token($vbulletin->GPC['humanverify']))
{
    eval(
standard_error(fetch_error($verify->fetch_error())));

Reply With Quote
  #3  
Old 06-14-2008, 06:48 AM
veenuisthebest's Avatar
veenuisthebest veenuisthebest is offline
 
Join Date: Mar 2008
Location: India
Posts: 1,416
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

excellent.... works perfect !!!

thank you so much.. I had posted the same on so many forums but could not get it to work. thanks again
Reply With Quote
  #4  
Old 10-07-2008, 12:22 PM
nerofix nerofix is offline
 
Join Date: Mar 2006
Location: Saarland
Posts: 219
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

hmm... where is the "veryfying stage" ? I don't know where to put this code.
Reply With Quote
  #5  
Old 10-07-2008, 02:45 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

The "asking" stage is when the user is presented with the form. The "verifying" stage is when the form is submitted and the contents are processed.
Reply With Quote
  #6  
Old 10-07-2008, 05:31 PM
nerofix nerofix is offline
 
Join Date: Mar 2006
Location: Saarland
Posts: 219
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I wonder a bit, because I can't even find an "verifying stage" in the original register tempate.
Reply With Quote
  #7  
Old 10-07-2008, 05:43 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Sure it's on the registration page. It's the form action "<form action="register.php?do=register" method="post">". When you click submit, the form action is done and that is the "verifying stage". (I'm talking about "in general". That is not the actual form action on the page that has the captcha image - it will have a different form action.)
Reply With Quote
  #8  
Old 03-12-2009, 07:49 AM
ivand ivand is offline
 
Join Date: Feb 2006
Posts: 7
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

How this code should be modified to work with 3.8.1?
I am trying to build a quick registration module on a custom page and can not solve the human verify function.

Thanks for any help.
Reply With Quote
  #9  
Old 03-12-2009, 07:53 AM
ragtek ragtek is offline
 
Join Date: Mar 2006
Location: austria, croatia
Posts: 1,630
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

PHP Code:
        require_once(DIR '/includes/class_humanverify.php');
        
$verify =& vB_HumanVerify::fetch_library($vbulletin);
        
$human_verify $verify->output_token(); 
check:
PHP Code:
$vbulletin->input->clean_array_gpc('p', array(
                        
'humanverify'    =>    TYPE_ARRAY
                    
));
        require_once(
DIR '/includes/class_humanverify.php');
        
$verify =& vB_HumanVerify::fetch_library($vbulletin);
        if (!
$verify->verify_token($vbulletin->GPC['humanverify']))
        {
            
standard_error(fetch_error($verify->fetch_error()));
        } 
Reply With Quote
  #10  
Old 08-22-2012, 02:55 AM
doob doob is offline
 
Join Date: Dec 2009
Posts: 127
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I'm doing something similar in modifying the Standard_Error template to also have user registration fields complete with human verifacation for when someone that is not logged in tries to post.

Does this mean that I need to modify newreply.php and newthread.php (in addition to any other pages that would generate the standard error message) with the code samples in this thread?

I've tried that, and inserted almost the entire register template into the standard error template. Everything except for human verification works and the $human_verify hook is in there.

Any thoughts?
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 08:17 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04346 seconds
  • Memory Usage 2,264KB
  • Queries Executed 11 (?)
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
  • (5)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)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
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete