if ($request == 'deletePost') { DBDeletePost($params['pId'], $_SESSION['UserID']); } else { 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']);
if ($request == 'deletePost') { DBDeletePost($params['pId'], $_SESSION['UserID'], $params['files']); } else { 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, $params['addedFiles'], null); } else { if ($request == 'editComment') { echo DBSaveComment($params['cId'], $params['parentPost'], $params['parentComment'], $params['content'], $_SESSION['UserID'], 0, $params['addedFiles'], $params['deletedFiles']); } else { if ($request == 'deleteComment') { DBDeleteComment($params['cId'], $_SESSION['UserID'], $params['files']); } 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']);