Beispiel #1
0
function getParentCategoryId($blogid, $id)
{
    $context = Model_Context::getInstance();
    if ($context->getProperty('category.raw') === null) {
        getCategories($blogid, 'raw');
    }
    //To cache category information.
    if ($result = MMCache::queryRow($context->getProperty('category.raw'), 'id', $id)) {
        return $result['parent'];
    }
    return null;
}
Beispiel #2
0
function getParentCategoryId($blogid, $id)
{
    global $__gCacheCategoryRaw;
    if (empty($__gCacheCategoryRaw)) {
        getCategories($blogid, 'raw');
    }
    //To cache category information.
    if ($result = MMCache::queryRow($__gCacheCategoryRaw, 'id', $id)) {
        return $result['parent'];
    }
    return null;
}