Hi Sama
In your filter file, you have a process_event function where you declare a global $qa_extra_question_fields. You then test if it's set.
My questions are:
1) Will it ever be set?
2) Will it issue a warning if testing on a variable index not set?
Thanks!
function process_event ($event, $userid, $handle, $cookieid, $params) {
global $qa_extra_question_fields;
switch ($event) {
case 'q_queue':
case 'q_post':
case 'q_edit':
for($key=1; $key<=qa_eqf::FIELD_COUNT_MAX; $key++) {
if((bool)qa_opt(qa_eqf::FIELD_ACTIVE.$key)) {
$name = qa_eqf::FIELD_BASE_NAME.$key;
if(isset($qa_extra_question_fields[$name]))
$content = qa_sanitize_html($qa_extra_question_fields[$name]['value']);
else
$content = qa_db_single_select(qa_db_post_meta_selectspec($params['postid'], 'qa_q_'.$name));
if(is_null($content))
$content = '';
qa_db_postmeta_set($params['postid'], 'qa_q_'.$name, $content);
}
}
break;
case 'q_delete':
for($key=1; $key<=qa_eqf::FIELD_COUNT_MAX; $key++) {
if((bool)qa_opt(qa_eqf::FIELD_ACTIVE.$key)) {
$name = qa_eqf::FIELD_BASE_NAME.$key;
qa_db_postmeta_clear($params['postid'], 'qa_q_'.$name);
}
}
break;
}
}