Esempio n. 1
0
define('__TEXTCUBE_CUSTOM_HEADER__', true);
define('__TEXTCUBE_LOGIN__', true);
require ROOT . '/library/preprocessor.php';
requireStrictBlogURL();
$context = Model_Context::getInstance();
$author = $suri['value'];
$authorId = User::getUserIdByName($author);
if (empty($authorId)) {
    exit;
}
$blogid = getBlogId();
$cache = pageCache::getInstance();
$cache->reset('authorATOM-' . $authorId);
if (!$cache->load()) {
    importlib("model.blog.feed");
    list($entries, $paging) = getEntriesWithPagingByAuthor($blogid, $author, 1, 1, 1);
    if (empty($entries)) {
        header("Location: " . $context->getProperty('uri.host') . $context->getProperty('uri.blog') . "/atom");
        exit;
    }
    $result = getFeedWithEntries($blogid, $entries, _textf('%1 의 글 목록', $author), 'atom');
    if ($result !== false) {
        $cache->reset('authorATOM-' . $authorId);
        $cache->contents = $result;
        $cache->update();
    }
}
header('Content-Type: application/atom+xml; charset=utf-8');
fireEvent('FeedOBStart');
echo fireEvent('ViewAuthorATOM', $cache->contents);
fireEvent('FeedOBEnd');
Esempio n. 2
0
$authorId = User::getUserIdByName($author);
if (empty($authorId)) {
    exit;
}
if ($skinSetting['showListOnAuthor'] != 0) {
    $cache->name = 'authorList-' . $authorId . "-" . $suri['page'] . "-";
    if (!$cache->load()) {
        if (!($listWithPaging = getEntryListWithPagingByAuthor($blogid, $author, $suri['page'], $blog['entriesOnList']))) {
            $listWithPaging = array(array(), array('total' => 0));
        }
        $list = array('title' => $author, 'items' => $listWithPaging[0], 'count' => $listWithPaging[1]['total']);
        $paging = $listWithPaging[1];
        $listView = null;
    } else {
        $paging = $cache->dbContents;
        $listView = $cache->contents;
    }
    require ROOT . '/interface/common/blog/begin.php';
    $listFeedURL = 'author/' . URL::encode($author);
    require ROOT . '/interface/common/blog/list.php';
}
$entries = array();
if ($skinSetting['showListOnAuthor'] != 2) {
    unset($cache);
    list($entries, $paging) = getEntriesWithPagingByAuthor($blogid, $author, $suri['page'], $blog['entriesOnList'], $skinSetting['showListOnAuthor'] == 3 ? $blog['entriesOnPage'] : $blog['entriesOnList']);
    if ($skinSetting['showListOnAuthor'] == 0) {
        require ROOT . '/interface/common/blog/begin.php';
    }
    require ROOT . '/interface/common/blog/entries.php';
}
require ROOT . '/interface/common/blog/end.php';