1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
| # On a une variable GET['msgcom'];
if(!empty($_GET['msgcom']))
$this->message_com = urldecode(plxUtils::unSlash(strip_tags($_GET['msgcom'])));
# On a validé le formulaire commentaire
if(!empty($_POST) AND $this->plxRecord_arts->f('allow_com') AND $this->aConf['allow_com']) {
# On récupère le retour de la création
$retour = $this->newCommentaire($this->cible,plxUtils::unSlash($_POST));
# Url de l'article
$url = $this->racine.'?article'.intval($this->plxRecord_arts->f('numero')).'/'.$this->plxRecord_arts->f('url');
if($retour[0] == 'c') { # Le commentaire a été publié
header('Location: '.$url.'/#'.$retour);
} elseif($retour == 'mod') { # Le commentaire est en modération
$msg = 'Le commentaire est en cours de modération par l\'administrateur de ce site';
header('Location: '.$url.'/&msgcom='.urlencode($msg).'#form');
} else {
header('Location: '.$url.'/&msgcom='.urlencode($retour).'&name='.urlencode(plxUtils::unSlash($_POST['name'])).'&site='.urlencode(plxUtils::unSlash($_POST['site'])).'&mail='.urlencode(plxUtils::unSlash($_POST['mail'])).'&content='.urlencode(plxUtils::unSlash($_POST['content'])).'#form');
}
exit;
} |