示例#1
0
        $current_groups = array(-1);
    }
} else {
    $current_user = -1;
    $current_groups = array(-1);
}
if (!$faqConfig->get('main.enableRssFeeds')) {
    exit;
}
$category_id = PMF_Filter::filterInput(INPUT_GET, 'category_id', FILTER_VALIDATE_INT);
$category = new PMF_Category($faqConfig);
$category->setUser($current_user);
$category->setGroups($current_groups);
$faq = new PMF_Faq($faqConfig);
$faq->setUser($current_user);
$faq->setGroups($current_groups);
$records = $faq->getAllRecordPerCategory($category_id, $faqConfig->get('records.orderby'), $faqConfig->get('records.sortby'));
$rss = new XMLWriter();
$rss->openMemory();
$rss->setIndent(true);
$rss->startDocument('1.0', 'utf-8');
$rss->startElement('rss');
$rss->writeAttribute('version', '2.0');
$rss->startElement('channel');
$rss->writeElement('title', $faqConfig->get('main.titleFAQ') . ' - ');
$rss->writeElement('description', html_entity_decode($faqConfig->get('main.metaDescription')));
$rss->writeElement('link', $faqConfig->get('main.referenceURL'));
if (is_array($records)) {
    foreach ($records as $item) {
        $link = str_replace($_SERVER['SCRIPT_NAME'], '/index.php', $item['record_link']);
        if (PMF_RSS_USE_SEO) {