From d3d56bdaa74fa30d54715eb6cf249d11add4dc92 Mon Sep 17 00:00:00 2001 From: Starbeamrainbowlabs Date: Sat, 13 May 2017 17:03:25 +0100 Subject: [PATCH] Fix comment replies on the server-side --- build/index.php | 8 ++++---- module_index.json | 2 +- modules/feature-comments.php | 8 ++++---- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/build/index.php b/build/index.php index 0477e16..6502913 100644 --- a/build/index.php +++ b/build/index.php @@ -2189,7 +2189,7 @@ register_module([ $comments_html .= "
\n" . "

Post a Comment

\n" . "\t\n" . - "\t\n" . + "\t\n" . "\t\n" . "
\n"; } @@ -2197,7 +2197,7 @@ register_module([ $comments_html .= "
\n" . "\t\n" . "\t

Login to post a comment.

\n" . - "\t\n" . + "\t\n" . "\t\n" . "
\n"; } @@ -2227,7 +2227,7 @@ function display_reply_form(event) var replyForm = document.querySelector(".comment-reply-form").cloneNode(true); replyForm.classList.add("nested"); // Set the comment we're replying to - replyForm.querySelector("[name=reply-to]").value = event.target.parentElement.parentElement.dataset.commentId; + replyForm.querySelector("[name=replyto]").value = event.target.parentElement.parentElement.dataset.commentId; // Display the newly-cloned commenting form event.target.parentElement.parentElement.querySelector(".reply-box-container").appendChild(replyForm); } @@ -2354,7 +2354,7 @@ function render_comments($comments_data, $depth = 0) $result .= "\t\t🔗\n"; $result .= "\t\t\n"; $result .= "\t

\n"; - $result .= "\t" . render_comments($comment->replies) . "\n"; + $result .= "\t" . render_comments($comment->replies, $depth + 1) . "\n"; $result .= "\t"; } $result .= ""; diff --git a/module_index.json b/module_index.json index ed8c321..f3f9785 100755 --- a/module_index.json +++ b/module_index.json @@ -50,7 +50,7 @@ "author": "Starbeamrainbowlabs", "description": "Adds threaded comments to the bottom of every page.", "id": "feature-comments", - "lastupdate": 1494689720, + "lastupdate": 1494689964, "optional": false }, { diff --git a/modules/feature-comments.php b/modules/feature-comments.php index 67398f4..5f3e23c 100644 --- a/modules/feature-comments.php +++ b/modules/feature-comments.php @@ -134,7 +134,7 @@ register_module([ $comments_html .= "
\n" . "

Post a Comment

\n" . "\t\n" . - "\t\n" . + "\t\n" . "\t\n" . "
\n"; } @@ -142,7 +142,7 @@ register_module([ $comments_html .= "
\n" . "\t\n" . "\t

Login to post a comment.

\n" . - "\t\n" . + "\t\n" . "\t\n" . "
\n"; } @@ -172,7 +172,7 @@ function display_reply_form(event) var replyForm = document.querySelector(".comment-reply-form").cloneNode(true); replyForm.classList.add("nested"); // Set the comment we're replying to - replyForm.querySelector("[name=reply-to]").value = event.target.parentElement.parentElement.dataset.commentId; + replyForm.querySelector("[name=replyto]").value = event.target.parentElement.parentElement.dataset.commentId; // Display the newly-cloned commenting form event.target.parentElement.parentElement.querySelector(".reply-box-container").appendChild(replyForm); } @@ -299,7 +299,7 @@ function render_comments($comments_data, $depth = 0) $result .= "\t\t🔗\n"; $result .= "\t\t\n"; $result .= "\t

\n"; - $result .= "\t" . render_comments($comment->replies) . "\n"; + $result .= "\t" . render_comments($comment->replies, $depth + 1) . "\n"; $result .= "\t"; } $result .= "";