Discuz X3.5实现发布主题后主题被回复,主题发布者加积分的修改方法。[erphpdown]
1.执行如下sql语句
INSERT INTO `pre_common_credit_rule` ( `rulename`, `action`, `cycletype`, `cycletime`, `rewardnum`, `norepeat`, `extcredits1`, `extcredits2`, `extcredits3`, `extcredits4`, `extcredits5`, `extcredits6`, `extcredits7`, `extcredits8`, `fids`) VALUES ('主题被回复', 'posthf', 4, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, '');
2.修改源码文件:source\include\post\post_newreply.php
在458行处找到如下代码
$url = "forum.php?mod=viewthread&tid=".$_G['tid']."&pid=".$modpost->pid."&page=".$modpost->param('page')."$antitheft&extra=".$extra."#pid".$modpost->pid;
在下一行处空一行添加如下代码:
if($_G['forum']['ispostjl']){
$authorispostjl = DB::fetch_first("SELECT ispostjl FROM %t u LEFT JOIN %t uf ON u.groupid=uf.groupid WHERE u.uid=%d", array('common_member','common_usergroup_field',$thread['authorid']));
if($authorispostjl['ispostjl']){
$rule = updatecreditbyaction('posthf', $thread['authorid']);
if(!$rule['updatecredit']) {
checkusergroup($thread['authorid']);
}
}
}
修改后大概是这个样子
$url = "forum.php?mod=viewthread&tid=".$_G['tid']."&pid=".$modpost->pid."&page=".$modpost->param('page')."$antitheft&extra=".$extra."#pid".$modpost->pid;
}
if($_G['forum']['ispostjl']){
$authorispostjl = DB::fetch_first("SELECT ispostjl FROM %t u LEFT JOIN %t uf ON u.groupid=uf.groupid WHERE u.uid=%d", array('common_member','common_usergroup_field',$thread['authorid']));
if($authorispostjl['ispostjl']){
$rule = updatecreditbyaction('posthf', $thread['authorid']);
if(!$rule['updatecredit']) {
checkusergroup($thread['authorid']);
}
}
}
if(!isset($inspacecpshare)) {
showmessage($return , $url, $modpost->param('showmsgparam'));
}
}
?>
3.更新表
ALTER table pre_common_usergroup_field ADD COLUMN `ispostjl` SMALLINT DEFAULT 0;
4.更新源码 source\admincp\admincp_usergroups.php。在admincp_usergroups.php大约626行处找到如下代码:
showsetting('usergroups_edit_basic_close_ad', 'closeadnew', $group['closead'], 'radio');
在它后面一行添加如下代码:
showsetting('主题被回复奖励', 'ispostjl',$group['ispostjl'], 'radio');
插入代码后上下行是这个样子:
showsetting('usergroups_edit_basic_disable_postctrl', 'disablepostctrlnew', $group['disablepostctrl'], 'radio');
showsetting('usergroups_edit_basic_ignore_censor', 'ignorecensornew', $group['ignorecensor'], 'radio');
showsetting('usergroups_edit_basic_allowcreatecollection', 'allowcreatecollectionnew', intval($group['allowcreatecollection']), 'text');
showsetting('usergroups_edit_basic_allowfollowcollection', 'allowfollowcollectionnew', intval($group['allowfollowcollection']), 'text');
showsetting('usergroups_edit_basic_close_ad', 'closeadnew', $group['closead'], 'radio');
showsetting('主题被回复奖励', 'ispostjl',$group['ispostjl'], 'radio');
showtablefooter();
showtagfooter('div');
再在1158行左右找到
'allowfollowcollection' => intval($_GET['allowfollowcollectionnew']),
后面添加
'ispostjl' => intval($_GET['ispostjl']),
添加后的样子:
'allowcreatecollection' => intval($_GET['allowcreatecollectionnew']), 'allowfollowcollection' => intval($_GET['allowfollowcollectionnew']), 'ispostjl' => intval($_GET['ispostjl']), 'exempt' => $exemptnew, 'raterange' => $raterangenew, 'ignorecensor' => intval($_GET['ignorecensornew']), 'allowsendallpm' => intval($_GET['allowsendallpmnew']), 'allowsendpmmaxnum' => intval($_GET['allowsendpmmaxnumnew']), 'closead' => intval($_GET['closeadnew']),
5.执行SQL语句,更新表
ALTER table pre_forum_forumfield ADD COLUMN `ispostjl` SMALLINT DEFAULT 0;
6.更新源码source\admincp\admincp_forums.php:
在大约950行附近找到
showsetting('forums_edit_posts_noforumrecommend', 'noforumrecommendnew', $forum['noforumrecommend'], 'radio');
在后边一行添加如下代码:
showsetting('主题被回复奖励', 'ispostjl',$forum['ispostjl'], 'radio');
添加后的代码如下:
showsetting('forums_edit_posts_noforumhidewater', 'noforumhidewaternew', $forum['noforumhidewater'], 'radio');
showsetting('forums_edit_posts_noforumrecommend', 'noforumrecommendnew', $forum['noforumrecommend'], 'radio');
showsetting('主题被回复奖励', 'ispostjl',$forum['ispostjl'], 'radio');
showtablefooter();
showtagfooter('div');
在1784行左右找到如下代码:
'noforumrecommend' => intval($_GET['noforumrecommendnew']),
后一行添加如下代码:
'ispostjl' => intval($_GET['ispostjl']),
添加后代码如下:
'noforumhidewater' => intval($_GET['noforumhidewaternew']), 'noforumrecommend' => intval($_GET['noforumrecommendnew']), 'ispostjl' => intval($_GET['ispostjl']), 'price' => intval($_GET['pricenew']),
最后,更新缓存进后台配置即可。[/erphpdown]