예제 #1
0
         $result = $cObj->postComment($comment, $app);
         if (!preg_match('/^[0-9]+$/', $result)) {
             $error = true;
             $errorMsg = " comment save error: {$result}";
         } else {
             $siteCommentId = $result;
             $filename = PATH_CACHE . '/read_' . $cid . '_com_m.cac';
             if (file_exists($filename)) {
                 unlink($filename);
             }
             $filename = PATH_CACHE . '/read_' . $cid . '_com_n.cac';
             if (file_exists($filename)) {
                 unlink($filename);
             }
         }
         $cObj->updateCommentCount($cid);
     }
     if (!$error) {
         require_once PATH_CORE . '/classes/log.class.php';
         $logObj = new log($db);
         $logItem = $logObj->serialize(0, $userid, 'comment', $siteCommentId, 0, $cid);
         $inLog = $logObj->add($logItem);
         $code = '<div id="dialogMessage"><h2>Your comment has been published successfully.</h2><p>What would you like to do next?</p>';
         $code .= '<ul class="bullet_list">' . $storyOption . '<li><a href="#" onclick="hideDialog(); return shareStory(this,' . $cid . ');">Share story with friends</a></li><li><a href="?p=invite" onclick="hideDialog(); return switchPage(\'invite\');">Invite friends to ' . SITE_TITLE . '</a></li></ul></div>';
     } else {
         $code = '<div id="dialogMessage">Sorry, there was a problem publishing your comment. Error: ' . $errorMsg . '</div>';
     }
     break;
 case 'requestVerify':
     // send it
     // to do - this code is duped in pagesignup, move to account.class.php