discuz!X2回复帖子运行代码和SQL语句
还是直接贴代码:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 |
$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'); |