public function run() { Wind::import('SRV:forum.dm.PwReplyDm'); Wind::import('SRV:forum.dm.PwTopicDm'); $replyDm = new PwReplyDm($this->pid); $replyDm->setTopped($this->topped); $this->_getThreadDs()->updatePost($replyDm); $topicDm = new PwTopicDm($this->tid); if ($this->topped) { $toppedDm = new PwPostsToppedDm(); $toppedDm->setPid($this->pid)->setTid($this->tid)->setCreatedUserid($this->srv->user->uid)->setFloor($this->lou); $this->_getPostsToppedDs()->addTopped($toppedDm); $topicDm->addReplyTopped(1); } else { $topicDm->addReplyTopped(-1); $this->_getPostsToppedDs()->deleteTopped($this->pid); } $this->_getThreadDs()->updateThread($topicDm, PwThread::FETCH_MAIN); if ($this->topped == 1) { $type = 'threadtopped'; } else { $type = 'untopped'; } Wekit::load('log.srv.PwLogService')->addThreadManageLog($this->srv->user, $type, $this->srv->getData(), $this->_reason, '', true); return true; }
public function run() { if (1 == $this->ifShield) { $type = 'shield'; } else { $type = 'unshield'; } if ($this->pids) { Wind::import('SRV:forum.dm.PwReplyDm'); $topicDm = new PwReplyDm(true); $topicDm->setIfshield($this->ifShield); $this->_getThreadDs()->batchUpdatePost($this->pids, $topicDm); //回复的屏蔽处理:被站内置顶的回复也会在屏蔽范围内,排除 if (!$this->tids) { Wekit::load('log.srv.PwLogService')->addThreadManageLog($this->srv->user, $type, $this->threads['p'], $this->_reason, '', true); } } if ($this->tids) { Wind::import('SRV:forum.dm.PwTopicDm'); $topicDm = new PwTopicDm(true); $topicDm->setIfshield($this->ifShield); $this->_getThreadDs()->batchUpdateThread($this->tids, $topicDm, PwThread::FETCH_MAIN); //帖子的屏蔽处理 Wekit::load('log.srv.PwLogService')->addThreadManageLog($this->srv->user, $type, $this->threads['t'], $this->_reason); } }
public function run() { $dm = new PwTopicDm(true); $dm->addLastposttime(-$this->downtime)->setDowned($this->downed); Wekit::load('forum.PwThread')->batchUpdateThread($this->tids, $dm, PwThread::FETCH_MAIN); Wekit::load('log.srv.PwLogService')->addThreadManageLog($this->srv->user, 'down', $this->srv->getData(), $this->_reason, $this->downtime); }
/** * 复制帖子 | 复制特殊帖、附件等待做。。。 * * @param int $topictype * @return int */ public function run() { $threads = Wekit::load('forum.PwThread')->fetchThread($this->tids); $topicDm = new PwTopicDm(true); $topicDm->setTopictype($this->topictype)->setFid($this->fid); $this->_getThreadDs()->batchUpdateThread(array_keys($threads), $topicDm, PwThread::FETCH_MAIN); $this->_getAttachDs()->batchUpdateFidByTid($this->tids, $this->fid); $fids = array(); foreach ($threads as $t) { if ($t['fid'] == $this->fid) { continue; } $fids[$t['fid']]['thread'] -= 1; $fids[$t['fid']]['replies'] -= $t['replies']; $fids[$this->fid]['thread'] += 1; $fids[$this->fid]['replies'] += $t['replies']; } if ($fids) { foreach ($fids as $fid => $value) { Wekit::load('forum.srv.PwForumService')->updateStatistics($fid, $value['thread'], $value['replies']); } } if (!$this->forum->isOpen()) { Wekit::load('attention.PwFresh')->batchDeleteByType(PwFresh::TYPE_THREAD_TOPIC, $this->tids); //回复与新鲜事的关联 if ($data = Wekit::load('attention.PwFreshIndex')->fetchByTid($this->tids)) { Wekit::load('attention.PwFresh')->batchDelete(array_keys($data)); } } //管理日志添加 Wekit::load('log.srv.PwLogService')->addThreadManageLog($this->srv->user, 'move', $this->srv->getData(), $this->_reason, $this->fid . '|' . $this->topictype); }
public function run($ids) { Wind::import('SRV:forum.dm.PwTopicDm'); Wind::import('SRV:forum.dm.PwReplyDm'); $threadDs = Wekit::load('forum.PwThread'); $forumSrv = Wekit::load('forum.srv.PwForumService'); foreach ($this->tids as $tid => $value) { $dm1 = new PwReplyDm(true); $dm1->setTid($tid); $value['disabled'] != 2 && $dm1->setDisabled(0); $threadDs->batchUpdatePost($value['ids'], $dm1); $post = current(Wekit::load('forum.PwThread')->getPostByTid($tid, 1, 0, false)); $dm = new PwTopicDm($tid); $dm->addReplies($value['replies']); $post && $dm->setLastpost($post['created_userid'], $post['created_username'], $post['created_time']); $threadDs->updateThread($dm, PwThread::FETCH_MAIN); } foreach ($this->fids as $fid => $value) { $forumSrv->updateStatistics($fid, 0, $value); } foreach ($this->rpids as $rpid => $value) { $dm = new PwReplyDm($rpid); $dm->addReplies($value); $threadDs->updatePost($dm); } Wekit::load('recycle.PwReplyRecycle')->batchDelete($ids); }
public function run() { $topicDm = new PwTopicDm(true); $topicDm->setTopictype($this->topictype); $this->_getThreadDs()->batchUpdateThread($this->tids, $topicDm, PwThread::FETCH_MAIN); //管理日志添加 Wekit::load('log.srv.PwLogService')->addThreadManageLog($this->srv->user, 'type', $this->threadsInfo, $this->_reason, $this->topictype); }
public function run() { $topicDm = new PwTopicDm(true); $topicDm->setLastposttime($this->uptime); Wekit::load('forum.PwThread')->batchUpdateThread($this->tids, $topicDm, PwThread::FETCH_MAIN); //管理日志添加 Wekit::load('log.srv.PwLogService')->addThreadManageLog($this->srv->user, 'up', $this->srv->getData(), $this->_reason, $this->uptime); }
public function copyThread(PwTopicDm $topicDm, $newTid) { $special = $topicDm->getField('special'); if ($special != 1) { return; } return $this->copyPoll($topicDm->tid, $newTid); }
public function run($ids) { Wekit::load('forum.PwPostsTopped')->batchDeleteTopped($this->record); Wind::import('SRV:forum.dm.PwTopicDm'); $dm = new PwTopicDm(true); $dm->addReplyTopped(-1); Wekit::load('forum.PwThread')->batchUpdateThread($this->tids, $dm, PwThread::FETCH_MAIN); }
/** * * 忽略一个回复通知 * @param array $notice */ public function ignoreNotice($notice, $ignore = 1) { if (!$notice) { return false; } Wind::import('SRV:forum.dm.PwTopicDm'); $dm = new PwTopicDm($notice['param']); $dm->setReplyNotice($ignore ? 0 : 1); $this->_getThreadDs()->updateThread($dm); }
public function run() { if ($this->tids) { $topicDm = new PwTopicDm(true); $topicDm->setDigest($this->digest); Wekit::load('forum.PwThread')->batchUpdateThread($this->tids, $topicDm, PwThread::FETCH_MAIN); $this->_digest(); $this->_operateUser(); $this->_addManageLog(); } }
protected function run() { Wind::import('SRV:forum.dm.PwTopicDm'); $dm = new PwTopicDm(true); $dm->setDisabled(0); Wekit::load('forum.PwThread')->batchUpdateThread($this->tids, $dm, PwThread::FETCH_MAIN); foreach ($this->fids as $fid => $value) { Wekit::load('forum.srv.PwForumService')->updateStatistics($fid, $value, 0, $value); } return true; }
public function run($ids) { Wind::import('SRV:forum.dm.PwTopicDm'); $dm = new PwTopicDm(); $dm->setDisabled(2)->setTopped(0)->setDigest(0); Wekit::load('forum.PwThread')->batchUpdateThread($ids, $dm); Wind::import('SRV:forum.dm.PwReplyDm'); $dm = new PwReplyDm(); $dm->setDisabled(2); Wekit::load('forum.PwThread')->batchUpdatePostByTid($ids, $dm); Wekit::load('recycle.PwTopicRecycle')->batchAdd($this->record); }
public function run($ids) { $so = new PwThreadSo(); $so->setFid($this->srv->fid); $data = Wekit::load('forum.PwThread')->searchThread($so, 0); $tids = array_keys($data); $dm = new PwTopicDm(); $dm->setFid($this->srv->tofid); Wekit::load('forum.PwThread')->batchUpdateThread($tids, $dm, PwThread::FETCH_MAIN); $dm = new PwReplyDm(); $dm->setFid($this->srv->tofid); Wekit::load('forum.PwThread')->batchUpdatePostByTid($tids, $dm); }
public function run() { $thread = $this->_getThreadDs()->getThread($this->tid); list($lou) = explode("\t", $thread['inspect']); if ($this->lou > intval($lou) && $this->lou <= $thread['replies'] || !$thread['inspect']) { $inspect = $this->lou . "\t" . $this->username; Wind::import('SRV:forum.dm.PwTopicDm'); $topicDm = new PwTopicDm($thread['tid']); $topicDm->setInspect($inspect); $this->_getThreadDs()->updateThread($topicDm, PwThread::FETCH_MAIN); //管理日志入口 Wekit::load('log.srv.PwLogService')->addThreadManageLog($this->srv->user, 'readed', $this->srv->getData(), $this->_reason, $this->lou, true); } }
public function run($ids) { $service = Wekit::load('forum.PwThread'); $service->batchDeletePost($ids); foreach ($this->tids as $tid => $value) { $post = current($service->getPostByTid($tid, 1, 0, false)); $dm = new PwTopicDm($tid); $dm->addReplies(-$value); $dm->setLastpost($post['created_userid'], $post['created_username'], $post['created_time']); Wekit::load('forum.PwThread')->updateThread($dm, PwThread::FETCH_MAIN); } if ($this->recode) { Wekit::load('recycle.PwReplyRecycle')->batchDelete($this->recode); } }
private function deleteThread($topic) { $tid = $topic['tid']; $fid = $topic['fid']; $subject = $topic['subject']; $created_userid = $topic['created_userid']; $dm = new PwTopicRecycleDm(); $dm->setTid($tid)->setFid($fid)->setOperateTime(time())->setOperateUsername('system')->setReason('长期断种'); Wekit::load('recycle.PwTopicRecycle')->add($dm); $dm = new PwTopicDm($tid); $dm->setDisabled(2)->setTopped(0)->setDigest(0); Wekit::load('forum.PwThread')->updateThread($dm); $api = WindidApi::api('message'); $api->send($created_userid, '您的种子 ' . $subject . ' 因长期断种已被系统自动移入回收站,如有异议请尽快联系管理员,管理员将根据相关规定决定恢复或彻底删除。', 1); }
public function run() { $remind = $this->ifRemind ? $this->_buildRemind() : ''; if ($this->pids) { Wind::import('SRV:forum.dm.PwReplyDm'); $topicDm = new PwReplyDm(true); $topicDm->setManageRemind($remind); $this->_getThreadDs()->batchUpdatePost($this->pids, $topicDm); } if ($this->tids) { Wind::import('SRV:forum.dm.PwTopicDm'); $topicDm = new PwTopicDm(true); $topicDm->setManageRemind($remind); $this->_getThreadDs()->batchUpdateThread($this->tids, $topicDm, PwThread::FETCH_CONTENT); } }
public function run($ids) { Wind::import('SRV:forum.dm.PwReplyDm'); Wind::import('SRV:forum.dm.PwTopicDm'); $service = Wekit::load('forum.PwThread'); $dm = new PwReplyDm(); $dm->setDisabled(2)->setTid(0); $service->batchUpdatePost($ids, $dm); foreach ($this->tids as $tid => $value) { $post = current($service->getPostByTid($tid, 1, 0, false)); $dm = new PwTopicDm($tid); $dm->addReplies(-$value); $dm->setLastpost($post['created_userid'], $post['created_username'], $post['created_time']); Wekit::load('forum.PwThread')->updateThread($dm, PwThread::FETCH_MAIN); } Wekit::load('recycle.PwReplyRecycle')->batchAdd($this->record); }
public function copyThread(PwTopicDm $topicDm, $newTid) { $ifupload = $topicDm->getField('ifupload'); if (!$ifupload) { return; } $tid = $topicDm->tid; $this->attachs = $this->_getService()->getAttachByTid($tid, array(0)); if (!$this->attachs) { return; } foreach ($this->attachs as $v) { $dm = new PwThreadAttachDm(); $dm->setFid($v['fid'])->setTid($newTid)->setPid($v['pid'])->setWidth($v['width'])->setHeight($v['height'])->setSpecial($v['special'])->setCost($v['cost'])->setCtype($v['ctype'])->addHits($v['hits'])->setName($v['name'])->setType($v['type'])->setSize($v['size'])->setPath($v['path'])->setIfthumb($v['ifthumb'])->setCreatedUser($v['created_userid'])->setCreatedTime($v['created_time'])->setApp($v['app'])->setDescrip($v['descrip']); $this->_getService()->addAttach($dm); } }
/** * 复制帖子 | 复制特殊帖、附件等待做。。。 * * @param int $topictype * @return int */ public function run() { foreach ($this->threads as $v) { $topicDm = new PwTopicDm($v['tid']); $topicDm->setLastpost($v['lastpost_userid'], $v['lastpost_username'], $v['lastpost_time'])->setSpecial($v['special'])->setDigest($v['digest'])->setTopped($v['topped'])->setSpecialsort($v['special_sort'])->setTopictype($this->topictype)->setTpcstatus($v['tpcstatus'])->setHighlight($v['highlight'])->setOvertime($v['overtime'])->addHits($v['hits'])->setTitle($v['subject'])->setContent($v['content'])->setFid($this->fid)->setAuthor($v['created_userid'], $v['created_username'], $v['created_ip'])->setModifyInfo($v['modified_userid'], $v['modified_username'], $v['modified_ip'], $v['modified_time'])->setCreatedTime($v['created_time'])->setDisabled($v['disabled'])->setAids($v['aids'])->setIfupload($v['ifupload'])->setReplyNotice($v['reply_notice'])->setLikeCount($v['like_count'])->setSellCount($v['sell_count'])->addReplies($v['replies'])->addSellCount($v['sell_count'])->setReminds($v['reminds'])->setWordVersion($v['word_version'])->setTags($v['tags']); $tid = $this->_getThreadDs()->addThread($topicDm); if ($tid) { PwSimpleHook::getInstance('PwThreadManageDoCopy')->runDo($topicDm, $tid); $forumDm = new PwForumDm($this->fid); $forumDm->addThreads(1); $forumDm->addArticle(1); Wekit::load('SRV:forum.PwForum')->updateForum($forumDm); } } //管理日志添加 Wekit::load('log.srv.PwLogService')->addThreadManageLog($this->srv->user, 'copy', $this->threads, $this->_reason, $this->fid . '|' . $this->topictype); }
public function run() { $dm = new PwTopicDm(true); $type = ''; if ($this->locked == 2) { $dm->setClosed(1)->setLocked(0); $type = 'closed'; } elseif ($this->locked == 1) { $dm->setClosed(0)->setLocked(1); $type = 'lock'; } else { $dm->setClosed(0)->setLocked(0); $type = 'unlock'; } Wekit::load('forum.PwThread')->batchUpdateThread($this->tids, $dm, PwThread::FETCH_MAIN); Wekit::load('log.srv.PwLogService')->addThreadManageLog($this->srv->user, $type, $this->srv->getData(), $this->_reason); }
public function run() { $topicDm = new PwTopicDm(true); $topicDm->setHighlight($this->hightlight); $threadDs = Wekit::load('forum.PwThread'); $threadDs->batchUpdateThread($this->tids, $topicDm, PwThread::FETCH_MAIN); if ($this->overtime) { if ($this->overids) { $topicDm = new PwTopicDm(true); $topicDm->setOvertime($this->overtime); $threadDs->batchUpdateThread($this->overids, $topicDm, PwThread::FETCH_MAIN); } $this->_getOvertimeDs()->batchAdd($this->tids, 'highlight', $this->overtime); } else { $this->_getOvertimeDs()->batchDeleteByTidAndType($this->tids, 'highlight'); } //管理日志添加 Wekit::load('log.srv.PwLogService')->addThreadManageLog($this->srv->user, 'highlight', $this->srv->getData(), $this->_reason, $this->overtime ? $this->overtime : '永久'); }
public function run($ids) { $threadPollDs = Wekit::load('poll.PwThreadPoll'); /* @var $threadPollDs PwThreadPoll */ $pollThread = $threadPollDs->fetchPoll($this->record); if (!$pollThread) { return false; } $service = Wekit::load('poll.srv.PwPollService'); /* @var $service PwPollService */ foreach ($pollThread as $value) { $service->deletePoll($value['poll_id']); } $threadPollDs->batchDeletePoll($this->record); Wind::import('SRV:forum.dm.PwTopicDm'); $dm = new PwTopicDm(true); $dm->setSpecial(0); Wekit::load('forum.PwThread')->batchUpdateThread($this->record, $dm, PwThread::FETCH_MAIN); return true; }
public function updateOvertime($tid) { $overtimes = $this->_getOvertimeDs()->getOvertimeByTid($tid); $deltop = 0; $dm = new PwTopicDm($tid); if ($overtimes) { $timestamp = Pw::getTime(); $newOvertime = 0; $ids = array(); foreach ($overtimes as $v) { if ($v['overtime'] > $timestamp) { (!$newOvertime || $newOvertime > $v['overtime']) && ($newOvertime = $v['overtime']); } else { switch ($v['m_type']) { case 'topped': $dm->setTopped(0); $deltop = 1; break; case 'highlight': $dm->setHighlight(''); break; } $ids[] = $v['id']; } } $ids && $this->_getOvertimeDs()->batchDelete($ids); $dm->setOvertime($newOvertime); } else { $dm->setOvertime(0); } $this->_getThreadDs()->updateThread($dm); if ($deltop) { Wekit::load('forum.PwSpecialSort')->deleteSpecialSortByTid($tid); } }
protected function run() { Wind::import('SRV:forum.dm.PwReplyDm'); Wind::import('SRV:forum.dm.PwTopicDm'); $dm = new PwReplyDm(true); $dm->setDisabled(0); Wekit::load('forum.PwThread')->batchUpdatePost($this->pids, $dm); foreach ($this->tids as $tid => $value) { $post = current(Wekit::load('forum.PwThread')->getPostByTid($tid, 1, 0, false)); $dm = new PwTopicDm($tid); $dm->addReplies($value); $dm->setLastpost($post['created_userid'], $post['created_username'], $post['created_time']); Wekit::load('forum.PwThread')->updateThread($dm, PwThread::FETCH_MAIN); } foreach ($this->fids as $fid => $value) { Wekit::load('forum.srv.PwForumService')->updateStatistics($fid, 0, $value, $value); } foreach ($this->rpids as $rpid => $value) { $dm = new PwReplyDm($rpid); $dm->addReplies($value); Wekit::load('forum.PwThread')->updatePost($dm); } return true; }
/** * 批量更新帖子话题 * * @param int $typeId * @param int $paramId * @param array $dmArray */ public function updateTags($typeId, $paramId, $dmArray) { if (!$typeId || !$paramId) { return new PwError('data.error'); } $tagsInfo = $this->_getTagDs()->getTagRelationByType($typeId, $paramId); $this->_getTagDs()->batchDeleteRelationsByType($typeId, $paramId, array_keys($tagsInfo)); $dmArray && $this->addTags($dmArray); $types = $this->_getTypeMap(); $tags = $this->getTagByType($types[$typeId], $paramId); Wind::import('SRV:forum.dm.PwTopicDm'); $dm = new PwTopicDm($paramId); $dm->setTags($this->_formatTags($tags)); Wekit::load('forum.PwThread')->updateThread($dm, PwThread::FETCH_CONTENT); return true; }
/** * 编辑回复后续操作<更新版块、缓存等信息> */ public function afterPost() { if ($this->postDm->getIscheck() != $this->info['ischeck']) { $reply = $this->info['ischeck'] ? -1 : 1; Wekit::load('forum.srv.PwForumService')->updateStatistics($this->forum, 0, $reply, $reply); Wind::import('SRV:forum.dm.PwTopicDm'); $dm = new PwTopicDm($this->tid); $dm->addReplies($reply); $this->_getThreadService()->updateThread($dm, PwThread::FETCH_MAIN); if ($this->info['rpid']) { $dm = new PwReplyDm($this->info['rpid']); $dm->addReplies($reply); $this->_getThreadService()->updatePost($dm); } } //编辑非自己的帖子回复添加管理日志 if ($this->info['created_userid'] != $this->user->uid) { $thread = $this->info; $thread['subject'] = $this->postDm->getField('subject') ? $this->postDm->getField('subject') : $this->info['subject']; Wekit::load('log.srv.PwLogService')->addEditThreadLog($this->user, $thread, true); } }
public function doPassPostAction() { $pid = $this->getInput('pid'); if (empty($pid)) { $this->showError('operate.select'); } !is_array($pid) && ($pid = array($pid)); $fids = $tids = array(); $postdb = Wekit::load('forum.PwThread')->fetchPost($pid); foreach ($postdb as $key => $value) { $fids[$value['fid']]++; $tids[$value['tid']]++; } Wind::import('SRV:forum.dm.PwReplyDm'); Wind::import('SRV:forum.dm.PwTopicDm'); $dm = new PwReplyDm(true); $dm->setDisabled(0); Wekit::load('forum.PwThread')->batchUpdatePost($pid, $dm); foreach ($tids as $key => $value) { $post = current(Wekit::load('forum.PwThread')->getPostByTid($key, 1, 0, false)); $dm = new PwTopicDm($key); $dm->addReplies($value); $dm->setLastpost($post['created_userid'], $post['created_username'], $post['created_time']); Wekit::load('forum.PwThread')->updateThread($dm, PwThread::FETCH_MAIN); } foreach ($fids as $fid => $value) { Wekit::load('forum.srv.PwForumService')->updateStatistics($fid, 0, $value, $value); } $this->showMessage('success'); }
/** * 批量更新帖子 * * @param array $tids 帖子id * @param object $topicDm 帖子数据模型 * @param int $fetchmode 帖子资料 <必然为FETCH_*的一种或者组合> * @return mixed */ public function batchUpdateThread($tids, PwTopicDm $topicDm, $fetchmode = self::FETCH_ALL) { if (empty($tids)) { return false; } if (($result = $topicDm->beforeUpdate()) !== true) { return $result; } return $this->_getThreadDao($fetchmode)->batchUpdateThread($tids, $topicDm->getData(), $topicDm->getIncreaseData(), $topicDm->getBitData()); }