From: <ri...@us...> - 2008-03-12 13:04:43
|
Update of /cvsroot/tikiwiki/tiki In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv21153 Modified Files: Tag: BRANCH-1-10 tiki-view_faq.php Log Message: [MOD] when suggesting an faq, the question field is required. no more empty suggstions Index: tiki-view_faq.php =================================================================== RCS file: /cvsroot/tikiwiki/tiki/tiki-view_faq.php,v retrieving revision 1.24.2.2 retrieving revision 1.24.2.3 diff -u -d -r1.24.2.2 -r1.24.2.3 --- tiki-view_faq.php 12 Mar 2008 12:49:49 -0000 1.24.2.2 +++ tiki-view_faq.php 12 Mar 2008 13:04:41 -0000 1.24.2.3 @@ -95,9 +95,16 @@ $smarty->assign('pendingquestion', $_REQUEST["suggested_question"]); $smarty->assign('pendinganswer', $_REQUEST["suggested_answer"]); } else { - $faqlib->add_suggested_faq_question($_REQUEST["faqId"], $_REQUEST["suggested_question"], $_REQUEST["suggested_answer"], + if (!empty($_REQUEST["suggested_question"])) + { + $faqlib->add_suggested_faq_question($_REQUEST["faqId"], $_REQUEST["suggested_question"], $_REQUEST["suggested_answer"], $user); - }} +} else { + $error = tra('You must suggest a question; please try again.'); + $smarty->assign('error', $error); +// Save the pending answer if question is empty + $smarty->assign('pendinganswer', $_REQUEST["suggested_answer"]); + }}} } $suggested = $faqlib->list_suggested_questions(0, -1, 'created_desc', '', $_REQUEST["faqId"]); |