<?php

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

$walls = mysql_fetch_array(mysql_query("SELECT * FROM `wall` WHERE `id` = '$post[id]';"));
$k_posts = mysql_result(mysql_query("SELECT COUNT(*) FROM `wall_comments` WHERE `id_wall` = '$post[id]'"), 0);
$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 = mysql_query("SELECT * FROM `wall_comments` WHERE `id_wall` = '$post[id]' ORDER BY `time` DESC LIMIT 5");
} else {
    $qs = mysql_query("SELECT * FROM `wall_comments` WHERE `id_wall` = '$post[id]' ORDER BY `time` DESC LIMIT 3");
}

if ($k_posts == 0) {
    
}

while ($posts = mysql_fetch_assoc($qs)) {
    $anks = get_user($posts['id_user']);

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

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

