Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+2 votes
569 views
in Q2A Core by
First off, I have never worked with this application before, so I'm really just looking for which files I should start looking in.

I would like to add an additional checkbox right below the "Email me <user email> ..." check box that allows the user to subscribe to emails for only comments. I would also like to change the checkbox that is already there to only subscribe to the user's answer being selected.

Thank you.
Q2A version: 1.5.3

1 Answer

0 votes
by

I used this method to let users create categories in an textbox instead selecting them on a list, or add field to Ask and Edit form based on certain conditions. it works:

1. layer: you should change the values in $this->content array in a layer in doctype() function(or somewhere else)  to add such fields.

this checks to see if it's Ask or Edit form:

if ( ($this->template=='ask') or (substr(qa_get_state(),0,4)=='edit')){}

get form array:

if ($this->template=='ask')
     $form_name = 'form';
else
     $form_name = 'form_q_edit';

$this->content[$form_name]['fields'] // it's form's fields value


2. event modul: for saving them add an event module and use qa_post_text() function to get the checkbox value and save it with qa_db_postmeta_set() or another function.

that's a long way to go to create custom fields, but it seems to be the only way(unless you use page override or core hacks).

...