diff --git a/website/public/API/postPost.php b/website/public/API/postPost.php index 7a33857..2f89133 100644 --- a/website/public/API/postPost.php +++ b/website/public/API/postPost.php @@ -6,6 +6,7 @@ require_once("../../queries/post.php"); require_once("../../queries/group_page.php"); require_once("../../queries/connect.php"); require_once("../../queries/checkInput.php"); +require_once("../../queries/picture.php"); if (empty($_POST["title"]) or empty($_POST["content"]) or @@ -17,7 +18,6 @@ if (empty($_POST["group"])) { // User Post makePost( $_SESSION["userID"], - null, test_input($_POST["title"]), test_input($_POST["content"]) ); @@ -32,23 +32,8 @@ if (empty($_POST["group"])) { makePost( $_SESSION["userID"], - $_POST["group"], test_input($_POST["title"]), - test_input($_POST["content"]) + test_input($_POST["content"]), + $_POST["group"] ); } - - - - - - -//if (empty($_POST['newpost-title'])) { -//} else { -// makePost($_SESSION['userID'], -// null, -// test_input($_POST['newpost-title']), -// test_input($_POST['newpost-content'])); -//} -// -//header("Location: ../profile.php"); \ No newline at end of file diff --git a/website/public/js/masonry.js b/website/public/js/masonry.js index d73c33c..7670d2b 100644 --- a/website/public/js/masonry.js +++ b/website/public/js/masonry.js @@ -31,14 +31,16 @@ function postPost() { $.post("API/postPost.php", { title: title, content : content, group : groupID }) - .done(function() { + .done(function(data) { masonry(masonryMode); + console.log(data); }); } else { $.post("API/postPost.php", { title: title, content : content }) - .done(function() { + .done(function(data) { masonry(masonryMode); + console.log(data); }); } @@ -80,24 +82,25 @@ function masonry(mode) { var columns = new Array(columnCount); var $columns = new Array(columnCount); for (i = 0; i < columnCount; i++) { - $column = $("
"); + $column = $("
"); $column.width(100/columnCount + "%"); $container.append($column); columns[i] = [0, $column]; } if(mode > 0) { - $postInput = $("
"); - $form = $("
"); + $postInput = $("
"); + $form = $(""); $postInput.append($form); if(mode == 2) { - $form.append($("")); + $form.append($("")); } - $form.append($("")); - $form.append($("