1
0
Fork 0
mirror of https://github.com/sbrl/Pepperminty-Wiki.git synced 2024-11-22 04:23:01 +00:00

Reverse the order comments are displayed in

This commit is contained in:
Starbeamrainbowlabs 2017-05-22 20:30:26 +01:00
parent 27c8037506
commit adc6b93f6d
3 changed files with 9 additions and 3 deletions

View file

@ -2394,7 +2394,10 @@ function render_comments($comments_data, $depth = 0)
$result = "<div class='comments-list" . ($depth > 0 ? " nested" : "") . "' data-depth='$depth'>";
foreach($comments_data as $comment) {
//$comments_data = array_reverse($comments_data);
for($i = count($comments_data) - 1; $i >= 0; $i--) {
$comment = $comments_data[$i];
$result .= "\t<div class='comment' id='comment-$comment->id' data-comment-id='$comment->id'>\n";
$result .= "\t<p class='comment-header'><span class='name'>$comment->username</span> said:</p>";
$result .= "\t<div class='comment-body'>\n";

View file

@ -50,7 +50,7 @@
"author": "Starbeamrainbowlabs",
"description": "Adds threaded comments to the bottom of every page.",
"id": "feature-comments",
"lastupdate": 1495479470,
"lastupdate": 1495481379,
"optional": false
},
{

View file

@ -307,7 +307,10 @@ function render_comments($comments_data, $depth = 0)
$result = "<div class='comments-list" . ($depth > 0 ? " nested" : "") . "' data-depth='$depth'>";
foreach($comments_data as $comment) {
//$comments_data = array_reverse($comments_data);
for($i = count($comments_data) - 1; $i >= 0; $i--) {
$comment = $comments_data[$i];
$result .= "\t<div class='comment' id='comment-$comment->id' data-comment-id='$comment->id'>\n";
$result .= "\t<p class='comment-header'><span class='name'>$comment->username</span> said:</p>";
$result .= "\t<div class='comment-body'>\n";