modified masonry and posts, masonry is now reusable on group pages.
This commit is contained in:
@@ -1,13 +1,17 @@
|
||||
<?php
|
||||
|
||||
if(empty($_POST["usr"])) {
|
||||
if(empty($_POST["usr"]) and empty($_POST["grp"])) {
|
||||
header('HTTP/1.1 500 Non enough arguments');
|
||||
}
|
||||
|
||||
require_once ("../../queries/user.php");
|
||||
require_once ("../../queries/post.php");
|
||||
require_once ("../../queries/nicetime.php");
|
||||
|
||||
$posts = selectAllUserPosts($_POST["usr"]);
|
||||
if(empty($_POST["usr"])) {
|
||||
$posts = selectAllPosts(0, $_POST["grp"]);
|
||||
} else {
|
||||
$posts = selectAllPosts($_POST["usr"], 0);
|
||||
}
|
||||
|
||||
if(!$posts) {
|
||||
header('HTTP/1.1 500 Query failed');
|
||||
@@ -19,6 +23,4 @@ for($i = 0; $i < sizeof($results); $i++) {
|
||||
$results[$i]["nicetime"] = nicetime($results[$i]["creationdate"]);
|
||||
}
|
||||
|
||||
//$results[0]["niceTime"] = nicetime($results[0]["creationdate"]);
|
||||
|
||||
echo json_encode($results);
|
||||
Reference in New Issue
Block a user