コード例 #1
0
 /**
  * @see	AbstractModule::readData()
  */
 public function readData()
 {
     parent::readData();
     // init sidebar factory
     $this->sidebarFactory = new MessageSidebarFactory($this);
     // read cache
     WCF::getCache()->addResource('newsItemsPageModule-' . $this->instanceID, WCF_DIR . 'cache/cache.newsItemsPageModule-' . $this->instanceID . '.php', WCF_DIR . 'lib/system/cache/CacheBuilderNewsPageModule.class.php');
     $this->newsItems = WCF::getCache()->get('newsItemsPageModule-' . $this->instanceID);
     // add items to sidebar factory
     foreach ($this->newsItems as $item) {
         $this->sidebarFactory->create($item);
     }
 }
コード例 #2
0
 /**
  * @see	Page::readData()
  */
 public function readData()
 {
     parent::readData();
     $sql = "SELECT\r\n\t\t\t    \t*\r\n\t\t\t\tFROM\r\n\t\t\t   \t\t`bash" . BASH_N . "_entry`" . (BASHCore::getUser()->isModerator() ? '' : 'WHERE `isDisabled` = 0 ') . "\r\n\t\t\t\tORDER BY\r\n\t\t\t    \ttimestamp DESC";
     $result = WCF::getDB()->sendQuery($sql, $this->itemsPerPage, ($this->pageNo - 1) * $this->itemsPerPage);
     while ($row = WCF::getDB()->fetchArray($result)) {
         $this->entries[] = new ViewableBashEntry(null, $row);
     }
     // init sidebars
     $this->sidebarFactory = new MessageSidebarFactory($this);
     foreach ($this->entries as $entry) {
         $this->sidebarFactory->create($entry);
     }
     $this->sidebarFactory->init();
 }
コード例 #3
0
 /**
  * @see Page::readData()
  */
 public function readData()
 {
     parent::readData();
     // get users online
     if (MODULE_USERS_ONLINE && THREAD_ENABLE_ONLINE_LIST) {
         $this->renderOnlineList();
     }
     // get posts
     $this->postList->offset = ($this->pageNo - 1) * $this->itemsPerPage;
     $this->postList->limit = $this->itemsPerPage;
     $this->postList->readPosts();
     $this->readSimilarThreads();
     // update thread visit
     if ($this->thread->isNew() && $this->postList->maxPostTime > $this->thread->lastVisitTime) {
         WCF::getUser()->setThreadVisitTime($this->threadID, $this->postList->maxPostTime);
     }
     // get marked posts
     $sessionVars = WCF::getSession()->getVars();
     if (isset($sessionVars['markedPosts'])) {
         $this->markedPosts = count($sessionVars['markedPosts']);
     }
     if (isset($sessionVars['markedThreads'])) {
         $this->markedThreads = count($sessionVars['markedThreads']);
     }
     if (isset($sessionVars['quotes'][$this->threadID])) {
         foreach ($sessionVars['quotes'][$this->threadID] as $postID => $postQuotes) {
             $this->quotes += count($postQuotes);
         }
     }
     // get tags
     if (MODULE_TAGGING && THREAD_ENABLE_TAGS) {
         $this->readTags();
     }
     // init sidebars
     $this->sidebarFactory = new MessageSidebarFactory($this);
     foreach ($this->postList->posts as $post) {
         $this->sidebarFactory->create($post);
     }
     $this->sidebarFactory->init();
     // update views
     if (!WCF::getSession()->spiderID) {
         $this->updateViews();
     }
 }
コード例 #4
0
 /**
  * @see Page::readData()
  */
 public function readData()
 {
     parent::readData();
     // calculates page number
     $this->calculateNumberOfPMPages();
     // get messages
     $this->pmList->sqlOffset = ($this->pmPageNo - 1) * $this->pmItemsPerPage;
     $this->pmList->sqlLimit = $this->pmItemsPerPage;
     $this->pmList->readObjects();
     // mark messages as read
     foreach ($this->pmList->getObjects() as $pm) {
         $pm->markAsRead();
     }
     // init sidebars
     $this->sidebarFactory = new MessageSidebarFactory($this);
     foreach ($this->pmList->getObjects() as $pm) {
         $this->sidebarFactory->create($pm);
     }
     $this->sidebarFactory->init();
     // get folders
     $this->loadMoveToOptions();
     // update folder id
     $this->updateFolderID();
 }