fix comments count

This commit is contained in:
themohooks 2024-07-12 00:35:52 +03:00
parent 45e8eb9438
commit 40c53bf0fb

View file

@ -294,12 +294,14 @@ if ($photo->i('id') !== null) {
</div> </div>
<?php } ?> <?php } ?>
<div class="p0" id="pp-item-comments">
<h4 class="pp-item-header">Комментарии<span style="font-weight:normal"> <span style="color:#aaa">&middot;</span> 1</span></h4>
<div id="posts">
<?php <?php
$comments = DB::query('SELECT * FROM photos_comments WHERE photo_id=:pid', array(':pid' => $id)); $comments = DB::query('SELECT * FROM photos_comments WHERE photo_id=:pid', array(':pid' => $id));
?>
<div class="p0" id="pp-item-comments">
<h4 class="pp-item-header">Комментарии<span style="font-weight:normal"> <span style="color:#aaa">&middot;</span> <?=count($comments)?></span></h4>
<div id="posts">
<?php
foreach ($comments as $c) { foreach ($comments as $c) {
$comm = new Comment($c); $comm = new Comment($c);
$comm->i(); $comm->i();