Discuz!X22.5 “会员每小时发帖数限制“修改为”会员每天发帖数限制“

it2022-05-05  241

Discuz!X2/2.5 “会员每小时发帖数限制“修改为”会员每天发帖数限制“

修改后台用户组的设置,由“会员每小时发帖数限制“到”会员每天发帖数限制“,下面分别讲一下Discuz! X2和Discuz! X2.5的修改方法。

一、Discuz! X2的修改方法: 1,修改后台设置显示; "\source\language\lang_admincp.php"的5021行

'project_option_group_maxpostsperhour' => '会员每小时发帖数限制',

复制代码

修改为:

'project_option_group_maxpostsperhour' => '会员每天发帖数限制',

复制代码

2,修改发帖数超过限制提醒文字;

\source\language\lang_message.php"的105行 'post_flood_ctrl_posts_per_hour' => '抱歉,您所在的用户组每小时限制发帖 {posts_per_hour} 个,请稍候再发表',

复制代码

修改为:

'post_flood_ctrl_posts_per_hour' => '抱歉,您所在的用户组每天限制发帖 {posts_per_hour} 个,请稍候再发表',

复制代码

3,修改检验程序文件,友“会员每小时发帖数限制“修改为”会员每天发帖数限制“ "\source\function\function_post.php"的313行

<ul type="1" class="litype_1"><li>function checkmaxpostsperhour() {</li><li> global $_G;</li><li> $morepostsperhour = false;</li><li> if(!$_G['group']['disablepostctrl'] && $_G['uid']) {</li><li></li><li> if($_G['group']['maxpostsperhour']) {</li><li> $timestamp = $_G['timestamp']-3600;</li><li> $userposts = DB::result_first('SELECT COUNT(*) FROM '.DB::table('common_member_action_log')." WHERE dateline>$timestamp AND (`action`='".getuseraction('tid')."' OR `action`='".getuseraction('pid')."') AND uid='$_G[uid]'");</li><li> $isflood = $userposts && ($userposts >= $_G['group']['maxpostsperhour']);</li><li> if($isflood) {</li><li> $morepostsperhour = true;</li><li> }</li><li> }</li><li> }</li><li> return $morepostsperhour;</li><li>}</li></ul>

复制代码

修改为:

<ul type="1" class="litype_1"><li>function checkmaxpostsperhour() {</li><li> global $_G;</li><li> $morepostsperhour = false;</li><li> if(!$_G['group']['disablepostctrl'] && $_G['uid']) {</li><li></li><li> if($_G['group']['maxpostsperhour']) {</li><li> $timestamp = $_G['timestamp']-86400;</li><li> $userposts = DB::result_first('SELECT COUNT(*) FROM '.DB::table('common_member_action_log')." WHERE dateline>$timestamp AND (`action`='".getuseraction('tid')."' OR `action`='".getuseraction('pid')."') AND uid='$_G[uid]'");</li><li> $isflood = $userposts && ($userposts >= $_G['group']['maxpostsperhour']);</li><li> if($isflood) {</li><li> $morepostsperhour = true;</li><li> }</li><li> }</li><li> }</li><li> return $morepostsperhour;</li><li>} </li></ul>

复制代码

二、Discuz! X2.5的修改方法: 1,修改后台设置显示; "\source\language\lang_admincp.php"的3703行

<ul type="1" class="litype_1"><li></li><li>'usergroups_edit_basic_hour_threads' => '会员每小时发主题数限制',</li><li> 'usergroups_edit_basic_hour_threads_comment' => '设置允许会员每小时最多的发主题数量,可以配合灌水预防功能进一步限制会员的发帖,可设置为 1~255 范围内的数值,0 为不限制。此功能会轻微加重服务器负担,且对游客无效',</li><li> 'usergroups_edit_basic_hour_posts' => '会员每小时发回帖数限制',</li><li> 'usergroups_edit_basic_hour_posts_comment' => '设置允许会员每小时最多的发回帖数量,可以配合灌水预防功能进一步限制会员的发帖,可设置为 1~255 范围内的数值,0 为不限制。此功能会轻微加重服务器负担,且对游客无效',</li><li> </li></ul>

复制代码

修改为:

<ul type="1" class="litype_1"><li></li><li>'usergroups_edit_basic_hour_threads' => '会员每天发主题数限制',</li><li> 'usergroups_edit_basic_hour_threads_comment' => '设置允许会员每天最多的发主题数量,可以配合灌水预防功能进一步限制会员的发帖,可设置为 1~255 范围内的数值,0 为不限制。此功能会轻微加重服务器负担,且对游客无效',</li><li> 'usergroups_edit_basic_hour_posts' => '会员每天发回帖数限制',</li><li> 'usergroups_edit_basic_hour_posts_comment' => '设置允许会员每天最多的发回帖数量,可以配合灌水预防功能进一步限制会员的发帖,可设置为 1~255 范围内的数值,0 为不限制。此功能会轻微加重服务器负担,且对游客无效',</li><li> </li></ul>

复制代码

\source\language\lang_message.php"的144行

<ul type="1" class="litype_1"><li> 'thread_flood_ctrl_threads_per_hour' => '抱歉,您所在的用户组每天限制发主题 {threads_per_hour} 个,请稍候再发表', </li></ul>

复制代码

修改为:

<ul type="1" class="litype_1"><li> 'thread_flood_ctrl_threads_per_hour' => '抱歉,您所在的用户组每天限制发主题 {threads_per_hour} 个,请稍候再发表',</li></ul>

复制代码

3,修改检验程序文件,友“会员每小时发帖数限制“修改为”会员每天发帖数限制“ "\source\class\table\table_common_member_action_log.php"的32行

<ul type="1" class="litype_1"><li>public function count_per_hour($uid, $type) {</li><li> return DB::result_first('SELECT COUNT(*) FROM %t WHERE dateline>%d AND `action`=%d AND uid=%d', array($this->_table, TIMESTAMP - 3600, getuseraction($type), $uid));</li><li> }</li></ul>

复制代码

修改为:

<ul type="1" class="litype_1"><li>public function count_per_hour($uid, $type) {</li><li> return DB::result_first('SELECT COUNT(*) FROM %t WHERE dateline>%d AND `action`=%d AND uid=%d', array($this->_table, TIMESTAMP - 86400, getuseraction($type), $uid));</li><li> }</li></ul>

复制代码


最新回复(0)