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');
查看完整版本: discuz!X2回复帖子运行代码和SQL语句
Tags: