Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+1 vote
1.4k views
in Q2A Core by
I would like to add a input field to all ask, answer and comment forms for anti spam measures.

How can I easily add them?

 

Edit: Maybe this is part of the answer? http://www.question2answer.org/qa/16466/ineed-to-add-custom-field-in-answer-page
Q2A version: 1.6.2
by
Can i do it with an advanced theme? But how can I detect with q2a if there is a form in the recent page?
by
I would need the filter plugin then, and prefer to check the "extra" field. http://www.question2answer.org/modules.php?module=filter

How to add this? What is the name of this field? name="extra" ?

2 Answers

0 votes
by
edited by
It is not working, I don't understand the structure yet :(

For now, I add an input field abusing the "function qa_set_up_name_field" from qa-app-format.php:

        // added anti spam field Honeypot
        $fields['extra']=array(
            // 'label' => '',
            'tags' => 'name="checkme"',
            'value' => '',
            'type' => 'text',
            'id' => 'botcheck',
        );

And in the filter module / plugin I want to read and return it like:

        function filter_question(&$question, &$errors, $oldquestion)
        {
           $errors['title'] = '# '.$question['extra'];
        }

which is not working, disappointingly....

$errors['title'] = '# '.$question['checkme']; does not work either :/
by
edited by
$question['extra'] is empty. So settings $fields['extra'] seems not be correct, as I do it?

----

PS: From the filter docs I can read, that the "extra" fields is not available in Answers and Comments so I think my attempt above is not the solution?!
0 votes
by
I finally did it with a captcha plugin!

http://www.question2answer.org/modules.php?module=captcha
by
Could you give more details on this? I have a similar problem.

If you added a captcha plugin and there is an existing captcha plugin. Can they work together? Thanks in advance.
...