check(1); include dirname(__FILE__).'/inc/connexion.php'; $cmd = null; # Mise hors ligne d'un commentaire if (!empty($_POST['cmts_action']) && !empty($_POST['c_ids'])) { $cmd = $_POST['cmts_action']; $ids = $_POST['c_ids']; foreach ($ids as $k => $v) { $ids[$k] = (integer)$v; } if (isset($_POST['redir']) && strpos($_POST['redir'],'://') === false) { $redir = strip_tags($_POST['redir']); } else { $redir = 'comments.php?env='.(integer)$_POST['env']; } if (($comments = $blog->getComments(array('c_id' => $ids,'no_content' => true))) === false) { $err = $blog->error(1); } else { if ($cmd == 'status') { while ($comments->fetch()) { if ($comments->f('user_id') == $_SESSION['sess_user_id'] || $_SESSION['sess_user_level'] >= 9) { if ($blog->statusComment($comments->f('comment_id')) === false) { $err = $blog->error(1); } } } if (empty($err)) { header('Location: '.$redir); exit; } } elseif ($cmd == 'delete') { while($comments->fetch()) { if ($comments->f('user_id') == $_SESSION['sess_user_id'] || $_SESSION['sess_user_level'] >= 9) { if ($blog->delComment($comments->f('comment_id')) === false) { $err = $blog->error(1); } } } if (empty($err)) { //$msg = __('Selected comments successfully removed'); header('Location: '.$redir); exit; } } } } # Sous menu if (!empty($redir)) { $mySubMenu->addItem( ''.__('Back to list of comments').'', array(htmlspecialchars($redir),'accesskey="r"'), 'images/ico_retour.png', false ); } openPage(__('Comments')); if (!empty($err)) { echo '
'.__('Error(s)').' :
'. $err.'