comment ordering and timestamp format change
This commit is contained in:
parent
14521fccd8
commit
22588626f2
1 changed files with 3 additions and 3 deletions
|
@ -35,7 +35,7 @@ class BlogpostComment
|
|||
</div>
|
||||
</div>
|
||||
<div class=\"comment-child-wrapper\">
|
||||
", $this->poster_name, date("Y-m-d", strtotime($this->timestamp)),
|
||||
", $this->poster_name, date("Y-m-d H:i", strtotime($this->timestamp)),
|
||||
$this->content);
|
||||
|
||||
if($this->children != null) {
|
||||
|
@ -56,7 +56,7 @@ class BlogpostComment
|
|||
$stmt = $conn->prepare("SELECT comment_id, poster_id, timestamp,
|
||||
content, username FROM (blogpost_comments INNER JOIN users ON
|
||||
poster_id = user_id) WHERE blogpost_id = :blogpost_id
|
||||
AND parent_id = :comment_id;");
|
||||
AND parent_id = :comment_id ORDER BY timestamp ASC;");
|
||||
|
||||
// Bind and execute the comment select
|
||||
$stmt->bindParam(":blogpost_id", $this->blogpost_id);
|
||||
|
@ -196,7 +196,7 @@ function load_comments($conn, $blogId) {
|
|||
$stmt = $conn->prepare("SELECT comment_id, poster_id, timestamp, content,
|
||||
username FROM (blogpost_comments INNER JOIN users ON
|
||||
poster_id = user_id) WHERE blogpost_id = :blogpost_id AND
|
||||
parent_id IS NULL;");
|
||||
parent_id IS NULL ORDER BY timestamp ASC;");
|
||||
|
||||
// Bind and execute the comment select
|
||||
$stmt->bindParam(":blogpost_id", $blogId);
|
||||
|
|
Loading…
Reference in a new issue