예제 #1
0
 } else {
     if (!empty($category)) {
         $article['cat_data'] = $category;
     }
     $containers = $articles->getContainers();
     $com_text = '';
     /* If user posting a comment */
     if (!empty($_POST['comtext']) && $article['comments'] == 'yes') {
         if (isset($system->config['article-guest']) and !LOGGED_IN) {
             show_error(__('You are not logined!'));
         } else {
             if (isset($_POST['antispam']) and isset($_POST['captcheckout'])) {
                 $defcatp = substr(md5($_POST['antispam']), 0, 5);
                 $intcapt = $_POST['captcheckout'];
                 if ($defcatp == $intcapt) {
                     if (!$articles->addComment($b, $a, $_POST['comtext'])) {
                         show_error($articles->last_error);
                         $com_text = $_POST['comtext'];
                     }
                     if (!empty($articles->config['email']) && rcms_is_valid_email($articles->config['email'])) {
                         rcms_send_mail($articles->config['email'], $articles->config['email'], __('Comments'), $system->config['encoding'], __('Notification'), __('Comment') . ': http://' . $_SERVER['HTTP_HOST'] . '?module=articles&c=' . $_GET['c'] . '&b=' . $_GET['b'] . '&a=' . $_GET['a']);
                     }
                     rcms_redirect(RCMS_ROOT_PATH . '?module=articles&c=' . $_GET['c'] . '&b=' . $_GET['b'] . '&a=' . $_GET['a']);
                     //f5 hack
                 } else {
                     show_window(__('Error'), __('Invalid form data'));
                 }
             } else {
                 if (!$articles->addComment($b, $a, $_POST['comtext'])) {
                     show_error($articles->last_error);
                     $com_text = $_POST['comtext'];