I am using the contact-form plugin, but didn't like the fact, that the text above the submit-button is the same as for normal comments. See this example:
Both text-blocks are "triggered" via the frontend_comment-hook from within the templates of the contact-form plugin.Contact-Form wrote:Enclosing asterisks marks text as bold (*word*), underscore are made via _word_.
Standard emoticons likeand
are converted to images.
To prevent automated Bots from commentspamming, please enter the string you see in the image below in the appropriate input box. Your comment will only be submitted if the strings match. Please ensure that your browser supports and accepts cookies, or your comment cannot be verified correctly.
So I decided to give it a try, hacked around a bit and ended up with a new spamblock-hook to enable a custom message for the contact-form.
From my first tests, this seems to work but anyway I would like to present my changes to the s9y-wizards, in case I have made any mistake. If anyone else likes my changes, maybe they can find their way into the contact-from plugin someday ???
So, here's what I did ...
OPEN
plugins/serendipity_event_spamblock/serendipity_event_spamblock.php
FIND
Code: Select all
$propbag->add('version', '1.68');
$propbag->add('event_hooks', array(
'frontend_saveComment' => true,
'external_plugin' => true, Code: Select all
'submit_contactform' => true,Code: Select all
case 'frontend_comment':Make a copy of that complete case-block and rename it to:
Code: Select all
case 'submit_contactform':Code: Select all
echo '<br />' . PLUGIN_EVENT_SPAMBLOCK_CAPTCHAS_USERDESC . '<br />';Code: Select all
echo '<br />My custom SPAMblock-message blablabla ...<br />';plugins/serendipity_event_contactform/plugin_contactform.tpl
FIND
Code: Select all
{serendipity_hookPlugin hook="frontend_comment" data=$commentform_entry}Code: Select all
{serendipity_hookPlugin hook="submit_contactform" data=$commentform_entry}plugins/serendipity_event_contactform/plugin_dynamicform.tpl
FIND
Code: Select all
{serendipity_hookPlugin hook="frontend_comment" data=$commentform_entry}Code: Select all
{serendipity_hookPlugin hook="submit_contactform" data=$commentform_entry}OPEN
include/functions_smarty.inc.php
FIND
Code: Select all
static $hookable = array('frontend_header',
'entries_header',
'entries_footer',
Code: Select all
'submit_contactform',I have also tried to use a construct like this in the new case-block
Code: Select all
echo '<br />' . PLUGIN_CONTACTFORM_SPAMBLOCK_MESSAGE . '<br />';I am looking forward to your feedback ...
Cheers,
Manfred