<?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) define('NO_SESSION', true); define('__TEXTCUBE_CUSTOM_HEADER__', true); define('__TEXTCUBE_LOGIN__', true); require ROOT . '/library/preprocessor.php'; requireStrictBlogURL(); $search = isset($_GET['search']) ? $_GET['search'] : $suri['value']; $search = isset($_GET['q']) ? $_GET['q'] : $search; // Consider the common search query GET name. (for compatibility) $list = array('title' => '', 'items' => array(), 'count' => 0); $blogid = getBlogId(); list($entries, $paging) = getEntriesWithPagingBySearch($blogid, $search, 1, 1, 1); if (empty($entries)) { header("Location: " . $context->getProperty('uri.host') . $context->getProperty('uri.blog') . "/atom"); exit; } $cache = pageCache::getInstance(); $cache->reset('searchATOM-' . $search); if (!$cache->load()) { requireModel("blog.feed"); $result = getSearchFeedByKeyword(getBlogId(), $search, 'atom', $search); if ($result !== false) { $cache->reset('searchATOM-' . $search); $cache->contents = $result; $cache->update(); } }
// Consider the common search query GET name. (for compatibility) $list = array('title' => '', 'items' => array(), 'count' => 0); if (strlen($search) > 0 && !empty($suri['page'])) { $listWithPaging = getEntryListWithPagingBySearch($blogid, $search, $suri['page'], $blog['entriesOnList']); $list = array('title' => $search, 'items' => $listWithPaging[0], 'count' => $listWithPaging[1]['total']); $listFeedURL = 'search/' . $search; $paging = $listWithPaging[1]; require ROOT . '/interface/common/blog/begin.php'; require ROOT . '/interface/common/blog/list.php'; } if ($suri['page'] === true || $suri['page'] === '1') { $commentList = getCommentList($blogid, $search); $trackbackList = getTrackbackList($blogid, $search); if (!isset($view)) { require ROOT . '/interface/common/blog/begin.php'; } if (isset($commentList)) { require ROOT . '/interface/common/blog/commentList.php'; } if (isset($trackbackList)) { require ROOT . '/interface/common/blog/trackbackList.php'; } } if ($skinSetting['showListOnSearch'] != 2) { if (!isset($view)) { require ROOT . '/interface/common/blog/begin.php'; } list($entries, $paging) = getEntriesWithPagingBySearch($blogid, $search, $suri['page'], $blog['entriesOnList'], $blog['entriesOnList']); require ROOT . '/interface/common/blog/entries.php'; } require ROOT . '/interface/common/blog/end.php';