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.
- Allowed the actions normally requiring the use of
action.phpto 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 ofselectoringlobalfunctions.php. A newACTION.phpclass in thelibs/directory now contains the code from the originalaction.php. The latter now serves as a proxy class. - Made it so the form templates in the
forms/directory can call plugin events. A new plugin eventFormExtrawas added, to which the NP_Captcha class and others can subscribe. (form templates use e.g.<%callback(FormExtra,commentform-notloggedin)%>) - 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
ValidateFormevent. The plugins can return an error message. - 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 anderrordivwill insert the error message. - 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.)
- 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
Add Comment