128 AND message('subject', lang('subject_length_over_limit', array('maxlength'=>128))); $message = param('message', '', FALSE); empty($message) AND message('message', lang('please_input_message')); $doctype = param('doctype', 0); $doctype > 10 AND message(-1, lang('doc_type_not_supported')); xn_strlen($message) > 2028000 AND message('message', lang('message_too_long')); $thread = array ( 'fid'=>$fid, 'uid'=>$uid, 'sid'=>$sid, 'subject'=>$subject, 'message'=>$message, 'time'=>$time, 'longip'=>$longip, 'doctype'=>$doctype, ); // hook thread_create_thread_before.php $tid = thread_create($thread, $pid); $pid === FALSE AND message(-1, lang('create_post_failed')); $tid === FALSE AND message(-1, lang('create_thread_failed')); // hook thread_create_thread_end.php message(0, lang('create_thread_sucessfully')); } // 帖子详情 | post detail } else { // thread-{tid}-{page}-{keyword}.htm $tid = param(1, 0); $page = param(2, 1); $keyword = param(3); $pagesize = $conf['postlist_pagesize']; //$pagesize = 10; //$page == 1 AND $pagesize++; // hook thread_info_start.php $thread = thread_read($tid); empty($thread) AND message(-1, lang('thread_not_exists'));; $fid = $thread['fid']; $forum = forum_read($fid); empty($forum) AND message(3, lang('forum_not_exists')); $postlist = post_find_by_tid($tid, $page, $pagesize); empty($postlist) AND message(4, lang('post_not_exists')); if($page == 1) { empty($postlist[$thread['firstpid']]) AND message(-1, lang('data_malformation')); $first = $postlist[$thread['firstpid']]; unset($postlist[$thread['firstpid']]); $attachlist = $imagelist = $filelist = array(); // 如果是大站,可以用单独的点击服务,减少 db 压力 // if request is huge, separate it from mysql server thread_inc_views($tid); } else { $first = post_read($thread['firstpid']); } $keywordurl = ''; if($keyword) { $thread['subject'] = post_highlight_keyword($thread['subject'], $keyword); //$first['message'] = post_highlight_keyword($first['subject']); $keywordurl = "-$keyword"; } $allowpost = forum_access_user($fid, $gid, 'allowpost') ? 1 : 0; $allowupdate = forum_access_mod($fid, $gid, 'allowupdate') ? 1 : 0; $allowdelete = forum_access_mod($fid, $gid, 'allowdelete') ? 1 : 0; forum_access_user($fid, $gid, 'allowread') OR message(-1, lang('user_group_insufficient_privilege')); $pagination = pagination(url("thread-$tid-{page}$keywordurl"), $thread['posts'] + 1, $page, $pagesize); $header['title'] = $thread['subject'].'-'.$forum['name'].'-'.$conf['sitename']; //$header['mobile_title'] = lang('thread_detail'); $header['mobile_title'] = $forum['name'];; $header['mobile_link'] = url("forum-$fid"); $header['keywords'] = ''; $header['description'] = $thread['subject']; $_SESSION['fid'] = $fid; // hook thread_info_end.php include _include(APP_PATH.'plugin/z_doc/view/htm/doc.htm'); } // hook thread_end.php ?>