本文整理汇总了PHP中checkbbcodes函数的典型用法代码示例。如果您正苦于以下问题:PHP checkbbcodes函数的具体用法?PHP checkbbcodes怎么用?PHP checkbbcodes使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了checkbbcodes函数的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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']) {
//.........这里部分代码省略.........
示例2: modthreadtag
}
DB::query("UPDATE " . DB::table('forum_thread') . " SET typeid='{$typeid}', sortid='{$sortid}', subject='{$subject}', readperm='{$readperm}', price='{$price}' {$closedadd} {$authoradd} {$polladd} {$replycreditadd}" . ($_G['forum_auditstatuson'] && $audit == 1 ? ",displayorder='0', moderated='1'" : ",displayorder='{$displayorder}'") . ", status='{$thread['status']}' WHERE tid='{$_G['tid']}'", 'UNBUFFERED');
$thread['closed'] > 1 && DB::query("UPDATE " . DB::table('forum_thread') . " SET subject='{$subject}' WHERE tid='{$thread['closed']}'", 'UNBUFFERED');
$tagstr = modthreadtag($_G['gp_tags'], $_G['tid']);
} else {
if ($subject == '' && $message == '' && $thread['special'] != 2) {
showmessage('post_sm_isnull');
}
}
$htmlon = $_G['group']['allowhtml'] && !empty($_G['gp_htmlon']) ? 1 : 0;
if ($_G['setting']['editedby'] && TIMESTAMP - $orig['dateline'] > 60 && $_G['adminid'] != 1) {
$editor = $isanonymous && $isorigauthor ? lang('forum/misc', 'anonymous') : $_G['username'];
$edittime = dgmdate(TIMESTAMP);
$message = lang('forum/misc', $htmlon ? 'post_edithtml' : (!$_G['forum']['allowbbcode'] || $_G['gp_bbcodeoff'] ? 'post_editnobbcode' : 'post_edit'), array('editor' => $editor, 'edittime' => $edittime)) . $message;
}
$bbcodeoff = checkbbcodes($message, !empty($_G['gp_bbcodeoff']));
$smileyoff = checksmilies($message, !empty($_G['gp_smileyoff']));
$tagoff = $isfirstpost ? !empty($tagoff) : 0;
$attachupdate = !empty($_G['gp_delattachop']) || ($_G['group']['allowpostattach'] || $_G['group']['allowpostimage']) && ($_G['gp_attachnew'] || $special == 2 && $_G['gp_tradeaid'] || $special == 4 && $_G['gp_activityaid'] || $isfirstpost && $sortid);
if ($attachupdate) {
updateattach($thread['displayorder'] == -4 || $_G['forum_auditstatuson'], $_G['tid'], $pid, $_G['gp_attachnew'], $_G['gp_attachupdate'], $orig['authorid']);
}
if ($special == 2 && $_G['group']['allowposttrade']) {
if ($trade = DB::fetch_first("SELECT * FROM " . DB::table('forum_trade') . " WHERE tid='{$_G['tid']}' AND pid='{$pid}'")) {
$seller = empty($_G['gp_paymethod']) && $_G['gp_seller'] ? censor(dhtmlspecialchars(trim($_G['gp_seller']))) : '';
$item_name = censor(dhtmlspecialchars(trim($_G['gp_item_name'])));
$item_price = floatval($_G['gp_item_price']);
$item_credit = intval($_G['gp_item_credit']);
$item_locus = censor(dhtmlspecialchars(trim($_G['gp_item_locus'])));
$item_number = intval($_G['gp_item_number']);
$item_quality = intval($_G['gp_item_quality']);
示例3: showmessage
showmessage('postappend_only_yourself');
}
if (submitcheck('postappendsubmit')) {
$message = censor($_GET['postappendmessage']);
$sppos = 0;
if ($post['first'] && strexists($post['message'], chr(0) . chr(0) . chr(0))) {
$sppos = strpos($post['message'], chr(0) . chr(0) . chr(0));
$specialextra = substr($post['message'], $sppos + 3);
$post['message'] = substr($post['message'], 0, $sppos);
}
$message = $post['message'] . "\n\n[b]" . lang('forum/misc', 'postappend_content') . " (" . dgmdate(TIMESTAMP) . "):[/b]\n{$message}";
if ($sppos) {
$message .= chr(0) . chr(0) . chr(0) . $specialextra;
}
require_once libfile('function/post');
$bbcodeoff = checkbbcodes($message, 0);
C::t('forum_post')->update('tid:' . $_G['tid'], $_GET['pid'], array('message' => $message, 'bbcodeoff' => $bbcodeoff));
showmessage('postappend_add_succeed', "forum.php?mod=viewthread&tid={$post['tid']}&pid={$post['pid']}&page={$_GET['page']}&extra={$_GET['extra']}#pid{$post['pid']}", array('tid' => $post['tid'], 'pid' => $post['pid']));
} else {
include template('forum/postappend');
}
} elseif ($_GET['action'] == 'pubsave') {
$return = threadpubsave($_G['tid']);
if ($return > 0) {
showmessage('post_newthread_succeed', dreferer(), array('coverimg' => ''));
} elseif ($return == -1) {
showmessage('post_newthread_mod_succeed', dreferer(), array('coverimg' => ''));
} elseif ($return == -2) {
showmessage('post_reply_mod_succeed', dreferer());
} else {
showmessage('thread_nonexistence');
示例4: showmessage
$db->query("DELETE FROM {$tablepre}threadtags WHERE tagname='{$tagname}' AND tid='{$tid}'", 'UNBUFFERED');
}
}
}
} else {
if ($subject == '' && $message == '') {
showmessage('post_sm_isnull');
}
}
if ($editedby && $timestamp - $orig['dateline'] > 60 && $adminid != 1) {
include_once language('misc');
$editor = $isanonymous && $isorigauthor ? $language['anonymous'] : $discuz_user;
$edittime = gmdate($_DCACHE['settings']['dateformat'] . ' ' . $_DCACHE['settings']['timeformat'], $timestamp + $timeoffset * 3600);
eval("\$message = \"{$language['post_edit']}\".\$message;");
}
$bbcodeoff = checkbbcodes($message, !empty($bbcodeoff));
$smileyoff = checksmilies($message, !empty($smileyoff));
$tagoff = $isfirstpost ? !empty($tagoff) : 0;
$htmlon = bindec(($tagstatus && $tagoff ? 1 : 0) . ($allowhtml && !empty($htmlon) ? 1 : 0));
$uattachment = $allowpostattach && ($uattachments = attach_upload('attachupdate', 1)) ? 1 : 0;
if ($uattachment) {
$query = $db->query("SELECT aid, tid, pid, uid, attachment, thumb, remote FROM {$tablepre}attachments WHERE pid='{$pid}'");
while ($attach = $db->fetch_array($query)) {
$paid = 'paid' . $attach['aid'];
$attachfileadd = '';
if ($uattachment && isset($uattachments[$paid])) {
dunlink($attach['attachment'], $attach['thumb'], $attach['remote']);
$attachfileadd = 'dateline=\'' . $timestamp . '\',
filename=\'' . $uattachments[$paid]['name'] . '\',
filetype=\'' . $uattachments[$paid]['type'] . '\',
filesize=\'' . $uattachments[$paid]['size'] . '\',
示例5: sendPost
//.........这里部分代码省略.........
if ($filedname && $valuelist) {
C::t('forum_optionvalue')->insert($sortid, "({$filedname}, tid, fid) VALUES ({$valuelist}, '{$tid}', '{$_G['fid']}')");
}
}
if ($_G['group']['allowat']) {
$atlist = $atlist_tmp = array();
preg_match_all("/@([^\r\n]*?)\\s/i", $message . ' ', $atlist_tmp);
$atlist_tmp = array_slice(array_unique($atlist_tmp[1]), 0, $_G['group']['allowat']);
if (!empty($atlist_tmp)) {
if (empty($_G['setting']['at_anyone'])) {
foreach (C::t('home_follow')->fetch_all_by_uid_fusername($_G['uid'], $atlist_tmp) as $row) {
$atlist[$row['followuid']] = $row['fusername'];
}
if (count($atlist) < $_G['group']['allowat']) {
$query = C::t('home_friend')->fetch_all_by_uid_username($_G['uid'], $atlist_tmp);
foreach ($query as $row) {
$atlist[$row['fuid']] = $row['fusername'];
}
}
} else {
foreach (C::t('common_member')->fetch_all_by_username($atlist_tmp) as $row) {
$atlist[$row['uid']] = $row['username'];
}
}
}
if ($atlist) {
foreach ($atlist as $atuid => $atusername) {
$atsearch[] = "/@" . str_replace('/', '\\/', preg_quote($atusername)) . " /i";
$atreplace[] = "[url=home.php?mod=space&uid={$atuid}]@{$atusername}[/url] ";
}
$message = preg_replace($atsearch, $atreplace, $message . ' ', 1);
}
}
$bbcodeoff = checkbbcodes($message, !empty($_GET['bbcodeoff']));
$smileyoff = checksmilies($message, !empty($_GET['smileyoff']));
$parseurloff = !empty($_GET['parseurloff']);
$htmlon = $_G['group']['allowhtml'] && !empty($_GET['htmlon']) ? 1 : 0;
$usesig = !empty($_GET['usesig']) && $_G['group']['maxsigsize'] ? 1 : 0;
$class_tag = new tag();
$tagstr = $class_tag->add_tag($_GET['tags'], $tid, 'tid');
/* if($_G['group']['allowreplycredit']) {
if($replycredit > 0 && $replycredit_real > 0) {
updatemembercount($_G['uid'], array('extcredits'.$_G['setting']['creditstransextra'][10] => -$replycredit_real), 1, 'RCT', $tid);
$insertdata = array(
'tid' => $tid,
'extcredits' => $_GET['replycredit_extcredits'],
'extcreditstype' => $_G['setting']['creditstransextra'][10],
'times' => $_GET['replycredit_times'],
'membertimes' => $_GET['replycredit_membertimes'],
'random' => $_GET['replycredit_random']
);
C::t('forum_replycredit')->insert($insertdata);
}
} */
if ($_G['group']['allowpostrushreply'] && $_GET['rushreply']) {
$rushdata = array('tid' => $tid, 'stopfloor' => $_GET['stopfloor'], 'starttimefrom' => $_GET['rushreplyfrom'], 'starttimeto' => $_GET['rushreplyto'], 'rewardfloor' => $_GET['rewardfloor'], 'creditlimit' => $_GET['creditlimit']);
C::t('forum_threadrush')->insert($rushdata);
}
$pinvisible = $modnewthreads ? -2 : (empty($_GET['save']) ? 0 : -3);
$message = preg_replace('/\\[attachimg\\](\\d+)\\[\\/attachimg\\]/is', '[attach]\\1[/attach]', $message);
$pid = insertpost(array('fid' => $_G['fid'], 'tid' => $tid, 'first' => '1', 'author' => $_G['username'], 'authorid' => $_G['uid'], 'subject' => $subject, 'dateline' => $publishdate, 'message' => $message, 'useip' => $_G['clientip'], 'invisible' => $pinvisible, 'anonymous' => $isanonymous, 'usesig' => $usesig, 'htmlon' => $htmlon, 'bbcodeoff' => $bbcodeoff, 'smileyoff' => $smileyoff, 'parseurloff' => $parseurloff, 'attachment' => '0', 'tags' => $tagstr, 'replycredit' => 0, 'status' => (defined('IN_MOBILE') ? 8 : 0) | $postStatus));
if ($_G['group']['allowat'] && $atlist) {
foreach ($atlist as $atuid => $atusername) {
notification_add($atuid, 'at', 'at_message', array('from_id' => $tid, 'from_idtype' => 'at', 'buyerid' => $_G['uid'], 'buyer' => $_G['username'], 'tid' => $tid, 'subject' => $subject, 'pid' => $pid, 'message' => messagecutstr($message, 150)));
}
set_atlist_cookie(array_keys($atlist));
示例6: array
$_GET['addfeed'] = 0;
}
$digest = $_G['forum']['ismoderator'] && !empty($addtodigest) ? 1 : 0;
$readperm = $_G['group']['allowsetreadperm'] ? $readperm : 0;
$isanonymous = $_GET['isanonymous'] && $_G['group']['allowanonymous'] ? 1 : 0;
$author = !$isanonymous ? $_G['username'] : '';
$moderated = $digest || $displayorder > 0 ? 1 : 0;
$isgroup = $_G['forum']['status'] == 3 ? 1 : 0;
$newthread = array('fid' => $_G['fid'], 'posttableid' => 0, 'readperm' => $readperm, 'price' => $price, 'typeid' => $typeid, 'author' => $author, 'authorid' => $_G['uid'], 'subject' => $subject, 'dateline' => $_G['timestamp'], 'lastpost' => $_G['timestamp'], 'lastposter' => $author, 'displayorder' => $displayorder, 'digest' => $digest, 'special' => $special, 'attachment' => $attachment, 'moderated' => $moderated, 'replies' => 1, 'status' => $thread['status'], 'isgroup' => $isgroup);
$tid = C::t('forum_thread')->insert($newthread, true);
useractionlog($_G['uid'], 'tid');
if ($moderated) {
updatemodlog($tid, $displayorder > 0 ? 'STK' : 'DIG');
updatemodworks($displayorder > 0 ? 'STK' : 'DIG', 1);
}
$bbcodeoff = checkbbcodes($message, !empty($_GET['bbcodeoff']));
$smileyoff = checksmilies($message, !empty($_GET['smileyoff']));
$parseurloff = !empty($_GET['parseurloff']);
$htmlon = $_G['group']['allowhtml'] && !empty($_GET['htmlon']) ? 1 : 0;
$attentionon = empty($_GET['attention_add']) ? 0 : 1;
$pinvisible = $modnewthreads ? -2 : (empty($_GET['save']) ? 0 : -3);
$class_tag = new tag();
$tagstr = $class_tag->add_tag($_GET['tags'], $tid, 'tid');
insertpost(array('fid' => $_G['fid'], 'tid' => $tid, 'first' => '1', 'author' => $_G['username'], 'authorid' => $_G['uid'], 'subject' => $subject, 'dateline' => $_G['timestamp'], 'message' => '', 'useip' => $_G['clientip'], 'invisible' => $pinvisible, 'anonymous' => $isanonymous, 'usesig' => $_GET['usesig'], 'htmlon' => $htmlon, 'bbcodeoff' => $bbcodeoff, 'smileyoff' => $smileyoff, 'parseurloff' => $parseurloff, 'attachment' => '0', 'tags' => $tagstr));
$message = preg_replace('/\\[attachimg\\](\\d+)\\[\\/attachimg\\]/is', '[attach]\\1[/attach]', $message);
$pid = insertpost(array('fid' => $_G['fid'], 'tid' => $tid, 'first' => '0', 'author' => $_G['username'], 'authorid' => $_G['uid'], 'subject' => $subject, 'dateline' => $_G['timestamp'], 'message' => $message, 'useip' => $_G['clientip'], 'invisible' => 0, 'anonymous' => $isanonymous, 'usesig' => $_GET['usesig'], 'htmlon' => $htmlon, 'bbcodeoff' => $bbcodeoff, 'smileyoff' => $smileyoff, 'parseurloff' => $parseurloff, 'attachment' => $attachment, 'tags' => $tagstr, 'status' => defined('IN_MOBILE') ? 8 : 0));
($_G['group']['allowpostattach'] || $_G['group']['allowpostimage']) && ($_GET['attachnew'] || $_GET['tradeaid']) && updateattach($displayorder == -4 || $modnewthreads, $tid, $pid, $_GET['attachnew']);
require_once libfile('function/trade');
trade_create(array('tid' => $tid, 'pid' => $pid, 'aid' => $_GET['tradeaid'], 'item_expiration' => $_GET['item_expiration'], 'thread' => $thread, 'discuz_uid' => $_G['uid'], 'author' => $author, 'seller' => empty($_GET['paymethod']) && $_GET['seller'] ? dhtmlspecialchars(trim($_GET['seller'])) : '', 'tenpayaccount' => $_GET['tenpay_account'], 'item_name' => $_GET['item_name'], 'item_price' => $_GET['item_price'], 'item_number' => $_GET['item_number'], 'item_quality' => $_GET['item_quality'], 'item_locus' => $_GET['item_locus'], 'transport' => $_GET['transport'], 'postage_mail' => $_GET['postage_mail'], 'postage_express' => $_GET['postage_express'], 'postage_ems' => $_GET['postage_ems'], 'item_type' => $_GET['item_type'], 'item_costprice' => $_GET['item_costprice'], 'item_credit' => $_GET['item_credit'], 'item_costcredit' => $_GET['item_costcredit']));
if (!empty($_GET['tradeaid'])) {
convertunusedattach($_GET['tradeaid'], $tid, $pid);
示例7: editpost
//.........这里部分代码省略.........
$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);
$this->param['message'] = lang('forum/misc', $this->param['htmlon'] ? 'post_edithtml' : (!$this->forum['allowbbcode'] || $this->param['bbcodeoff'] ? 'post_editnobbcode' : 'post_edit'), array('editor' => $editor, 'edittime' => $edittime)) . $this->param['message'];
}
$this->param['bbcodeoff'] = checkbbcodes($this->param['message'], !empty($this->param['bbcodeoff']));
$this->param['smileyoff'] = checksmilies($this->param['message'], !empty($this->param['smileyoff']));
$tagoff = $isfirstpost ? !empty($tagoff) : 0;
if (getglobal('forum_auditstatuson') && $this->param['audit'] == 1) {
C::t('forum_post')->update($this->thread['posttableid'], $this->post['pid'], array('status' => 4), false, false, null, -2, null, 0);
updatepostcredits('+', $this->post['authorid'], $isfirstpost ? 'post' : 'reply', $this->forum['fid']);
updatemodworks('MOD', 1);
updatemodlog($this->thread['tid'], 'MOD');
}
$displayorder = $pinvisible = 0;
if ($isfirstpost) {
$displayorder = $this->param['modnewthreads'] ? -2 : $this->thread['displayorder'];
$pinvisible = $this->param['modnewthreads'] ? -2 : (empty($this->param['save']) ? 0 : -3);
} else {
$pinvisible = $this->param['modnewreplies'] ? -2 : ($this->thread['displayorder'] == -4 ? -3 : 0);
}
$this->param['message'] = preg_replace('/\\[attachimg\\](\\d+)\\[\\/attachimg\\]/is', '[attach]\\1[/attach]', $this->param['message']);
$this->param['parseurloff'] = !empty($this->param['parseurloff']);
$setarr = array('message' => $this->param['message'], 'usesig' => $this->param['usesig'], 'htmlon' => $this->param['htmlon'], 'bbcodeoff' => $this->param['bbcodeoff'], 'parseurloff' => $this->param['parseurloff'], 'smileyoff' => $this->param['smileyoff'], 'subject' => $this->param['subject'], 'tags' => $tagstr, 'port' => getglobal('remoteport'));
$setarr['status'] = $this->post['status'];
if ($this->param['modstatus']) {
foreach ($this->param['modstatus'] as $modbit => $modvalue) {
$setarr['status'] = setstatus($modbit, $modvalue, $setarr['status']);
}
}
if ($anonymousadd !== '') {
$setarr['anonymous'] = $anonymousadd;
}
if ($publishdate) {
$setarr['dateline'] = $publishdate;
}
if (getglobal('forum_auditstatuson') && $this->param['audit'] == 1) {
$setarr['invisible'] = 0;
} else {
$setarr['invisible'] = $pinvisible;
}
C::t('forum_post')->update('tid:' . $this->thread['tid'], $this->post['pid'], $setarr);
$this->forum['lastpost'] = explode("\t", $this->forum['lastpost']);
if ($this->post['dateline'] == $this->forum['lastpost'][2] && ($this->post['author'] == $this->forum['lastpost'][3] || $this->forum['lastpost'][3] == '' && $this->post['anonymous'])) {
$lastpost = $this->thread['tid'] . "\t" . ($isfirstpost ? $this->param['subject'] : $this->thread['subject']) . "\t" . $this->post['dateline'] . "\t" . ($this->param['isanonymous'] ? '' : $this->post['author']);
C::t('forum_forum')->update($this->forum['fid'], array('lastpost' => $lastpost));
}
if (!getglobal('forum_auditstatuson') || $this->param['audit'] != 1) {
if ($isfirstpost && $this->param['modnewthreads']) {
C::t('forum_thread')->update($this->thread['tid'], array('displayorder' => -2));
manage_addnotify('verifythread');
} elseif (!$isfirstpost && $this->param['modnewreplies']) {
C::t('forum_thread')->increase($this->thread['tid'], array('replies' => -1));
manage_addnotify('verifypost');
}
if ($this->param['modnewreplies'] || $this->param['modnewthreads']) {
C::t('forum_forum')->update($this->forum['fid'], array('modworks' => '1'));
}
}
if ($this->thread['lastpost'] == $this->post['dateline'] && (!$this->post['anonymous'] && $this->thread['lastposter'] == $this->post['author'] || $this->post['anonymous'] && $this->thread['lastposter'] == '') && $this->post['anonymous'] != $this->param['isanonymous']) {
C::t('forum_thread')->update($this->thread['tid'], array('lastposter' => $this->param['isanonymous'] ? '' : $this->post['author']), true);
}
if (!$isorigauthor) {
updatemodworks('EDT', 1);
require_once libfile('function/misc');
modlog($this->thread, 'EDT');
}
if ($isfirstpost && $this->thread['displayorder'] == -4 && empty($this->param['save'])) {
threadpubsave($this->thread['tid']);
}
}
示例8: article_reply
function article_reply($arr)
{
global $_G;
require_once libfile('function/editor');
require_once libfile('function/post');
$time_arr = create_public_time($arr, count($arr['reply']), 1);
//需传入已经发布的帖子的public_start_time
$uid_arr = get_rand_uid($arr, 'reply');
$subject = addslashes($arr['title']);
$view_num = $arr['view_num'];
$tid = $arr['tid'];
$reply_arr = $arr['reply'];
if ($arr['public_reply_seq'] == 1) {
shuffle($reply_arr);
}
//打乱回帖
//print_r($reply_arr);exit();
$replys = count($reply_arr);
foreach ((array) $reply_arr as $k => $v) {
$message = dstripslashes($v);
$message = media_htmlbbcode($message, $arr['page_url']);
$message = img_htmlbbcode($message, $arr['page_url']);
$message = htmlspecialchars_decode(html2bbcode($message));
$bbcodeoff = checkbbcodes($message, !empty($_GET['bbcodeoff']));
$smileyoff = checksmilies($message, !empty($_GET['smileyoff']));
$parseurloff = !empty($_GET['parseurloff']);
$htmlon = $_G['group']['allowhtml'] && !empty($_GET['htmlon']) ? 1 : 0;
$usesig = !empty($_GET['usesig']) ? 1 : ($_G['uid'] && $_G['group']['maxsigsize'] ? 1 : 0);
$isanonymous = $_G['group']['allowanonymous'] && !empty($_GET['isanonymous']) ? 1 : 0;
if (!$message || strlen($message) < 2) {
continue;
}
$post_setarr = array('fid' => $arr['fid'], 'tid' => $tid, 'first' => '0', 'author' => $uid_arr[$k]['username'] ? $uid_arr[$k]['username'] : $_G['username'], 'authorid' => $uid_arr[$k]['uid'] ? $uid_arr[$k]['uid'] : $_G['uid'], 'subject' => '', 'dateline' => $time_arr[$k], 'message' => $message, 'useip' => $_G['clientip'], 'invisible' => 0, 'anonymous' => $isanonymous, 'usesig' => $usesig, 'htmlon' => $htmlon, 'bbcodeoff' => $bbcodeoff, 'smileyoff' => $smileyoff, 'parseurloff' => $parseurloff, 'attachment' => '0', 'tags' => 0, 'replycredit' => 0, 'status' => defined('IN_MOBILE') ? 8 : 0);
//$new[$k] = $post_setarr;
if (DISCUZ_VERSION != 'X2') {
//2.5版本
$post_setarr = dstripslashes($post_setarr);
} else {
$post_setarr = daddslashes($post_setarr);
}
$lastpost = $post_setarr['dateline'];
$lastposter = $post_setarr['author'];
$reply_pid = insertpost($post_setarr);
$forum_arr['tid'] = $tid;
$forum_arr['pid'] = $reply_pid;
$forum_arr['is_post'] = 1;
//标识是回复
$forum_arr['cookie'] = $arr['cookie'];
$forum_arr['is_water_img'] = $arr['is_water_img'];
$forum_arr['is_download_img'] = $arr['is_download_img'];
$forum_arr['is_download_file'] = $arr['is_download_file'];
$forum_arr['content'] = $v;
$re_arr = forum_downremotefile($forum_arr);
DB::query("UPDATE " . DB::table('common_member_count') . " SET posts=posts+1 WHERE uid='{$post_setarr['authorid']}'");
//更新数
}
//今日发帖
$todayposts = 0;
foreach ((array) $time_arr as $k => $v) {
if (date("Yjn", $_G['timestamp']) == date("Yjn", $v)) {
$todayposts++;
}
}
DB::update('forum_thread', array('replies' => count($reply_arr), 'lastpost' => $lastpost, 'lastposter' => $lastposter), array('tid' => $tid));
$subject = str_replace("\t", ' ', $subject);
$replys = $replys ? $replys : 1;
$forum_lastpost = "{$tid}\t{$subject}\t{$lastpost}\t{$lastposter}";
DB::query("UPDATE " . DB::table('forum_forum') . " SET lastpost='{$forum_lastpost}', posts=posts+{$replys}, todayposts=todayposts+{$todayposts} WHERE fid='{$arr['fid']}'", 'UNBUFFERED');
//更新今日发帖这些数据
return TRUE;
}