id_utilisateur=$_SESSION["id_utilisateur"]; $form["auteur"]=$auteur; $hub=new FclFlux_hub(); $hub->id_hub=intval(trim($_POST["id_hub"])); $form["hub"]=$hub; if(empty($Bd)) require("../modele/connexion-bd.php"); $form["limites"]["ancre_long_min"]=POST_MIN_ANCRE; $form["limites"]["ancre_long_max"]=POST_MAX_ANCRE; $form["limites"]["annonce_long_min"]=POST_MIN_ANNONCE; $form["limites"]["annonce_long_max"]=POST_MAX_ANNONCE; $form["limites"]["url_long_max"]=POST_MAX_URL; $post=new FclFlux_post($form); if(!empty($post->erreurs)) $msg_form=array_merge($post->erreurs,$msg_form); if(empty($msg_form)) { $action=$post->ajout(); if(!empty($post->erreurs)) $msg_form=array_merge($post->erreurs,$msg_form); elseif($action===false) $msg_form[]=ERREUR_IMPREVUE; if(empty($msg_form)) $msg_form[]=MSG_ADMIN_VALID; } $Bd=null; } } if((!empty($msg_form))&&($ajax_on)) { if(($msg_form[0]==MSG_ADMIN_VALID)&&(!empty($hub->id_hub))) echo $hub->id_hub;//tout s'est bien passé, je recharge le hub en ajax else { foreach($msg_form as $message) echo "

$message

"; } }