yangakw yangakw

discuz权限增强的功能

in 代码read (52) 文章转载请注明来源!

1.在\source\module\forum\forum_viewthread.php下修改
$_G["article_tagnames"]=$tagnames;

 

2.新增插件

class plugin_userarticletag {

var $value = array();
function global_usernav_extra1() {
$this->article_tag();
return $this->value['global_usernav_extra1'];
}
function article_tag(){
global $_G;
if(!$_G['uid']) {
return;
}
$tag = DB::table("common_tag");
$tagitem = DB::table("common_tagitem");
$sql=sprintf(
"select tagname as tag from %s join %s on %s.tagid = %s.tagid where %s.itemid = %s and idtype= 'uid';",
$tagitem,
$tag,
$tagitem,
$tag,
$tagitem,
$_G['uid']
);
$iData = DB::fetch_first($sql);
$tag = isset($iData["tag"])?$iData["tag"]:"no tag";
$_G["tag"]=$tag;

//var_dump($_G);die;
$this->value['global_usernav_extra1'] = $tag;
$tagnames = $_G["article_tagnames"];
if(count($tagnames)>0){
if(isset($_G["tag"])){
if(in_array($_G["tag"] , $tagnames)){
goto SUCCESS;
}
}
exit("<script>alert('您不可以查看本贴!');location.href='/';</script>");
}
SUCCESS:
return true;
}
}
jrotty WeChat Pay

微信打赏

jrotty Alipay

支付宝打赏

文章二维码

扫描二维码,在手机上阅读!

此处评论已关闭

博客已运行
© 2017 yangakw
PREVIOUS NEXT
雷姆
拉姆