Skip to main content.

Saturday, August 07, 2004

I've been able to move the captcha functionality into a plugin, NP_Captcha. It's not complete yet. It needs some more work, but it's in the plugins project CVS repository as of now.

Captchas are now also present on the member info pages, when non-members are allowed to send e-mail messages to members.

The changes to the core are now also in CVS. I'll highlight the changes in this post.

  1. Allowed the actions normally requiring the use of action.php to be done using any entry point (index.php, xml-rss.php, ...). This allows for comment forms and member mail forms to post back to themselves, allowing the better error handling. The actions are executed at the start of selector in globalfunctions.php. A new ACTION.php class in the libs/ directory now contains the code from the original action.php. The latter now serves as a proxy class.
  2. Made it so the form templates in the forms/ directory can call plugin events. A new plugin event FormExtra was added, to which the NP_Captcha class and others can subscribe. (form templates use e.g. <%callback(FormExtra,commentform-notloggedin)%>)
  3. Made it so that when a comment is posted or when a message is about to be sent to a member, plugins can subscribe to a ValidateForm event. The plugins can return an error message.
  4. When posting a comment to the page itself (thus, not through action.php), the errors are not displayed on a separate page. Instead, the page is generated as before and errordiv will insert the error message.
  5. Added some code which pre-fills the comment/membermail form with the values from the request (if an error occurs while commenting, the old values will be filled out again.)
  6. Added an <%errordiv%> var available to form templates. When an error occurred during comment validation or when sending a member message, this will output <div class="error">message</div>

These changes are not final and still subject to changes and improvements.

Comments

Check off another of admun's feature list items.

Got captcha? yns671

Posted by hcgtv at Saturday, August 07, 2004 19:09:20

awesome!

Posted by admun at Monday, August 09, 2004 01:40:40

btw, you may check out my NP_Control and NP_FancyText plugin mods, they allow spam control as well, particularly prevent comment flooding (same IP has to wait X seconds before posting a new comment), same IP cannot post same commetn twice, even for different articles, and comment must be previewed as well.

This, combined with NP_Captcha makes comments basically spam-free.

Posted by rADo at Thursday, September 09, 2004 13:16:02

@rADo: That flooding protection sounds interesting! Will take a look at it when I get some time.

Posted by karma at Thursday, September 09, 2004 18:10:51

Hi.

I've installed NP_Captcha as per the instructions on the wiki. What do I do now to get it to display in my comment form?

Posted by Rob... at Tuesday, December 14, 2004 21:48:14

Never mind... worked out that I need the CVS version :)

I bet upgrading to 3.2 will be complicated now!

Posted by Rob... at Tuesday, December 14, 2004 23:07:45

Add Comment

This item is closed, it's not possible to add new comments to it or to vote on it