Exemplo n.º 1
0
 if ($request == 'newComment') {
     $parentComment = $params['parentComment'];
     if ($parentComment == null) {
         $parentComment = -1;
     }
     $parentPost = $params['parentPost'];
     if ($parentPost == null) {
         $parentPost = -1;
     }
     echo DBSaveComment(-1, $parentPost, $parentComment, $params['content'], $_SESSION['UserID'], 0);
 } else {
     if ($request == 'editComment') {
         echo DBSaveComment($params['cId'], $params['parentPost'], $params['parentComment'], $params['content'], $_SESSION['UserID'], 0);
     } else {
         if ($request == 'deleteComment') {
             DBDeleteComment($params['cId'], $_SESSION['UserID']);
         } else {
             if ($request == 'login') {
                 echo Login($params['email'], $params['password']);
             } else {
                 if ($request == 'logout') {
                     Logout();
                 } else {
                     if ($request == 'signUp') {
                         echo SignUp($params['userName'], $params['emailAddress'], $params['password']);
                     } else {
                         if ($request == 'updateName') {
                             SaveUserName($_SESSION['UserID'], $params['userName']);
                         } else {
                             if ($request == 'updatePassword') {
                                 echo SaveUserPassword($_SESSION['UserID'], $params['newPassword'], $params['oldPassword']);
Exemplo n.º 2
0
    if ($request == 'editPost') {
        if ($params['pId']) {
            DBEditPost($params['pId'], $params['title'], $params['content']);
        }
    } else {
        if ($request == 'deletePost') {
            DBDeletePost($params['pId']);
        } else {
            if ($request == 'newComment') {
                echo DBNewComment($params['parentPost'], $params['parentComment'], $params['content']);
            } else {
                if ($request == 'editComment') {
                    DBEditComment($params['cId'], $params['content']);
                } else {
                    if ($request == 'deleteComment') {
                        DBDeleteComment($params['cId']);
                    }
                }
            }
        }
    }
}
/*
$request = $_POST['r'];
if($_POST['b']) $board_id = $_POST['b'];
if($_POST['n']) $post_no = $_POST['n'];
if($_POST['t']) $title = $purifier->purify($_POST['t']);
if($_POST['p']) $pinned = $_POST['p'];
if($_POST['co']) $content_original = $_POST['co'];
if($_POST['cs']) $content_sanitized = $purifier->purify($_POST['cs']);
if($_POST['pr']) $parent = $_POST['pr'];