- function insertpost($data) {
- if(isset($data['tid'])) {
- $tableid = DB::result_first("SELECT posttableid FROM ".DB::table('forum_thread')." WHERE tid='{$data['tid']}'");
- } else {
- $tableid = $data['tid'] = 0;
- }
- $pid = DB::insert('forum_post_tableid', array('pid' => null), true);
- if(!$tableid) {
- $tablename = 'forum_post';
- } else {
- $tablename = "forum_post_$tableid";
- }
- $data = array_merge($data, array('pid' => $pid));
- DB::insert($tablename, $data);
- if($pid % 1024 == 0) {
- DB::delete('forum_post_tableid', "pid<$pid");
- }
- save_syscache('max_post_id', $pid);
- return $pid;
- }
复制代码
|
上一篇: Discuz X2 function sendmail 发送邮件函数下一篇: Discuz X2 uc通信不成功,cache文件的问题
|