作者:182860498
1,修改source/include/topicadmin/topicadmin_merge.php
找到
- $firstpost = DB::fetch_first("SELECT pid, fid, authorid, author, subject, dateline FROM ".DB::table($posttable)." WHERE tid IN ('$_G[tid]', '$othertid') AND invisible='0' ORDER BY dateline LIMIT 1");
复制代码 在其下加
- //合并主题时合并主题帖
- $otherposttable=getposttablebytid($othertid);
- $otherpost=DB::fetch_first("SELECT pid,message,attachment,dateline FROM ".DB::table($otherposttable)." where tid='$othertid' and first=1 limit 1");
- $otherpostmessage=daddslashes($otherpost['message']);
- $thispid=DB::result_first("SELECT pid FROM ".DB::table($posttable)." where tid='{$_G['tid']}' and first=1 limit 1");
- DB::query("UPDATE ".DB::table($posttable)." SET `message`=CONCAT(`message`,'\n$otherpostmessage'),dateline='{$firstpost['dateline']}' WHERE pid='$thispid' limit 1");
- DB::query("UPDATE ".DB::table('forum_attachment')." SET pid='{$thispid}' WHERE pid='{$otherpost['pid']}'");
- if($otherpost['attachment']){
- DB::query("UPDATE ".DB::table($posttable)." SET attachment='{$otherpost['attachment']}' WHERE pid='{$thispid}'");
- //DB::query("UPDATE ".DB::table("forum_thread")." SET attachment='{$otherpost['attachment']}' WHERE tid='{$_G['tid']}'");
- }
- DB::query("DELETE FROM ".DB::table($otherposttable)." WHERE pid='{$otherpost['pid']}'");
- //合并主题时合并主题帖
复制代码
|