本文整理汇总了PHP中pwQuery::insert方法的典型用法代码示例。如果您正苦于以下问题:PHP pwQuery::insert方法的具体用法?PHP pwQuery::insert怎么用?PHP pwQuery::insert使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pwQuery
的用法示例。
在下文中一共展示了pwQuery::insert方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: insert
/**
* 添加
*
* @param array $fieldsData 数据数组,以数据库字段为key
* @return int 新增id
*/
function insert($fieldsData)
{
if (S::isArray($fieldsData)) {
pwQuery::insert($this->_tableName, $fieldsData);
return $this->_db->insert_id();
}
}
示例2: addRewardRecord
function addRewardRecord($data)
{
$data = $this->_checkAllowField($data, $this->_allowFields);
if (!S::isArray($data)) {
return false;
}
return pwQuery::insert($this->_tableName, $data);
}
示例3: insertMemberTags
/**
* 添加
*
* @param array $fieldsData 数据数组,以数据库字段为key
*/
function insertMemberTags($fieldsData)
{
if (!S::isArray($fieldsData)) {
return false;
}
pwQuery::insert($this->_tableName, $fieldsData);
return true;
}
示例4: insert
function insert($fieldData)
{
$fieldData = $this->_checkData($fieldData);
if (!$fieldData) {
return false;
}
if (!$fieldData['uid'] || !$fieldData['behavior']) {
return false;
}
return pwQuery::insert($this->_tableName, $fieldData);
}
示例5: add
function add($username, $pwd, $email)
{
$this->db->update("INSERT INTO pw_members SET " . UC::sqlSingle(array('username' => $username, 'password' => $pwd, 'email' => $email, 'groupid' => 0, 'regdate' => $this->base->time)));
$uid = $this->db->insert_id();
/**
$this->db->update("INSERT INTO pw_memberdata SET " . $this->base->sqlSingle(array(
'uid' => $uid,
'lastvisit' => $this->base->time,
'thisvisit' => $this->base->time,
'onlineip' => $this->base->onlineip
)));
**/
pwQuery::insert('pw_memberdata', array('uid' => $uid, 'lastvisit' => $this->base->time, 'thisvisit' => $this->base->time, 'onlineip' => $this->base->onlineip));
return $uid;
}
示例6: strlen
(!$atc_content || strlen($atc_content) == 0) && Showmsg('annouce_content');
/**
$pwSQL = S::sqlSingle(array(
'fid' => $fid,
'ifopen' => $ifopen,
'vieworder' => $vieworder,
'author' => $windid,
'startdate' => $startdate,
'enddate' => $enddate,
'url' => $url,
'subject' => $atc_title,
'content' => $atc_content
));
$db->update("INSERT INTO pw_announce SET $pwSQL");
**/
pwQuery::insert('pw_announce', array('fid' => $fid, 'ifopen' => $ifopen, 'vieworder' => $vieworder, 'author' => $windid, 'startdate' => $startdate, 'enddate' => $enddate, 'url' => $url, 'subject' => $atc_title, 'content' => $atc_content));
if ($ifopen && (!$enddate || $enddate >= $timestamp)) {
require_once R_P . 'require/updatenotice.php';
updatecache_i_i($fid);
}
} else {
$rt = $db->get_one('SELECT aid,fid,content FROM pw_announce WHERE aid=' . S::sqlEscape($aid));
!$atc_title && Showmsg('annouce_title');
!$atc_content && Showmsg('annouce_content');
(!$rt['aid'] || $rt['fid'] != $fid) && Showmsg('data_error');
$pwSQL = array('ifopen' => $ifopen, 'vieworder' => $vieworder, 'startdate' => $startdate, 'enddate' => $enddate, 'url' => $url, 'subject' => $atc_title, 'content' => $atc_content);
//* $db->update("UPDATE pw_announce SET $pwSQL WHERE aid=".S::sqlEscape($aid));
pwQuery::update('pw_announce', 'aid=:aid', array($aid), $pwSQL);
require_once R_P . 'require/updatenotice.php';
updatecache_i_i($fid);
}
示例7: updateForumPostTop
function updateForumPostTop($fidArr)
{
global $db;
if (!is_array($fidArr)) {
return false;
}
$postTopData = array();
$query = $db->query("SELECT * FROM pw_poststopped WHERE floor = 3 GROUP BY tid ");
while ($row = $db->fetch_array($query)) {
$postTopData[] = $row;
}
foreach ($postTopData as $key => $value) {
foreach ($fidArr as $fid) {
pwQuery::insert('pw_poststopped', array('fid' => $fid, 'tid' => $value['tid'], 'pid' => $value['pid'], 'floor' => $value['floor'], 'uptime' => $value['uptime'], 'overtime' => $value['overtime']));
}
}
updatetop();
}
示例8: array
$pwSQL = S::sqlSingle(array(
'uid' => $winduid,
'dtid' => $dtid,
'username' => $windid,
'privacy' => $privacy,
'subject' => $diary['subject'],
// 'content' => $diary['content'],
'copyurl' => $diary['copyurl'],
'ifcopy' => $diary['ifcopy'],
'ifconvert' => $diary['ifconvert'],
'ifwordsfb' => $diary['ifwordsfb'],
'postdate' => $timestamp,
));
$db->update("INSERT INTO pw_diary SET $pwSQL");****/
$pwSQL = array('uid' => $winduid, 'dtid' => $dtid, 'username' => $windid, 'privacy' => $privacy, 'subject' => $diary['subject'], 'copyurl' => $diary['copyurl'], 'ifcopy' => $diary['ifcopy'], 'ifconvert' => $diary['ifconvert'], 'ifwordsfb' => $diary['ifwordsfb'], 'postdate' => $timestamp);
pwQuery::insert('pw_diary', $pwSQL);
$did = $db->insert_id();
$db->update("UPDATE pw_diarytype SET num=num+1 WHERE uid=" . S::sqlEscape($winduid) . " AND dtid=" . S::sqlEscape($dtid));
//更新分类日志数
//*=======拷贝图片待优化===========*//
$diaryAttachs = $diary['aid'] ? unserialize($diary['aid']) : array();
L::loadClass('upload', '', false);
require_once R_P . 'require/imgfunc.php';
$uploadSerivce = new PwUpload();
$ifthumb = 0;
if ($o_attachdir) {
if ($o_attachdir == 1) {
$savedir = "Type_{$attach_ext}";
} elseif ($o_attachdir == 2) {
$savedir = 'Mon_' . date('ym');
} elseif ($o_attachdir == 3) {
示例9: doPing
function doPing($cid, $addpoint, $params = array())
{
global $credit, $winddb, $winduid, $windid, $timestamp, $onlineip, $gp_gptype;
require_once R_P . 'require/credit.php';
$add_c = $tmp = $pingLog = array();
if (is_array($cid)) {
foreach ($cid as $k => $v) {
if ($v && isset($credit->cType[$v]) && is_numeric($addpoint[$k]) && $addpoint[$k] != 0) {
if (!isset($this->markset[$v])) {
return 'masigle_credit_right';
}
$tmp[$v] += intval($addpoint[$k]);
}
}
foreach ($tmp as $k => $v) {
if (!$v) {
continue;
}
if ($v > $this->markset[$k]['maxper'] || $v < $this->markset[$k]['minper']) {
$GLOBALS['limitCreditType'] = $k;
//GLOBAL
$GLOBALS['markset'] = $this->markset;
//GLOBAL
return 'masigle_creditlimit';
}
$add_c[$k] = $v;
}
}
if (empty($add_c)) {
return 'member_credit_error';
}
if (strlen($params['atc_content']) > 100) {
return 'showping_content_too_long';
}
$count = count($this->postData);
foreach ($add_c as $k => $v) {
$allpoint = abs($v) * $count;
if ($allpoint > $this->markset[$k]['leavepoint']) {
$GLOBALS['leavepoint'] = $this->markset[$k]['leavepoint'];
return 'masigle_point';
}
if (isset($this->userCreditInfo[$k])) {
$this->userCreditInfo[$k]['pingdate'] = $timestamp;
$this->userCreditInfo[$k]['pingnum'] += $allpoint;
} else {
$this->userCreditInfo[$k] = array('pingdate' => $timestamp, 'pingnum' => $allpoint, 'pingtype' => $k);
}
//需扣除积分
if ($this->markset[$k]['markdt'] && $allpoint > 0) {
if ($credit->get($winduid, $k) < $allpoint) {
return 'credit_enough';
}
$credit->set($winduid, $k, -$allpoint, false);
}
}
$newcreditdb = '';
foreach ($this->userCreditInfo as $v) {
$newcreditdb .= ($newcreditdb ? '|' : '') . implode("\t", $v);
}
//更新用户评分信息
$userService = L::loadClass('UserService', 'user');
/* @var $this->userService PW_UserService */
$userService->update($winduid, array(), array(), array('credit' => $newcreditdb));
$singlepoint = array_sum($add_c);
require_once R_P . 'require/showimg.php';
//* $threadService = L::loadClass("threads", 'forum');
foreach ($this->postData as $pid => $atc) {
!$atc['subject'] && ($atc['subject'] = substrs(strip_tags(convert($atc['content'])), 35));
/*积分日志*/
$credit->addLog('credit_showping', $add_c, array('uid' => $atc['authorid'], 'username' => $atc['author'], 'ip' => $onlineip, 'operator' => $windid, 'tid' => $this->tid, 'subject' => $atc['subject'], 'reason' => $params['atc_content']));
//为被评用户增加积分
$credit->sets($atc['authorid'], $add_c, false);
if (!is_numeric($pid)) {
//主题时,更新总评分数
//* $this->db->update("UPDATE pw_threads SET ifmark=ifmark+" . S::sqlEscape($singlepoint)." WHERE tid=" . S::sqlEscape($tid));
$this->db->update(pwQuery::buildClause("UPDATE :pw_table SET ifmark=ifmark+:ifmark WHERE tid=:tid", array('pw_threads', $singlepoint, $this->tid)));
$rpid = 0;
} else {
$rpid = $pid;
}
$pwSQL = $ping = array();
$affect = '';
list($ping['pingtime'], $ping['pingdate']) = getLastDate($timestamp - 1);
//list($face) = showfacedesign($winddb['icon'],1,'m');
foreach ($add_c as $key => $value) {
/*记录评分日志*/
$pwSQL = array('fid' => $this->fid, 'tid' => $this->tid, 'pid' => $rpid, 'name' => $key, 'point' => $value, 'pinger' => $windid, 'record' => $params['atc_content'], 'pingdate' => $timestamp);
$affect .= ($affect ? ',' : '') . $credit->cType[$key] . ':' . $value;
//$this->db->update("INSERT INTO pw_pinglog SET " . S::sqlSingle($pwSQL));
//$pingLogId = $this->db->insert_id();
$pingLogId = pwQuery::insert('pw_pinglog', $pwSQL);
$pingLog[$pid][$key] = array('fid' => $this->fid, 'tid' => $this->tid, 'pid' => $pid, 'name' => $credit->cType[$key], 'point' => $value > 0 ? "+{$value}" : $value, 'pinger' => $windid, 'pingeruid' => $winduid, 'record' => $params['atc_content'] ? $params['atc_content'] : '-', 'pingtime' => $ping['pingtime'], 'pingdate' => $ping['pingdate'], 'pingLogId' => $pingLogId);
}
$this->update_markinfo($this->tid, $rpid);
//* $threadService->clearTmsgsByThreadId($this->tid);
Perf::gatherInfo('changeTmsgWithThreadIds', array('tid' => $this->tid));
$this->postData[$pid]['ifmark'] = $ifmark;
if ($params['ifmsg'] && !$atc['anonymous'] && $atc['author'] != $windid) {
//发消息
$title = getLangInfo('writemsg', 'ping_title', array('sender' => $windid, 'receiver' => $atc['author']));
//.........这里部分代码省略.........
示例10: array
//* $pid = $db->insert_id();
$uniqueService = L::loadClass('unique', 'utility');
$pid = $uniqueService->getUnique('post');
} else {
$pid = '';
}
/*$pwSQL = S::sqlSingle(array('pid' => $pid, 'fid' => $fid, 'tid' => $totid, 'aid' => $fromdb['aid'],
'author' => $fromdb['author'], 'authorid' => $fromdb['authorid'], 'icon' => $fromdb['icon'],
'postdate' => $fromdb['postdate'], 'subject' => $fromdb['subject'], 'userip' => $fromdb['userip'],
'ifsign' => $fromdb['ifsign'], 'alterinfo' => $fromdb['alterinfo'], 'ipfrom' => $fromdb['ipfrom'],
'ifconvert' => $fromdb['ifconvert'], 'ifcheck' => $fromdb['ifcheck'],
'content' => $fromdb['content'], 'ifmark' => $fromdb['ifmark'], 'ifshield' => $fromdb['ifshield']), false);
$db->update("INSERT INTO $pw_posts SET $pwSQL");
*/
$pwSQL = array('pid' => $pid, 'fid' => $fid, 'tid' => $totid, 'aid' => $fromdb['aid'], 'author' => $fromdb['author'], 'authorid' => $fromdb['authorid'], 'icon' => $fromdb['icon'], 'postdate' => $fromdb['postdate'], 'subject' => $fromdb['subject'], 'userip' => $fromdb['userip'], 'ifsign' => $fromdb['ifsign'], 'alterinfo' => $fromdb['alterinfo'], 'ipfrom' => $fromdb['ipfrom'], 'ifconvert' => $fromdb['ifconvert'], 'ifcheck' => $fromdb['ifcheck'], 'content' => $fromdb['content'], 'ifmark' => $fromdb['ifmark'], 'ifshield' => $fromdb['ifshield']);
pwQuery::insert($pw_posts, $pwSQL);
!$pid && ($pid = $db->insert_id());
$replies += $fromdb['replies'] + 1;
# $db->update('DELETE FROM pw_threads WHERE tid='.S::sqlEscape($fromdb['tid']));
# ThreadManager
//* $threadManager = L::loadClass("threadmanager", 'forum');
//* $threadManager->deleteByThreadId($fromdb['fid'], $fromdb['tid']);
$threadService = L::loadclass('threads', 'forum');
$threadService->deleteByThreadId($fromdb['tid']);
Perf::gatherInfo('changeThreadWithForumIds', array('fid' => $fromdb['fid']));
$pw_tmsgsf = GetTtable($fromdb['tid']);
//* $db->update("DELETE FROM $pw_tmsgsf WHERE tid=" . S::sqlEscape($fromdb['tid']));
pwQuery::delete($pw_tmsgsf, 'tid=:tid', array($fromdb['tid']));
if ($db_guestread) {
require_once R_P . 'require/guestfunc.php';
clearguestcache($fromdb['tid'], $replies);
示例11: add
function add($uid, $cid, $value, $isAdd = true)
{
$cid == 'rvrc' && ($value *= 10);
$value = intval($value);
if (is_numeric($cid)) {
$rt = $this->db->get_one("SELECT uid,value FROM pw_membercredit WHERE uid=" . UC::escape($uid) . ' AND cid=' . UC::escape($cid));
if ($rt) {
if ($isAdd) {
//* $this->db->update("UPDATE pw_membercredit SET value=value+" . UC::escape($value) . ' WHERE uid=' . UC::escape($uid) . ' AND cid=' . UC::escape($cid));
$this->db->update(pwQuery::buildClause('UPDATE :pw_table SET value=value+:value WHERE uid=:uid AND cid=:cid', array('pw_membercredit', $value, intval($uid), $cid)));
return $rt['value'] + $value;
} else {
//* $this->db->update("UPDATE pw_membercredit SET value=" . UC::escape($value) . ' WHERE uid=' . UC::escape($uid) . ' AND cid=' . UC::escape($cid));
pwQuery::update('pw_membercredit', 'uid=:uid AND cid=:cid', array($uid, $cid), array('value' => $value));
return $value;
}
} else {
//* $this->db->update("INSERT INTO pw_membercredit SET " . UC::sqlSingle(array('uid' => $uid, 'cid' => $cid, 'value' => $value)));
pwQuery::insert('pw_membercredit', array('uid' => $uid, 'cid' => $cid, 'value' => $value));
return $value;
}
} elseif ($this->isAllow($cid)) {
if ($isAdd) {
//* $this->db->update("UPDATE pw_memberdata SET $cid=$cid+" . UC::escape($value) . ' WHERE uid=' . UC::escape($uid));
$this->db->update(pwQuery::buildClause("UPDATE :pw_table SET {$cid}={$cid}+" . UC::escape($value) . ' WHERE uid=:uid', array('pw_memberdata', intval($uid))));
$cid == 'rvrc' && ($cid = "FLOOR(rvrc/10)");
return $this->db->get_value("SELECT {$cid} FROM pw_memberdata WHERE uid=" . UC::escape($uid));
} else {
//* $this->db->update("UPDATE pw_memberdata SET $cid=" . UC::escape($value) . ' WHERE uid=' . UC::escape($uid));
$this->db->update(pwQuery::buildClause("UPDATE :pw_table SET {$cid}=" . UC::escape($value) . ' WHERE uid=:uid', array('pw_memberdata', intval($uid))));
$cid == 'rvrc' && ($value /= 10);
return $value;
}
}
return null;
}
示例12: addColonyUser
function addColonyUser($uid, $username, $frombbs = false)
{
global $credit;
require_once R_P . 'require/credit.php';
//积分变动
$o_groups_creditset = L::config('o_groups_creditset', 'o_config');
if (!empty($o_groups_creditset['Joingroup'])) {
require_once R_P . 'u/require/core.php';
$credit->appendLogSet(L::config('o_groups_creditlog', 'o_config'), 'groups');
$creditset = getCreditset($o_groups_creditset['Joingroup'], false);
$credit->addLog('groups_Joingroup', $creditset, array('uid' => $uid, 'username' => $username, 'ip' => $GLOBALS['onlineip']));
$credit->sets($uid, $creditset);
}
/**
$this->_db->update("INSERT INTO pw_cmembers SET " . S::sqlSingle(array(
'uid' => $uid,
'username' => $username,
'ifadmin' => $this->info['ifcheck'] == 2 ? '0' : '-1',
'colonyid' => $this->cyid,
'addtime' => $GLOBALS['timestamp']
)));
**/
pwQuery::insert('pw_cmembers', array('uid' => $uid, 'username' => $username, 'ifadmin' => $this->info['ifcheck'] == 2 ? '0' : '-1', 'colonyid' => $this->cyid, 'addtime' => $GLOBALS['timestamp']));
if ($this->info['ifcheck'] == 2) {
$this->updateInfoCount(array('members' => 1));
}
$this->_sendJoinMsg($frombbs);
if ($this->info['ifcheck'] == 2) {
updateUserAppNum($uid, 'group');
return 'colony_joinsuccess';
}
return 'colony_joinsuccess_check';
}
示例13: GetPtable
$pw_posts_tid = GetPtable('N', $tid);
//post表
if ($splittype == 0) {
//新帖操作
if (strlen($splittitle) == 0) {
Showmsg('split_title_not_null');
}
if (strlen($splittitle) > 100) {
Showmsg('split_title_not_big');
}
//拆分
$threadId = $pids[0];
$postInfo = $db->get_one("SELECT * FROM {$pw_posts_tid} WHERE pid = " . S::sqlEscape($threadId));
$threadInfo = array('fid' => $fid, 'author' => $postInfo['author'], 'authorid' => $postInfo['authorid'], 'subject' => $splittitle, 'ifcheck' => $postInfo['ifcheck'], 'postdate' => $postInfo['postdate'], 'lastpost' => $postInfo['postdate'], 'ptable' => $db_ptable, 'lastposter' => $postInfo['author']);
//$db->update("INSERT INTO pw_threads SET " . S::sqlSingle($threadInfo));
$newId = pwQuery::insert("pw_threads", $threadInfo);
$newId = $db->insert_id();
$pw_tmsgs = GetTtable($newId);
//获取分表表名
$pwtmsgInfo = array('userip' => $postInfo['userip'], 'content' => $postInfo['content'], 'ipfrom' => $postInfo['ipfrom'], 'ifsign' => $postInfo['ifsign'], 'ifconvert' => $postInfo['ifconvert'], 'ifwordsfb' => $postInfo['ifwordsfb'], 'tid' => $newId);
$db->update("INSERT INTO {$pw_tmsgs} SET " . S::sqlSingle($pwtmsgInfo));
$db->query("DELETE FROM {$pw_posts_tid} WHERE pid = " . S::sqlEscape($threadId));
$splitid = $newId;
//更新板块数据表
//* $db->update("UPDATE pw_forumdata SET topic = topic + 1 WHERE fid = " . S::sqlEscape($fid));
$db->update(pwQuery::buildClause("UPDATE :pw_table SET topic=topic+1 WHERE fid=:fid", array('pw_forumdata', $fid)));
} else {
//合并帖子操作
!$splitid && Showmsg('split_no_splitid');
$splitid = (int) $splitid;
if ($tid == $splitid) {
示例14: execute
function execute($postdata)
{
global $db_cvtime, $db_ptable, $onlineip, $db_plist;
$this->setPostData($postdata);
$ipTable = L::loadClass('IPTable', 'utility');
$ipfrom = $ipTable->getIpFrom($onlineip);
$timestamp = time();
$db_cvtime != 0 && ($timestamp += $db_cvtime * 60);
$pwSQL = array('fid' => $this->data['fid'], 'tid' => $this->tid, 'aid' => $this->data['aid'], 'author' => $this->data['author'], 'authorid' => $this->data['authorid'], 'icon' => $this->data['icon'], 'postdate' => $timestamp, 'subject' => $this->data['title'], 'userip' => $onlineip, 'ifsign' => $this->data['ifsign'], 'ipfrom' => $ipfrom, 'ifconvert' => $this->data['convert'], 'ifwordsfb' => $this->data['ifwordsfb'], 'ifcheck' => $this->data['ifcheck'], 'content' => $this->data['content'], 'anonymous' => $this->data['anonymous'], 'ifhide' => $this->data['hideatt'], 'frommob' => $this->data['frommob']);
$pw_posts = GetPtable($this->tpcArr['ptable']);
if ($db_plist && count($db_plist) > 1) {
//* $this->db->update("INSERT INTO pw_pidtmp(pid) VALUES(null)");
//* $pid = $this->db->insert_id();
$uniqueService = L::loadClass('unique', 'utility');
$pid = $uniqueService->getUnique('post');
} else {
$pid = '';
}
$pwSQL['pid'] = $pid;
//$pwSQL = S::sqlSingle($pwSQL);
//$this->db->update("INSERT INTO $pw_posts SET $pwSQL");
pwQuery::insert($pw_posts, $pwSQL);
!$pid && ($pid = $this->db->insert_id());
$this->tpcArr['openIndex'] && ($floor = $this->setPostFloor($pid));
if (getstatus($this->tpcArr['tpcstatus'], 7)) {
$robbuildService = L::loadClass("robbuild", 'forum');
$robbuildService->setRobbuilds($pid, $floor, $this->tid);
}
$this->pid = $pid;
if (is_object($this->att) && ($aids = $this->att->getAids())) {
$this->db->update("UPDATE pw_attachs SET " . S::sqlSingle(array('tid' => $this->tid, 'pid' => $this->pid)) . ' WHERE aid IN(' . S::sqlImplode($aids) . ')');
//tucool
$imgNum = $this->att->getUploadImgNum();
if ($this->forum->forumset['iftucool'] && $this->forum->forumset['tucoolpic'] && $imgNum) {
$tucoolService = L::loadClass('tucool', 'forum');
$tucoolService->setForum($this->forum->foruminfo);
$tucoolService->updateTucoolImageNum($this->tid);
}
}
if ($this->data['ifcheck'] == 1) {
$sqladd1 = '';
$sqladd = array('lastposter' => $this->data['lastposter']);
$this->tpcArr['locked'] < 3 && ($sqladd['lastpost'] = $timestamp);
$this->data['ifupload'] && ($sqladd['ifupload'] = $this->data['ifupload']);
$ret = $this->sendMail();
if ($ret & 2) {
$sqladd['ifmail'] = 4;
} elseif ($ret & 1) {
$sqladd1 = "ifmail=ifmail-1,";
}
$this->db->update("UPDATE pw_threads SET {$sqladd1}replies=replies+1,hits=hits+1," . S::sqlSingle($sqladd) . " WHERE tid=" . S::sqlEscape($this->tid));
Perf::gatherInfo('changeThreads', array('tid' => $this->tid));
$userCache = L::loadClass('Usercache', 'user');
$userCache->delete($this->data['authorid'], 'reply');
}
//weibo
$weiboService = L::loadClass('weibo', 'sns');
/* @var $weiboService PW_Weibo */
$weiboContent = substrs(stripWindCode($weiboService->escapeStr(strip_tags($this->data['content']))), 125);
$weiboExtra = array('title' => stripslashes($this->tpcArr['subject']), 'fid' => $this->forum->fid, 'fname' => $this->forum->name, 'atusers' => $this->data['atusers'], 'pid' => $this->pid);
$weiboService->send($this->post->uid, $weiboContent, 'article', $this->tid, $weiboExtra);
$threadService = L::loadClass('threads', 'forum');
$threadService->setAtUsers($this->tid, $this->pid, $this->data['atusers']);
//end weibo
if ($this->data['ifcheck'] == 1) {
$this->post->updateUserInfo($this->type, $this->userCreidtSet(), $this->data['content']);
}
$this->afterReply();
if ($this->extraBehavior) {
$this->extraBehavior->replyPost($this->pid, $this->tid, $this->data);
}
}
示例15: execute
function execute(&$postdata)
{
global $timestamp, $db_ptable, $onlineip;
$this->setPostData($postdata);
/*
$pwSQL = S::sqlSingle(array(
'fid' => $this->data['fid'],
'icon' => $this->data['icon'],
'author' => $this->data['author'],
'authorid' => $this->data['authorid'],
'subject' => $this->data['title'],
'ifcheck' => $this->data['ifcheck'],
'type' => $this->data['w_type'],
'postdate' => $timestamp,
'lastpost' => $timestamp,
'lastposter' => $this->data['lastposter'],
'hits' => 1,
'replies' => 0,
'topped' => $this->data['topped'],
'digest' => $this->data['digest'],
'special ' => $this->data['special'],
'state' => 0,
'ifupload' => $this->data['ifupload'],
'ifmail' => $this->data['ifmail'],
'anonymous' => $this->data['anonymous'],
'ptable' => $db_ptable,
'ifmagic' => $this->data['ifmagic'],
'ifhide' => $this->data['hideatt'],
'tpcstatus' => $this->data['tpcstatus'],
'modelid' => $this->data['modelid']
));*/
//$this->db->update("INSERT INTO pw_threads SET $pwSQL");
$pwSQL = array('fid' => $this->data['fid'], 'icon' => $this->data['icon'], 'author' => $this->data['author'], 'authorid' => $this->data['authorid'], 'subject' => $this->data['title'], 'ifcheck' => $this->data['ifcheck'], 'type' => $this->data['w_type'], 'postdate' => $timestamp, 'lastpost' => $timestamp, 'lastposter' => $this->data['lastposter'], 'hits' => 1, 'replies' => 0, 'topped' => $this->data['topped'], 'digest' => $this->data['digest'], 'special ' => $this->data['special'], 'state' => 0, 'ifupload' => $this->data['ifupload'], 'ifmail' => $this->data['ifmail'], 'anonymous' => $this->data['anonymous'], 'ptable' => $db_ptable, 'ifmagic' => $this->data['ifmagic'], 'ifhide' => $this->data['hideatt'], 'tpcstatus' => $this->data['tpcstatus'], 'modelid' => $this->data['modelid'], 'frommob' => $this->data['frommob']);
$this->tid = pwQuery::insert('pw_threads', $pwSQL);
//* $this->tid = $this->db->insert_id();
# memcache refresh
// $threadList = L::loadClass("threadlist", 'forum');
// $threadList->updateThreadIdsByForumId($this->data['fid'], $this->tid);
//* Perf::gatherInfo('changeThreadWithForumIds', array('fid'=>$this->data['fid'])); //pwQuery::insert已经执行清理缓存
$pw_tmsgs = GetTtable($this->tid);
if (is_object($postdata->tag)) {
$postdata->tag->insert($this->tid);
$this->data['tags'] .= "\t" . $postdata->tag->relate($this->data['title'], $this->data['content']);
}
if (is_object($this->att) && ($aids = $this->att->getAids())) {
$this->att->pw_attachs->updateById($aids, array('tid' => $this->tid));
$topicImgNum = $this->att->getUploadImgNum();
if ($this->forum->forumset['iftucool'] && $this->forum->forumset['tucoolpic'] && $topicImgNum >= $this->forum->forumset['tucoolpic']) {
$tucoolService = L::loadClass('tucool', 'forum');
$tucoolService->add(array('fid' => $this->data['fid'], 'tid' => $this->tid, 'tpcnum' => $topicImgNum));
}
}
$ipTable = L::loadClass('IPTable', 'utility');
$pwSQL = S::sqlSingle(array('tid' => $this->tid, 'aid' => $this->data['aid'], 'userip' => $onlineip, 'ifsign' => $this->data['ifsign'], 'buy' => '', 'ipfrom' => $ipTable->getIpFrom($onlineip), 'tags' => $this->data['tags'], 'ifconvert' => $this->data['convert'], 'ifwordsfb' => $this->data['ifwordsfb'], 'content' => $this->data['content'], 'magic' => $this->data['magic']));
$this->db->update("INSERT INTO {$pw_tmsgs} SET {$pwSQL}");
if ($this->data['digest']) {
$userService = L::loadClass('UserService', 'user');
/* @var $userService PW_UserService */
$userService->updateByIncrement($this->data['authorid'], array(), array('digests' => 1));
$this->post->user['digests']++;
}
if ($this->data['replyreward']) {
$replyRewardService = L::loadClass('ReplyReward', 'forum');
/* @var $replyRewardService PW_ReplyReward */
$this->data['replyreward']['tid'] = $this->tid;
$replyRewardService->addNewReward($this->data['authorid'], $this->data['replyreward']);
}
$this->post->updateUserInfo($this->type, $this->userCreidtSet(), $this->data['content']);
$this->afterpost();
if ($this->extraBehavior) {
$this->extraBehavior->topicPost($this->tid, $this->data);
}
}