本文整理汇总了PHP中useractionlog函数的典型用法代码示例。如果您正苦于以下问题:PHP useractionlog函数的具体用法?PHP useractionlog怎么用?PHP useractionlog使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了useractionlog函数的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: sendpm
public static function sendpm($toid, $subject, $message, $fromid = '', $replypmid = 0, $isusername = 0, $type = 0)
{
global $_G;
if ($fromid === '') {
$fromid = $_G['uid'];
}
$author = '';
if ($fromid) {
if ($fromid == $_G['uid']) {
$sendpmmaxnum = $_G['group']['allowsendpmmaxnum'];
$author = $_G['username'];
} else {
$user = getuserbyuid($fromid);
$author = $user['username'];
loadcache('usergroup_' . $user['groupid']);
$sendpmmaxnum = $_G['cache']['usergroup_' . $user['groupid']]['allowsendpmmaxnum'];
}
$currentnum = C::t('common_member_action_log')->count_day_hours(getuseraction('pmid'), $fromid);
if ($sendpmmaxnum && $currentnum >= $sendpmmaxnum) {
return -16;
}
}
loaducenter();
$return = uc_pm_send($fromid, $toid, addslashes($subject), addslashes($message), 1, $replypmid, $isusername, $type);
if ($return > 0 && $fromid) {
if ($_G['setting']['cloud_status']) {
$msgService = Cloud::loadClass('Cloud_Service_Client_Message');
if (is_numeric($toid)) {
$tospace = getuserbyuid($toid);
if ($tospace['conisbind']) {
$msgService->add($toid, $fromid, $author, $_G['timestamp']);
}
} else {
$senduids = array();
foreach (C::t('common_member')->fetch_all_by_username(explode(',', $toid)) as $touser) {
if ($touser['conisbind']) {
$senduids[$touser['uid']] = $touser['uid'];
}
}
if ($senduids) {
$msgService->add($senduids, $fromid, $author, $_G['timestamp']);
}
}
}
foreach (explode(',', $fromid) as $v) {
useractionlog($fromid, 'pmid');
}
}
return $return;
}
示例2: newthread
public function newthread($parameters)
{
require_once libfile('function/post');
$this->tid = $this->pid = 0;
$this->_init_parameters($parameters);
if (trim($this->param['subject']) == '') {
return $this->showmessage('post_sm_isnull');
}
if (!$this->param['sortid'] && !$this->param['special'] && trim($this->param['message']) == '') {
return $this->showmessage('post_sm_isnull');
}
list($this->param['modnewthreads'], $this->param['modnewreplies']) = threadmodstatus($this->param['subject'] . "\t" . $this->param['message'] . $this->param['extramessage']);
if ($post_invalid = checkpost($this->param['subject'], $this->param['message'], $this->param['special'] || $this->param['sortid'])) {
return $this->showmessage($post_invalid, '', array('minpostsize' => $this->setting['minpostsize'], 'maxpostsize' => $this->setting['maxpostsize']));
}
if (checkflood()) {
return $this->showmessage('post_flood_ctrl', '', array('floodctrl' => $this->setting['floodctrl']));
} elseif (checkmaxperhour('tid')) {
return $this->showmessage('thread_flood_ctrl_threads_per_hour', '', array('threads_per_hour' => $this->group['maxthreadsperhour']));
}
$this->param['save'] = $this->member['uid'] ? $this->param['save'] : 0;
$this->param['typeid'] = isset($this->param['typeid']) && isset($this->forum['threadtypes']['types'][$this->param['typeid']]) && (!$this->forum['threadtypes']['moderators'][$this->param['typeid']] || $this->forum['ismoderator']) ? $this->param['typeid'] : 0;
$this->param['displayorder'] = $this->param['modnewthreads'] ? -2 : ($this->forum['ismoderator'] && $this->group['allowstickthread'] && !empty($this->param['sticktopic']) ? 1 : (empty($this->param['save']) ? 0 : -4));
if ($this->param['displayorder'] == -2) {
C::t('forum_forum')->update($this->forum['fid'], array('modworks' => '1'));
}
$this->param['digest'] = $this->forum['ismoderator'] && $this->group['allowdigestthread'] && !empty($this->param['digest']) ? 1 : 0;
$this->param['readperm'] = $this->group['allowsetreadperm'] ? $this->param['readperm'] : 0;
$this->param['isanonymous'] = $this->group['allowanonymous'] && $this->param['isanonymous'] ? 1 : 0;
$this->param['price'] = intval($this->param['price']);
if (!$this->param['special']) {
$this->param['price'] = $this->group['maxprice'] ? $this->param['price'] <= $this->group['maxprice'] ? $this->param['price'] : $this->group['maxprice'] : 0;
}
if (!$this->param['typeid'] && $this->forum['threadtypes']['required'] && !$this->param['special']) {
return $this->showmessage('post_type_isnull');
}
if (!$this->param['sortid'] && $this->forum['threadsorts']['required'] && !$this->param['special']) {
return $this->showmessage('post_sort_isnull');
}
if (!$this->param['special'] && $this->param['price'] > 0 && floor($this->param['price'] * (1 - $this->setting['creditstax'])) == 0) {
return $this->showmessage('post_net_price_iszero');
}
$this->param['sortid'] = $this->param['special'] && $this->forum['threadsorts']['types'][$this->param['sortid']] ? 0 : $this->param['sortid'];
$this->param['typeexpiration'] = intval($this->param['typeexpiration']);
if ($this->forum['threadsorts']['expiration'][$this->param['typeid']] && !$this->param['typeexpiration']) {
return $this->showmessage('threadtype_expiration_invalid');
}
$author = !$this->param['isanonymous'] ? $this->member['username'] : '';
$this->param['moderated'] = $this->param['digest'] || $this->param['displayorder'] > 0 ? 1 : 0;
$this->param['ordertype'] && ($this->param['tstatus'] = setstatus(4, 1, $this->param['tstatus']));
$this->param['imgcontent'] && ($this->param['tstatus'] = setstatus(15, $this->param['imgcontent'], $this->param['tstatus']));
$this->param['hiddenreplies'] && ($this->param['tstatus'] = setstatus(2, 1, $this->param['tstatus']));
$this->param['allownoticeauthor'] && ($this->param['tstatus'] = setstatus(6, 1, $this->param['tstatus']));
$this->param['isgroup'] = $this->forum['status'] == 3 ? 1 : 0;
$this->param['publishdate'] = !$this->param['modnewthreads'] ? $this->param['publishdate'] : TIMESTAMP;
$newthread = array('fid' => $this->forum['fid'], 'posttableid' => 0, 'readperm' => $this->param['readperm'], 'price' => $this->param['price'], 'typeid' => $this->param['typeid'], 'sortid' => $this->param['sortid'], 'author' => $author, 'authorid' => $this->member['uid'], 'subject' => $this->param['subject'], 'dateline' => $this->param['publishdate'], 'lastpost' => $this->param['publishdate'], 'lastposter' => $author, 'displayorder' => $this->param['displayorder'], 'digest' => $this->param['digest'], 'special' => $this->param['special'], 'attachment' => 0, 'moderated' => $this->param['moderated'], 'status' => $this->param['tstatus'], 'isgroup' => $this->param['isgroup'], 'replycredit' => $this->param['replycredit'], 'closed' => $this->param['closed'] ? 1 : 0);
$this->tid = C::t('forum_thread')->insert($newthread, true);
C::t('forum_newthread')->insert(array('tid' => $this->tid, 'fid' => $this->forum['fid'], 'dateline' => $this->param['publishdate']));
useractionlog($this->member['uid'], 'tid');
if (!getuserprofile('threads') && $this->setting['newbie']) {
C::t('forum_thread')->update($this->tid, array('icon' => $this->setting['newbie']));
}
if ($this->param['publishdate'] != TIMESTAMP) {
$cron_publish_ids = dunserialize($this->cache('cronpublish'));
$cron_publish_ids[$this->tid] = $this->tid;
$cron_publish_ids = serialize($cron_publish_ids);
savecache('cronpublish', $cron_publish_ids);
}
if (!$this->param['isanonymous']) {
C::t('common_member_field_home')->update($this->member['uid'], array('recentnote' => $this->param['subject']));
}
if ($this->param['moderated']) {
updatemodlog($this->tid, $this->param['displayorder'] > 0 ? 'STK' : 'DIG');
updatemodworks($this->param['displayorder'] > 0 ? 'STK' : 'DIG', 1);
}
$this->param['bbcodeoff'] = checkbbcodes($this->param['message'], !empty($this->param['bbcodeoff']));
$this->param['smileyoff'] = checksmilies($this->param['message'], !empty($this->param['smileyoff']));
$this->param['parseurloff'] = !empty($this->param['parseurloff']);
$this->param['htmlon'] = $this->group['allowhtml'] && !empty($this->param['htmlon']) ? 1 : 0;
$this->param['usesig'] = !empty($this->param['usesig']) && $this->group['maxsigsize'] ? 1 : 0;
$class_tag = new tag();
$this->param['tagstr'] = $class_tag->add_tag($this->param['tags'], $this->tid, 'tid');
$this->param['pinvisible'] = $this->param['modnewthreads'] ? -2 : (empty($this->param['save']) ? 0 : -3);
$this->param['message'] = preg_replace('/\\[attachimg\\](\\d+)\\[\\/attachimg\\]/is', '[attach]\\1[/attach]', $this->param['message']);
$this->param['pstatus'] = intval($this->param['pstatus']);
defined('IN_MOBILE') && ($this->param['pstatus'] = setstatus(4, 1, $this->param['pstatus']));
if ($this->param['imgcontent']) {
stringtopic($this->param['message'], $this->tid, true, $this->param['imgcontentwidth']);
}
$this->pid = insertpost(array('fid' => $this->forum['fid'], 'tid' => $this->tid, 'first' => '1', 'author' => $this->member['username'], 'authorid' => $this->member['uid'], 'subject' => $this->param['subject'], 'dateline' => $this->param['publishdate'], 'message' => $this->param['message'], 'useip' => $this->param['clientip'] ? $this->param['clientip'] : getglobal('clientip'), 'port' => $this->param['remoteport'] ? $this->param['remoteport'] : getglobal('remoteport'), 'invisible' => $this->param['pinvisible'], 'anonymous' => $this->param['isanonymous'], 'usesig' => $this->param['usesig'], 'htmlon' => $this->param['htmlon'], 'bbcodeoff' => $this->param['bbcodeoff'], 'smileyoff' => $this->param['smileyoff'], 'parseurloff' => $this->param['parseurloff'], 'attachment' => '0', 'tags' => $this->param['tagstr'], 'replycredit' => 0, 'status' => $this->param['pstatus']));
$statarr = array(0 => 'thread', 1 => 'poll', 2 => 'trade', 3 => 'reward', 4 => 'activity', 5 => 'debate', 127 => 'thread');
include_once libfile('function/stat');
updatestat($this->param['isgroup'] ? 'groupthread' : $statarr[$this->param['special']]);
if ($this->param['geoloc'] && IN_MOBILE == 2) {
list($mapx, $mapy, $location) = explode('|', $this->param['geoloc']);
if ($mapx && $mapy && $location) {
C::t('forum_post_location')->insert(array('pid' => $this->pid, 'tid' => $this->tid, 'uid' => $this->member['uid'], 'mapx' => $mapx, 'mapy' => $mapy, 'location' => $location));
}
}
if ($this->param['modnewthreads']) {
//.........这里部分代码省略.........
示例3: sendPost
//.........这里部分代码省略.........
} elseif($floor > $_GET['stopfloor']) {
unset($floors[$key]);
}
}
}
$_GET['rewardfloor'] = implode(',', $floors);
}
}
$thread['status'] = setstatus(3, 1, $thread['status']);
$thread['status'] = setstatus(1, 1, $thread['status']);
} */
$_GET['allownoticeauthor'] && ($thread['status'] = setstatus(6, 1, $thread['status']));
$isgroup = $_G['forum']['status'] == 3 ? 1 : 0;
/* if($_G['group']['allowreplycredit']) {
$_GET['replycredit_extcredits'] = intval($_GET['replycredit_extcredits']);
$_GET['replycredit_times'] = intval($_GET['replycredit_times']);
$_GET['replycredit_membertimes'] = intval($_GET['replycredit_membertimes']);
$_GET['replycredit_random'] = intval($_GET['replycredit_random']);
$_GET['replycredit_random'] = $_GET['replycredit_random'] < 0 || $_GET['replycredit_random'] > 99 ? 0 : $_GET['replycredit_random'] ;
$replycredit = $replycredit_real = 0;
if($_GET['replycredit_extcredits'] > 0 && $_GET['replycredit_times'] > 0) {
$replycredit_real = ceil(($_GET['replycredit_extcredits'] * $_GET['replycredit_times']) + ($_GET['replycredit_extcredits'] * $_GET['replycredit_times'] * $_G['setting']['creditstax']));
if($replycredit_real > getuserprofile('extcredits'.$_G['setting']['creditstransextra'][10])) {
return WebUtils::makeErrorInfo_oldVersion($res, 'forum_passwd');
showmessage('replycredit_morethan_self');
} else {
$replycredit = ceil($_GET['replycredit_extcredits'] * $_GET['replycredit_times']);
}
}
} */
$newthread = array('fid' => $_G['fid'], 'posttableid' => 0, 'readperm' => $readperm, 'price' => $price, 'typeid' => $typeid, 'sortid' => $sortid, 'author' => $author, 'authorid' => $_G['uid'], 'subject' => $subject, 'dateline' => $publishdate, 'lastpost' => $publishdate, 'lastposter' => $author, 'displayorder' => $displayorder, 'digest' => $digest, 'special' => $special, 'attachment' => 0, 'moderated' => $moderated, 'status' => $thread['status'] | $topicStatus, 'isgroup' => $isgroup, 'replycredit' => $replycredit, 'closed' => $closed ? 1 : 0);
$tid = C::t('forum_thread')->insert($newthread, true);
useractionlog($_G['uid'], 'tid');
if (!getuserprofile('threads') && $_G['setting']['newbie']) {
C::t('forum_thread')->update($tid, array('icon' => $_G['setting']['newbie']));
}
if ($publishdate != $_G['timestamp']) {
loadcache('cronpublish');
$cron_publish_ids = dunserialize($_G['cache']['cronpublish']);
$cron_publish_ids[$tid] = $tid;
$cron_publish_ids = serialize($cron_publish_ids);
savecache('cronpublish', $cron_publish_ids);
}
if (!$isanonymous) {
C::t('common_member_field_home')->update($_G['uid'], array('recentnote' => $subject));
}
if ($special == 3 && $_G['group']['allowpostreward']) {
updatemembercount($_G['uid'], array($_G['setting']['creditstransextra'][2] => -$realprice), 1, 'RTC', $tid);
}
if ($moderated) {
updatemodlog($tid, $displayorder > 0 ? 'STK' : 'DIG');
updatemodworks($displayorder > 0 ? 'STK' : 'DIG', 1);
}
/* if($special == 1) {
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";
}
示例4: intval
$_G['gp_replycredit_random'] = intval($_G['gp_replycredit_random']);
$_G['gp_replycredit_random'] = $_G['gp_replycredit_random'] < 0 || $_G['gp_replycredit_random'] > 99 ? 0 : $_G['gp_replycredit_random'];
$replycredit = $replycredit_real = 0;
if ($_G['gp_replycredit_extcredits'] > 0 && $_G['gp_replycredit_times'] > 0) {
$replycredit_real = ceil($_G['gp_replycredit_extcredits'] * $_G['gp_replycredit_times'] + $_G['gp_replycredit_extcredits'] * $_G['gp_replycredit_times'] * $_G['setting']['creditstax']);
if ($replycredit_real > getuserprofile('extcredits' . $_G['setting']['creditstransextra'][10])) {
showmessage('replycredit_morethan_self');
} else {
$replycredit = ceil($_G['gp_replycredit_extcredits'] * $_G['gp_replycredit_times']);
}
}
}
//vot added escape_str
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, status, isgroup, replycredit, closed)\r\n\t\tVALUES ('{$_G['fid']}', '0', '{$readperm}', '{$price}', '{$typeid}', '{$sortid}',\r\n '" . DB::escape_str($author) . "',\r\n '{$_G['uid']}',\r\n '" . DB::escape_str($subject) . "',\r\n '{$_G['timestamp']}', '{$_G['timestamp']}',\r\n '" . DB::escape_str($author) . "',\r\n '{$displayorder}', '{$digest}', '{$special}', '0', '{$moderated}', '{$thread['status']}', '{$isgroup}', '{$replycredit}', '" . ($closed ? "1" : '0') . "')");
$tid = DB::insert_id();
useractionlog($_G['uid'], 'tid');
/*vot*/
DB::update('common_member_field_home', array('recentnote' => DB::escape_str($subject)), array('uid' => $_G['uid']));
if ($special == 3 && $_G['group']['allowpostreward']) {
updatemembercount($_G['uid'], array($_G['setting']['creditstransextra'][2] => -$realprice), 1, 'RTC', $tid);
}
if ($moderated) {
updatemodlog($tid, $displayorder > 0 ? 'STK' : 'DIG');
updatemodworks($displayorder > 0 ? 'STK' : 'DIG', 1);
}
if ($special == 1) {
foreach ($pollarray['options'] as $polloptvalue) {
$polloptvalue = dhtmlspecialchars(trim($polloptvalue));
DB::query("INSERT INTO " . DB::table('forum_polloption') . " (tid, polloption) VALUES ('{$tid}', '{$polloptvalue}')");
}
$polloptionpreview = '';
示例5: newreply
public function newreply($parameters)
{
$this->_init_parameters($parameters);
if ($this->thread['closed'] && !$this->forum['ismoderator'] && !$this->thread['isgroup']) {
return $this->showmessage('post_thread_closed');
} elseif (!$this->thread['isgroup'] && ($post_autoclose = checkautoclose($this->thread))) {
return $this->showmessage($post_autoclose, '', array('autoclose' => $this->forum['autoclose']));
}
if (trim($this->param['subject']) == '' && trim($this->param['message']) == '' && $this->thread['special'] != 2) {
return $this->showmessage('post_sm_isnull');
} elseif ($post_invalid = checkpost($this->param['subject'], $this->param['message'], $this->param['special'] == 2 && $this->group['allowposttrade'])) {
return $this->showmessage($post_invalid, '', array('minpostsize' => $this->setting['minpostsize'], 'maxpostsize' => $this->setting['maxpostsize']));
} elseif (checkflood()) {
return $this->showmessage('post_flood_ctrl', '', array('floodctrl' => $this->setting['floodctrl']));
} elseif (checkmaxperhour('pid')) {
return $this->showmessage('post_flood_ctrl_posts_per_hour', '', array('posts_per_hour' => $this->group['maxpostsperhour']));
}
$heatthreadset = update_threadpartake($this->thread['tid'], true);
$bbcodeoff = checkbbcodes($this->param['message'], !empty($this->param['bbcodeoff']));
$smileyoff = checksmilies($this->param['message'], !empty($this->param['smileyoff']));
$parseurloff = !empty($this->param['parseurloff']);
$htmlon = $this->group['allowhtml'] && !empty($this->param['htmlon']) ? 1 : 0;
$usesig = !empty($this->param['usesig']) && $this->group['maxsigsize'] ? 1 : 0;
$this->param['isanonymous'] = $this->group['allowanonymous'] && !empty($this->param['isanonymous']) ? 1 : 0;
$author = empty($this->param['isanonymous']) ? $this->member['username'] : '';
list(, $this->param['modnewreplies']) = threadmodstatus($this->param['subject'] . "\t" . $this->param['message'] . $this->param['extramessage']);
if ($this->thread['displayorder'] == -4) {
$this->param['modnewreplies'] = 0;
}
$pinvisible = $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']);
if (!empty($this->param['noticetrimstr'])) {
$this->param['message'] = $this->param['noticetrimstr'] . "\n\n" . $this->param['message'];
$bbcodeoff = false;
}
$status = defined('IN_MOBILE') ? 8 : 0;
if ($this->param['modstatus']) {
foreach ($this->param['modstatus'] as $modbit => $modvalue) {
$status = setstatus($modbit, $modvalue, $status);
}
}
$this->pid = insertpost(array('fid' => $this->forum['fid'], 'tid' => $this->thread['tid'], 'first' => '0', 'author' => $this->member['username'], 'authorid' => $this->member['uid'], 'subject' => $this->param['subject'], 'dateline' => $this->param['timestamp'] ? $this->param['timestamp'] : getglobal('timestamp'), 'message' => $this->param['message'], 'useip' => $this->param['clientip'] ? $this->param['clientip'] : getglobal('clientip'), 'port' => $this->param['remoteport'] ? $this->param['remoteport'] : getglobal('remoteport'), 'invisible' => $pinvisible, 'anonymous' => $this->param['isanonymous'], 'usesig' => $usesig, 'htmlon' => $htmlon, 'bbcodeoff' => $bbcodeoff, 'smileyoff' => $smileyoff, 'parseurloff' => $parseurloff, 'attachment' => '0', 'status' => $status));
$this->param['updatethreaddata'] = $heatthreadset ? $heatthreadset : array();
$this->param['maxposition'] = C::t('forum_post')->fetch_maxposition_by_tid($this->thread['posttableid'], $this->thread['tid']);
$this->param['updatethreaddata'][] = DB::field('maxposition', $this->param['maxposition']);
useractionlog($this->member['uid'], 'pid');
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->thread['tid'], 'uid' => $this->member['uid'], 'mapx' => $mapx, 'mapy' => $mapy, 'location' => $location));
}
}
$nauthorid = 0;
if (!empty($this->param['noticeauthor']) && !$this->param['isanonymous'] && !$this->param['modnewreplies']) {
list($ac, $nauthorid) = explode('|', authcode($this->param['noticeauthor'], 'DECODE'));
if ($nauthorid != $this->member['uid']) {
if ($ac == 'q') {
notification_add($nauthorid, 'post', 'reppost_noticeauthor', array('tid' => $this->thread['tid'], 'subject' => $this->thread['subject'], 'fid' => $this->forum['fid'], 'pid' => $this->pid, 'from_id' => $this->pid, 'from_idtype' => 'quote'));
} elseif ($ac == 'r') {
notification_add($nauthorid, 'post', 'reppost_noticeauthor', array('tid' => $this->thread['tid'], 'subject' => $this->thread['subject'], 'fid' => $this->forum['fid'], 'pid' => $this->pid, 'from_id' => $this->thread['tid'], 'from_idtype' => 'post'));
}
}
}
if ($this->thread['authorid'] != $this->member['uid'] && getstatus($this->thread['status'], 6) && empty($this->param['noticeauthor']) && !$this->param['isanonymous'] && !$this->param['modnewreplies']) {
$thapost = C::t('forum_post')->fetch_threadpost_by_tid_invisible($this->thread['tid'], 0);
notification_add($thapost['authorid'], 'post', 'reppost_noticeauthor', array('tid' => $this->thread['tid'], 'subject' => $this->thread['subject'], 'fid' => $this->forum['fid'], 'pid' => $this->pid, 'from_id' => $this->thread['tid'], 'from_idtype' => 'post'));
}
$this->forum['threadcaches'] && deletethreadcaches($this->thread['tid']);
include_once libfile('function/stat');
updatestat($this->thread['isgroup'] ? 'grouppost' : 'post');
$this->param['showmsgparam']['fid'] = $this->forum['fid'];
$this->param['showmsgparam']['tid'] = $this->thread['tid'];
$this->param['showmsgparam']['pid'] = $this->pid;
$this->param['showmsgparam']['from'] = $this->param['from'];
$this->param['showmsgparam']['sechash'] = !empty($this->param['sechash']) ? $this->param['sechash'] : '';
dsetcookie('clearUserdata', 'forum');
if ($this->thread['replies'] <= 0) {
C::t('forum_sofa')->delete($this->thread['tid']);
}
if ($this->param['modnewreplies']) {
updatemoderate('pid', $this->pid);
unset($this->param['showmsgparam']['pid']);
if ($this->param['updatethreaddata']) {
C::t('forum_thread')->update($this->thread['tid'], $this->param['updatethreaddata'], false, false, 0, true);
}
C::t('forum_forum')->update_forum_counter($this->forum['fid'], 0, 0, 1, 1);
manage_addnotify('verifypost');
return 'post_reply_mod_succeed';
} else {
$fieldarr = array('lastposter' => array($author), 'replies' => 1);
if ($this->thread['lastpost'] < getglobal('timestamp')) {
$fieldarr['lastpost'] = array(getglobal('timestamp'));
}
$row = C::t('forum_threadaddviews')->fetch($this->thread['tid']);
if (!empty($row)) {
C::t('forum_threadaddviews')->update($this->thread['tid'], array('addviews' => 0));
$fieldarr['views'] = $row['addviews'];
}
$this->param['updatethreaddata'] = array_merge($this->param['updatethreaddata'], C::t('forum_thread')->increase($this->thread['tid'], $fieldarr, false, 0, true));
if ($this->thread['displayorder'] != -4) {
//.........这里部分代码省略.........
示例6: getPublishPollObj
//.........这里部分代码省略.........
switch ($v["type"]) {
case 0:
$message .= $v["infor"];
break;
case 1:
if (empty($aid_Img)) {
$message .= '[attachimg]' . $aid . '[/attachimg]';
} else {
$message .= '[attachimg]' . $aid_Img[$i] . '[/attachimg]';
$i = $i + 1;
}
$attachment = 2;
break;
case 3:
$message .= "[audio]" . $v["infor"] . "[/audio]";
break;
}
}
/* 判断是否发匿名与仅该作者可见贴*/
$isOnlyAuthor = $_GET['isOnlyAuthor'] ? $_GET['isOnlyAuthor'] : 0;
$thread['status'] = 32;
$isOnlyAuthor == 1 && ($thread['status'] = setstatus(2, 1, $thread['status']));
$isAnonymous = $_GET['isAnonymous'] ? $_GET['isAnonymous'] : 0;
$author = !$isAnonymous ? $_G['username'] : '';
$newthread = array('fid' => $_G['fid'], 'posttableid' => 0, 'readperm' => $readperm, 'price' => $price, 'typeid' => $typeid, 'sortid' => $sortid, 'author' => $author, 'authorid' => $_G['uid'], 'subject' => $subject, 'dateline' => $publishdate, 'lastpost' => $publishdate, 'lastposter' => $author, 'displayorder' => $displayorder, 'digest' => $digest, 'special' => $special, 'attachment' => $attachment, 'moderated' => $moderated, 'status' => $thread['status'], 'isgroup' => $isgroup, 'replycredit' => $replycredit, 'closed' => $closed);
$tid = C::t('forum_thread')->insert($newthread, true);
if ($modnewposts['modnewposts'] > 0) {
table_forum_thread_moderate::insert($tid, 0, time());
}
if (!$tid) {
echo '{"rs":0}';
exit;
}
useractionlog($_G['uid'], 'tid');
C::t('common_member_field_home')->update($_G['uid'], array('recentnote' => $subject));
$pinvisible = $modnewposts['modnewposts'] > 0 ? -2 : 0;
$isanonymous = 0;
$usesig = 1;
$htmlon = 0;
$bbcodeoff = -1;
$smileyoff = -1;
$parseurloff = false;
$tagstr = null;
$message = htmlspecialchars_decode($message);
$_G['group']['allowat'] = substr_count($message, '@');
if ($_G['group']['allowat']) {
$bbcodeoff = 0;
$atlist = $atlist_tmp = array();
$res = 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'];
}
}
示例7: updateforum
function updateforum($data, $postthread)
{
global $_G;
$tid = $data['tid'];
$subject = $data['subject'];
$message = $data['message'];
$author = $data['username'];
$authorid = $data['uid'];
$publishdate = TIMESTAMP;
$closed = $postthread[closed];
$replycredit = $postthread[replycredit];
$isgroup = $postthread[isgroup];
$moderated = $postthread[moderated];
$special = $postthread[special];
$displayorder = $data['isshow'] == 1 && $data['status'] == 1 ? 0 : -1;
$digest = $postthread[digest];
$newthread = array('fid' => $data['fid'], 'posttableid' => $postthread[posttableid], 'readperm' => $postthread[readperm], 'price' => $postthread[price], 'typeid' => $postthread[typeid], 'sortid' => $postthread[sortid], 'author' => $author, 'authorid' => $data['uid'], 'subject' => $subject, 'dateline' => $publishdate, 'lastpost' => $publishdate, 'lastposter' => $author, 'displayorder' => $displayorder, 'digest' => $digest, 'special' => $special, 'attachment' => $postthread[attachment], 'moderated' => $moderated, 'status' => $postthread[status], 'isgroup' => $isgroup, 'replycredit' => $replycredit, 'closed' => $closed);
C::t('#sanree_brand#forum_thread')->update($tid, $newthread);
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 = 1;
$usesig = 1;
$tagstr = '';
$pinvisible = 0;
$message = preg_replace('/\\[attachimg\\](\\d+)\\[\\/attachimg\\]/is', '[attach]\\1[/attach]', $message);
$postdata = array('fid' => $data['fid'], 'tid' => $tid, 'first' => '1', 'subject' => $subject, 'message' => $message, 'invisible' => $pinvisible, 'anonymous' => $isanonymous, 'usesig' => $usesig, 'htmlon' => $htmlon, 'bbcodeoff' => $bbcodeoff, 'smileyoff' => $smileyoff, 'parseurloff' => $parseurloff, 'attachment' => '0', 'tags' => $tagstr, 'replycredit' => 0, 'status' => 0);
C::t('#sanree_brand#forum_post')->update(0, $data[pid], $postdata);
$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);
}
示例8: article_move_forums
//.........这里部分代码省略.........
$author = !$arr['username'] ? $_G['username'] : $arr['username'];
$moderated = $digest || $displayorder > 0 ? 1 : 0;
$thread['status'] = 0;
$_GET['ordertype'] && ($thread['status'] = setstatus(4, 1, $thread['status']));
$_GET['hiddenreplies'] && ($thread['status'] = setstatus(2, 1, $thread['status']));
$_GET['allownoticeauthor'] && ($thread['status'] = setstatus(6, 1, $thread['status']));
$isgroup = $_G['forum']['status'] == 3 ? 1 : 0;
//检查各项设置
$bbcodeoff = checkbbcodes($message, FALSE);
$smileyoff = checksmilies($message, FALSE);
$parseurloff = FALSE;
$htmlon = $_G['group']['allowhtml'] && !empty($_GET['htmlon']) ? 1 : 0;
if ($_G['group']['allowreplycredit']) {
$_GET['replycredit_extcredits'] = intval($_GET['replycredit_extcredits']);
$_GET['replycredit_times'] = intval($_GET['replycredit_times']);
$_GET['replycredit_membertimes'] = intval($_GET['replycredit_membertimes']);
$_GET['replycredit_random'] = intval($_GET['replycredit_random']);
$_GET['replycredit_random'] = $_GET['replycredit_random'] < 0 || $_GET['replycredit_random'] > 99 ? 0 : $_GET['replycredit_random'];
$replycredit = $replycredit_real = 0;
}
if ($old_arr['forum_id']) {
$info = DB::fetch_first("SELECT p.pid,p.tid,t.tid,p.first FROM " . DB::table('forum_post') . " p Inner Join " . DB::table('forum_thread') . " t ON p.tid = t.tid WHERE p.first = '1' AND t.tid='" . $old_arr['forum_id'] . "' AND t.displayorder > '-1'");
}
$reply_count = count($arr['reply']);
$view_num = $view_num < $reply_count - 1 ? rand($reply_count * 2, $reply_count * 10) : $view_num;
if ($info['tid']) {
//更新
DB::query("UPDATE " . DB::table('forum_thread') . " SET typeid='{$typeid}', author='{$author}', authorid='{$uid}', subject='{$subject}', dateline='{$arr['public_time']}', lastpost='{$arr['public_time']}', fid='{$arr['fid']}', lastposter='{$author}', views='{$view_num}', attachment='0' WHERE tid='{$info['tid']}'", 'UNBUFFERED');
$tid = $info['tid'];
} else {
//添加
DB::query("INSERT INTO " . DB::table('forum_thread') . " (fid, posttableid, readperm, price, typeid, sortid, author, authorid, subject, dateline, lastpost, lastposter, views, displayorder, digest, special, attachment, moderated, status, isgroup, replycredit, closed)\r\n\t\t\tVALUES ('{$_G['fid']}', '0', '{$readperm}', '{$price}', '{$typeid}', '{$sortid}', '{$author}', '{$_G['uid']}', '{$subject}', '{$arr['public_time']}', '{$arr['public_time']}', '{$author}', '{$view_num}', '{$displayorder}', '{$digest}', '{$special}', '0', '{$moderated}', '32', '{$isgroup}', '{$replycredit}', '" . ($closed ? "1" : '0') . "')");
$tid = DB::insert_id();
useractionlog($uid, 'tid');
}
DB::update('common_member_field_home', array('recentnote' => $subject), array('uid' => $uid));
if ($moderated) {
updatemodlog($tid, $displayorder > 0 ? 'STK' : 'DIG');
updatemodworks($displayorder > 0 ? 'STK' : 'DIG', 1);
}
if (DISCUZ_VERSION == 'X2') {
//2.0版本
$tagstr = addthreadtag($arr['article_tag'], $tid);
} else {
$class_tag = new tag();
$tagstr = $class_tag->add_tag($arr['article_tag'], $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);
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'] && $_GET['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']}')");
}
$message = preg_replace('/\\[attachimg\\](\\d+)\\[\\/attachimg\\]/is', '[attach]\\1[/attach]', $message);
$post_setarr = array('fid' => $arr['fid'], 'tid' => $tid, 'first' => '1', 'author' => $author, 'authorid' => $_G['uid'], 'subject' => $subject, 'dateline' => $arr['public_time'], 'message' => $message, 'useip' => $_G['clientip'], 'invisible' => 0, 'anonymous' => $isanonymous, 'usesig' => 1, 'htmlon' => $htmlon, 'bbcodeoff' => $bbcodeoff, 'smileyoff' => $smileyoff, 'parseurloff' => $parseurloff, 'attachment' => '0', 'replycredit' => 0, 'status' => defined('IN_MOBILE') ? 8 : 0);
if (DISCUZ_VERSION != 'X2') {
//2.5版本 2.5版本多了一个position字段
$post_setarr['position'] = 1;
$post_setarr = dstripslashes($post_setarr);
} else {
$post_setarr = daddslashes($post_setarr);
}
$post_setarr['tags'] = $tagstr;
示例9: array
$u_ip = "127.0.0.1";
}
//echo $u_ip;
//Get parameter: fid, forum id
if (in_array($_POST["fid"], array('36', '37', '38', '39', '40', '41', '42', '43'))) {
$fid = $_POST["fid"];
} else {
echo "Forum id: " . $_POST["fid"] . " error!<br>";
$fid = "36";
}
$publishdate = $_G['timestamp'];
$author = "machine";
$authorid = "2";
$newthread = array('fid' => $fid, 'posttableid' => 0, 'readperm' => 0, 'price' => 0, 'typeid' => 0, 'sortid' => 0, 'author' => $author, 'authorid' => $authorid, 'subject' => $_POST["subject"], 'dateline' => $publishdate, 'lastpost' => $publishdate, 'lastposter' => $author, 'displayorder' => 0, 'digest' => 0, 'special' => 0, 'attachment' => 0, 'moderated' => 0, 'status' => 32, 'isgroup' => 0, 'replycredit' => 0, 'closed' => 0);
$tid = C::t('forum_thread')->insert($newthread, true);
useractionlog($authorid, 'tid');
C::t('common_member_field_home')->update($authorid, array('recentnote' => $_POST["subject"]));
$pid = insertpost(array('fid' => $fid, 'tid' => $tid, 'first' => '1', 'author' => $author, 'authorid' => $authorid, 'subject' => $_POST["subject"], 'dateline' => $publishdate, 'message' => $_POST["message"], 'useip' => $u_ip, 'invisible' => '0', 'anonymous' => '0', 'usesig' => '1', 'htmlon' => '0', 'bbcodeoff' => '-1', 'smileyoff' => '-1', 'parseurloff' => '0', 'attachment' => '0', 'tags' => '', 'replycredit' => '0', 'status' => '0'));
include_once libfile('function/stat');
updatestat("thread");
//update user status
$sql = array('extcredits2' => 2, 'threads' => 1, 'posts' => 1);
C::t('common_member_count')->increase($authorid, $sql);
C::t('common_member')->increase($authorid, array('credits' => 2));
$last_status = array('lastip' => $u_ip, 'lastvisit' => $publishdate, 'lastactivity' => $publishdate, 'lastpost' => TIMESTAMP);
C::t('common_member_status')->update($authorid, $last_status, 'UNBUFFERED');
$subject = str_replace("\t", ' ', $_POST["subject"]);
$lastpost = "{$tid}\t" . $subject . "\t{$_G['timestamp']}\t{$author}";
C::t('forum_forum')->update($fid, array('lastpost' => $lastpost));
C::t('forum_forum')->update_forum_counter($fid, 1, 1, 1);
echo "OK, ID: " . $pid;