本文整理汇总了PHP中insertpost函数的典型用法代码示例。如果您正苦于以下问题:PHP insertpost函数的具体用法?PHP insertpost怎么用?PHP insertpost使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了insertpost函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: usesubmit
function usesubmit()
{
global $_G;
if (empty($_G['gp_tid'])) {
showmessage(lang('magic/sofa', 'sofa_info_nonexistence'));
}
$thread = getpostinfo($_G['gp_tid'], 'tid', array('fid', 'authorid', 'dateline', 'subject'));
$this->_check($thread);
$firstsofa = DB::result_first("SELECT COUNT(*) FROM " . DB::table('forum_threadmod') . " WHERE magicid='" . $this->magic['magicid'] . "' AND tid='{$_G['gp_tid']}'");
if ($firstsofa >= 1) {
showmessage(lang('magic/sofa', 'sofa_info_sofaexistence'), '', array(), array('login' => 1));
}
$sofamessage = lang('magic/sofa', 'sofa_text', array('actor' => $_G['member']['username'], 'time' => dgmdate(TIMESTAMP), 'magicname' => $this->magic['name']));
$dateline = $thread['dateline'] + 1;
insertpost(array('fid' => $thread['fid'], 'tid' => $_G['gp_tid'], 'first' => '0', 'author' => $_G['username'], 'authorid' => $_G['uid'], 'dateline' => $dateline, 'message' => $sofamessage, 'useip' => $_G['clientip'], 'usesig' => '1'));
DB::query("UPDATE " . DB::table('forum_thread') . " SET replies=replies+1, moderated='1' WHERE tid='{$_G['tid']}'", 'UNBUFFERED');
DB::query("UPDATE " . DB::table('forum_forum') . " SET posts=posts+1, todayposts=todayposts+1 WHERE fid='{$post['fid']}'", 'UNBUFFERED');
usemagic($this->magic['magicid'], $this->magic['num']);
updatemagiclog($this->magic['magicid'], '2', '1', '0', 0, 'tid', $_G['gp_tid']);
updatemagicthreadlog($_G['gp_tid'], $this->magic['magicid']);
if ($thread['authorid'] != $_G['uid']) {
notification_add($thread['authorid'], 'magic', lang('magic/sofa', 'sofa_notification'), array('tid' => $_G['gp_tid'], 'subject' => $thread['subject'], 'magicname' => $this->magic['name']));
}
showmessage(lang('magic/sofa', 'sofa_succeed'), dreferer(), array(), array('showdialog' => 1, 'locationtime' => 1));
}
示例2: 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);
}
}
示例3: global_footer
function global_footer(){
global $_G;
extract($_G['cache']['plugin']['pao_reply_robot']);
if($switch && date('H')>=$jointime && date('H')<=$overtime && CURSCRIPT=='forum'){
$forums = dunserialize($forums);
$groups = dunserialize($groups);
$limits = $limits ? (intval($limits)<1 ? 1 : intval($limits)) : 10;
$percent = array('trigger'=>$limits / 100,'standby'=>(100-$limits)/100);
if(count($forums)>0 && count($groups)>0 && $this->percent($percent)=='trigger'){
$timestamp = TIMESTAMP;
$postes = preg_split("/[\r\n]/", $posts, -1, PREG_SPLIT_NO_EMPTY);
$groups = implode(',', $groups);
$forums = implode(',', $forums);
$indays = $indays ? strtotime("-{$indays} day") : '';
$indays = $indays ? " AND dateline>". $indays : '';
$maxpost = $maxpost ? " AND replies<".$maxpost : '';
$attach = $attach ? " AND attachment>0" : '';
$thread = DB::fetch_all("SELECT tid,fid,subject FROM ".DB::table('forum_thread')." WHERE closed=0 AND displayorder>=0 AND fid IN ($forums) {$attach} {$indays} {$maxpost} ORDER BY RAND() LIMIT {$limits}");
foreach ($thread as $td) {
$member = $this->member($groups);
$fid = $td['fid'];
$tid = $td['tid'];
$uid = $member['uid'];
$username = $member['username'];
$message = $postes[array_rand($postes)];
$lastpost = "{$td['tid']}\t".addslashes($td['subject'])."\t{$timestamp}\t{$username}";
//updatemembercount($uid, array($extctype => $extcnum));╗§ио
$pid = insertpost(array('fid' => $fid,'tid' => $tid,'first' => '0','author' => $username,'authorid' => $uid,'dateline' => $timestamp,'message' => $message,'useip' => '','invisible' => '0','anonymous' => '0','usesig' => 1,'htmlon' => '0','bbcodeoff' => 0,'smileyoff' => '0','parseurloff' => '0','attachment' => '0'));
DB::query("UPDATE ".DB::table('forum_forum')." SET lastpost='$lastpost',posts=posts+1,todayposts=todayposts+1 WHERE fid='$fid'", 'UNBUFFERED');
DB::query("UPDATE ".DB::table('forum_thread')." SET lastpost='$timestamp',replies=replies+1,views=views+'$views',lastposter='$username' WHERE tid='$tid'", 'UNBUFFERED');
DB::query("UPDATE ".DB::table('common_member_status')." SET lastpost='$timestamp',lastactivity='$timestamp',lastvisit='$timestamp' WHERE uid='$uid'", 'UNBUFFERED');
DB::query("UPDATE ".DB::table('common_member_count')." SET posts=posts+1 WHERE uid='$uid'", 'UNBUFFERED');
}
}
return;
}
}
示例4: preg_replace
$message = preg_replace("/((https?|ftp|gopher|news|telnet|rtsp|mms|callto):\\/\\/|www\\.)([a-z0-9\\/\\-_+=.~!%@?#%&;:\$\\()|]+\\s*)/i", '', $message);
$message = str_replace(explode(' ', lang('plugin/qqconnect', 'connect_reply_filter_smiley')), '', $message);
if ($message) {
$newmessage = censor($message, null, true);
if ($message != $newmessage) {
continue;
//note 有过滤词直接跳过,不入库
}
} else {
$message = lang('plugin/qqconnect', 'connect_tthread_broadcast');
}
if ($_G['setting']['connect']['t']['reply_showauthor']) {
//$message .= lang('plugin/qqconnect', 'connect_tthread_message', array('username' => $post['username'], 'nick' => $post['nick']));
$message .= '[tthread=' . $post['username'] . ', ' . $post['nick'] . ']' . $post['head'] . '[/tthread]';
}
$pid = insertpost(array('fid' => $thread['fid'], 'tid' => $thread['tid'], 'first' => '0', 'author' => '', 'authorid' => '0', 'subject' => '', 'dateline' => $_G['timestamp'] + $i, 'message' => $message, 'useip' => '', 'invisible' => $pinvisible, 'anonymous' => '0', 'usesig' => '0', 'htmlon' => '1', 'bbcodeoff' => '0', 'smileyoff' => '0', 'parseurloff' => '0', 'attachment' => '0', 'status' => 16));
if ($pid) {
$pids[] = $pid;
}
$i++;
}
//note 更新回复数及最后发表人
if ($pinvisible) {
updatemoderate('pid', $pids);
C::t('forum_forum')->update_forum_counter($thread['fid'], 0, 0, count($pids), 1);
} else {
$fieldarr = array('lastposter' => array(''), 'replies' => count($pids));
if ($thread['lastpost'] < $_G['timestamp']) {
$fieldarr['lastpost'] = array($_G['timestamp']);
}
C::t('forum_thread')->increase($tid, $fieldarr);
示例5: str_replace
} else {
$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';
示例6: addthreadtag
$parseurloff = !empty($_G['gp_parseurloff']);
$htmlon = $_G['group']['allowhtml'] && !empty($_G['gp_htmlon']) ? 1 : 0;
$usesig = !empty($_G['gp_usesig']) && $_G['group']['maxsigsize'] ? 1 : 0;
$tagstr = addthreadtag($_G['gp_tags'], $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);
DB::query("INSERT INTO " . DB::table('forum_replycredit') . " (tid, extcredits, extcreditstype, times, membertimes, random)VALUES('{$tid}', '{$_G['gp_replycredit_extcredits']}', '{$_G[setting][creditstransextra][10]}', '{$_G['gp_replycredit_times']}', '{$_G['gp_replycredit_membertimes']}', '{$_G['gp_replycredit_random']}')");
}
}
if ($_G['group']['allowpostrushreply'] && $_G['gp_rushreply']) {
DB::query("INSERT INTO " . DB::table('forum_threadrush') . " (tid, stopfloor, starttimefrom, starttimeto, rewardfloor) VALUES ('{$tid}', '{$_G['gp_stopfloor']}', '{$_G['gp_rushreplyfrom']}', '{$_G['gp_rushreplyto']}', '{$_G['gp_rewardfloor']}')");
}
$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' => DB::escape_str($_G['username']), 'authorid' => $_G['uid'], 'subject' => DB::escape_str($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' => $tagstr, 'replycredit' => 0, 'status' => defined('IN_MOBILE') ? 8 : 0));
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']))) {
示例7: cpmsg
cpmsg(lang('plugin/wechat', 'show_input_error'), '', 'error');
}
if (@strtotime($_GET['starttimefrom']) === -1 || @strtotime($_GET['starttimefrom']) === FALSE) {
cpmsg(lang('message', 'activity_fromtime_error'), '', 'error');
} elseif (trim($_GET['activityexpiration']) && (@strtotime($_GET['activityexpiration']) === -1 || @strtotime($_GET['activityexpiration']) === FALSE)) {
cpmsg(lang('message', 'activity_totime_error'), '', 'error');
}
$activity = array();
$activity['class'] = $_GET['activityclass'];
$activity['starttimefrom'] = @strtotime($_GET['starttimefrom']);
$activity['starttimeto'] = $_GET['starttimeto'] ? @strtotime($_GET['starttimeto']) : 0;
$activity['place'] = $_GET['activityplace'];
$activity['expiration'] = @strtotime($_GET['activityexpiration']);
$newthread = array('fid' => $_GET['fid'], 'posttableid' => 0, 'readperm' => 0, 'price' => 0, 'typeid' => 0, 'sortid' => 0, 'author' => $_G['username'], 'authorid' => $_G['uid'], 'subject' => $_GET['subject'], 'dateline' => TIMESTAMP, 'lastpost' => TIMESTAMP, 'lastposter' => $_G['username'], 'displayorder' => 1, 'digest' => 0, 'special' => 4, 'attachment' => 0, 'moderated' => 0, 'status' => 0, 'isgroup' => 0, 'replycredit' => 0, 'closed' => 0);
$tid = C::t('forum_thread')->insert($newthread, true);
$pid = insertpost(array('fid' => $_GET['fid'], 'tid' => $tid, 'first' => '1', 'author' => $_G['username'], 'authorid' => $_G['uid'], 'subject' => $_GET['subject'], 'dateline' => TIMESTAMP, 'message' => $_GET['message'], 'useip' => '', 'invisible' => 0, 'anonymous' => 0, 'usesig' => 0, 'htmlon' => 0, 'bbcodeoff' => 0, 'smileyoff' => 0, 'parseurloff' => 0, 'attachment' => '0', 'tags' => '', 'replycredit' => 0, 'status' => 0));
$data = array('tid' => $tid, 'uid' => $_G['uid'], 'cost' => 0, 'starttimefrom' => $activity['starttimefrom'], 'starttimeto' => $activity['starttimeto'], 'place' => $activity['place'], 'class' => $activity['class'], 'expiration' => $activity['expiration']);
C::t('forum_activity')->insert($data);
$setting['showactivity']['tids'][$tid] = $tid;
$settings = array('mobilewechat' => serialize($setting));
C::t('common_setting')->update_batch($settings);
updatecache(array('plugin', 'setting'));
require_once DISCUZ_ROOT . './source/plugin/wechat/wsq.class.php';
wsq::report('pubshowactivity');
cpmsg(lang('plugin/wechat', 'show_addthread_succeed'), 'action=plugins&operation=config&do=' . $pluginid . '&identifier=wechat&pmod=showactivity_setting', 'succeed');
}
} elseif ($ac == 'export') {
if (!isset($setting['showactivity']['tids'][$_GET['tid']])) {
cpmsg(lang('plugin/wechat', 'show_thread_not_found'));
}
$thread = get_thread_by_tid($_GET['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;
}
示例9: 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']) {
//.........这里部分代码省略.........
示例10: updatepostcredits
updatepostcredits('+', $_G['uid'], 'post', $var['fidnumber']);
$lastpost = "{$tid}\t" . addslashes($subject) . "\t{$_G['timestamp']}\t{$_G['username']}";
DB::query("UPDATE " . DB::table('forum_forum') . " SET lastpost='{$lastpost}', threads=threads+1, posts=posts+1, todayposts=todayposts+1 WHERE fid='{$var['fidnumber']}'", 'UNBUFFERED');
$tidnumber = $tid;
} else {
$tidnumber = $stats['qdtidnumber'];
$thread = DB::fetch_first("SELECT subject FROM " . DB::table('forum_thread') . " WHERE tid='{$tidnumber}'");
$hft = dgmdate($_G['timestamp'], 'Y-m-d H:i', $var['tos']);
if ($num >= 1 && $num <= 9 && $exacr && $exacz) {
$message = "[quote][size=2][color=gray][color=teal] [/color][color=gray]{$lang[tsn_01]}[/color] [color=darkorange]{$hft}[/color] {$lang[tsn_02]}[color=red]{$lang[tsn_03]}[/color][color=darkorange]{$lang[tsn_04]}{$psc}{$lang[tsn_05]}[/color]{$lang[tsn_06]} [/color][color=gray]{$_G[setting][extcredits][$var[nrcredit]][title]} [/color][color=darkorange]{$credit}[/color][color=gray]{$_G[setting][extcredits][$var[nrcredit]][unit]}[/color][color=gray]{$lang[tsn_17]}[/color] [color=gray]{$_G[setting][extcredits][$exacr][title]} [/color][color=darkorange]{$exacz}[/color][color=gray]{$_G[setting][extcredits][$exacr][unit]}[/color][/color][/size][/quote][size=3][color=dimgray]{$lang[tsn_07]}[color=red]{$todaysay}[/color]{$lang[tsn_08]}[/color][/size]";
} else {
$message = "[quote][size=2][color=gray][color=teal] [/color][color=gray]{$lang[tsn_01]}[/color] [color=darkorange]{$hft}[/color] {$lang[tsn_09]}{$lang[tsn_06]} [/color][color=gray]{$_G[setting][extcredits][$var[nrcredit]][title]} [/color][color=darkorange]{$credit} [/color][color=gray]{$_G[setting][extcredits][$var[nrcredit]][unit]}[/color][/size][/quote][size=3][color=dimgray]{$lang[tsn_07]}[color=red]{$todaysay}[/color]{$lang[tsn_08]}[/color][/size]";
}
require_once libfile('function/post');
require_once libfile('function/forum');
$pid = insertpost(array('fid' => $var['fidnumber'], 'tid' => $tidnumber, 'first' => '0', 'author' => $_G['username'], 'authorid' => $_G['uid'], 'subject' => '', 'dateline' => $_G['timestamp'], 'message' => $message, 'useip' => $_G['clientip'], 'invisible' => '0', 'anonymous' => '0', 'usesig' => '0', 'htmlon' => '0', 'bbcodeoff' => '0', 'smileyoff' => '0', 'parseurloff' => '0', 'attachment' => '0'));
DB::query("UPDATE " . DB::table('forum_thread') . " SET lastposter='{$_G['username']}', lastpost='{$_G['timestamp']}', replies=replies+1 WHERE tid='{$tidnumber}' AND fid='{$var['fidnumber']}'", 'UNBUFFERED');
updatepostcredits('+', $_G['uid'], 'reply', $var['fidnumber']);
$lastpost = "{$tidnumber}\t" . addslashes($thread['subject']) . "\t{$_G['timestamp']}\t{$_G['username']}";
DB::query("UPDATE " . DB::table('forum_forum') . " SET lastpost='{$lastpost}', posts=posts+1, todayposts=todayposts+1 WHERE fid='{$var['fidnumber']}'", 'UNBUFFERED');
}
}
if (memory('check')) {
memory('set', 'dsu_pualsign_' . $_G['uid'], $_G['timestamp'], 86400);
}
if ($num == 0) {
if ($stats['todayq'] > $stats['highestq']) {
DB::query("UPDATE " . DB::table('dsu_paulsignset') . " SET highestq='{$stats['todayq']}' WHERE id='1'");
}
DB::query("UPDATE " . DB::table('dsu_paulsignset') . " SET yesterdayq='{$stats['todayq']}',todayq=1 WHERE id='1'");
} else {
示例11: bbs_post
function bbs_post($input)
{
global $_G;
require_once libfile('function/post');
require_once libfile('function/forum');
$subject = $input['title'];
$message = stripslashes($input['text']);
$auid = $input['uid'];
$au = $input['username'];
$fid = $input['fid'];
$dateline = TIMESTAMP;
$data = array('fid' => $fid, 'subject' => $subject, 'dateline' => $dateline, 'lastpost' => $dateline, 'author' => $au, 'authorid' => $auid);
$tid = DB::insert("forum_thread", $data, $tid = true);
$pid = insertpost(array('tid' => $tid, 'fid' => $fid, 'first' => 1, 'subject' => $subject, 'message' => $message, 'dateline' => $dateline, 'author' => $au, 'authorid' => $auid, 'htmlon' => "1"));
updatepostcredits('+', $_G['uid'], 'post', $fid);
$synclastpost = "{$tid}\t" . addslashes($subject) . "\t{$_G[timestamp]}\t{$_G[username]}";
DB::query("UPDATE " . DB::table('forum_forum') . " SET lastpost='{$synclastpost}', threads=threads+1, posts=posts+1, todayposts=todayposts+1 WHERE fid='{$fid}'", 'UNBUFFERED');
return $tid;
}
示例12: getPublishPollObj
//.........这里部分代码省略.........
} 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[] = "/@{$atusername} /i";
$atreplace[] = "[url=home.php?mod=space&uid={$atuid}]@{$atusername}[/url] ";
}
$message = preg_replace($atsearch, $atreplace, $message . ' ', 1);
}
}
/*renxing vote insert*/
foreach ($pollarray['options'] as $polloptvalue) {
$polloptvalue = dhtmlspecialchars(trim($polloptvalue));
C::t('forum_polloption')->insert(array('tid' => $tid, 'polloption' => $polloptvalue));
}
$polloptionpreview = '';
$query = C::t('forum_polloption')->fetch_all_by_tid($tid, 1, 2);
foreach ($query as $option) {
$polloptvalue = preg_replace("/\\[url=(https?){1}:\\/\\/([^\\[\"']+?)\\](.+?)\\[\\/url\\]/i", "<a href=\"\\1://\\2\" target=\"_blank\">\\3</a>", $option['polloption']);
$polloptionpreview .= $polloptvalue . "\t";
}
$polloptionpreview = daddslashes($polloptionpreview);
$data = array('tid' => $tid, 'multiple' => $pollarray['multiple'], 'visible' => $pollarray['visible'], 'maxchoices' => $pollarray['maxchoices'], 'expiration' => $pollarray['expiration'], 'overt' => $pollarray['overt'], 'pollpreview' => $polloptionpreview);
C::t('forum_poll')->insert($data);
/*end renxing vote insert*/
$class_tag = new tag();
$tagstr = $class_tag->add_tag($_GET['tags'], $tid, 'tid');
$message = preg_replace('/\\[attachimg\\](\\d+)\\[\\/attachimg\\]/is', '[attach]\\1[/attach]', $message);
$message = $_GET['platType'] == 1 ? $message . "\r\n[url=/mobcent/download/down.php]" . Common::get_unicode_charset('\\u6765\\u81ea\\u5b89\\u5353\\u5ba2\\u6237\\u7aef') . '[/url]' : $message . "\r\n[url=/mobcent/download/down.php]" . Common::get_unicode_charset('\\u6765\\u81ea\\u0069\\u0070\\u0068\\u006f\\u006e\\u0065\\u5ba2\\u6237\\u7aef') . "[/url]";
$pid = insertpost(array('fid' => $_G['fid'], 'tid' => $tid, 'first' => '1', 'author' => $author, 'authorid' => $_G['uid'], 'subject' => $subject, 'dateline' => time(), 'message' => $message, 'useip' => get_client_ip(), 'invisible' => $pinvisible, 'anonymous' => $isAnonymous, 'usesig' => $usesig, 'htmlon' => $htmlon, 'bbcodeoff' => 0, 'smileyoff' => $smileyoff, 'parseurloff' => $parseurloff, 'attachment' => $attachment, 'tags' => $tagstr, 'replycredit' => 0, 'status' => 0));
if ($_G['group']['allowat'] && $atlist) {
foreach ($atlist as $atuid => $atusername) {
mobcent_helper_notification::notification_add($_G['username'], $atuid, 'at', 'at_message', $_G['uid'], 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));
}
if (empty($aid_Img)) {
$threadimageaid = $aid;
if ($aid) {
$tableid = getattachtableid($tid);
$query = get_forum_attachment_unused($aid);
while ($attach = DB::fetch($query)) {
$aids = $attach['aid'];
$data = $attach;
}
$uid = $_G['uid'];
update_forum_attachment($tid, $tableid, $uid, $pid, $aids);
$data['uid'] = 1;
$data['tid'] = $tid;
$data['pid'] = $pid;
C::t('forum_attachment_n')->insert($tableid, $data);
}
$values = array('fid' => $_G['fid'], 'tid' => $tid, 'pid' => $pid, 'coverimg' => '');
$param = array();
if ($_G['forum']['picstyle']) {
if (!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;
}
}
示例13: _startSign
//.........这里部分代码省略.........
require_once libfile('function/forum');
// 是否同步到记录
if ($var['sync_say'] && $_GET['qdmode'] == '1') {
}
// 是否同步到广播大厅
if ($var['sync_follow'] && $_GET['qdmode'] == '1' && $_G['setting']['followforumid']) {
}
// 每日最想说是否同步到签名
if ($var['sync_sign'] && $_G['group']['maxsigsize']) {
$signhtml = cutstr(strip_tags($todaysay . $lang['fromsign']), $_G['group']['maxsigsize']);
DB::update('common_member_field_forum', array('sightml' => $signhtml), "uid='{$_G['uid']}'");
}
// 对前N额外奖励项
if ($num <= $extreward_num - 1) {
list($exacr, $exacz) = explode("|", $extreward[$num]);
$psc = $num + 1;
if ($exacr && $exacz) {
updatemembercount($_G['uid'], array($exacr => $exacz));
}
}
// 获取主题和帖子要插入的状态信息
$topicStatus = $this->getClientApp('topic', $_GET['platType']);
$postStatus = $this->getClientApp('post', $_GET['platType']);
// 对签到自动回复的类型进行处理
// 2:指定贴自动回复
if ($var['qdtype'] == '2') {
$thread = DB::fetch_first("SELECT * FROM " . DB::table('forum_thread') . " WHERE tid='{$var['tidnumber']}'");
$hft = dgmdate($_G['timestamp'], 'Y-m-d H:i', $var['tos']);
if ($num >= 0 && $num <= $extreward_num - 1 && $exacr && $exacz) {
$message = "[quote][size=2][color=gray][color=teal] [/color][color=gray]{$lang[tsn_01]}[/color] [color=darkorange]{$hft}[/color] {$lang[tsn_02]}[color=red]{$lang[tsn_03]}[/color][color=darkorange]{$lang[tsn_04]}{$psc}{$lang[tsn_05]}[/color]{$lang[tsn_06]} [/color][color=gray]{$_G[setting][extcredits][$var[nrcredit]][title]} [/color][color=darkorange]{$credit}[/color][color=gray]{$_G[setting][extcredits][$var[nrcredit]][unit]}[/color][color=gray]{$lang[tsn_17]}[/color] [color=gray]{$_G[setting][extcredits][$exacr][title]} [/color][color=darkorange]{$exacz}[/color][color=gray]{$_G[setting][extcredits][$exacr][unit]}.{$another_vip}[/color][/color][/size][/quote][size=3][color=dimgray]{$lang[tsn_07]}[color=red]{$todaysay}[/color]{$lang[tsn_08]}[/color][/size]";
} else {
$message = "[quote][size=2][color=gray][color=teal] [/color][color=gray]{$lang[tsn_01]}[/color] [color=darkorange]{$hft}[/color] {$lang[tsn_09]}{$lang[tsn_06]} [/color][color=gray]{$_G[setting][extcredits][$var[nrcredit]][title]} [/color][color=darkorange]{$credit} [/color][color=gray]{$_G[setting][extcredits][$var[nrcredit]][unit]}.{$another_vip}[/color][/size][/quote][size=3][color=dimgray]{$lang[tsn_07]}[color=red]{$todaysay}[/color]{$lang[tsn_08]}[/color][/size]";
}
$pid = insertpost(array('fid' => $thread['fid'], 'tid' => $var['tidnumber'], 'first' => '0', 'author' => $_G['username'], 'authorid' => $_G['uid'], 'subject' => '', 'dateline' => $_G['timestamp'], 'message' => $message, 'useip' => $_G['clientip'], 'invisible' => '0', 'anonymous' => '0', 'usesig' => '0', 'htmlon' => '0', 'bbcodeoff' => '0', 'smileyoff' => '0', 'parseurloff' => '0', 'attachment' => '0', 'status' => $postStatus));
DB::query("UPDATE " . DB::table('forum_thread') . " SET lastposter='{$_G['username']}', lastpost='{$_G['timestamp']}', replies=replies+1 WHERE tid='{$var['tidnumber']}' AND fid='{$thread['fid']}'", 'UNBUFFERED');
updatepostcredits('+', $_G['uid'], 'reply', $thread['fid']);
$lastpost = "{$thread['tid']}\t" . addslashes($thread['subject']) . "\t{$_G['timestamp']}\t{$_G['username']}";
DB::query("UPDATE " . DB::table('forum_forum') . " SET lastpost='{$lastpost}', posts=posts+1, todayposts=todayposts+1 WHERE fid='{$thread['fid']}'", 'UNBUFFERED');
$tidnumber = $var['tidnumber'];
// 指定板块每天一主题
} elseif ($var['qdtype'] == '3') {
if ($num == '0' || $stats['qdtidnumber'] == '0') {
$subject = str_replace(array('{m}', '{d}', '{y}', '{bbname}', '{author}'), array(dgmdate($_G['timestamp'], 'n', $var['tos']), dgmdate($_G['timestamp'], 'j', $var['tos']), dgmdate($_G['timestamp'], 'Y', $var['tos']), $_G['setting']['bbname'], $_G['username']), $var['title_thread']);
$hft = dgmdate($_G['timestamp'], 'Y-m-d H:i', $var['tos']);
if ($exacr && $exacz) {
$message = "[quote][size=2][color=dimgray]{$lang[tsn_10]}[/color][url={$_G[siteurl]}plugin.php?id=dsu_paulsign:sign][color=darkorange]{$lang[tsn_11]}[/color][/url][color=dimgray]{$lang[tsn_12]}[/color][/size][/quote][quote][size=2][color=gray][color=teal] [/color][color=gray]{$lang[tsn_01]}[/color] [color=darkorange]{$hft}[/color] {$lang[tsn_02]}[color=red]{$lang[tsn_03]}[/color][color=darkorange]{$lang[tsn_04]}{$lang[tsn_13]}{$lang[tsn_05]}[/color]{$lang[tsn_06]} [/color][color=gray]{$_G[setting][extcredits][$var[nrcredit]][title]} [/color][color=darkorange]{$credit}[/color][color=gray]{$_G[setting][extcredits][$var[nrcredit]][unit]}[/color][color=gray]{$lang[tsn_17]}[/color] [color=gray]{$_G[setting][extcredits][$exacr][title]} [/color][color=darkorange]{$exacz}[/color][color=gray]{$_G[setting][extcredits][$exacr][unit]}.{$another_vip}[/color][/color][/size][/quote][size=3][color=dimgray]{$lang[tsn_07]}[color=red]{$todaysay}[/color]{$lang[tsn_08]}[/color][/size]";
} else {
$message = "[quote][size=2][color=dimgray]{$lang[tsn_10]}[/color][url={$_G[siteurl]}plugin.php?id=dsu_paulsign:sign][color=darkorange]{$lang[tsn_11]}[/color][/url][color=dimgray]{$lang[tsn_12]}[/color][/size][/quote][quote][size=2][color=gray][color=teal] [/color][color=gray]{$lang[tsn_01]}[/color] [color=darkorange]{$hft}[/color] {$lang[tsn_02]}[color=red]{$lang[tsn_03]}[/color][color=darkorange]{$lang[tsn_04]}{$lang[tsn_13]}{$lang[tsn_05]}[/color]{$lang[tsn_06]} [/color][color=gray]{$_G[setting][extcredits][$var[nrcredit]][title]} [/color][color=darkorange]{$credit}[/color][color=gray]{$_G[setting][extcredits][$var[nrcredit]][unit]}.{$another_vip}[/color][/color][/size][/quote][size=3][color=dimgray]{$lang[tsn_07]}[color=red]{$todaysay}[/color]{$lang[tsn_08]}[/color][/size]";
}
DB::query("INSERT INTO " . DB::table('forum_thread') . " (fid, posttableid, readperm, price, typeid, sortid, author, authorid, subject, dateline, lastpost, lastposter, displayorder, digest, special, attachment, moderated, highlight, closed, status, isgroup) VALUES ('{$var['fidnumber']}', '0', '0', '0', '{$var['qdtypeid']}', '0', '{$_G['username']}', '{$_G['uid']}', '{$subject}', '{$_G['timestamp']}', '{$_G['timestamp']}', '{$_G['username']}', '0', '0', '0', '0', '1', '1', '1', '{$topicStatus}', '0')");
$tid = DB::insert_id();
DB::query("UPDATE " . DB::table('dsu_paulsignset') . " SET qdtidnumber = '{$tid}' WHERE id='1'");
$pid = insertpost(array('fid' => $var['fidnumber'], 'tid' => $tid, 'first' => '1', 'author' => $_G['username'], 'authorid' => $_G['uid'], 'subject' => $subject, 'dateline' => $_G['timestamp'], 'message' => $message, 'useip' => $_G['clientip'], 'invisible' => '0', 'anonymous' => '0', 'usesig' => '0', 'htmlon' => '0', 'bbcodeoff' => '0', 'smileyoff' => '0', 'parseurloff' => '0', 'attachment' => '0', 'status' => $postStatus));
$expiration = $_G['timestamp'] + 86400;
DB::query("INSERT INTO " . DB::table('forum_thread') . "mod (tid, uid, username, dateline, action, expiration, status) VALUES ('{$tid}', '{$_G['uid']}', '{$_G['username']}', '{$_G['timestamp']}', 'EHL', '{$expiration}', '1')");
DB::query("INSERT INTO " . DB::table('forum_thread') . "mod (tid, uid, username, dateline, action, expiration, status) VALUES ('{$tid}', '{$_G['uid']}', '{$_G['username']}', '{$_G['timestamp']}', 'CLS', '0', '1')");
updatepostcredits('+', $_G['uid'], 'post', $var['fidnumber']);
$lastpost = "{$tid}\t" . addslashes($subject) . "\t{$_G['timestamp']}\t{$_G['username']}";
DB::query("UPDATE " . DB::table('forum_forum') . " SET lastpost='{$lastpost}', threads=threads+1, posts=posts+1, todayposts=todayposts+1 WHERE fid='{$var['fidnumber']}'", 'UNBUFFERED');
$tidnumber = $tid;
} else {
$tidnumber = $stats['qdtidnumber'];
$thread = DB::fetch_first("SELECT subject FROM " . DB::table('forum_thread') . " WHERE tid='{$tidnumber}'");
$hft = dgmdate($_G['timestamp'], 'Y-m-d H:i', $var['tos']);
if ($num >= 1 && $num <= $extreward_num - 1 && $exacr && $exacz) {
$message = "[quote][size=2][color=gray][color=teal] [/color][color=gray]{$lang[tsn_01]}[/color] [color=darkorange]{$hft}[/color] {$lang[tsn_02]}[color=red]{$lang[tsn_03]}[/color][color=darkorange]{$lang[tsn_04]}{$psc}{$lang[tsn_05]}[/color]{$lang[tsn_06]} [/color][color=gray]{$_G[setting][extcredits][$var[nrcredit]][title]} [/color][color=darkorange]{$credit}[/color][color=gray]{$_G[setting][extcredits][$var[nrcredit]][unit]}[/color][color=gray]{$lang[tsn_17]}[/color] [color=gray]{$_G[setting][extcredits][$exacr][title]} [/color][color=darkorange]{$exacz}[/color][color=gray]{$_G[setting][extcredits][$exacr][unit]}[/color][/color][/size][/quote][size=3][color=dimgray]{$lang[tsn_07]}[color=red]{$todaysay}[/color]{$lang[tsn_08]}[/color][/size]";
示例14: instertoforum
function instertoforum($data)
{
global $_G;
$subject = $data['subject'];
$message = $data['message'];
$author = $data['username'];
$authorid = $data['uid'];
$publishdate = TIMESTAMP;
$closed = 0;
$replycredit = 0;
$isgroup = 0;
$moderated = 0;
$special = 0;
$displayorder = $data['isshow'] == 1 && $data['status'] == 1 ? 0 : -1;
$newthread = array('fid' => $data['fid'], 'posttableid' => 0, 'readperm' => 0, 'price' => 0, 'typeid' => 0, 'sortid' => 0, 'author' => $author, 'authorid' => $data['uid'], 'subject' => $subject, 'dateline' => $publishdate, 'lastpost' => $publishdate, 'lastposter' => $author, 'displayorder' => $displayorder, 'digest' => $digest, 'special' => $special, 'attachment' => 0, 'moderated' => $moderated, 'status' => 0, 'isgroup' => $isgroup, 'replycredit' => $replycredit, 'closed' => 0);
$tid = C::t('#sanree_brand#forum_thread')->insert($newthread, true);
if ($displayorder != 0) {
$newrow = array('tid' => $tid, 'uid' => $_G['uid'], 'username' => $_G['username'], 'dateline' => TIMESTAMP, 'expiration' => 0, 'action' => 'DEL', 'status' => 1, 'magicid' => 0, 'stamp' => 0, 'reason' => srlang('warningdelete'));
C::t('#sanree_brand#forum_threadmod')->insert($newrow, true);
}
useractionlog($data['uid'], 'tid');
require_once libfile('function/forum');
require_once libfile('function/post');
$bbcodeoff = 0;
//checkbbcodes($message, 0);
$smileyoff = 0;
//checksmilies($message, 0);
$parseurloff = 1;
$htmlon = 0;
$usesig = 1;
$tagstr = '';
$pinvisible = 0;
$message = preg_replace('/\\[attachimg\\](\\d+)\\[\\/attachimg\\]/is', '[attach]\\1[/attach]', $message);
$pid = insertpost(array('fid' => $data['fid'], 'tid' => $tid, 'first' => '1', 'author' => $data['username'], 'authorid' => $data['uid'], 'subject' => $subject, 'dateline' => $publishdate, 'message' => $message, 'useip' => $data['ip'], 'invisible' => $pinvisible, 'anonymous' => $isanonymous, 'usesig' => $usesig, 'htmlon' => $htmlon, 'bbcodeoff' => $bbcodeoff, 'smileyoff' => $smileyoff, 'parseurloff' => $parseurloff, 'attachment' => '0', 'tags' => $tagstr, 'replycredit' => 0, 'status' => 0));
$subject = str_replace("\t", ' ', $subject);
$lastpost = "{$tid}\t" . $subject . "\t{$_G['timestamp']}\t{$author}";
C::t('#sanree_brand#forum_forum')->update($data['fid'], array('lastpost' => $lastpost));
C::t('#sanree_brand#forum_forum')->update_forum_counter($data['fid'], 1, 1, 1);
return array($tid, $pid);
}
示例15: define
<?php
define('APPTYPEID', 2);
define('CURSCRIPT', 'forum');
require '../source/class/class_core.php';
require '../source/function/function_forum.php';
C::app()->init();
isset($_REQUEST['tid']) ? $tid = $_REQUEST['tid'] : ($res['err'] = 1);
isset($_REQUEST['author']) ? $author = $_REQUEST['author'] : ($res['err'] = 1);
isset($_REQUEST['uid']) ? $uid = $_REQUEST['uid'] : ($res['err'] = 1);
$message = isset($_REQUEST['message']) ? $_REQUEST['message'] : '';
$message = iconv('utf-8', 'gbk', $message);
$author = iconv('utf-8', 'gbk', $author);
if ($res['err'] != 1) {
$pid = insertpost(array('fid' => 1004, 'tid' => $tid, 'first' => '0', 'author' => $author, 'authorid' => $uid, 'subject' => '', 'dateline' => time(), 'message' => $message, 'useip' => $_G['clientip'], 'invisible' => 0, 'anonymous' => 0, 'usesig' => 1, 'htmlon' => 0, 'bbcodeoff' => false, 'smileyoff' => -1, 'parseurloff' => false, 'attachment' => '0', 'tags' => '', 'replycredit' => 0, 'status' => 100));
if ($pid) {
updatethreadcount($tid, 0);
C::t('forum_forum')->update_forum_counter(1005, 0, 1, 1);
$res['tid'] = $tid;
$res['pid'] = $pid;
$res['err'] = 0;
}
}
function updatethreadcount($tid, $updateattach = 0)
{
$replycount = C::t('forum_post')->count_visiblepost_by_tid($tid) - 1;
$lastpost = C::t('forum_post')->fetch_visiblepost_by_tid('tid:' . $tid, $tid, 0, 1);
$lastpost['author'] = $lastpost['anonymous'] ? lang('forum/misc', 'anonymous') : addslashes($lastpost['author']);
$lastpost['dateline'] = !empty($lastpost['dateline']) ? $lastpost['dateline'] : TIMESTAMP;
$data = array('replies' => $replycount, 'lastposter' => $lastpost['author'], 'lastpost' => $lastpost['dateline']);
if ($updateattach) {