- 积分
- 185528
- 最后登录
- 2024-4-28
- 精华
- 0
- 阅读权限
- 255
- 主题
- 250
- UID
- 1004992
- 帖子
- 156604
- PB币
- 213424
- 威望
- 20481
- 贡献
- 3
- 技术
- 142
- 活跃
- 2668
幻想乡中享幸福
- UID
- 1004992
- 帖子
- 156604
- PB币
- 213424
- 贡献
- 3
- 技术
- 142
- 活跃
- 2668
|
@shiniv- if($thread['replycredit'] > 0 && !$modnewreplies && $thread['authorid'] != $_G['uid'] && $_G['uid']) {
- $replycredit_rule = DB::fetch_first("SELECT * FROM ".DB::table('forum_replycredit')." WHERE tid = '$_G[tid]' LIMIT 1");
- if(!empty($replycredit_rule['times'])) {
- $have_replycredit = DB::result_first("SELECT COUNT(*) FROM ".DB::table('common_credit_log')." WHERE relatedid = '{$_G[tid]}' AND uid = '{$_G[uid]}' AND operation = 'RCA' LIMIT {$replycredit_rule['times']} ");
- $replycredit_rule['membertimes'] = $replycredit_rule['membertimes'] < 1 ? 5 : $replycredit_rule['membertimes'];
- $replycredit_rule['extcredits'] = $replycredit_rule['extcredits'] < 1 ? 1 : $replycredit_rule['extcredits'];
- if($replycredit_rule['membertimes'] - $have_replycredit > 0 && $thread['replycredit'] - $replycredit_rule['extcredits'] >= 0) {
- $replycredit_rule['extcreditstype'] = $replycredit_rule['extcreditstype'] ? $replycredit_rule['extcreditstype'] : $_G['setting']['creditstransextra'][10];
- if($replycredit_rule['random'] > 0) {
- $rand = rand(1, 100);
- $replycredit_rule['random'] = $replycredit_rule['random'] < 10 ? 10 : $replycredit_rule['random'];
- $rand_replycredit = $rand <= $replycredit_rule['random'] ? true : false ;
- } else {
- $rand_replycredit = true;
- }
- if($rand_replycredit) {
- if(!$posttable) {
- $posttable = getposttablebytid($_G['tid']);
- }
- updatemembercount($_G['uid'], array($replycredit_rule['extcreditstype'] => $replycredit_rule['extcredits']), 1, 'RCA', $_G[tid]);
- DB::update($posttable, array('replycredit' => $replycredit_rule['extcredits']), array('pid' => $pid));
- DB::update("forum_thread", array('replycredit' => $thread['replycredit'] - $replycredit_rule['extcredits']), array('tid' => $_G[tid]));
- }
- }
- }
- }
复制代码 |
|