<?php

$pid = B;
$post = show_topic($pid);
$pg_d = 10;

$pg_c = C < 1 ? 1 : C;
$pg_s = $pg_d * ($pg_c - 1);
$comment = array();
$rs = $db->query('select *,comments.id as id from ' . PF .
    'comments as comments left join ' . PF .
    'user as user on user.id=comments.authorid where comments.post_id=' . $pid .
    ' order by comments.post_time desc LIMIT ' . $pg_s . ',' . $pg_d);
while ($row = $db->fetch_array($rs))
{
    $comment[$row['id']]['post_time'] = showtime($row['post_time']);
    $comment[$row['id']]['author'] = htmlspecialchars($row['name']);
    $comment[$row['id']]['content'] = htmlspecialchars($row['content']);
}
$page = page(RPGMA . MID . '/' . B . '/(*)/', $pg_c, $post['comment'], $pg_d);
ini_editor('ubb');
arg($post, $comment, $page, $pg_c);

?>