예제 #1
0
파일: rss.php 프로젝트: davidmottet/automne
    } else {
        $content .= '<item>' . "\n" . '    <title>RSS Feed Error ..</title>' . "\n" . '    <guid isPermaLink="false">Error' . time() . '</guid>' . "\n" . '    <description><![CDATA[';
        switch ($error) {
            case 1:
                $content .= 'Error : RSS ID not found or not a valid integer ... Please contact the webmaster here : ' . APPLICATION_MAINTAINER_EMAIL;
                break;
            case 2:
                $content .= 'Error : Invalid RSS ID found ... Please contact the webmaster here : ' . APPLICATION_MAINTAINER_EMAIL;
                break;
            case 3:
                $content .= 'Error : RSS Content generation error or no valid content for this RSS feed ... Please contact the webmaster here : ' . APPLICATION_MAINTAINER_EMAIL;
                break;
        }
        $content .= ']]></description>' . "\n" . '    <link>' . CMS_websitesCatalog::getMainURL() . '</link>' . "\n" . '</item>';
    }
    $content .= '	</channel>' . "\n" . '</rss>';
    if ('utf-8' != strtolower(APPLICATION_DEFAULT_ENCODING)) {
        $content = io::utf8Encode($content);
    }
    //output content to record it into cache
    echo $content;
    $content = $cache->endSave();
}
unset($cache);
//send RSS content
if (!isset($_REQUEST['atm-previz'])) {
    header('Content-type: text/xml; charset=UTF-8');
    echo $content;
} else {
    echo '<pre>' . htmlspecialchars($content) . '</pre>';
}