Exemplo n.º 1
0
/// Copyright (c) 2004-2012, Needlworks  / Tatter Network Foundation
/// All rights reserved. Licensed under the GPL.
/// See the GNU General Public License for more details. (/documents/LICENSE, /documents/COPYRIGHT)
define('NO_SESSION', true);
define('__TEXTCUBE_CUSTOM_HEADER__', true);
define('__TEXTCUBE_LOGIN__', true);
require ROOT . '/library/preprocessor.php';
requireStrictBlogURL();
$context = Model_Context::getInstance();
$period = $suri['id'];
$blogid = getBlogId();
$cache = pageCache::getInstance();
$cache->reset('archiveAtom-' . $period);
if (!$cache->load()) {
    requireModel("blog.feed");
    list($entries, $paging) = getEntriesWithPagingByPeriod($blogid, $period, 1, 1, 1);
    //var_dump($entries);
    if (empty($entries)) {
        header("Location: " . $context->getProperty('uri.host') . $context->getProperty('uri.blog') . "/atom");
        exit;
    }
    $result = getFeedWithEntries($blogid, $entries, _textf('%1 기간의 글 목록', $period), 'atom');
    if ($result !== false) {
        $cache->reset('archiveAtom-' . $period);
        $cache->contents = $result;
        $cache->update();
    }
}
header('Content-Type: application/rss+xml; charset=utf-8');
fireEvent('FeedOBStart');
echo fireEvent('ViewArchiveRSS', $cache->contents);
Exemplo n.º 2
0
<?php

/// Copyright (c) 2004-2012, Needlworks  / Tatter Network Foundation
/// All rights reserved. Licensed under the GPL.
/// See the GNU General Public License for more details. (/documents/LICENSE, /documents/COPYRIGHT)
require ROOT . '/library/preprocessor.php';
if (!empty($suri['id'])) {
    $period = $suri['id'];
} else {
    $period = Timestamp::getYearMonth();
}
fireEvent('OBStart');
require ROOT . '/interface/common/blog/begin.php';
if ($skinSetting['showListOnArchive'] != 0) {
    $listWithPaging = getEntryListWithPagingByPeriod($blogid, $period, $suri['page'], $blog['entriesOnList']);
    $list = array('title' => getPeriodLabel($period), 'items' => $listWithPaging[0], 'count' => $listWithPaging[1]['total']);
    $paging = $listWithPaging[1];
    if ($skinSetting['showListOnArchive'] == 1) {
        $skinSetting['showListWithTotalEntries'] = true;
    }
    $listFeedURL = 'archive/' . $period;
    require ROOT . '/interface/common/blog/list.php';
}
$entries = array();
if ($skinSetting['showListOnArchive'] != 2) {
    list($entries, $paging) = getEntriesWithPagingByPeriod($blogid, $period, $suri['page'], $skinSetting['showListOnArchive'] == 3 ? $blog['entriesOnPage'] : $blog['entriesOnList']);
    require ROOT . '/interface/common/blog/entries.php';
}
require ROOT . '/interface/common/blog/end.php';
fireEvent('OBEnd');