<?php

/* DCMS Special
 * Дата последнего редактирования 13.10.2016
 * Модифицировал densnet
 */

$walls = $db->get_array($db->query("SELECT * FROM `wall` WHERE `id` = '$post[id]';"));
$k_post = $db->super_query("SELECT COUNT(*) as count FROM `wall_comments` WHERE `id_wall` = '$post[id]'");
$k_posts = $k_post['count'];
$k_pages = k_page($k_posts, $set['p_str']);
$pages = page($k_pages);
$starts = $set['p_str'] * $pages - $set['p_str'];

if (IS_WEB) {
    $qs = $db->query("SELECT * FROM `wall_comments` WHERE `id_wall` = '$post[id]' ORDER BY `time` DESC LIMIT 5");
} else {
    $qs = $db->query("SELECT * FROM `wall_comments` WHERE `id_wall` = '$post[id]' ORDER BY `time` DESC LIMIT 3");
}

while ($posts = $db->get_row($qs)) {
    $anks = get_user($posts['id_user']);

    echo "<div class='list-group-item-null list-group-item-grey'>";
    echo "<b><font color='#4C6B8F'>$anks[nick]</font>:</b> ";
    echo toOutput(cutStr($posts['msg'], 50));
    echo "</div>";
}

if ($k_posts == 0) {
    
} else {
    //echo "</div>";
}

