Example #1
0
    }
    if (strlen($reply) > 2000) {
        emDirect("./comment.php?error_d=1");
    }
    if (isset($_POST['pub_it'])) {
        $Comment_Model->showComment($commentId);
        $hide = 'n';
    }
    $Comment_Model->replyComment($blogId, $commentId, $reply, $hide);
    $CACHE->updateCache('comment');
    $CACHE->updateCache('sta');
    doAction('comment_reply', $commentId, $reply);
    emDirect("./comment.php?active_rep=1");
}
if ($action == 'doedit') {
    $name = isset($_POST['name']) ? addslashes(trim($_POST['name'])) : '';
    $mail = isset($_POST['mail']) ? addslashes(trim($_POST['mail'])) : '';
    $url = isset($_POST['url']) ? addslashes(trim($_POST['url'])) : '';
    $comment = isset($_POST['comment']) ? addslashes(trim($_POST['comment'])) : '';
    $commentId = isset($_POST['cid']) ? intval($_POST['cid']) : '';
    if ($comment == '') {
        emDirect("./comment.php?error_e=1");
    }
    if (strlen($comment) > 2000) {
        emDirect("./comment.php?error_d=1");
    }
    $commentData = array('poster' => $name, 'mail' => $mail, 'url' => $url, 'comment' => $comment);
    $Comment_Model->updateComment($commentData, $commentId);
    $CACHE->updateCache('comment');
    emDirect("./comment.php?active_edit=1");
}