Esempio n. 1
0
define('__TEXTCUBE_CUSTOM_HEADER__', true);
require ROOT . '/library/preprocessor.php';
importlib("model.blog.feed");
importlib("model.blog.entry");
requireStrictBlogURL();
$cache = pageCache::getInstance();
if (!empty($suri['id'])) {
    $cache->reset('responseRSS-' . $suri['id']);
    if (!$cache->load()) {
        $result = getResponseFeedByEntryId(getBlogId(), $suri['id']);
        if ($result !== false) {
            $cache->reset('responseRSS-' . $suri['id']);
            $cache->contents = $result;
            $cache->update();
        }
    }
} else {
    $cache->reset('responseRSS');
    if (!$cache->load()) {
        $result = getResponseFeedTotal(getBlogId());
        if ($result !== false) {
            $cache->reset('responseRSS');
            $cache->contents = $result;
            $cache->update();
        }
    }
}
header('Content-Type: application/rss+xml; charset=utf-8');
fireEvent('FeedOBStart');
echo fireEvent('ViewResponseRSS', $cache->contents);
fireEvent('FeedOBEnd');
Esempio n. 2
0
define('__TEXTCUBE_CUSTOM_HEADER__', true);
require ROOT . '/library/preprocessor.php';
importlib("model.blog.feed");
importlib("model.blog.entry");
requireStrictBlogURL();
$cache = pageCache::getInstance();
if (!empty($suri['id'])) {
    $cache->reset('responseATOM-' . $suri['id']);
    if (!$cache->load()) {
        $result = getResponseFeedByEntryId(getBlogId(), $suri['id'], 'atom');
        if ($result !== false) {
            $cache->reset('responseATOM-' . $suri['id']);
            $cache->contents = $result;
            $cache->update();
        }
    }
} else {
    $cache->reset('responseATOM');
    if (!$cache->load()) {
        $result = getResponseFeedTotal(getBlogId(), 'atom');
        if ($result !== false) {
            $cache->reset('responseATOM');
            $cache->contents = $result;
            $cache->update();
        }
    }
}
header('Content-Type: application/atom+xml; charset=utf-8');
fireEvent('FeedOBStart');
echo fireEvent('ViewResponseATOM', $cache->contents);
fireEvent('FeedOBEnd');