Page 1 of 1

Integrating SPAMblock with dynamic contact form/email check

Posted: Sat Jan 11, 2014 7:10 pm
by Huhu
Is there a chance that the SPAMblock plugin will have better intergation with the Contcat form plugin? Including the specific error messages ("Field %s is missing"-style)
This would help a lot.

This problem occurs when using the "dynamicform.tpl" wirth a fully customized form, for the field names do not match names spamblock requires ([name], [email] ...)

Re: Integrating SPAMblock with contact form

Posted: Sat Jan 11, 2014 7:47 pm
by garvinhicking
Actually the spamblock plugin doesn't have support to output such specific messages, also because the plugin doesn't want to tipp of visitors what exactly triggered a spam responsone, to not let them easily work around that...

Re: Integrating SPAMblock with dynamic contact form

Posted: Sat Jan 11, 2014 8:30 pm
by Huhu
Ah, thanks! I meant the "Field XY left empty" error messages, those are specific in SPAMblock, or not?

Another issue: Inserting wrong CAPTCHA seems to call the "required field"-error message as well. I will have a look why that is the case ...

PS SPAMblock is affected by the Dynamic Form it seems, see updated first post. Any workaround?

Re: Integrating SPAMblock with dynamic contact form

Posted: Sun Jan 12, 2014 12:59 pm
by Huhu
PPS.
input type="email"/"text"
the mail input field of the custom.tpl is set to
type="text"
instead of type="email".
Any specific reason for this? type="email" does a basic @-test, after all.

Dynamicform/SPAMblock
As for dynamicform.tpl: The Spamblock problem could be solved the field name could be specified in addition to the label text. Then one could set the label to "Your mail" but the field name to "email", thus enabling SPAMblock.
So the only workarount seems to be editing the custom.tpl instead of using dynamicform.tpl

Mail matching check
I have included a php code into seredipity_event_contactform.php to check email adresses. It seems to do the job, but again, dynamicform.tpl wouldn't work due to the lack of custom names for fields.

Code: Select all

//Position:
  function checkSubmit() {
        global $serendipity;

        if (empty($serendipity['POST']['commentform'])) {
            return false;
        }
 
        // Here the new code for an email match test
        
                 if (($serendipity['POST']['email'] == $serendipity['POST']['email_again'])){
      $from = $serendipity['POST']['email'] ;
        $email = $serendipity['POST']['email_again'] ; 
        } else {
                $serendipity['smarty']->assign(
                array(
                    'is_contactform_error'     => true,
                    'plugin_contactform_error' => PLUGIN_CONTACTFORM_ERROR_DATA
                )
            );

            return false;
                }       
Thanks for help!