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 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83
| $discuz_uid = 1; $discuz_user = 'admin'; $fid = intval($_POST['fid']); $typeid = 0; $subject = substr(strrchr($dirs, '\\'),1); $message = $text_content.$word_content.$imgpng_content.$imgjpg_content; $timestamp = $_G['timestamp']; $onlineip = $_G['clientip']; $ismobile = 4;
if($arr_attachment_file==NULL){ $newthread = array( 'fid' => $fid, 'posttableid' => 0, 'typeid' => $typeid, 'readperm' => '0', 'price' => '0', 'author' => $discuz_user, 'authorid' => $discuz_uid, 'subject' => $subject, 'dateline' => $timestamp, 'lastpost' => $timestamp, 'lastposter' => $discuz_user ); $tid = C::t('forum_thread')->insert($newthread, true);
$subject = addslashes($subject); $message = addslashes($message); $pid = insertpost(array( 'fid' => $fid, 'tid' => $tid, 'first' => '1', 'author' => $discuz_user, 'authorid' => $discuz_uid, 'subject' => $subject, 'dateline' => $timestamp, 'message' => $message, 'useip' => $_G['clientip'] )); }else{ $newthread = array( 'fid' => $fid, 'posttableid' => 0, 'typeid' => $typeid, 'readperm' => '0', 'price' => '0', 'author' => $discuz_user, 'authorid' => $discuz_uid, 'subject' => $subject, 'dateline' => $timestamp, 'lastpost' => $timestamp, 'attachment'=>'1', 'lastposter' => $discuz_user ); $tid = C::t('forum_thread')->insert($newthread, true);
$subject = addslashes($subject); $message = addslashes($message); $pid = insertpost(array( 'fid' => $fid, 'tid' => $tid, 'first' => '1', 'author' => $discuz_user, 'authorid' => $discuz_uid, 'subject' => $subject, 'dateline' => $timestamp, 'message' => $message, 'attachment'=>'1', 'useip' => $_G['clientip'] )); foreach($arr_attachment_file as $keyes=> $values ){ foreach($values as $file){ add_attachment($file,$tid,$pid,$dirs,$attachment_score);
} }
} DB::query("UPDATE pre_forum_forum SET lastpost='$timestamp', threads=threads+1, posts=posts+1, todayposts=todayposts+1 WHERE fid='$fid'", 'UNBUFFERED'); DB::query("UPDATE pre_common_member_count SET threads=threads+1 WHERE uid='$discuz_uid'", 'UNBUFFERED'); DB::query("UPDATE pre_common_member_status SET lastpost='$timestamp' WHERE uid='$discuz_uid'", 'UNBUFFERED');
|