本文整理汇总了PHP中updateattach函数的典型用法代码示例。如果您正苦于以下问题:PHP updateattach函数的具体用法?PHP updateattach怎么用?PHP updateattach使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了updateattach函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: after_newthread
public function after_newthread()
{
if (!$this->tid) {
return;
}
$this->trademessage = preg_replace('/\\[attachimg\\](\\d+)\\[\\/attachimg\\]/is', '[attach]\\1[/attach]', $this->trademessage);
$pid = insertpost(array('fid' => $this->forum['fid'], 'tid' => $this->tid, 'first' => '0', 'author' => $this->member['username'], 'authorid' => $this->member['uid'], 'subject' => $this->param['subject'], 'dateline' => getglobal('timestamp'), 'message' => $this->trademessage, 'useip' => getglobal('clientip'), 'invisible' => 0, 'anonymous' => $this->param['isanonymous'], 'usesig' => $_GET['usesig'], 'htmlon' => $this->param['htmlon'], 'bbcodeoff' => $this->param['bbcodeoff'], 'smileyoff' => $this->param['smileyoff'], 'parseurloff' => $this->param['parseurloff'], 'attachment' => 0, 'tags' => $this->param['tagstr'], 'status' => defined('IN_MOBILE') ? 8 : 0));
($this->group['allowpostattach'] || $this->group['allowpostimage']) && ($_GET['attachnew'] || $_GET['tradeaid']) && updateattach($this->param['displayorder'] == -4 || $this->param['modnewthreads'], $this->tid, $pid, $_GET['attachnew']);
require_once libfile('function/trade');
$author = !$this->param['isanonymous'] ? $this->member['username'] : '';
trade_create(array('tid' => $this->tid, 'pid' => $pid, 'aid' => $_GET['tradeaid'], 'item_expiration' => $_GET['item_expiration'], 'thread' => $this->thread, 'discuz_uid' => $this->member['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'], $this->tid, $pid);
}
}
开发者ID:tang86,项目名称:discuz-utf8,代码行数:15,代码来源:extend_thread_trade.php
示例2: showmessage
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']);
$item_transport = intval($_G['gp_item_transport']);
$postage_mail = intval($_G['gp_postage_mail']);
$postage_express = intval(trim($_G['gp_postage_express']));
$postage_ems = intval($_G['gp_postage_ems']);
$item_type = intval($_G['gp_item_type']);
开发者ID:kleitz,项目名称:sports,代码行数:31,代码来源:post_editpost.php
示例3: showmessage
$_G['tid'] > 1 && DB::query("UPDATE " . DB::table('forum_thread') . " SET subject='{$subject}' WHERE closed='{$_G['tid']}'", 'UNBUFFERED');
} else {
if ($subject == '' && $message == '' && $thread['special'] != 2) {
showmessage('post_sm_isnull');
}
}
$htmlon = bindec(($_G['setting']['tagstatus'] && $tagoff ? 1 : 0) . ($_G['group']['allowhtml'] && !empty($_G['gp_htmlon']) ? 1 : 0));
if ($_G['setting']['editedby'] && TIMESTAMP - $orig['dateline'] > 1 && $_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;
($_G['group']['allowpostattach'] || $_G['group']['allowpostimage']) && ($_G['gp_attachnew'] || $_G['gp_attachdel'] || $special == 2 && $_G['gp_tradeaid'] || $special == 4 && $_G['gp_activityaid'] || $isfirstpost && $sortid) && updateattach($postattachcredits, $_G['tid'], $pid, $_G['gp_attachnew'], $_G['gp_attachdel'], $_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']);
$item_transport = intval($_G['gp_item_transport']);
$postage_mail = intval($_G['gp_postage_mail']);
$postage_express = intval(trim($_G['gp_postage_express']));
$postage_ems = intval($_G['gp_postage_ems']);
$item_type = intval($_G['gp_item_type']);
$item_costprice = floatval($_G['gp_item_costprice']);
开发者ID:v998,项目名称:discuzx-en,代码行数:31,代码来源:post_editpost.php
示例4: unset
filename=\'' . $uattachments[$paid]['name'] . '\',
filetype=\'' . $uattachments[$paid]['type'] . '\',
filesize=\'' . $uattachments[$paid]['size'] . '\',
attachment=\'' . $uattachments[$paid]['attachment'] . '\',
thumb=\'' . $uattachments[$paid]['thumb'] . '\',
isimage=\'-' . $uattachments[$paid]['isimage'] . '\',
remote=\'' . $uattachments[$paid]['remote'] . '\',
width=\'' . $uattachments[$paid]['width'] . '\'';
unset($uattachments[$paid]);
}
if ($attachfileadd) {
$db->query("UPDATE {$tablepre}attachments SET {$attachfileadd} WHERE aid='{$attach['aid']}'");
}
}
}
$allowpostattach && ($attachnew || $attachdel || $special == 2 && $tradeaid || $isfirstpost && $sortid) && updateattach();
if ($uattachment || $attachdel) {
$tattachment = $db->result_first("SELECT count(*) FROM {$tablepre}posts p, {$tablepre}attachments a WHERE a.tid='{$tid}' AND a.isimage IN ('1', '-1') AND a.pid=p.pid AND p.invisible='0' LIMIT 1") ? 2 : ($db->result_first("SELECT count(*) FROM {$tablepre}posts p, {$tablepre}attachments a WHERE a.tid='{$tid}' AND a.pid=p.pid AND p.invisible='0' LIMIT 1") ? 1 : 0);
$db->query("UPDATE {$tablepre}threads SET attachment='{$tattachment}' WHERE tid='{$tid}'");
}
if ($special == 2 && $allowposttrade) {
$oldtypeid = $db->result_first("SELECT typeid FROM {$tablepre}trades WHERE pid='{$pid}'");
$oldtypeid = isset($tradetypes[$oldtypeid]) ? $oldtypeid : 0;
$tradetypeid = !$tradetypeid ? $oldtypeid : $tradetypeid;
$optiondata = array();
threadsort_checkoption($oldtypeid, 1);
$optiondata = array();
if ($tradetypes && $typeoption && is_array($typeoption) && $checkoption) {
$optiondata = threadsort_validator($typeoption);
}
if ($tradetypes && $optiondata && is_array($optiondata)) {
开发者ID:lilhorse,项目名称:cocoa,代码行数:31,代码来源:editpost.inc.php
示例5: elseif
if ($stand == 1) {
$db->query("UPDATE {$tablepre}debates SET affirmdebaters=affirmdebaters+1 WHERE tid='{$tid}'");
} elseif ($stand == 2) {
$db->query("UPDATE {$tablepre}debates SET negadebaters=negadebaters+1 WHERE tid='{$tid}'");
}
} else {
$stand = $firststand;
}
if ($stand == 1) {
$db->query("UPDATE {$tablepre}debates SET affirmreplies=affirmreplies+1 WHERE tid='{$tid}'");
} elseif ($stand == 2) {
$db->query("UPDATE {$tablepre}debates SET negareplies=negareplies+1 WHERE tid='{$tid}'");
}
$db->query("INSERT INTO {$tablepre}debateposts (tid, pid, uid, dateline, stand, voters, voterids) VALUES ('{$tid}', '{$pid}', '{$discuz_uid}', '{$timestamp}', '{$stand}', '0', '')");
}
$allowpostattach && ($attachnew || $attachdel || $special == 2 && $tradeaid) && updateattach();
$replymessage = 'post_reply_succeed';
if ($special == 2 && $allowposttrade && $thread['authorid'] == $discuz_uid && !empty($trade) && !empty($item_name)) {
if ($tradetypes && $optiondata) {
foreach ($optiondata as $optionid => $value) {
$db->query("INSERT INTO {$tablepre}tradeoptionvars (sortid, pid, optionid, value)\r\n\t\t\t\t\tVALUES ('{$tradetypeid}', '{$pid}', '{$optionid}', '{$value}')");
}
}
require_once DISCUZ_ROOT . './include/trade.func.php';
trade_create(array('tid' => $tid, 'pid' => $pid, 'aid' => $tradeaid, 'typeid' => $tradetypeid, 'item_expiration' => $item_expiration, 'thread' => $thread, 'discuz_uid' => $discuz_uid, 'author' => $author, 'seller' => $seller, 'item_name' => $item_name, 'item_price' => $item_price, 'item_number' => $item_number, 'item_quality' => $item_quality, 'item_locus' => $item_locus, 'transport' => $transport, 'postage_mail' => $postage_mail, 'postage_express' => $postage_express, 'postage_ems' => $postage_ems, 'item_type' => $item_type, 'item_costprice' => $item_costprice, 'item_credit' => $item_credit, 'item_costcredit' => $item_costcredit));
$replymessage = 'trade_add_succeed';
}
if ($specialextra) {
@(include_once DISCUZ_ROOT . './plugins/' . $threadplugins[$specialextra]['module'] . '.class.php');
$classname = 'threadplugin_' . $specialextra;
if (method_exists($classname, 'newreply_submit_end')) {
开发者ID:lilhorse,项目名称:cocoa,代码行数:31,代码来源:newreply.inc.php
示例6: str_replace
$tags = str_replace(array(chr(0xa1) . chr(0xa1), chr(0xa1) . chr(0x40), chr(0xe3) . chr(0x80) . chr(0x80)), ' ', $tags);
$tagarray = array_unique(explode(' ', $tags));
}
$tagarraynew = array();
foreach ($tagarray as $k => $tagname) {
if (preg_match('/^([\\x7f-\\xff_-]|\\w){3,20}$/', $tagname)) {
$tagarraynew[$k] = trim($tagname);
}
}
$tagarray = $tagarraynew;
unset($tagarraynew);
}
$pinvisible = $modnewreplies ? -2 : 0;
$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' => $pinvisible, 'anonymous' => $isanonymous, 'usesig' => $_G['gp_usesig'], 'htmlon' => $htmlon, 'bbcodeoff' => $bbcodeoff, 'smileyoff' => $smileyoff, 'parseurloff' => $parseurloff, 'attachment' => $attachment, 'tags' => implode(',', $tagarray)));
($_G['group']['allowpostattach'] || $_G['group']['allowpostimage']) && ($_G['gp_attachnew'] || $_G['gp_attachdel'] || $_G['gp_tradeaid']) && updateattach($postattachcredits, $tid, $pid, $_G['gp_attachnew'], $_G['gp_attachdel']);
require_once libfile('function/trade');
trade_create(array('tid' => $tid, 'pid' => $pid, 'aid' => $_G['gp_tradeaid'], 'item_expiration' => $_G['gp_item_expiration'], 'thread' => $thread, 'discuz_uid' => $_G['uid'], 'author' => $author, 'seller' => empty($_G['gp_paymethod']) && $_G['gp_seller'] ? dhtmlspecialchars(trim($_G['gp_seller'])) : '', 'tenpayaccount' => $_G['gp_tenpay_account'], 'item_name' => $_G['gp_item_name'], 'item_price' => $_G['gp_item_price'], 'item_number' => $_G['gp_item_number'], 'item_quality' => $_G['gp_item_quality'], 'item_locus' => $_G['gp_item_locus'], 'transport' => $_G['gp_transport'], 'postage_mail' => $_G['gp_postage_mail'], 'postage_express' => $_G['gp_postage_express'], 'postage_ems' => $_G['gp_postage_ems'], 'item_type' => $_G['gp_item_type'], 'item_costprice' => $_G['gp_item_costprice'], 'item_credit' => $_G['gp_item_credit'], 'item_costcredit' => $_G['gp_item_costcredit']));
if (!empty($_G['gp_tradeaid'])) {
DB::query("UPDATE " . DB::table('forum_attachment') . " SET tid='{$tid}', pid='{$pid}' WHERE aid='{$_G['gp_tradeaid']}' AND uid='{$_G['uid']}'");
}
$param = array($_G['fid'], $tid, $pid);
if ($modnewthreads) {
DB::query("UPDATE " . DB::table('forum_forum') . " SET todayposts=todayposts+1 WHERE fid='{$_G['fid']}'", 'UNBUFFERED');
showmessage('post_newthread_mod_succeed', "forum.php?mod=forumdisplay&fid={$_G['fid']}", $param);
} else {
$feed = array();
if (!empty($_G['gp_addfeed']) && $_G['forum']['allowfeed'] && !$isanonymous) {
$feed['icon'] = 'goods';
$feed['title_template'] = 'feed_thread_goods_title';
if ($_G['gp_item_price'] > 0) {
开发者ID:Kingson4Wu,项目名称:php_demo,代码行数:31,代码来源:post_newtrade.php
示例7: savepostposition
if ($pid && getstatus($thread['status'], 1)) {
savepostposition($tid, $pid);
}
$threadimageaid = 0;
$threadimage = array();
if ($special == 4 && $_G['gp_activityaid']) {
$threadimageaid = $_G['gp_activityaid'];
convertunusedattach($_G['gp_activityaid'], $tid, $pid);
}
if ($_G['forum']['threadsorts']['types'][$sortid] && !empty($_G['forum_optiondata']) && is_array($_G['forum_optiondata']) && $sortaids) {
foreach ($sortaids as $sortaid) {
convertunusedattach($sortaid, $tid, $pid);
}
}
if (($_G['group']['allowpostattach'] || $_G['group']['allowpostimage']) && ($_G['gp_attachnew'] || $sortid || !empty($_G['gp_activityaid']))) {
updateattach($displayorder == -4 || $modnewthreads, $tid, $pid, $_G['gp_attachnew']);
if (!$threadimageaid) {
$threadimage = DB::fetch_first("SELECT aid, attachment, remote FROM " . DB::table(getattachtablebytid($tid)) . " WHERE tid='{$tid}' AND isimage IN ('1', '-1') ORDER BY width DESC LIMIT 1");
$threadimageaid = $threadimage['aid'];
}
if ($_G['forum']['picstyle']) {
setthreadcover($pid, 0, $threadimageaid);
}
}
if ($threadimageaid) {
if (!$threadimage) {
$threadimage = DB::fetch_first("SELECT attachment, remote FROM " . DB::table(getattachtablebytid($tid)) . " WHERE aid='{$threadimageaid}'");
}
$threadimage = daddslashes($threadimage);
DB::insert('forum_threadimage', array('tid' => $tid, 'attachment' => $threadimage['attachment'], 'remote' => $threadimage['remote']));
}
开发者ID:v998,项目名称:discuzx-en,代码行数:31,代码来源:post_newthread.php
示例8: sendPost
//.........这里部分代码省略.........
'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));
}
$threadimageaid = 0;
$threadimage = array();
if ($special == 4 && $_GET['activityaid']) {
$threadimageaid = $_GET['activityaid'];
convertunusedattach($_GET['activityaid'], $tid, $pid);
}
if ($_G['forum']['threadsorts']['types'][$sortid] && !empty($_G['forum_optiondata']) && is_array($_G['forum_optiondata']) && $sortaids) {
foreach ($sortaids as $sortaid) {
convertunusedattach($sortaid, $tid, $pid);
}
}
if (($_G['group']['allowpostattach'] || $_G['group']['allowpostimage']) && ($_GET['attachnew'] || $sortid || !empty($_GET['activityaid']))) {
updateattach($displayorder == -4 || $modnewthreads, $tid, $pid, $_GET['attachnew']);
if (!$threadimageaid) {
$threadimage = C::t('forum_attachment_n')->fetch_max_image('tid:' . $tid, 'tid', $tid);
$threadimageaid = $threadimage['aid'];
}
}
$values = array('fid' => $_G['fid'], 'tid' => $tid, 'pid' => $pid, 'coverimg' => '', 'sechash' => !empty($_GET['sechash']) ? $_GET['sechash'] : '');
$param = array();
Mobcent::import(MOBCENT_APP_ROOT . '/components/discuz/source/function/function_post.php');
if ($_G['forum']['picstyle']) {
if (!mobcent_setthreadcover($pid, 0, $threadimageaid)) {
preg_match_all("/(\\[img\\]|\\[img=\\d{1,4}[x|\\,]\\d{1,4}\\])\\s*([^\\[\\<\r\n]+?)\\s*\\[\\/img\\]/is", $message, $imglist, PREG_SET_ORDER);
$values['coverimg'] = "<p id=\"showsetcover\">" . lang('message', 'post_newthread_set_cover') . "<span id=\"setcoverwait\"></span></p><script>if(\$('forward_a')){\$('forward_a').style.display='none';setTimeout(\"\$('forward_a').style.display=''\", 5000);};ajaxget('forum.php?mod=ajax&action=setthreadcover&tid={$tid}&pid={$pid}&fid={$_G['fid']}&imgurl={$imglist[0][2]}&newthread=1', 'showsetcover', 'setcoverwait')</script>";
$param['clean_msgforward'] = 1;
$param['timeout'] = $param['refreshtime'] = 15;
}
}
if ($threadimageaid) {
if (!$threadimage) {
$threadimage = C::t('forum_attachment_n')->fetch('tid:' . $tid, $threadimageaid);
}
$threadimage = daddslashes($threadimage);
C::t('forum_threadimage')->insert(array('tid' => $tid, 'attachment' => $threadimage['attachment'], 'remote' => $threadimage['remote']));
}
$statarr = array(0 => 'thread', 1 => 'poll', 2 => 'trade', 3 => 'reward', 4 => 'activity', 5 => 'debate', 127 => 'thread');
include_once libfile('function/stat');
updatestat($isgroup ? 'groupthread' : $statarr[$special]);
if ($modnewthreads) {
updatemoderate('tid', $tid);
C::t('forum_forum')->update_forum_counter($_G['fid'], 0, 0, 1);
manage_addnotify('verifythread');
return WebUtils::makeErrorInfo_oldVersion($res, 'post_newthread_mod_succeed', array('noError' => 1));
//showmessage('post_newthread_mod_succeed', $returnurl, $values, $param);
开发者ID:caidongyun,项目名称:CS,代码行数:67,代码来源:TopicAdminAction.php
示例9: updatemodlog
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);
}
if ($_G['forum']['picstyle']) {
setthreadcover($pid);
}
$param = array('fid' => $_G['fid'], 'tid' => $tid, 'pid' => $pid, 'coverimg' => '');
include_once libfile('function/stat');
updatestat($isgroup ? 'groupthread' : 'trade');
dsetcookie('clearUserdata', 'forum');
if ($modnewthreads) {
updatemoderate('tid', $tid);
C::t('forum_forum')->update_forum_counter($_G['fid'], 0, 0, 1);
开发者ID:softhui,项目名称:discuz,代码行数:31,代码来源:post_newtrade.php
示例10: VALUES
} else {
$db->query("INSERT INTO {$tablepre}tags (tagname, closed, total)\r\n\t\t\t\t\t\tVALUES ('{$tagname}', 0, 1)", 'UNBUFFERED');
$tagstatus = 0;
}
if (!$tagstatus) {
$db->query("INSERT {$tablepre}threadtags (tagname, tid) VALUES ('{$tagname}', {$tid})", 'UNBUFFERED');
}
$tagcount++;
if ($tagcount > 4) {
unset($tagarray);
break;
}
}
}
}
$allowpostattach && ($attachnew || $attachdel || $sortid) && updateattach();
if ($modnewthreads) {
$db->query("UPDATE {$tablepre}forums SET todayposts=todayposts+1 WHERE fid='{$fid}'", 'UNBUFFERED');
showmessage('post_newthread_mod_succeed', "forumdisplay.php?fid={$fid}");
} else {
$feed = array('icon' => '', 'title_template' => '', 'title_data' => array(), 'body_template' => '', 'body_data' => array(), 'title_data' => array(), 'images' => array());
if ($addfeed && $forum['allowfeed'] && !$isanonymous) {
if ($special == 0) {
$feed['icon'] = 'thread';
$feed['title_template'] = 'feed_thread_title';
$feed['body_template'] = 'feed_thread_message';
$feed['body_data'] = array('subject' => "<a href=\"{$boardurl}viewthread.php?tid={$tid}\">{$subject}</a>", 'message' => cutstr(strip_tags(preg_replace(array("/\\[hide=?\\d*\\].+?\\[\\/hide\\]/is", "/\\[.+?\\]/is"), array('', ''), $message)), 150));
} elseif ($special > 0) {
if ($special == 1) {
$feed['icon'] = 'poll';
$feed['title_template'] = 'feed_thread_poll_title';
开发者ID:lilhorse,项目名称:cocoa,代码行数:31,代码来源:newthread.inc.php
示例11: elseif
if ($stand == 1) {
DB::query("UPDATE " . DB::table('forum_debate') . " SET affirmdebaters=affirmdebaters+1 WHERE tid='{$_G['tid']}'");
} elseif ($stand == 2) {
DB::query("UPDATE " . DB::table('forum_debate') . " SET negadebaters=negadebaters+1 WHERE tid='{$_G['tid']}'");
}
} else {
$stand = $firststand;
}
if ($stand == 1) {
DB::query("UPDATE " . DB::table('forum_debate') . " SET affirmreplies=affirmreplies+1 WHERE tid='{$_G['tid']}'");
} elseif ($stand == 2) {
DB::query("UPDATE " . DB::table('forum_debate') . " SET negareplies=negareplies+1 WHERE tid='{$_G['tid']}'");
}
DB::query("INSERT INTO " . DB::table('forum_debatepost') . " (tid, pid, uid, dateline, stand, voters, voterids) VALUES ('{$_G['tid']}', '{$pid}', '{$_G['uid']}', '{$_G['timestamp']}', '{$stand}', '0', '')");
}
($_G['group']['allowpostattach'] || $_G['group']['allowpostimage']) && ($_G['gp_attachnew'] || $special == 2 && $_G['gp_tradeaid']) && updateattach($thread['displayorder'] == -4 || $modnewreplies, $_G['tid'], $pid, $_G['gp_attachnew']);
$replymessage = 'post_reply_succeed';
if ($special == 2 && $_G['group']['allowposttrade'] && $thread['authorid'] == $_G['uid'] && !empty($_G['gp_trade']) && !empty($_G['gp_item_name'])) {
require_once libfile('function/trade');
trade_create(array('tid' => $_G['tid'], 'pid' => $pid, 'aid' => $_G['gp_tradeaid'], 'item_expiration' => $_G['gp_item_expiration'], 'thread' => $thread, 'discuz_uid' => $_G['uid'], 'author' => $author, 'seller' => empty($_G['gp_paymethod']) && $_G['gp_seller'] ? dhtmlspecialchars(trim($_G['gp_seller'])) : '', 'item_name' => $_G['gp_item_name'], 'item_price' => $_G['gp_item_price'], 'item_number' => $_G['gp_item_number'], 'item_quality' => $_G['gp_item_quality'], 'item_locus' => $_G['gp_item_locus'], 'transport' => $_G['gp_transport'], 'postage_mail' => $_G['gp_postage_mail'], 'postage_express' => $_G['gp_postage_express'], 'postage_ems' => $_G['gp_postage_ems'], 'item_type' => $_G['gp_item_type'], 'item_costprice' => $_G['gp_item_costprice'], 'item_credit' => $_G['gp_item_credit'], 'item_costcredit' => $_G['gp_item_costcredit']));
$replymessage = 'trade_add_succeed';
if (!empty($_G['gp_tradeaid'])) {
convertunusedattach($_G['gp_tradeaid'], $_G['tid'], $pid);
}
}
if ($specialextra) {
@(include_once DISCUZ_ROOT . './source/plugin/' . $_G['setting']['threadplugins'][$specialextra]['module'] . '.class.php');
$classname = 'threadplugin_' . $specialextra;
if (class_exists($classname) && method_exists($threadpluginclass = new $classname(), 'newreply_submit_end')) {
$threadpluginclass->newreply_submit_end($_G['fid'], $_G['tid']);
}
开发者ID:v998,项目名称:discuzx-en,代码行数:31,代码来源:post_newreply.php
示例12: foreach
foreach ($optiondata as $optionid => $value) {
$db->query("INSERT INTO {$tablepre}tradeoptionvars (sortid, pid, optionid, value)\r\n\t\t\tVALUES ('{$tradetypeid}', '{$pid}', '{$optionid}', '{$value}')");
}
}
if ($discuz_uid) {
$stataction = '';
if ($attentionon) {
$stataction = 'attentionon';
$db->query("REPLACE INTO {$tablepre}favoritethreads (tid, uid, dateline) VALUES ('{$tid}', '{$discuz_uid}', '{$timestamp}')", 'UNBUFFERED');
}
if ($stataction) {
write_statlog('', 'item=attention&action=newtrade_' . $stataction, '', '', 'my.php');
}
$db->query("UPDATE {$tablepre}favoriteforums SET newthreads=newthreads+1 WHERE fid='{$fid}' AND uid<>'{$discuz_uid}'", 'UNBUFFERED');
}
$allowpostattach && ($attachnew || $attachdel || $tradeaid) && updateattach();
require_once DISCUZ_ROOT . './include/trade.func.php';
trade_create(array('tid' => $tid, 'pid' => $pid, 'aid' => $tradeaid, 'typeid' => $tradetypeid, 'item_expiration' => $item_expiration, 'thread' => $thread, 'discuz_uid' => $discuz_uid, 'author' => $author, 'seller' => $seller, 'item_name' => $item_name, 'item_price' => $item_price, 'item_number' => $item_number, 'item_quality' => $item_quality, 'item_locus' => $item_locus, 'transport' => $transport, 'postage_mail' => $postage_mail, 'postage_express' => $postage_express, 'postage_ems' => $postage_ems, 'item_type' => $item_type, 'item_costprice' => $item_costprice, 'item_credit' => $item_credit, 'item_costcredit' => $item_costcredit));
if ($modnewthreads) {
$db->query("UPDATE {$tablepre}forums SET todayposts=todayposts+1 WHERE fid='{$fid}'", 'UNBUFFERED');
showmessage('post_newthread_mod_succeed', "forumdisplay.php?fid={$fid}");
} else {
$feed = array();
if ($addfeed && $forum['allowfeed']) {
$feed['icon'] = 'goods';
$feed['title_template'] = 'feed_thread_goods_title';
$feed['body_template'] = 'feed_thread_goods_message';
$feed['body_data'] = array('itemname' => "<a href=\"{$boardurl}viewthread.php?do=tradeinfo&tid={$tid}&pid={$pid}\">{$item_name}</a>", 'itemprice' => $item_price);
if (in_array($attachments[1]['type'], array('image/gif', 'image/jpeg', 'image/png'))) {
$attachurl = preg_match("/^((https?|ftps?):\\/\\/|www\\.)/i", $attachurl) ? $attachurl : $boardurl . $attachurl;
$imgurl = $attachurl . '/' . $attachments[1]['attachment'] . ($attachments[1]['thumb'] && $attachments[1]['type'] != 'image/gif' ? '.thumb.jpg' : '');
开发者ID:lilhorse,项目名称:cocoa,代码行数:31,代码来源:newtrade.inc.php
示例13: bindec
$parseurloff = !empty($_G['gp_parseurloff']);
$htmlon = bindec(($_G['setting']['tagstatus'] && !empty($tagoff) ? 1 : 0) . ($_G['group']['allowhtml'] && !empty($_G['gp_htmlon']) ? 1 : 0));
$usesig = !empty($_G['gp_usesig']) && $_G['group']['maxsigsize'] ? 1 : 0;
$pinvisible = $modnewthreads ? -2 : (empty($_G['gp_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' => $_G['timestamp'], 'message' => $message, 'useip' => $_G['clientip'], 'invisible' => $pinvisible, 'anonymous' => $isanonymous, 'usesig' => $usesig, 'htmlon' => $htmlon, 'bbcodeoff' => $bbcodeoff, 'smileyoff' => $smileyoff, 'parseurloff' => $parseurloff, 'attachment' => '0', 'tags' => implode(',', $tagarray)));
if ($pid && getstatus($thread['status'], 1)) {
savepostposition($tid, $pid);
}
if ($special == 4 && $_G['gp_activityaid']) {
DB::query("UPDATE " . DB::table('forum_attachment') . " SET tid='{$tid}', pid='{$pid}' WHERE aid='{$_G['gp_activityaid']}' AND uid='{$_G['uid']}'");
}
if ($_G['forum']['threadsorts']['types'][$sortid] && !empty($_G['forum_optiondata']) && is_array($_G['forum_optiondata']) && $sortaid) {
DB::query("UPDATE " . DB::table('forum_attachment') . " SET tid='{$tid}', pid='{$pid}' WHERE aid='{$sortaid}'");
}
($_G['group']['allowpostattach'] || $_G['group']['allowpostimage']) && ($_G['gp_attachnew'] || $_G['gp_attachdel'] || $sortid || !empty($_G['gp_activityaid'])) && updateattach($postattachcredits, $tid, $pid, $_G['gp_attachnew'], $_G['gp_attachdel']);
$param = array('fid' => $_G['fid'], 'tid' => $tid, 'pid' => $pid);
$statarr = array(0 => 'thread', 1 => 'poll', 2 => 'trade', 3 => 'reward', 4 => 'activity', 5 => 'debate', 127 => 'thread');
include_once libfile('function/stat');
updatestat($isgroup ? 'groupthread' : $statarr[$special]);
if ($modnewthreads) {
DB::query("UPDATE " . DB::table('forum_forum') . " SET todayposts=todayposts+1 WHERE fid='{$_G['fid']}'", 'UNBUFFERED');
showmessage('post_newthread_mod_succeed', "forum.php?mod=viewthread&tid={$tid}&extra={$extra}", $param);
} else {
$feed = array('icon' => '', 'title_template' => '', 'title_data' => array(), 'body_template' => '', 'body_data' => array(), 'title_data' => array(), 'images' => array());
if (!empty($_G['gp_addfeed']) && $_G['forum']['allowfeed'] && !$isanonymous) {
$message = !$price ? $message : '';
if ($special == 0) {
$feed['icon'] = 'thread';
$feed['title_template'] = 'feed_thread_title';
$feed['body_template'] = 'feed_thread_message';
开发者ID:v998,项目名称:discuzx-en,代码行数:31,代码来源:post_newthread.php
示例14: before_editpost
public function before_editpost($parameters)
{
global $_G;
$isfirstpost = $this->post['first'] ? 1 : 0;
$attachupdate = !empty($_GET['delattachop']) || ($this->group['allowpostattach'] || $this->group['allowpostimage']) && ($_GET['attachnew'] || $parameters['special'] == 2 && $_GET['tradeaid'] || $parameters['special'] == 4 && $_GET['activityaid'] || $isfirstpost && $parameters['sortid']);
if ($attachupdate) {
updateattach($this->thread['displayorder'] == -4 || $_G['forum_auditstatuson'], $this->thread['tid'], $this->post['pid'], $_GET['attachnew'], $_GET['attachupdate'], $this->post['authorid']);
}
if ($isfirstpost && $attachupdate) {
if (!$this->param['threadimageaid']) {
$this->param['threadimage'] = C::t('forum_attachment_n')->fetch_max_image('tid:' . $this->thread['tid'], 'pid', $this->post['pid']);
$this->param['threadimageaid'] = $this->param['threadimage']['aid'];
}
if ($this->forum['picstyle']) {
if (empty($this->thread['cover'])) {
setthreadcover($this->post['pid'], 0, $this->param['threadimageaid']);
} else {
setthreadcover($this->post['pid'], $this->thread['tid'], 0, 1);
}
}
if ($this->param['threadimageaid']) {
if (!$this->param['threadimage']) {
$this->param['threadimage'] = C::t('forum_attachment_n')->fetch_max_image('tid:' . $this->thread['tid'], 'tid', $this->thread['tid']);
}
C::t('forum_threadimage')->delete_by_tid($this->thread['tid']);
C::t('forum_threadimage')->insert(array('tid' => $this->thread['tid'], 'attachment' => $this->param['threadimage']['attachment'], 'remote' => $this->param['threadimage']['remote']));
}
}
}
开发者ID:MCHacker,项目名称:discuz-docker,代码行数:29,代码来源:extend_thread_image.php
示例15: article_move_forums
//.........这里部分代码省略.........
//$re_arr = forum_downremotefile($forum_arr);
if ($arr['is_download_img'] == 1) {
$re_arr = forum_downremotefile($v);
}
DB::query("UPDATE " . DB::table('common_member_count') . " SET posts=posts+1 WHERE uid='{$post_setarr['authorid']}'");
//更新数
$new[$k] = $post_setarr;
}
unset($post_setarr);
DB::update('forum_thread', array('replies' => count($reply_arr), 'lastpost' => $lastpost, 'lastposter' => $lastposter), array('tid' => $tid));
}
}
//exit();
$re = $arr;
$re['fid'] = $fid;
$re['tid'] = $tid;
$re['fid'] = $fid;
$re['uid'] = $arr['uid'];
$re['username'] = $author;
$re['pid'] = $pid;
$re['message'] = $message;
if ($pid && getstatus($thread['status'], 1)) {
savepostposition($tid, $pid);
}
$threadimageaid = 0;
$threadimage = array();
//print_r($message);exit();
if ($_G['forum']['threadsorts']['types'][$sortid] && !empty($_G['forum_optiondata']) && is_array($_G['forum_optiondata']) && $sortaids) {
foreach ($sortaids as $sortaid) {
convertunusedattach($sortaid, $tid, $pid);
}
}
if (($_G['group']['allowpostattach'] || $_G['group']['allowpostimage']) && ($_GET['attachnew'] || $sortid || !empty($_GET['activityaid']))) {
updateattach($displayorder == -4 || $modnewthreads, $tid, $pid, $_GET['attachnew']);
if (!$threadimageaid) {
$threadimage = DB::fetch_first("SELECT aid, attachment, remote FROM " . DB::table(getattachtablebytid($tid)) . " WHERE tid='{$tid}' AND isimage IN ('1', '-1') ORDER BY width DESC LIMIT 1");
$threadimageaid = $threadimage['aid'];
}
if ($_G['forum']['picstyle']) {
setthreadcover($pid, 0, $threadimageaid);
}
}
/*删除附件*/
if ($old_arr['forum_id']) {
$query = DB::query("SELECT attachment, thumb, remote, aid FROM " . DB::table(getattachtablebytid($old_arr['forum_id'])) . " WHERE tid='{$old_arr['forum_id']}'");
while ($v = DB::fetch($query)) {
$attach[] = $v;
}
dunlink($attach);
DB::query("DELETE FROM " . DB::table('forum_attachment') . " WHERE tid='{$old_arr['forum_id']}'");
DB::query("DELETE FROM " . DB::table(getattachtablebytid($old_arr['forum_id'])) . " WHERE tid='{$old_arr['forum_id']}'");
DB::delete('forum_threadimage', "tid='{$old_arr['forum_id']}'");
//图片表
}
$param = array('fid' => $arr['fid'], 'tid' => $tid, 'pid' => $pid);
$statarr = array(0 => 'thread', 1 => 'poll', 2 => 'trade', 3 => 'reward', 4 => 'activity', 5 => 'debate', 127 => 'thread');
include_once libfile('function/stat');
updatestat($isgroup ? 'groupthread' : $statarr[$special]);
dsetcookie('clearUserdata', 'forum');
if ($specialextra) {
$classname = 'threadplugin_' . $specialextra;
if (class_exists($classname) && method_exists($threadpluginclass = new $classname(), 'newthread_submit_end')) {
$threadpluginclass->newthread_submit_end($_G['fid'], $tid);
}
}
$feed = array('icon' => '', 'title_template' => '', 'title_data' => array(), 'body_template' => '', 'body_data' => array(), 'title_data' => array(), 'images' => array());
开发者ID:edmundwong,项目名称:V604,代码行数:67,代码来源:function.article.php
注:本文中的updateattach函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论