diff options
Diffstat (limited to 'web/_views/template/post.php')
-rw-r--r-- | web/_views/template/post.php | 31 |
1 files changed, 23 insertions, 8 deletions
diff --git a/web/_views/template/post.php b/web/_views/template/post.php index 40a3c1d..4fbf485 100644 --- a/web/_views/template/post.php +++ b/web/_views/template/post.php @@ -29,25 +29,40 @@ <div class="col comments"> <?php $_GET['id'] = $post['id']; - $this->comments(); - ilang('action_load_comments', - class: 'action-load-comments btn btn-line mt', - attrs: array('postId' => $post['id']) - ); + $cdata = $this->comments(); + + $loaded = $cdata['loaded']; + $max = $cdata['max']; + $page_size = $cdata['page_size']; + $total = $post['comment_count']; + + if ($loaded >= $page_size && $page_size < $total) { + ilang('action_load_comments', + class: 'action-load-comments btn btn-line mt', + attrs: array( + 'postId' => $post['id'], + 'loaded' => $loaded, + 'pageSize' => $page_size, + 'commentCount' => $total, + 'commentMax' => $max, + ) + ); + } + ?> </div> <?php if ($self): ?> <div class="row grow mt"> <?php $this->view('template/pfp', array('user' => $user))?> - <form class="ml"> + <form class="ml action-new-comment-form"> <input type="hidden" name="id" value="<?=$post['id']?>" > <input - id="new-comment-<?=$post['id']?>" - class="input" + class="action-new-comment input" + postId="<?=$post['id']?>" autocomplete="off" type="text" name="text" |