コード例 #1
0
 /**
  * @see	\wcf\page\IPage::readData()
  */
 public function readData()
 {
     parent::readData();
     // categories
     $categoryTree = new NewsCategoryNodeTree($this->objectTypeName);
     $this->categoryList = $categoryTree->getIterator();
     $this->categoryList->setMaxDepth(0);
     // stats
     $this->stats = NewsStatsCacheBuilder::getInstance()->getData();
     $this->stats['categories'] = count(CategoryHandler::getInstance()->getCategories($this->objectTypeName));
     $this->stats['comments'] = count(CommentHandler::getInstance()->getObjectType('de.voolia.news.comment'));
     // users online list
     if (MODULE_USERS_ONLINE && NEWS_INDEX_ENABLE_USERS_ONLINE_LIST) {
         $this->usersOnlineList = new UsersOnlineList();
         $this->usersOnlineList->readStats();
         $this->usersOnlineList->getConditionBuilder()->add('session.userID IS NOT NULL');
         $this->usersOnlineList->readObjects();
     }
     // add breadcrumbs
     NEWSCore::getInstance()->setBreadcrumbs($this->category !== null ? $this->category->getParentCategories() : array());
 }
 /**
  * @see	\wcf\system\event\IEventListener::execute()
  */
 public function execute($eventObj, $className, $eventName)
 {
     WCF::getTPL()->assign(array('newsStatsDashboardBox' => NewsStatsCacheBuilder::getInstance()->getData()));
 }
コード例 #3
0
 /**
  * @see	\wcf\data\IEditableCachedObject::resetCache()
  */
 public static function resetNewsStatsCache()
 {
     NewsStatsCacheBuilder::getInstance()->reset();
 }
コード例 #4
-1
 /**
  * @see	\wcf\page\IPage::readData()
  */
 public function readData()
 {
     parent::readData();
     // news stats
     $this->stats = NewsStatsCacheBuilder::getInstance()->getData();
     $this->stats['categories'] = count(CategoryHandler::getInstance()->getCategories('de.voolia.news.category'));
     // categories
     $categoryTree = new NewsCategoryNodeTree('de.voolia.news.category');
     $this->categoryList = $categoryTree->getIterator();
     $this->categoryList->setMaxDepth(0);
     // users online list
     if (MODULE_USERS_ONLINE && NEWS_INDEX_ENABLE_USERS_ONLINE_LIST) {
         $this->usersOnlineList = new UsersOnlineList();
         $this->usersOnlineList->readStats();
         $this->usersOnlineList->getConditionBuilder()->add('session.userID IS NOT NULL');
         $this->usersOnlineList->readObjects();
     }
     // add breadcrumbs
     if ($this->category !== null) {
         NEWSCore::getInstance()->setBreadcrumbs($this->category->getParentCategories());
     } else {
         if (PageMenu::getInstance()->getLandingPage()->menuItem == 'news.header.menu.news') {
             // remove default breadcrumb entry and set current page as 'website'
             WCF::getBreadcrumbs()->remove(0);
             // meta tags
             MetaTagHandler::getInstance()->addTag('og:url', 'og:url', LinkHandler::getInstance()->getLink('NewsOverview', array('application' => 'news')), true);
             MetaTagHandler::getInstance()->addTag('og:type', 'og:type', 'website', true);
             MetaTagHandler::getInstance()->addTag('og:title', 'og:title', WCF::getLanguage()->get(PAGE_TITLE), true);
             MetaTagHandler::getInstance()->addTag('og:description', 'og:description', WCF::getLanguage()->get(PAGE_DESCRIPTION), true);
             MetaTagHandler::getInstance()->addTag('generator', 'generator', 'voolia News-System');
         }
     }
 }