assign('rss_latestDate', $data[$latest_id]['p_date']); $smarty->display('rss_head.tpl'); $i = 0; foreach ($data as $item) { if ($i < $count) { $smarty->assign('rss_title', htmlentities($item['p_title'])); $smarty->assign('rss_description', truncate(htmlentities(strip_tags($item['p_post'])), 100)); $smarty->assign('rss_pubDate', $item['p_date']); $smarty->assign('rss_guid', BASE_URL.(PRETTY_URLS==1 ? '/post/'.$item['p_id'].'/'.pretty_title(stripslashes($item['p_title'])) : '/archive.php?p_id='.$item['p_id'])); $smarty->assign('categories', get_topic_names_by_postid($item['p_id'])); $smarty->display('rss_item.tpl'); } $i++; } $smarty->display('rss_foot.tpl'); ?>