discuz!X2回复帖子运行代码和SQL语句

$subject="";


$message = isset($_G['gp_message']) ? censor($_G['gp_message']) : '';
$message = preg_replace('/\[attachimg\](\d+)\[\/attachimg\]/is', '[attach]\1[/attach]', $message);


$uid=$_G['uid'];
$username = $_G['username'];
$pid = insertpost(array(
'fid' => $fid,
'tid' => $tid,
'first' => '0',
'author' => $username,
'authorid' => $uid,
'subject' => $subject,
'dateline' => $_G['timestamp']+20,
'message' => $message,
'useip' => $_G['clientip'],
'invisible' => 0,
'anonymous' => 0,
'usesig' => 0,
'htmlon' => 0,
'bbcodeoff' => 0,
'smileyoff' => 0,
'parseurloff' => 0,
'attachment' => 0,
'tags' => '',
'replycredit' => 0,
'status' => 0
));


$lastpost = "$tid\t$subject\t$_G[timestamp]\t$username";


$num=DB::fetch(DB::query("SELECT threads,posts,todayposts FROM ".DB::table('forum_forum')." WHERE fid='$fid'"));
$array=array('posts'=>$num["posts"]+1,'lastpost'=>"$lastpost",'todayposts'=>$num["todayposts"]+1);


DB::update('forum_forum', $array,"fid='$fid'");
DB::query("UPDATE ".DB::table('common_member_count')." SET posts=posts+1 WHERE uid='$uid'", 'UNBUFFERED');
DB::query("UPDATE ".DB::table('common_member_status')." SET lastip='".$_G['clientip']."',lastvisit='".$_G['timestamp']."',lastactivity='".$_G['timestamp']."',lastpost='".$_G['timestamp']."' WHERE uid='$uid'", 'UNBUFFERED');


DB::query("UPDATE ".DB::table('forum_thread')." SET replies=replies+1,views=views+1,lastposter='$username', lastpost='".$_G['timestamp']."' WHERE tid='$tid'", 'UNBUFFERED');
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值