软着陆 发表于 2011-8-22 21:01
-
好了,请把之前修改post_editpost.php的地方复原
一个主题限制的编辑次数在系统设置中设置就可以了
找到:- showmessage('post_edit_succeed', $redirecturl, $param);
复制代码 在上面加:- if($orig['first']){
- $editnum = DB::fetch_first("SELECT rewardnum,rid FROM ".DB::table('common_credit_rule')." WHERE action='editpost' LIMIT 1");
- $creditlogs = DB::result_first("SELECT count(*) FROM ".DB::table('common_credit_log')." WHERE uid='$_G[uid]' AND relatedid='$_G[tid]' AND operation='EDP' AND dateline>'".($_G['timestamp'] - 86400)."'");
- if($creditlogs < $editnum['rewardnum']){
- $creditrule = array();
- updatecreditbyaction('editpost', $_G['uid']);
- DB::query("UPDATE ".DB::table('common_credit_rule_log')." SET cyclenum=cyclenum-1 WHERE uid='$_G[uid]' AND rid='$editnum[rid]'");
- $creditrule = DB::fetch_first("SELECT * FROM ".DB::table('common_credit_rule')." WHERE action='editpost' LIMIT 1");
- DB::insert('common_credit_log', array('extcredits1' => $creditrule['extcredits1'],'extcredits2' => $creditrule['extcredits2'],'extcredits3' => $creditrule['extcredits3'],'extcredits4' => $creditrule['extcredits4'],'extcredits5' => $creditrule['extcredits5'],'extcredits6' => $creditrule['extcredits6'],'extcredits7' => $creditrule['extcredits7'],'extcredits8' => $creditrule['extcredits8'],'dateline' => $_G['timestamp'],'relatedid' => $_G['tid'],'operation' => 'EDP','uid' => $_G['uid']));
- }
- }
复制代码 |