The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Adding Image Verification to a plugin
Hi,
I've had this hack installed for awhile, but just recently started tackling a few of its shortcomings. Namely, for Unregistered users to use the form, Guest Post Image Verification has to be disabled entirely. So I started adding code to the plugin to get Image Verification, and I've been successful.. except for one thing: If the user enters the incorrect code and presses submit, it does NOT give this error like it should Quote:
I'm really new to coding... so can anyone lend any hands? I've added all the code in red. Code:
removed code, in case anyone tries taking credit for my upcoming hack :) |
#2
|
|||
|
|||
Anybody?
I figure I would need code in the format of this Quote:
I only need the error message to pop up when you enter the wrong verification code. I guess I can just put a warning above the Image Verification telling users to double check the code they input, because it won't tell them if they've input the wrong one.. but that could lead to users submitting the same form over and over again if they're not sure they input the right code. Argh. |
#3
|
|||
|
|||
bump. Still haven't figured it out.
|
#4
|
|||
|
|||
Bump. In advance, excuse me for what will probably be improper terminology..
So the Form Hack uses the newthread_start hook, so I've been looking through newthread.php trying to find the code that shows Quote:
When using image verification in newthread or newreply, if the code you input is wrong, the "String did not match" error message pops up where the Preview of your post would. So this is all done inside of the same PHP file.. and the code has to be somewhere in there.. but I just can't seem to find it. So is there some "error" section in newthread.php or does it use the same code that clicking the Preview button does? So, since no one is helping me with the big problem... does anybody at least have these answers? I've at least found this code that might be what I want: Code:
// ### POST HAS ERRORS ### $postpreview = construct_errors($errors); // this will take the preview's place construct_checkboxes($newpost); |
#5
|
||||
|
||||
Try this:
PHP Code:
PHP Code:
|
#6
|
|||
|
|||
I have... but what is the if conditional I need?? "if condition="!reg_imagecheck"" Or something?
I've gotten one step closer. I added Code:
if (sizeof($errors) > 0) { // ### POST HAS ERRORS ### if ($vbulletin->GPC['ajax']) { require_once(DIR . '/includes/class_xml.php'); $xml = new vB_AJAX_XML_Builder($vbulletin, 'text/xml'); $xml->add_group('errors'); foreach ($errors AS $error) { $xml->add_tag('error', $error); } $xml->close_group(); $xml->print_xml(); } else { $postpreview = construct_errors($errors); // this will take the preview's place construct_checkboxes($newpost); $_REQUEST['do'] = 'newreply'; $newpost['message'] = htmlspecialchars_uni($newpost['message']); } } But anyway, now if they get the Image Code wrong it redirects them to a blank box. (Instead of popping up a box with the error in the same window) So at least I'm getting somewhere. I'm a total n00b at coding, if you can't tell. Yes yes yes yes yes. So I tried.. Code:
removed Is there a way to change it so that it ONLY evaluates that if !=='register_imagecheck' ? I don't want just any error causing it to give that message. Or will it? |
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|