特定用户组隐藏贴免回复权限,從4.0一直用到7.2,很好用。
现在升到X1.5,因為自己不懂PHP請教別人升級也一直無人幫忙指導
所以就自己照原版本修改,功能正常,現在把修改方法寫出來,請高手看看,有無錯誤或優化代碼的地方
X1.5内容:
- 一:升级数据库:ALTER TABLE `pre_common_usergroup_field` ADD `ishidefree` TINYINT( 1 ) DEFAULT '0' NOT NULL ;
- 二:修改source/admin/admincp_usergroups.php
- 查找:
- showsetting('usergroups_edit_post_new', 'allowpostnew', $group['allowpost'], 'radio');
- 前面加入:
- showsetting('usergroups_hidefree_post', 'ishidefreenew', $group['ishidefree'], 'radio');
- 再查找:
- 'allowpost' => $_G['gp_allowpostnew'],
- 前面加入 :
- 'ishidefree' => $_G['gp_ishidefreenew'],
- 三:修改source/function/function_discuzcode.php
- 查找 :
- $_G['member']['credits'] >= $creditsrequire || $_G['forum']['ismoderator']
- 后面插入 :
- || $_G['group']['ishidefree']
- 再找第2個 :
- if($authorreplyexist
- 注意:是第2個
- 后面插入 :
- || $_G['group']['ishidefree']
- 四:修改source/language/lang_admincp.php
- 查找:
- 'usergroups_edit_post_new' => '允許發表主題',
- 上面添加:
- 'usergroups_hidefree_post' => '擁有隱藏貼免回覆權限:',
- 'usergroups_hidefree_post_comment' => '設置是否擁有隱藏貼免回覆權限',
- 後台 "用戶"->用戶組->論壇相關->貼子相關>要設置此功能的用戶組按設置是否擁有隱藏貼免回復權限 選"是",即可.
复制代码 這是7.0的
- 一:升级数据库:ALTER TABLE `cdb_usergroups` ADD `ishidefree` TINYINT( 1 ) DEFAULT '0' NOT NULL ;
- 二:修改admin/usergroups.inc.php
- 查找:
- showsetting('usergroups_edit_special_vote', 'allowvotenew', $group['allowvote'], 'radio');
- 前面加入:showsetting('usergroups_hidefree_post', 'ishidefreenew', $group['ishidefree'], 'radio');
- 再查找:
- allowpost='$allowpostnew',
- 前面加入 :
- ishidefree='$ishidefreenew',
- 三:修改include/discuzcode.func.php
- 查找 :
- && !$GLOBALS['forum']['ismoderator'
- 前面插入 :
- && !$GLOBALS['ishidefree']
- 再找 :
- || $apid = $db->result($query, 0)
- 前面插入:
- || $GLOBALS['ishidefree']
- 四:修改templates\default\admincp.lang.php
- 查找:
- 'usergroups_edit_post_new' => '允许发新话题:',
- 上面添加:
- 'usergroups_hidefree_post' => '拥有隐藏贴免回复权限:',
- 'usergroups_hidefree_post_comment' => '设置是否拥有隐藏贴免回复权限',
- 后台 "用户"->用户组->特殊主体>要设置此功能的用户组按设置是否拥有隐藏贴免回复权限 选"是",即可
复制代码
|