Poser une nouvelle question :
'); } function newFAQAnswer($idfaq, $numquestion, $numanswer) { $idfaqanswer = 'faqAnswer-'.$idfaq.'-'.$numquestion.'-'.$numanswer; return Keep(''); } function HandleFAQ() { global $pagename, $CurrentTime, $Author; Lock(2); if (isset($_REQUEST['question']) && $_REQUEST['question'] && ($page = RetrieveAuthPage($pagename, 'edit', true))) { $idfaq = stripmagic($_REQUEST['faqId']); $question = stripmagic($_REQUEST['question']); $numquestion = stripmagic($_REQUEST['numQuestion']); $titre = $question; if (strlen($titre) > 30) { $titre = substr($question, 0, 50).'...'; $question = $titre."\n".$question; } $page['text'] = preg_replace( ',(\(:faqList '.$idfaq.':\)),', "\n".'*[[{$FullName}#faq'.$idfaq.'-'.$numquestion.' | '.$titre.']]$1', $page['text']); $page['text'] = preg_replace( ',(\(:if auth edit:\)\(:faqNewQuestion '.$idfaq.') '.$numquestion.':\),', '!![[#faq'.$idfaq.'-'.$numquestion.']]Q : '.$question.'\\\\\\\\'."\n". '[-\'\'question posée le '.$CurrentTime.($Author?(' par [[~ '.$Author.' ]]\'\'-]'):'')."\n". '(:if auth edit:)(:faqNewAnswer '.$idfaq.' '.$numquestion.' 1:)(:if:)'."\n". '$1 '.($numquestion + 1).':)', $page['text']); WritePage($pagename,$page); Redirect($pagename); } Lock(0); return ""; } function HandleFAQAnswer() { global $pagename, $CurrentTime, $Author; Lock(2); if (isset($_REQUEST['answer']) && $_REQUEST['answer'] && ($page = RetrieveAuthPage($pagename, 'edit', true))) { $idfaq = stripmagic($_REQUEST['faqId']); $answer = str_replace("\n", "\n->", stripmagic($_REQUEST['answer'])); $numanswer = stripmagic($_REQUEST['numAnswer']); $numquestion = stripmagic($_REQUEST['numQuestion']); $page['text'] = preg_replace( ',(\(:if auth edit:\)\(:faqNewAnswer '.$idfaq.' '.$numquestion.') '.$numanswer.':\),', '->[[#faq'.$idfaq.'-'.$numquestion.'-'.$numanswer.']]R : '.$answer."\n". '->[-\'\'réponse le '.$CurrentTime.($Author?(' par [[~ '.$Author.' ]]\'\'-]'):'')."\n". '$1 '.($numanswer + 1).':)', $page['text']); WritePage($pagename,$page); Redirect($pagename); } Lock(0); return ""; } ?>