コード例 #1
0
 /**
  * @see	\wcf\system\sitemap\ISitemapProvider::getTemplate()
  */
 public function getTemplate()
 {
     // get all accessible news categories
     $categoryList = new NewsCategoryNodeTree('de.voolia.news.category');
     WCF::getTPL()->assign(array('categoryNodeList' => $categoryList->getIterator()));
     // init template
     return WCF::getTPL()->fetch('newsSitemap', 'news');
 }
コード例 #2
0
 /**
  * @see	\wcf\page\IPage::readData()
  */
 public function readData()
 {
     parent::readData();
     // get the accessible news categories
     $categoryTree = new NewsCategoryNodeTree('de.voolia.news.category');
     $this->categoryList = $categoryTree->getIterator();
     $this->categoryList->setMaxDepth(0);
     if (empty($_POST)) {
         // multilingualism
         if (!empty($this->availableContentLanguages)) {
             if (!$this->languageID) {
                 $language = LanguageFactory::getInstance()->getUserLanguage();
                 $this->languageID = $language->languageID;
             }
             if (!isset($this->availableContentLanguages[$this->languageID])) {
                 $languageIDs = array_keys($this->availableContentLanguages);
                 $this->languageID = array_shift($languageIDs);
             }
         }
         // set default publication and archivation date
         $dateTime = DateUtil::getDateTimeByTimestamp(TIME_NOW);
         $dateTime->setTimezone(WCF::getUser()->getTimeZone());
         $this->publicationDate = $this->archivingDate = $dateTime->format('c');
     }
     // add breadcrumbs
     NEWSCore::getInstance()->setBreadcrumbs();
 }
コード例 #3
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());
 }
コード例 #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');
         }
     }
 }