Example #1
0
            $CACHE->updateCache(array('sta', 'comment'));
            doAction('comment_saved', $cid);
            emDirect($targetBlogUrl);
        } else {
            $CACHE->updateCache('sta');
            doAction('comment_saved', $cid);
            mMsg('评论发表成功,请等待管理员审核', $targetBlogUrl);
        }
    }
}
if (ROLE === ROLE_ADMIN && $action == 'delcom') {
    LoginAuth::checkToken();
    $blogId = isset($_GET['gid']) ? intval($_GET['gid']) : -1;
    $id = isset($_GET['id']) ? intval($_GET['id']) : '';
    $Comment_Model = new Comment_Model();
    $Comment_Model->delComment($id);
    $CACHE->updateCache(array('sta', 'comment'));
    emDirect('./?post=' . $blogId);
}
if ($action == 'reply') {
    $Comment_Model = new Comment_Model();
    $cid = isset($_GET['cid']) ? intval($_GET['cid']) : 0;
    $commentArray = $Comment_Model->getOneComment($cid);
    if (!$commentArray) {
        mMsg('参数错误', './');
    }
    extract($commentArray);
    $verifyCode = ISLOGIN == false && Option::get('comment_code') == 'y' ? "<img src=\"../include/lib/checkcode.php\" /><br /><input name=\"imgcode\" type=\"text\" />" : '';
    include View::getView('header');
    include View::getView('reply');
    include View::getView('footer');