コード例 #1
0
ファイル: index.php プロジェクト: ragi79/Textcube
define('__TEXTCUBE_LOGIN__', true);
define('__TEXTCUBE_CUSTOM_HEADER__', true);
require ROOT . '/library/preprocessor.php';
requireModel("blog.category");
requireStrictBlogURL();
$children = array();
$cache = pageCache::getInstance();
if (!empty($suri['id'])) {
    $categoryId = $suri['id'];
    if (in_array($categoryId, getCategoryVisibilityList($blogid, 'private'))) {
        return false;
    }
    $categotyTitle = getCategoryNameById($categoryId);
} else {
    if (!empty($suri['value'])) {
        $categoryId = getCategoryIdByLabel(getBlogId(), $suri['value']);
        if (in_array($categoryId, getCategoryVisibilityList($blogid, 'private'))) {
            return false;
        }
        $categoryTitle = $suri['value'];
    } else {
        // If no category is mentioned, redirect it to total atom.
        header("Location: " . $context->getProperty('uri.host') . $context->getProperty('uri.blog') . "/atom");
        exit;
    }
}
$cache->reset('categoryATOM-' . $categoryId);
if (!$cache->load()) {
    $categoryIds = array($categoryId);
    $parent = getParentCategoryId(getBlogId(), $categoryId);
    if ($parent === null) {
コード例 #2
0
ファイル: category.php プロジェクト: Avantians/Textcube
<?php

/// Copyright (c) 2004-2015, 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';
$cache = pageCache::getInstance();
if (!isset($suri['id']) || Setting::getBlogSettingGlobal('useSloganOnCategory', 1) == 1) {
    $category = empty($suri['value']) ? 0 : getCategoryIdByLabel($blogid, $suri['value']);
    $listFeedURL = 'category/' . $suri['value'];
} else {
    $category = $suri['id'];
    $suri['value'] = getCategoryLabelById($blogid, $category);
    $listFeedURL = 'category/' . $suri['id'];
}
if (!doesHaveOwnership() && getCategoryVisibility($blogid, $category) < 2) {
    $category = null;
}
// Keylog as category description
$keylogEntry = null;
if (Setting::getBlogSettingGlobal('useKeywordAsCategory', true) == true) {
    $cache->reset();
    $cache->name = 'keyword-category-' . $category . '-';
    if ($cache->load()) {
        $keylogEntry = unserialize($cache->contents);
    } else {
        $entries = array();
        $entries[0] = getKeylogByTitle(getBlogId(), $suri['value']);
        if (!empty($entries[0])) {
            $keylogEntry = $entries;
            $cache->contents = serialize($entries);