示例#1
0
  You should have received a copy of the GNU General Public License
  along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/
require 'sys/header.php';
$strFeed = empty($_GET['name']) ? "" : $CMS->FilterAlphanumeric($_GET['name'], "");
$RSS = new RSSBuilder();
switch ($strFeed) {
    case "articles":
        $intAreaID = empty($_GET['id']) ? "" : $CMS->FilterNumeric($_GET['id']);
        if (!$intAreaID) {
            $strFeedburnerURL = $CMS->SYS->GetSysPref(C_PREF_RSS_ARTICLES_URL);
            if ($strFeedburnerURL) {
                $strUserAgent = empty($_SERVER['HTTP_USER_AGENT']) ? "" : $_SERVER['HTTP_USER_AGENT'];
                if (strpos(strtoupper($strUserAgent), "FEEDBURNER") !== false) {
                    // Feedburner is OK to access this URL
                } else {
                    httpRedirect($strFeedburnerURL);
                    exit;
                }
            }
        }
        exit($RSS->GetArticleRSS($intAreaID));
        break;
    case "comments":
        $intArticleID = empty($_GET['id']) ? "" : $CMS->FilterNumeric($_GET['id']);
        exit($RSS->GetCommentRSS($intArticleID));
        break;
    default:
        $CMS->Err_MFail(M_ERR_MISSINGPARAMS_SYSTEM, "name");
}