示例#1
0
            if (empty($cotypes[$coid]['self_reg'])) {
                $sqlstr .= (empty($sqlstr) ? '' : ' AND ') . "ccid{$coid}='" . $v . "'";
            } else {
                $tempstr = self_sqlstr($coid, $v, '');
                $tempstr && ($sqlstr .= (empty($sqlstr) ? '' : ' AND ') . $tempstr);
                unset($tempstr);
            }
        }
    }
}
$mode = 0;
if (empty($cnstr) || !isset($cnodes[$cnstr])) {
    $mode = 1;
    $cn_link = $cms_abs;
} else {
    if (!$curuser->pmbypmids('cread', cn_pmids($cnstr, $sid))) {
        exit(lang('nocatasbrowsepermis'));
    }
    $cnode = cnodearr($cnstr);
    $cn_link = $cnode['indexurl'];
}
$cn_name = mhtmlspecialchars($cn_name);
$rss_str = "<?xml version=\"1.0\" encoding=\"" . $mcharset . "\"?>\n" . "<rss version=\"2.0\">\n" . "  <channel>\n" . "    <title>{$cn_name}</title>\n" . "    <link>" . mhtmlspecialchars($archive['subject']) . "{$cn_link}</link>\n" . "    <description>Latest {$rss_num} archives of {$cn_name}</description>\n" . "    <copyright>Copyright(C) " . mhtmlspecialchars($cmsname) . "</copyright>\n" . "    <generator>www.08cms.com</generator>\n" . "    <lastBuildDate>" . date('r', $timestamp) . "</lastBuildDate>\n" . "    <ttl>{$rss_ttl}</ttl>\n" . "    <image>\n" . "      <url>" . view_atmurl($cmslogo) . "</url>\n" . "      <title>" . mhtmlspecialchars($cmsname) . "</title>\n" . "      <link>" . $cms_abs . "</link>\n" . "    </image>\n";
$cachefile = htmlcac_dir('rss', '', 1) . cac_namepre('rss', $cnstr) . '.php';
if ($timestamp - @filemtime($cachefile) > $rss_ttl * 60) {
    $rsscaches = rss_cache($sqlstr);
} else {
    include $cachefile;
}
foreach ($rsscaches as $aid => $archive) {
    $archive['arcurl'] = view_arcurl($archive);