function getResponseFeedByEntryId($blogid, $entryId, $mode = 'rss') { global $database, $serviceURL, $defaultURL, $blogURL, $blog, $service; if (empty($blogid)) { $blogid = getBlogId(); } $entry = POD::queryRow("SELECT slogan, visibility, category FROM {$database['prefix']}Entries WHERE blogid = {$blogid} AND id = {$entryId}"); if (empty($entry)) { return false; } if ($entry['visibility'] < 2) { return false; } if (in_array($entry['category'], getCategoryVisibilityList($blogid, 'private'))) { return false; } $channel = array(); $channel = initializeRSSchannel($blogid); $channel['title'] = RSSMessage($blog['title'] . ': ' . _textf('%1에 달린 최근 댓글/트랙백 목록', $entry['slogan'])); $recentComment = getCommentFeedByEntryId($blogid, $entryId, true, $mode); $recentTrackback = getTrackbackFeedByEntryId($blogid, $entryId, true, $mode); $merged = array_merge($recentComment, $recentTrackback); $channel['items'] = $merged; $rss = array('channel' => $channel); if ($mode == 'rss') { return publishRSS($blogid, $rss); } else { if ($mode == 'atom') { return publishATOM($blogid, $rss); } } return false; }
/// 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_LOGIN__', true); define('__TEXTCUBE_CUSTOM_HEADER__', true); require ROOT . '/library/preprocessor.php'; requireModel("blog.feed"); requireModel("blog.entry"); requireStrictBlogURL(); $cache = pageCache::getInstance(); if (!empty($suri['id'])) { $cache->reset('trackbackATOM-' . $suri['id']); if (!$cache->load()) { $result = getTrackbackFeedByEntryId(getBlogId(), $suri['id'], false, 'atom'); if ($result !== false) { $cache->reset('trackbackATOM-' . $suri['id']); $cache->contents = $result; $cache->update(); } } } else { $cache->reset('trackbackATOM'); if (!$cache->load()) { $result = getTrackbackFeedTotal(getBlogId(), false, 'atom'); if ($result !== false) { $cache->reset('trackbackATOM'); $cache->contents = $result; $cache->update(); }
function getResponseFeedByEntryId($blogid, $entryId, $mode = 'rss') { $context = Model_Context::getInstance(); if (empty($blogid)) { $blogid = getBlogId(); } $pool = DBModel::getInstance(); $pool->reset("Entries"); $pool->setQualifier("blogid", "eq", $blogid); $pool->setQualifier("id", "eq", $entryId); $entry = $pool->getRow("slogan,visibility,category"); if (empty($entry)) { return false; } if ($entry['visibility'] < 2) { return false; } if (in_array($entry['category'], getCategoryVisibilityList($blogid, 'private'))) { return false; } $channel = array(); $channel = initializeRSSchannel($blogid); $channel['title'] = RSSMessage($context->getProperty('blog.title') . ': ' . _textf('%1에 달린 최근 댓글/트랙백 목록', $entry['slogan'])); $recentComment = getCommentFeedByEntryId($blogid, $entryId, true, $mode); $recentTrackback = getTrackbackFeedByEntryId($blogid, $entryId, true, $mode); $merged = array_merge($recentComment, $recentTrackback); $channel['items'] = $merged; $rss = array('channel' => $channel); if ($mode == 'rss') { return publishRSS($blogid, $rss); } else { if ($mode == 'atom') { return publishATOM($blogid, $rss); } } return false; }
/// 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_LOGIN__', true); define('__TEXTCUBE_CUSTOM_HEADER__', true); require ROOT . '/library/preprocessor.php'; requireModel("blog.feed"); requireModel("blog.entry"); requireStrictBlogURL(); $cache = pageCache::getInstance(); if (!empty($suri['id'])) { $cache->reset('trackbackRSS-' . $suri['id']); if (!$cache->load()) { $result = getTrackbackFeedByEntryId(getBlogId(), $suri['id']); if ($result !== false) { $cache->reset('trackbackRSS-' . $suri['id']); $cache->contents = $result; $cache->update(); } } } else { $cache->reset('trackbackRSS'); if (!$cache->load()) { $result = getTrackbackFeedTotal(getBlogId()); if ($result !== false) { $cache->reset('trackbackRSS'); $cache->contents = $result; $cache->update(); }
function getResponseFeedByEntryId($blogid, $entryId, $mode = 'rss') { $ctx = Model_Context::getInstance(); if (empty($blogid)) { $blogid = getBlogId(); } $entry = POD::queryRow("SELECT slogan, visibility, category FROM " . $ctx->getProperty('database.prefix') . "Entries WHERE blogid = {$blogid} AND id = {$entryId}"); if (empty($entry)) { return false; } if ($entry['visibility'] < 2) { return false; } if (in_array($entry['category'], getCategoryVisibilityList($blogid, 'private'))) { return false; } $channel = array(); $channel = initializeRSSchannel($blogid); $channel['title'] = RSSMessage($ctx->getProperty('blog.title') . ': ' . _textf('%1에 달린 최근 댓글/트랙백 목록', $entry['slogan'])); $recentComment = getCommentFeedByEntryId($blogid, $entryId, true, $mode); $recentTrackback = getTrackbackFeedByEntryId($blogid, $entryId, true, $mode); $merged = array_merge($recentComment, $recentTrackback); $channel['items'] = $merged; $rss = array('channel' => $channel); if ($mode == 'rss') { return publishRSS($blogid, $rss); } else { if ($mode == 'atom') { return publishATOM($blogid, $rss); } } return false; }