当前位置: 首页>>代码示例>>PHP>>正文


PHP getallowcategory函数代码示例

本文整理汇总了PHP中getallowcategory函数的典型用法代码示例。如果您正苦于以下问题:PHP getallowcategory函数的具体用法?PHP getallowcategory怎么用?PHP getallowcategory使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了getallowcategory函数的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: _getResult

 private function _getResult($res, $aid, $page)
 {
     require_once DISCUZ_ROOT . './source/function/function_home.php';
     require_once DISCUZ_ROOT . './source/function/function_portal.php';
     loadcache('portalcategory');
     global $_G;
     // 在DISCUZ_ROOT/source/module/portal/portal_view.php基础上二次开发
     if (empty($aid)) {
         return $this->makeErrorInfo($res, lang('message', 'view_no_article_id'));
     }
     $article = C::t('portal_article_title')->fetch($aid);
     require_once libfile('function/portalcp');
     $categoryperm = getallowcategory($_G['uid']);
     if (empty($article) || $article['status'] > 0 && $article['uid'] != $_G['uid'] && !$_G['group']['allowmanagearticle'] && empty($categoryperm[$article['catid']]['allowmanage']) && $_G['adminid'] != 1 && $_GET['modarticlekey'] != modauthkey($article['aid'])) {
         return $this->makeErrorInfo($res, lang('message', 'view_article_no_exist'));
     }
     // if(!empty($_G['setting']['antitheft']['allow']) && empty($_G['setting']['antitheft']['disable']['article']) && empty($_G['cache']['portalcategory'][$article['catid']]['noantitheft'])) {
     //     helper_antitheft::check($aid, 'aid');
     // }
     $res['body']['newsInfo'] = $this->_getNewsInfo($article, $page);
     return $res;
 }
开发者ID:caidongyun,项目名称:CS,代码行数:22,代码来源:NewsViewAction.php

示例2: exit

/**
 *      [Discuz!] (C)2001-2099 Comsenz Inc.
 *      This is NOT a freeware, use is subject to license terms
 *
 *      $Id: portal_view.php 33660 2013-07-29 07:51:05Z nemohou $
 */
