} if ($error_type > 0) { //erreur de type champ non valide $msginfo = 'Champ non valide'; $a = 4; break; } $tfaq = new CTableFaq(array('etat'=>$etat, 'question'=>CFunction::addslashes($question), 'reponse'=>CFunction::addslashes($reponse))); $tfaq->insert(); $msginfo = 'FAQ bien ajoutée'; /* * CREATION AUTOMATIQUE DE LA PAGE */ $page_faq = CTablePage::select('*', 'text LIKE \'%<!--FAQ-->%\''); if(!$page_faq || !mysql_num_rows($page_faq)) { // Get first article $art = CBdd::select_row('SELECT id FROM article WHERE 1 ORDER BY id LIMIT 0,1'); $tpag = new CTablePage( array( 'nom'=>'FAQ', 'etat'=>$etat, 'idart'=>$art['id'], 'text'=>'<!--FAQ-->', 'head'=>'', 'description'=>'',
/*------------------------------------------------------ A FAIRE DANS TOUS LES CAS --------------------------------------------------------*/ $select = "*"; if(!empty($_SESSION['idart'])) { $filtre = " idart = " . $_SESSION['idart']; } else if(!empty($_SESSION['idcat'])) { $filtre = " idcat = " . $_SESSION['idcat']; } else { $filtre = '1'; } //echo $filtre; $r_page = CTablePage::select("*", $filtre, $order); ?> <!-- InstanceEndEditable --> <div id="mainwrap"> <div id="header"><?php include("../nav/header.php"); ?></div> <div id="top"><?php include("../nav/menu_h.php"); ?></div> <div id="filet"> <div id="zonetitre"> <div id="signe"></div> <div id="titre"><!-- InstanceBeginEditable name="titre" -->Pages<!-- InstanceEndEditable --></div> </div> </div> <div id="contentarea"> <div id="left"><?php include("../nav/menu_g.php"); ?></div> <div id="center"> <div id="page"><!-- InstanceBeginEditable name="page" --><?php echo CHtml::get_toolbar() ?><!-- InstanceEndEditable --></div>