Пример #1
0
     }
     ob_start();
     include S9Y_INCLUDE_PATH . 'include/genpage.inc.php';
     $data = ob_get_contents();
     ob_end_clean();
     if (isset($serendipity['pregenerate']) && $serendipity['pregenerate']) {
         $fp = fopen($serendipity['serendipityPath'] . PATH_ARCHIVES . '/' . $id, 'w');
         fwrite($fp, $data);
         fclose($fp);
     }
     print $data;
 } elseif (preg_match(PAT_PERMALINK_FEEDCATEGORIES, $uri, $matches) || preg_match(PAT_PERMALINK_FEEDAUTHORS, $uri, $matches) || preg_match(PAT_FEEDS, $uri)) {
     $serendipity['view'] = 'feed';
     header('Content-Type: text/html; charset=utf-8');
     if (preg_match('@/(index|atom[0-9]*|rss|comments|trackbacks|comments_and_trackbacks|opml)\\.(rss[0-9]?|rdf|rss|xml|atom)@', $uri, $vmatches)) {
         list($_GET['version'], $_GET['type']) = serendipity_discover_rss($vmatches[1], $vmatches[2]);
     }
     if (is_array($matches)) {
         if (preg_match('@(/?' . preg_quote(PATH_FEEDS, '@') . '/)(.+)\\.rss@i', $uri, $uriparts)) {
             if (strpos($uriparts[2], $serendipity['permalinkCategoriesPath']) === 0) {
                 $catid = serendipity_searchPermalink($serendipity['permalinkFeedCategoryStructure'], $uriparts[2], $matches[1], 'category');
                 if (is_numeric($catid) && $catid > 0) {
                     $_GET['category'] = $catid;
                 }
             } elseif (strpos($uriparts[2], $serendipity['permalinkAuthorsPath']) === 0) {
                 $authorid = serendipity_searchPermalink($serendipity['permalinkFeedAuthorStructure'], $uriparts[2], $matches[1], 'author');
                 if (is_numeric($authorid) && $authorid > 0) {
                     $_GET['viewAuthor'] = $authorid;
                 }
             }
         }
Пример #2
0
function serveFeed($matches)
{
    global $serendipity;
    $serendipity['view'] = 'feed';
    header('Content-Type: text/html; charset=utf-8');
    $uri = $_SERVER['REQUEST_URI'];
    if (preg_match('@/(index|atom[0-9]*|rss|comments|trackbacks|comments_and_trackbacks|opml)\\.(rss[0-9]?|rdf|rss|xml|atom)@', $uri, $vmatches)) {
        list($_GET['version'], $_GET['type']) = serendipity_discover_rss($vmatches[1], $vmatches[2]);
    }
    if (is_array($matches)) {
        if (preg_match('@(/?' . preg_quote(PATH_FEEDS, '@') . '/)(.+?)(?:\\.rss)?$@i', $uri, $uriparts)) {
            if (strpos($uriparts[2], $serendipity['permalinkCategoriesPath']) === 0) {
                $catid = serendipity_searchPermalink($serendipity['permalinkFeedCategoryStructure'], $uriparts[2], $matches[1], 'category');
                if (is_numeric($catid) && $catid > 0) {
                    $_GET['category'] = $catid;
                }
            } elseif (strpos($uriparts[2], $serendipity['permalinkAuthorsPath']) === 0) {
                $authorid = serendipity_searchPermalink($serendipity['permalinkFeedAuthorStructure'], $uriparts[2], $matches[1], 'author');
                if (is_numeric($authorid) && $authorid > 0) {
                    $_GET['viewAuthor'] = $authorid;
                }
            }
        }
    }
    include S9Y_INCLUDE_PATH . 'rss.php';
}
Пример #3
0
<?php

# $Id: rss.php 2684 2010-08-26 15:51:33Z garvinhicking $
# Copyright (c) 2003-2005, Jannis Hermanns (on behalf the Serendipity Developer Team)
# All rights reserved.  See LICENSE file for licensing details
header('Content-Type: text/xml; charset=utf-8');
session_cache_limiter('public');
@define('IN_RSS', true);
include 'serendipity_config.inc.php';
include S9Y_INCLUDE_PATH . 'include/functions_rss.inc.php';
$version = $_GET['version'];
$description = $serendipity['blogDescription'];
$title = $serendipity['blogTitle'];
$comments = FALSE;
if (empty($version)) {
    list($version) = serendipity_discover_rss($_GET['file'], $_GET['ext']);
}
if (isset($_GET['category'])) {
    $serendipity['GET']['category'] = $_GET['category'];
}
if (isset($_GET['viewAuthor'])) {
    $serendipity['GET']['viewAuthor'] = $_GET['viewAuthor'];
}
if (!isset($_GET['type'])) {
    $_GET['type'] = 'content';
}
if (!empty($_SERVER['HTTP_USER_AGENT']) && stristr($_SERVER['HTTP_USER_AGENT'], 'feedburner')) {
    $_GET['nocache'] = true;
}
$serendipity['view'] = 'feed';
switch ($_GET['type']) {