function afterpost() { global $db_ifpwcache, $timestamp; if ($this->data['ifcheck'] == 1) { if ($this->forum->foruminfo['allowhtm'] && !$this->forum->foruminfo['cms']) { $StaticPage = L::loadClass('StaticPage'); $StaticPage->update($this->tid); } $lastpost = array('subject' => substrs($this->data['title'], 26), 'author' => $this->data['lastposter'], 'lastpost' => $timestamp, 'tid' => $this->tid, 't_date' => $timestamp); $this->forum->lastinfo('topic', '+', $lastpost); if ($this->forum->isOpen() && !$this->data['anonymous']) { pwAddFeed($this->post->uid, 'post', $this->tid, array('subject' => stripslashes($this->data['title']), 'tid' => $this->tid, 'fid' => $this->forum->fid)); //会员资讯缓存 $usercachedata = array(); $usercache = L::loadDB('Usercache'); $usercachedata['subject'] = substrs(stripWindCode($this->data['title']), 100, N); $usercachedata['content'] = substrs(stripWindCode($this->data['content']), 100, N); $usercachedata['postdate'] = $timestamp; if ($this->att) { $usercachedata['attimages'] = $this->att->getImages(4); } $usercache->update($this->data['authorid'], 'topic', $this->tid, $usercachedata); } //Start elementupdate if ($db_ifpwcache & 128 || $db_ifpwcache & 512 && $this->att && $this->att->elementpic) { require_once R_P . 'lib/elementupdate.class.php'; $elementupdate = new ElementUpdate($this->forum->fid); if ($db_ifpwcache & 128) { $elementupdate->newSubjectUpdate($this->tid, $this->forum->fid, $timestamp, $this->data['special']); } if ($db_ifpwcache & 512 && $this->att && $this->att->elementpic) { $elementupdate->newPicUpdate($this->att->elementpic['aid'], $this->forum->fid, $this->tid, $this->att->elementpic['attachurl'], $this->att->elementpic['ifthumb'], $this->data['content']); } $elementupdate->updateSQL(); } updateDatanalyse($this->data['authorid'], 'memberThread', 1); //End elementupdate } if ($this->postdata->filter->filter_weight > 1) { $this->postdata->filter->insert($this->tid, 0, implode(',', $this->postdata->filter->filter_word), $this->postdata->filter->filter_weight); } if ($this->data['topped'] > 0) { require_once R_P . 'require/updateforum.php'; setForumsTopped($this->tid, $this->data['fid'], $this->data['topped']); updatetop(); } }
@name:置顶道具 @type:帖子类 @effect:可将自己发表的帖子在版块中置顶,置顶时间为6小时。 ****/ if ($tooldb['type'] != 1) { Showmsg('tooluse_type_error'); // 判断道具类型是否设置错误 } if ($tpcdb['authorid'] != $winduid) { Showmsg('tool_authorlimit'); } if ($tpcdb['topped'] != 0) { Showmsg('toolmsg_4_failed'); } $toolfield = $timestamp + 3600 * 6; //$db->update("UPDATE pw_threads SET topped='1',toolinfo=".S::sqlEscape($tooldb['name'],false).",toolfield=".S::sqlEscape($toolfield)."WHERE tid=".S::sqlEscape($tid)); pwQuery::update('pw_threads', 'tid=:tid', array($tid), array('topped' => 1, 'toolinfo' => $tooldb['name'], 'toolfield' => $toolfield)); $fid = $db->get_value("SELECT fid FROM pw_threads WHERE tid=" . intval($tid)); //* $threadList = L::loadClass("threadlist", 'forum'); //* $threadList->refreshThreadIdsByForumId($fid); Perf::gatherInfo('changeThreadWithForumIds', array('fid' => $fid)); require_once R_P . 'require/updateforum.php'; setForumsTopped($tid, $fid, 1, $toolfield); updatetop(); delfcache($fid, $db_fcachenum); $db->update("UPDATE pw_usertool SET nums=nums-1 WHERE uid=" . S::sqlEscape($winduid) . "AND toolid=" . S::sqlEscape($toolid)); $logdata = array('type' => 'use', 'nums' => '', 'money' => '', 'descrip' => 'tool_4_descrip', 'uid' => $winduid, 'username' => $windid, 'ip' => $onlineip, 'time' => $timestamp, 'toolname' => $tooldb['name'], 'subject' => substrs($tpcdb['subject'], 15), 'tid' => $tid); writetoollog($logdata); Showmsg('toolmsg_success');
function afterpost() { global $db_ifpwcache, $timestamp; if ($this->data['ifcheck'] == 1) { if ($this->forum->foruminfo['allowhtm'] && !$this->forum->foruminfo['cms']) { $StaticPage = L::loadClass('StaticPage'); $StaticPage->update($this->tid); } $lastpost = array('subject' => substrs($this->data['title'], 26), 'author' => $this->data['lastposter'], 'lastpost' => $timestamp, 'tid' => $this->tid, 't_date' => $timestamp); $this->forum->lastinfo('topic', '+', $lastpost); if ($this->forum->isOpen() && !$this->data['anonymous']) { require_once R_P . 'require/functions.php'; if (!$this->extraBehavior) { $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->data['title']), 'fid' => $this->forum->fid, 'fname' => $this->forum->name, 'atusers' => $this->data['atusers']); $weiboService->send($this->post->uid, $weiboContent, 'article', $this->tid, $weiboExtra); $threadService = L::loadClass('threads', 'forum'); $threadService->setAtUsers($this->tid, 0, $this->data['atusers']); } //会员资讯缓存 $userCache = L::loadClass('Usercache', 'user'); $userCache->delete($this->data['authorid'], array('article', 'cardtopic')); /* $usercachedata = array(); $usercachedata['subject'] = substrs(stripWindCode($this->data['title']), 100, N); $usercachedata['content'] = substrs(stripWindCode($this->data['content']), 100, N); $usercachedata['postdate'] = $timestamp; if ($this->att) { $usercachedata['attimages'] = $this->att->getImages(4); } $userCache->update($this->data['authorid'], 'topic', $this->tid, $usercachedata); */ } //Start elementupdate require_once D_P . 'data/bbscache/o_config.php'; if ($db_ifpwcache & 128 || $o_browseopen || $db_ifpwcache & 512 && $this->att && $this->att->elementpic) { L::loadClass('elementupdate', '', false); $elementupdate = new ElementUpdate($this->forum->fid); if ($db_ifpwcache & 128) { $elementupdate->newSubjectUpdate($this->tid, $this->forum->fid, $timestamp, $this->data['special']); } if ($db_ifpwcache & 512 && $this->att && $this->att->elementpic && $this->_checkIfHidden()) { $elementupdate->newPicUpdate($this->att->elementpic['aid'], $this->forum->fid, $this->tid, $this->att->elementpic['attachurl'], $this->att->elementpic['ifthumb'], $this->data['content']); } if ($o_browseopen) { $elementupdate->setCacheNum(100); /*设置缓存100个*/ $elementupdate->lastPostUpdate($this->data['authorid'], $this->tid, $timestamp); } $elementupdate->updateSQL(); } require_once R_P . 'require/functions.php'; updateDatanalyse($this->data['authorid'], 'memberThread', 1); //End elementupdate } if ($this->postdata->filter->filter_weight > 1) { $this->postdata->filter->insert($this->tid, 0, implode(',', $this->postdata->filter->filter_word), $this->postdata->filter->filter_weight); } if ($this->data['topped'] > 0) { require_once R_P . 'require/updateforum.php'; setForumsTopped($this->tid, $this->data['fid'], $this->data['topped']); updatetop(); } }