예제 #1
0
} elseif ($category > 0) {
    $crit_top = new CriteriaCompo(new Criteria("cat_id", $category));
    $crit_top->add(new Criteria("forum_id", "(" . implode(", ", $valid_forums) . ")", "IN"));
    $forums_top = $forum_handler->getIds($crit_top);
    $valid_forums = array_intersect($forums_top, $valid_forums);
}
if (count($valid_forums) == 0) {
    newbb_trackback_response(1, _NOPERM);
}
$charset = 'UTF-8';
header('Content-Type:text/xml; charset=' . $charset);
$tpl = new XoopsTpl();
$tpl->caching = 2;
$tpl->cache_lifetime = $xoopsModuleConfig['rss_cachetime'] * 60;
if (!empty($xoopsConfig['rewrite'])) {
    $tpl->load_filter('output', 'xoRewriteModule');
}
mod_loadFunctions("cache");
$xoopsCachedTemplateId = md5(mod_generateCacheId_byGroup() . str_replace(XOOPS_URL, '', $_SERVER['REQUEST_URI']));
$compile_id = NULL;
if (!$tpl->is_cached('db:newbb_rss.html', $xoopsCachedTemplateId, $compile_id)) {
    mod_loadFunctions("time", "newbb");
    $xmlrss_handler =& xoops_getmodulehandler('xmlrss', 'newbb');
    $rss = $xmlrss_handler->create();
    $rss->setVarRss('channel_title', $xoopsConfig['sitename'] . ' :: ' . _MD_FORUM);
    $rss->channel_link = XOOPS_URL . '/';
    $rss->setVarRss('channel_desc', $xoopsConfig['slogan'] . ' :: ' . $xoopsModule->getInfo('description'));
    // There is a "bug" with xoops function formatTimestamp(time(), 'rss')
    // We have to make a customized function
    //$rss->channel_lastbuild = formatTimestamp(time(), 'rss');
    $rss->setVarRss('channel_lastbuild', newbb_formatTimestamp(time(), 'rss'));