<?
if (!$id){
	$tag = $this->NpjTranslit($this->tag);
	$page = $this->LoadSingle("SELECT * FROM `".$this->GetConfigValue("mysql_database")."`.`".$this->GetConfigValue("table_prefix")."pages` WHERE `supertag` = '".$tag."'");
    $id = $page['id'];
}
$comments = $this->LoadAll("SELECT * FROM `".$this->GetConfigValue("mysql_database")."`.`".$this->GetConfigValue("table_prefix")."comment` WHERE `pid` = \"".$id."\" ORDER BY `date`  ASC ");
$srvComment = $this->srvFactory('Comment');
$sm = $srvComment->newSmarty();
$sm->assign('count', count($comments));
echo $sm->fetch('commentcount.txt');
?>