if (!defined('IN_DISCUZ')) {
    exit('Access Denied');
}
$aid = empty($_GET['aid']) ? 0 : intval($_GET['aid']);
if (empty($aid)) {
    showmessage('view_no_article_id');
}
$article = C::t('portal_article_title')->fetch($aid);
require_once libfile('function/portalcp');
$categoryperm = getallowcategory($_G['uid']);
if (empty($article) || $article['status'] > 0 && $article['uid'] != $_G['uid'] && !$_G['group']['allowmanagearticle'] && empty($categoryperm[$article['catid']]['allowmanage']) && $_G['adminid'] != 1 && $_GET['modarticlekey'] != modauthkey($article['aid'])) {
    showmessage('view_article_no_exist');
}
if (!empty($_G['setting']['antitheft']['allow']) && empty($_G['setting']['antitheft']['disable']['article']) && empty($_G['cache']['portalcategory'][$article['catid']]['noantitheft'])) {
    helper_antitheft::check($aid, 'aid');
}
if (!empty($_G['setting']['makehtml']['flag']) && $article['htmlmade'] && !isset($_G['makehtml']) && empty($_GET['diy']) && empty($article['url'])) {
    dheader('location:' . fetch_article_url($article));
}
$article_count = C::t('portal_article_count')->fetch($aid);
if ($article_count) {
    $article = array_merge($article_count, $article);
}
if ($article_count) {
    C::t('portal_article_count')->increase($aid, array('viewnum' => 1));
开发者ID:tang86,项目名称:discuz-utf8,代码行数:31,代码来源:portal_view.php

示例3: showmessage

         $_time = !empty($article) ? $article['dateline'] : TIMESTAMP;
         if (file_exists(helper_makehtml::fetch_dir($portalcategory[$catid]['fullfoldername'], $_time) . $htmlname . '.' . $_G['setting']['makehtml']['extendname'])) {
             showmessage('html_existed');
         } else {
             showmessage('html_have_no_exists');
         }
     } else {
         showmessage('make_html_closed');
     }
 } else {
     if (empty($_G['cache']['portalcategory'])) {
         showmessage('portal_has_not_category');
     }
     if (!checkperm('allowmanagearticle') && !checkperm('allowpostarticle')) {
         $allowcategorycache = array();
         if ($allowcategory = getallowcategory($_G['uid'])) {
             foreach ($allowcategory as $catid => $category) {
                 $allowcategorycache[$catid] = $_G['cache']['portalcategory'][$catid];
             }
         }
         foreach ($allowcategorycache as &$_value) {
             if ($_value['upid'] && !isset($allowcategorycache[$_value['upid']])) {
                 $_value['level'] = 0;
             }
         }
         $_G['cache']['portalcategory'] = $allowcategorycache;
     }
     if (empty($_G['cache']['portalcategory'])) {
         showmessage('portal_article_add_nopermission');
     }
     $category = $_G['cache']['portalcategory'];
开发者ID:renning,项目名称:html,代码行数:31,代码来源:portalcp_article.php

示例4: check_articleperm

function check_articleperm($catid, $aid = 0, $article = array(), $isverify = false, $return = false)
{
    global $_G;
    if (empty($catid)) {
        if (!$return) {
            showmessage('article_category_empty');
        } else {
            return 'article_category_empty';
        }
    }
    if ($_G['group']['allowmanagearticle'] || empty($aid) && $_G['group']['allowpostarticle'] || $_GET['modarticlekey'] == modauthkey($aid)) {
        return true;
    }
    $permission = getallowcategory($_G['uid']);
    if (isset($permission[$catid])) {
        if ($permission[$catid]['allowmanage'] || empty($aid) && $permission[$catid]['allowpublish']) {
            return true;
        }
    }
    if (!$isverify && $aid && !empty($article['uid']) && $article['uid'] == $_G['uid'] && ($article['status'] == 1 && $_G['group']['allowpostarticlemod'] || empty($_G['group']['allowpostarticlemod']))) {
        return true;
    }
    if (!$return) {
        showmessage('article_edit_nopermission');
    } else {
        return 'article_edit_nopermission';
    }
}
开发者ID:softhui,项目名称:discuz,代码行数:28,代码来源:function_portalcp.php

示例5: exit

/**
 *      [Discuz!] (C)2001-2099 Comsenz Inc.
 *      This is NOT a freeware, use is subject to license terms
 *
 *      $Id: portal_view.php 29055 2012-03-23 09:25:15Z zhangguosheng $
 */
if (!defined('IN_DISCUZ')) {
    exit('Access Denied');
}
$aid = empty($_GET['aid']) ? 0 : intval($_GET['aid']);
if (empty($aid)) {
    showmessage('view_no_article_id');
}
$article = C::t('portal_article_title')->fetch($aid);
require_once libfile('function/portalcp');
$permission = getallowcategory($_G['uid']);
if (empty($article) || $article['status'] > 0 && $article['uid'] != $_G['uid'] && !$_G['group']['allowmanagearticle'] && empty($permission[$article['catid']]['allowmanage']) && $_G['adminid'] != 1 && $_GET['modarticlekey'] != modauthkey($article['aid'])) {
    showmessage('view_article_no_exist');
}
$article_count = C::t('portal_article_count')->fetch($aid);
if ($article_count) {
    $article = array_merge($article_count, $article);
}
if ($article_count) {
    C::t('portal_article_count')->increase($aid, array('viewnum' => 1));
    unset($article_count);
} else {
    C::t('portal_article_count')->insert(array('aid' => $aid, 'catid' => $article['catid'], 'viewnum' => 1));
}
if ($article['url']) {
    dheader("location:{$article['url']}");
开发者ID:dalinhuang,项目名称:healthshop,代码行数:31,代码来源:portal_view.php

示例6: check_articleperm

function check_articleperm($catid, $aid = 0)
{
    global $_G;
    if (empty($catid) && empty($aid)) {
        showmessage('article_category_empty');
    }
    if ($_G['group']['allowmanagearticle'] || empty($aid) && $_G['group']['allowpostarticle']) {
        return true;
    }
    $permission = getallowcategory($_G['uid']);
    if (isset($permission[$catid])) {
        if ($permission[$catid]['allowmanage'] || empty($aid) && $permission[$catid]['allowpublish']) {
            return true;
        }
    }
    showmessage('article_edit_nopermission');
}
开发者ID:Kingson4Wu,项目名称:php_demo,代码行数:17,代码来源:portalcp_article.php


注:本文中的getallowcategory函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。