本文整理汇总了PHP中threadmodstatus函数的典型用法代码示例。如果您正苦于以下问题:PHP threadmodstatus函数的具体用法?PHP threadmodstatus怎么用?PHP threadmodstatus使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了threadmodstatus函数的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: before_newreply
public function before_newreply($parameters)
{
global $nauthorid;
list(, $this->param['modnewreplies']) = threadmodstatus($this->param['subject'] . "\t" . $this->param['message'] . $this->param['extramessage']);
if ($this->thread['displayorder'] == -4) {
$this->param['modnewreplies'] = 0;
}
$pinvisible = $parameters['modnewreplies'] ? -2 : ($this->thread['displayorder'] == -4 ? -3 : 0);
$this->postcomment = in_array(2, $this->setting['allowpostcomment']) && $this->group['allowcommentreply'] && !$pinvisible && !empty($_GET['reppid']) && ($nauthorid != $this->member['uid'] || $this->setting['commentpostself']) ? messagecutstr($parameters['message'], 200, ' ') : '';
}
示例2: newthread
public function newthread($parameters)
{
require_once libfile('function/post');
$this->tid = $this->pid = 0;
$this->_init_parameters($parameters);
if (trim($this->param['subject']) == '') {
return $this->showmessage('post_sm_isnull');
}
if (!$this->param['sortid'] && !$this->param['special'] && trim($this->param['message']) == '') {
return $this->showmessage('post_sm_isnull');
}
list($this->param['modnewthreads'], $this->param['modnewreplies']) = threadmodstatus($this->param['subject'] . "\t" . $this->param['message'] . $this->param['extramessage']);
if ($post_invalid = checkpost($this->param['subject'], $this->param['message'], $this->param['special'] || $this->param['sortid'])) {
return $this->showmessage($post_invalid, '', array('minpostsize' => $this->setting['minpostsize'], 'maxpostsize' => $this->setting['maxpostsize']));
}
if (checkflood()) {
return $this->showmessage('post_flood_ctrl', '', array('floodctrl' => $this->setting['floodctrl']));
} elseif (checkmaxperhour('tid')) {
return $this->showmessage('thread_flood_ctrl_threads_per_hour', '', array('threads_per_hour' => $this->group['maxthreadsperhour']));
}
$this->param['save'] = $this->member['uid'] ? $this->param['save'] : 0;
$this->param['typeid'] = isset($this->param['typeid']) && isset($this->forum['threadtypes']['types'][$this->param['typeid']]) && (!$this->forum['threadtypes']['moderators'][$this->param['typeid']] || $this->forum['ismoderator']) ? $this->param['typeid'] : 0;
$this->param['displayorder'] = $this->param['modnewthreads'] ? -2 : ($this->forum['ismoderator'] && $this->group['allowstickthread'] && !empty($this->param['sticktopic']) ? 1 : (empty($this->param['save']) ? 0 : -4));
if ($this->param['displayorder'] == -2) {
C::t('forum_forum')->update($this->forum['fid'], array('modworks' => '1'));
}
$this->param['digest'] = $this->forum['ismoderator'] && $this->group['allowdigestthread'] && !empty($this->param['digest']) ? 1 : 0;
$this->param['readperm'] = $this->group['allowsetreadperm'] ? $this->param['readperm'] : 0;
$this->param['isanonymous'] = $this->group['allowanonymous'] && $this->param['isanonymous'] ? 1 : 0;
$this->param['price'] = intval($this->param['price']);
if (!$this->param['special']) {
$this->param['price'] = $this->group['maxprice'] ? $this->param['price'] <= $this->group['maxprice'] ? $this->param['price'] : $this->group['maxprice'] : 0;
}
if (!$this->param['typeid'] && $this->forum['threadtypes']['required'] && !$this->param['special']) {
return $this->showmessage('post_type_isnull');
}
if (!$this->param['sortid'] && $this->forum['threadsorts']['required'] && !$this->param['special']) {
return $this->showmessage('post_sort_isnull');
}
if (!$this->param['special'] && $this->param['price'] > 0 && floor($this->param['price'] * (1 - $this->setting['creditstax'])) == 0) {
return $this->showmessage('post_net_price_iszero');
}
$this->param['sortid'] = $this->param['special'] && $this->forum['threadsorts']['types'][$this->param['sortid']] ? 0 : $this->param['sortid'];
$this->param['typeexpiration'] = intval($this->param['typeexpiration']);
if ($this->forum['threadsorts']['expiration'][$this->param['typeid']] && !$this->param['typeexpiration']) {
return $this->showmessage('threadtype_expiration_invalid');
}
$author = !$this->param['isanonymous'] ? $this->member['username'] : '';
$this->param['moderated'] = $this->param['digest'] || $this->param['displayorder'] > 0 ? 1 : 0;
$this->param['ordertype'] && ($this->param['tstatus'] = setstatus(4, 1, $this->param['tstatus']));
$this->param['imgcontent'] && ($this->param['tstatus'] = setstatus(15, $this->param['imgcontent'], $this->param['tstatus']));
$this->param['hiddenreplies'] && ($this->param['tstatus'] = setstatus(2, 1, $this->param['tstatus']));
$this->param['allownoticeauthor'] && ($this->param['tstatus'] = setstatus(6, 1, $this->param['tstatus']));
$this->param['isgroup'] = $this->forum['status'] == 3 ? 1 : 0;
$this->param['publishdate'] = !$this->param['modnewthreads'] ? $this->param['publishdate'] : TIMESTAMP;
$newthread = array('fid' => $this->forum['fid'], 'posttableid' => 0, 'readperm' => $this->param['readperm'], 'price' => $this->param['price'], 'typeid' => $this->param['typeid'], 'sortid' => $this->param['sortid'], 'author' => $author, 'authorid' => $this->member['uid'], 'subject' => $this->param['subject'], 'dateline' => $this->param['publishdate'], 'lastpost' => $this->param['publishdate'], 'lastposter' => $author, 'displayorder' => $this->param['displayorder'], 'digest' => $this->param['digest'], 'special' => $this->param['special'], 'attachment' => 0, 'moderated' => $this->param['moderated'], 'status' => $this->param['tstatus'], 'isgroup' => $this->param['isgroup'], 'replycredit' => $this->param['replycredit'], 'closed' => $this->param['closed'] ? 1 : 0);
$this->tid = C::t('forum_thread')->insert($newthread, true);
C::t('forum_newthread')->insert(array('tid' => $this->tid, 'fid' => $this->forum['fid'], 'dateline' => $this->param['publishdate']));
useractionlog($this->member['uid'], 'tid');
if (!getuserprofile('threads') && $this->setting['newbie']) {
C::t('forum_thread')->update($this->tid, array('icon' => $this->setting['newbie']));
}
if ($this->param['publishdate'] != TIMESTAMP) {
$cron_publish_ids = dunserialize($this->cache('cronpublish'));
$cron_publish_ids[$this->tid] = $this->tid;
$cron_publish_ids = serialize($cron_publish_ids);
savecache('cronpublish', $cron_publish_ids);
}
if (!$this->param['isanonymous']) {
C::t('common_member_field_home')->update($this->member['uid'], array('recentnote' => $this->param['subject']));
}
if ($this->param['moderated']) {
updatemodlog($this->tid, $this->param['displayorder'] > 0 ? 'STK' : 'DIG');
updatemodworks($this->param['displayorder'] > 0 ? 'STK' : 'DIG', 1);
}
$this->param['bbcodeoff'] = checkbbcodes($this->param['message'], !empty($this->param['bbcodeoff']));
$this->param['smileyoff'] = checksmilies($this->param['message'], !empty($this->param['smileyoff']));
$this->param['parseurloff'] = !empty($this->param['parseurloff']);
$this->param['htmlon'] = $this->group['allowhtml'] && !empty($this->param['htmlon']) ? 1 : 0;
$this->param['usesig'] = !empty($this->param['usesig']) && $this->group['maxsigsize'] ? 1 : 0;
$class_tag = new tag();
$this->param['tagstr'] = $class_tag->add_tag($this->param['tags'], $this->tid, 'tid');
$this->param['pinvisible'] = $this->param['modnewthreads'] ? -2 : (empty($this->param['save']) ? 0 : -3);
$this->param['message'] = preg_replace('/\\[attachimg\\](\\d+)\\[\\/attachimg\\]/is', '[attach]\\1[/attach]', $this->param['message']);
$this->param['pstatus'] = intval($this->param['pstatus']);
defined('IN_MOBILE') && ($this->param['pstatus'] = setstatus(4, 1, $this->param['pstatus']));
if ($this->param['imgcontent']) {
stringtopic($this->param['message'], $this->tid, true, $this->param['imgcontentwidth']);
}
$this->pid = insertpost(array('fid' => $this->forum['fid'], 'tid' => $this->tid, 'first' => '1', 'author' => $this->member['username'], 'authorid' => $this->member['uid'], 'subject' => $this->param['subject'], 'dateline' => $this->param['publishdate'], 'message' => $this->param['message'], 'useip' => $this->param['clientip'] ? $this->param['clientip'] : getglobal('clientip'), 'port' => $this->param['remoteport'] ? $this->param['remoteport'] : getglobal('remoteport'), 'invisible' => $this->param['pinvisible'], 'anonymous' => $this->param['isanonymous'], 'usesig' => $this->param['usesig'], 'htmlon' => $this->param['htmlon'], 'bbcodeoff' => $this->param['bbcodeoff'], 'smileyoff' => $this->param['smileyoff'], 'parseurloff' => $this->param['parseurloff'], 'attachment' => '0', 'tags' => $this->param['tagstr'], 'replycredit' => 0, 'status' => $this->param['pstatus']));
$statarr = array(0 => 'thread', 1 => 'poll', 2 => 'trade', 3 => 'reward', 4 => 'activity', 5 => 'debate', 127 => 'thread');
include_once libfile('function/stat');
updatestat($this->param['isgroup'] ? 'groupthread' : $statarr[$this->param['special']]);
if ($this->param['geoloc'] && IN_MOBILE == 2) {
list($mapx, $mapy, $location) = explode('|', $this->param['geoloc']);
if ($mapx && $mapy && $location) {
C::t('forum_post_location')->insert(array('pid' => $this->pid, 'tid' => $this->tid, 'uid' => $this->member['uid'], 'mapx' => $mapx, 'mapy' => $mapy, 'location' => $location));
}
}
if ($this->param['modnewthreads']) {
//.........这里部分代码省略.........
示例3: threadpubsave
function threadpubsave($tid, $passapproval = false)
{
global $_G;
if ($_G['setting']['plugins']['func'][HOOKTYPE]['threadpubsave']) {
$hookparam = func_get_args();
hookscript('threadpubsave', 'global', 'funcs', array('param' => $hookparam, 'step' => 'check'), 'threadpubsave');
}
$thread = C::t('forum_thread')->fetch_by_tid_displayorder($tid, -4, '=', !$passapproval ? $_G['uid'] : null);
if (!$thread) {
return 0;
}
$threadpost = C::t('forum_post')->fetch_threadpost_by_tid_invisible($tid);
$thread['message'] = $threadpost['message'];
$modworksql = 0;
$displayorder = 0;
$dateline = $_G['timestamp'];
$moderatepids = $saveposts = array();
$return = 1;
list($modnewthreads) = threadmodstatus($thread['subject'] . "\t" . $thread['message']);
if ($modnewthreads && $passapproval === false) {
updatemoderate('tid', $tid);
manage_addnotify('verifythread');
$displayorder = -2;
$modworksql = 1;
$return = -1;
} else {
C::t('forum_post')->update_by_tid('tid:' . $tid, $tid, array('dateline' => $dateline, 'invisible' => '0'), false, false, 1);
}
C::t('forum_thread')->update($tid, array('displayorder' => $displayorder, 'dateline' => $_G['timestamp'], 'lastpost' => $_G['timestamp']));
$posts = $thread['replies'] + 1;
if ($thread['replies']) {
$saveposts = C::t('forum_post')->fetch_all_by_tid('tid:' . $tid, $tid, true, '', 0, 0, 0);
foreach ($saveposts as $post) {
$dateline++;
$invisible = 0;
list(, $modnewreplies) = threadmodstatus($post['subject'] . "\t" . $post['message']);
if ($modnewreplies) {
$moderatepids[] = $post['pid'];
$verifypost = true;
$invisible = -2;
$modworksql = 1;
$return = -2;
}
C::t('forum_post')->update('tid:' . $tid, $post['pid'], array('dateline' => $dateline, 'invisible' => $invisible));
updatepostcredits('+', $thread['authorid'], 'reply', $thread['fid']);
}
}
if ($moderatepids) {
updatemoderate('pid', $moderatepids);
manage_addnotify('verifypost');
}
updatepostcredits('+', $thread['authorid'], 'post', $thread['fid']);
$attachcount = C::t('forum_attachment_n')->count_by_id('tid:' . $thread['tid'], 'tid', $thread['tid']);
updatecreditbyaction('postattach', $thread['authorid'], array(), '', $attachcount, 1, $thread['fid']);
if ($_G['forum']['status'] == 3) {
C::t('forum_groupuser')->update_counter_for_user($thread['authorid'], $thread['fid'], 1);
}
$subject = str_replace("\t", ' ', $thread['subject']);
$lastpost = $thread['tid'] . "\t" . $subject . "\t" . $thread['lastpost'] . "\t" . $thread['lastposter'];
C::t('forum_forum')->update($_G['fid'], array('lastpost' => $lastpost));
C::t('forum_forum')->update_forum_counter($thread['fid'], 1, $posts, $posts, $modworksql);
if ($_G['forum']['type'] == 'sub') {
C::t('forum_forum')->update($_G['forum']['fup'], array('lastpost' => $lastpost));
}
if ($_G['setting']['plugins']['func'][HOOKTYPE]['threadpubsave']) {
hookscript('threadpubsave', 'global', 'funcs', array('param' => $hookparam, 'step' => 'save', 'posts' => $saveposts), 'threadpubsave');
}
return $return;
}
示例4: _sendPostResult
//.........这里部分代码省略.........
switch ($v["type"]) {
case 0:
// 解析文本的超链接
// @author: xjp
$v['infor'] = preg_replace('/(https?:\\/\\/\\S+)/i', '[url=$1]$1[/url]', $v['infor']);
$message .= $v["infor"] . "\r\n";
break;
case 1:
if (empty($aid_Img)) {
if ($aid != 0) {
$message .= '[attachimg]' . $aid . '[/attachimg]';
} else {
$message .= '[img]' . $v['infor'] . '[/img]';
}
} else {
if ($aid_Img[$i] != 0) {
$message .= '[attachimg]' . $aid_Img[$i] . '[/attachimg]';
} else {
$message .= '[img]' . $v['infor'] . '[/img]';
}
$i = $i + 1;
}
$attachment = 2;
$message .= "\r\n";
break;
case 3:
$message .= "[audio]" . $v["infor"] . "[/audio]";
break;
}
}
//表情处理
$message = $this->smilesReplace($message);
WebUtils::getDzPluginAppbymeAppConfig('forum_allow_gbk_special') && ($message = mb_convert_encoding($message, 'HTML-ENTITIES', 'UTF-8'));
$message = WebUtils::t($message);
$readperm = isset($_GET['readperm']) ? intval($_GET['readperm']) : 0;
$price = isset($_GET['price']) ? intval($_GET['price']) : 0;
if (empty($bbcodeoff) && !$_G['group']['allowhidecode'] && !empty($message) && preg_match("/\\[hide=?\\d*\\].*?\\[\\/hide\\]/is", preg_replace("/(\\[code\\](.+?)\\[\\/code\\])/is", ' ', $message))) {
return WebUtils::makeErrorInfo_oldVersion($res, 'post_hide_nopermission');
}
$modnewthreads = $modnewreplies = 0;
if (($subject || $message) && empty($_GET['save'])) {
$extramessage = ($special == 5 ? "\t" . $_GET['affirmpoint'] . "\t" . $_GET['negapoint'] : '') . ($special == 4 ? "\t" . $_GET['activityplace'] . "\t" . $_GET['activitycity'] . "\t" . $_GET['activityclass'] : '') . ($special == 2 ? "\t" . $_GET['item_name'] . "\t" . $_GET['item_locus'] : '') . ($_GET['typeoption'] ? "\t" . implode("\t", $_GET['typeoption']) : '') . ($_GET['polloptions'] || $_GET['polloption'] ? "\t" . implode("\t", $_GET['tpolloption'] == 2 ? explode("\n", $_GET['polloptions']) : $_GET['polloption']) : '');
list($modnewthreads, $modnewreplies) = threadmodstatus($subject . "\t" . $message . $extramessage);
unset($extramessage);
}
$urloffcheck = $usesigcheck = $smileyoffcheck = $codeoffcheck = $htmloncheck = $emailcheck = '';
$seccodecheck = $_G['setting']['seccodestatus'] & 4 && (!$_G['setting']['seccodedata']['minposts'] || getuserprofile('posts') < $_G['setting']['seccodedata']['minposts']);
$secqaacheck = $_G['setting']['secqaa']['status'] & 2 && (!$_G['setting']['secqaa']['minposts'] || getuserprofile('posts') < $_G['setting']['secqaa']['minposts']);
$_G['group']['allowpostpoll'] = $_G['group']['allowpost'] && $_G['group']['allowpostpoll'] && $_G['forum']['allowpostspecial'] & 1;
$_G['group']['allowposttrade'] = $_G['group']['allowpost'] && $_G['group']['allowposttrade'] && $_G['forum']['allowpostspecial'] & 2;
$_G['group']['allowpostreward'] = $_G['group']['allowpost'] && $_G['group']['allowpostreward'] && $_G['forum']['allowpostspecial'] & 4;
$_G['group']['allowpostactivity'] = $_G['group']['allowpost'] && $_G['group']['allowpostactivity'] && $_G['forum']['allowpostspecial'] & 8;
$_G['group']['allowpostdebate'] = $_G['group']['allowpost'] && $_G['group']['allowpostdebate'] && $_G['forum']['allowpostspecial'] & 16;
$usesigcheck = $_G['uid'] && $_G['group']['maxsigsize'] ? 'checked="checked"' : '';
$ordertypecheck = !empty($thread['tid']) && getstatus($thread['status'], 4) ? 'checked="checked"' : '';
$specialextra = !empty($_GET['specialextra']) ? $_GET['specialextra'] : '';
$_G['forum']['threadplugin'] = dunserialize($_G['forum']['threadplugin']);
$_G['group']['allowanonymous'] = $_G['forum']['allowanonymous'] || $_G['group']['allowanonymous'] ? 1 : 0;
if ($specialextra) {
$special = 127;
}
if ($act == 'newthread') {
$policykey = 'post';
} elseif ($act == 'reply') {
$policykey = 'reply';
} else {
$policykey = '';
}
if ($policykey) {
$postcredits = $_G['forum'][$policykey . 'credits'] ? $_G['forum'][$policykey . 'credits'] : $_G['setting']['creditspolicy'][$policykey];
}
if ($act == 'reply') {
$allow = $this->check_allow_action($res, 'allowreply');
} else {
$allow = $this->check_allow_action($res, 'allowpost');
}
if ($allow) {
return $allow;
}
if (!empty($jsonInfo['location'])) {
$jsonInfo['location'] = WebUtils::t(rawurldecode($jsonInfo['location']));
}
$extract = array('modnewthreads' => $modnewthreads, 'modnewreplies' => $modnewreplies, 'thread' => $thread, 'res' => $res, 'special' => $special, 'subject' => $subject, 'message' => $message, 'jsonInfo' => $jsonInfo, 'sortid' => $sortid, 'typeid' => $typeid);
switch ($act) {
case 'newthread':
$result = $this->sendPost($extract);
break;
case 'reply':
$result = $this->replyPost($extract);
break;
case 'edit':
$result = $this->editPost($extract);
break;
}
if ($result['errcode'] != WebUtils::t('发贴成功')) {
return $result;
}
$res = array_merge($result, $res);
return $res;
}
示例5: editpost
public function editpost($parameters)
{
$this->_init_parameters($parameters);
$isfirstpost = $this->post['first'] ? 1 : 0;
$isorigauthor = $this->member['uid'] && $this->member['uid'] == $this->post['authorid'];
$this->param['audit'] = $this->post['invisible'] == -2 || $this->thread['displayorder'] == -2 ? $this->param['audit'] : 0;
list($this->param['modnewthreads'], $this->param['modnewreplies']) = threadmodstatus($this->param['subject'] . "\t" . $this->param['message'] . $this->param['extramessage']);
if ($post_invalid = checkpost($this->param['subject'], $this->param['message'], $isfirstpost && ($this->param['special'] || $this->param['sortid']))) {
showmessage($post_invalid, '', array('minpostsize' => $this->setting['minpostsize'], 'maxpostsize' => $this->setting['maxpostsize']));
}
if (!$isorigauthor && !$this->group['allowanonymous']) {
if ($this->post['anonymous'] && !$this->param['isanonymous']) {
$this->param['isanonymous'] = 0;
$this->param['threadupdatearr']['author'] = $this->post['author'];
$anonymousadd = 0;
} else {
$this->param['isanonymous'] = $this->post['anonymous'];
$anonymousadd = '';
}
} else {
$this->param['threadupdatearr']['author'] = $this->param['isanonymous'] ? '' : $this->post['author'];
$anonymousadd = $this->param['isanonymous'];
}
if ($isfirstpost) {
if (trim($this->param['subject']) == '' && $this->thread['special'] != 2) {
showmessage('post_sm_isnull');
}
if (!$this->param['sortid'] && !$this->thread['special'] && trim($this->param['message']) == '') {
showmessage('post_sm_isnull');
}
$publishdate = null;
if ($this->group['allowsetpublishdate'] && $this->thread['displayorder'] == -4) {
$cron_publish_ids = dunserialize($this->cache('cronpublish'));
if (!$this->param['cronpublish'] && in_array($this->thread['tid'], $cron_publish_ids) || $this->param['modnewthreads']) {
$this->param['threadupdatearr']['dateline'] = $publishdate = TIMESTAMP;
unset($cron_publish_ids[$this->thread['tid']]);
$cron_publish_ids = serialize($cron_publish_ids);
savecache('cronpublish', $cron_publish_ids);
} elseif ($this->param['cronpublish'] && $this->param['cronpublishdate']) {
$this->param['threadupdatearr']['dateline'] = $publishdate = strtotime($this->param['cronpublishdate']);
$this->param['save'] = 1;
if (!in_array($this->thread['tid'], $cron_publish_ids)) {
$cron_publish_ids[$this->thread['tid']] = $this->thread['tid'];
$cron_publish_ids = serialize($cron_publish_ids);
savecache('cronpublish', $cron_publish_ids);
}
}
}
$this->param['readperm'] = $this->group['allowsetreadperm'] ? intval($this->param['readperm']) : ($isorigauthor ? 0 : 'ignore');
if ($this->thread['special'] != 3) {
$this->param['price'] = intval($this->param['price']);
$this->param['price'] = $this->thread['price'] < 0 && !$this->thread['special'] ? $isorigauthor || !$this->param['price'] ? -1 : $this->param['price'] : ($this->group['maxprice'] ? $this->param['price'] <= $this->group['maxprice'] ? $this->param['price'] > 0 ? $this->param['price'] : 0 : $this->group['maxprice'] : ($isorigauthor ? $this->param['price'] : $this->thread['price']));
if ($this->param['price'] > 0 && floor($this->param['price'] * (1 - $this->setting['creditstax'])) == 0) {
return $this->showmessage('post_net_price_iszero');
}
}
$this->thread['status'] = setstatus(4, $this->param['ordertype'], $this->thread['status']);
$this->thread['status'] = setstatus(15, $this->param['imgcontent'], $this->thread['status']);
if ($this->param['imgcontent']) {
stringtopic($this->param['message'], $this->post['tid'], true, $this->param['imgcontentwidth']);
}
$this->thread['status'] = setstatus(2, $this->param['hiddenreplies'], $this->thread['status']);
$this->thread['status'] = setstatus(6, $this->param['allownoticeauthor'] ? 1 : 0, $this->thread['status']);
$displayorder = empty($this->param['save']) ? $this->thread['displayorder'] == -4 ? -4 : $this->thread['displayorder'] : -4;
$this->param['threadupdatearr']['typeid'] = $this->param['typeid'];
$this->param['threadupdatearr']['sortid'] = $this->param['sortid'];
$this->param['threadupdatearr']['subject'] = $this->param['subject'];
if ($this->param['readperm'] !== 'ignore') {
$this->param['threadupdatearr']['readperm'] = $this->param['readperm'];
}
$this->param['threadupdatearr']['price'] = $this->param['price'];
$this->param['threadupdatearr']['status'] = $this->thread['status'];
if (getglobal('forum_auditstatuson') && $this->param['audit'] == 1) {
$this->param['threadupdatearr']['displayorder'] = 0;
$this->param['threadupdatearr']['moderated'] = 1;
} else {
$this->param['threadupdatearr']['displayorder'] = $displayorder;
}
C::t('forum_thread')->update($this->thread['tid'], $this->param['threadupdatearr'], true);
if ($this->thread['tid'] > 1) {
if ($this->thread['closed'] > 1) {
C::t('forum_thread')->update($this->thread['closed'], array('subject' => $this->param['subject']), true);
} elseif (empty($this->thread['isgroup'])) {
$threadclosed = C::t('forum_threadclosed')->fetch($thread['tid']);
if ($threadclosed['redirect']) {
C::t('forum_thread')->update($threadclosed['redirect'], array('subject' => $this->param['subject']), true);
}
}
}
$class_tag = new tag();
$tagstr = $class_tag->update_field($this->param['tags'], $this->thread['tid'], 'tid', $this->thread);
} else {
if ($this->param['subject'] == '' && $this->param['message'] == '' && $this->thread['special'] != 2) {
showmessage('post_sm_isnull');
}
}
$this->param['htmlon'] = $this->group['allowhtml'] && !empty($this->param['htmlon']) ? 1 : 0;
if ($this->setting['editedby'] && TIMESTAMP - $this->post['dateline'] > 60 && $this->member['adminid'] != 1) {
$editor = $this->param['isanonymous'] && $isorigauthor ? lang('forum/misc', 'anonymous') : $this->member['username'];
$edittime = dgmdate(TIMESTAMP);
//.........这里部分代码省略.........
示例6: empty
$notifycheck = empty($emailnotify) ? '' : 'checked="checked"';
$stickcheck = empty($sticktopic) ? '' : 'checked="checked"';
$digestcheck = empty($addtodigest) ? '' : 'checked="checked"';
$subject = isset($_GET['subject']) ? dhtmlspecialchars(censor(trim($_GET['subject']))) : '';
$subject = !empty($subject) ? str_replace("\t", ' ', $subject) : $subject;
$message = isset($_GET['message']) ? censor($_GET['message']) : '';
$polloptions = isset($polloptions) ? censor(trim($polloptions)) : '';
$readperm = isset($_GET['readperm']) ? intval($_GET['readperm']) : 0;
$price = isset($_GET['price']) ? intval($_GET['price']) : 0;
if (empty($bbcodeoff) && !$_G['group']['allowhidecode'] && !empty($message) && preg_match("/\\[hide=?\\d*\\].*?\\[\\/hide\\]/is", preg_replace("/(\\[code\\](.+?)\\[\\/code\\])/is", ' ', $message))) {
showmessage('post_hide_nopermission');
}
$modnewthreads = $modnewreplies = 0;
if (($subject || $message) && empty($_GET['save'])) {
$extramessage = ($special == 5 ? "\t" . $_GET['affirmpoint'] . "\t" . $_GET['negapoint'] : '') . ($special == 4 ? "\t" . $_GET['activityplace'] . "\t" . $_GET['activitycity'] . "\t" . $_GET['activityclass'] : '') . ($special == 2 ? "\t" . $_GET['item_name'] . "\t" . $_GET['item_locus'] : '') . ($_GET['typeoption'] ? "\t" . implode("\t", $_GET['typeoption']) : '') . ($_GET['polloptions'] || $_GET['polloption'] ? "\t" . implode("\t", $_GET['tpolloption'] == 2 ? explode("\n", $_GET['polloptions']) : $_GET['polloption']) : '');
list($modnewthreads, $modnewreplies) = threadmodstatus($subject . "\t" . $message . $extramessage);
unset($extramessage);
}
$urloffcheck = $usesigcheck = $smileyoffcheck = $codeoffcheck = $htmloncheck = $emailcheck = '';
$seccodecheck = $_G['setting']['seccodestatus'] & 4 && (!$_G['setting']['seccodedata']['minposts'] || getuserprofile('posts') < $_G['setting']['seccodedata']['minposts']);
$secqaacheck = $_G['setting']['secqaa']['status'] & 2 && (!$_G['setting']['secqaa']['minposts'] || getuserprofile('posts') < $_G['setting']['secqaa']['minposts']);
$_G['group']['allowpostpoll'] = $_G['group']['allowpost'] && $_G['group']['allowpostpoll'] && $_G['forum']['allowpostspecial'] & 1;
$_G['group']['allowposttrade'] = $_G['group']['allowpost'] && $_G['group']['allowposttrade'] && $_G['forum']['allowpostspecial'] & 2;
$_G['group']['allowpostreward'] = $_G['group']['allowpost'] && $_G['group']['allowpostreward'] && $_G['forum']['allowpostspecial'] & 4;
$_G['group']['allowpostactivity'] = $_G['group']['allowpost'] && $_G['group']['allowpostactivity'] && $_G['forum']['allowpostspecial'] & 8;
$_G['group']['allowpostdebate'] = $_G['group']['allowpost'] && $_G['group']['allowpostdebate'] && $_G['forum']['allowpostspecial'] & 16;
$usesigcheck = $_G['uid'] && $_G['group']['maxsigsize'] ? 'checked="checked"' : '';
$ordertypecheck = !empty($thread['tid']) && getstatus($thread['status'], 4) ? 'checked="checked"' : '';
$specialextra = !empty($_GET['specialextra']) ? $_GET['specialextra'] : '';
$_G['forum']['threadplugin'] = dunserialize($_G['forum']['threadplugin']);
if ($specialextra && $_G['group']['allowpost'] && $_G['setting']['threadplugins'] && (!array_key_exists($specialextra, $_G['setting']['threadplugins']) || !@in_array($specialextra, is_array($_G['forum']['threadplugin']) ? $_G['forum']['threadplugin'] : dunserialize($_G['forum']['threadplugin'])) || !@in_array($specialextra, $_G['group']['allowthreadplugin']))) {