PHP-код
$newscity = mysql_query("SELECT `newscity`.*, (SELECT COUNT(1) FROM `newscity_comments` WHERE `newscity_comments`.`id_news`=`newscity`.`id`) AS `comment_count` FROM `newscity` ORDER BY `id` DESC LIMIT 10");
while ($rows_news = mysql_fetch_assoc($newscity)){
$row_news['time'] = times($rows_news['time']);
$arraynewscity[] = $rows_news;
}
$smarty->assign('newscity',$arraynewscity);
В шаблоне
{foreach from=$newscity item=itemnewscity}
<li>
<img src="{$home}/files/newscity/{$itemnewscity.kartinka}">
<h3>{$itemnewscity.name}</h3>
<p>{$itemnewscity.anons|nl2br}...</p>
<p><img src="{$home}/style/{$skin}/images/clock.png" width="16" height="15" style="margin-right:4px;"><span class="left" style="margin-right:8px;">
{$itemnewscity.time}
</span><img src="{$home}/style/{$skin}/images/saycloud.png" width="14" height="16" style="margin-right:4px;"><a href="{$home}/pages/newscity.php?id={$itemnewscity.id}">{$itemnewscity.comment_count}</a></p>
</li>
{/foreach}
Время не обрабатывается моей функцией times, а выводится в обычном unix-формате. Как поправить?