/**
  * @see	\wcf\page\IPage::readData()
  */
 public function readData()
 {
     parent::readData();
     // stats
     if (LINKLIST_ENABLE_STATISTICS) {
         $this->stats = array_merge(StatsCacheBuilder::getInstance()->getData(), UserStatsCacheBuilder::getInstance()->getData());
     }
     // get categories
     $categoryTree = new LinklistCategoryNodeTree('de.incendium.linklist.category');
     $this->categoryList = $categoryTree->getIterator();
     $this->categoryList->setMaxDepth(0);
     // get featured entries
     $this->featuredEntryList = new AccessibleEntryList();
     $this->featuredEntryList->getConditionBuilder()->add('entry.isFeatured = ?', array(1));
     $this->featuredEntryList->sqlLimit = 10;
     $this->featuredEntryList->sqlOrderBy = 'RAND()';
     $this->featuredEntryList->readObjects();
     // remove default breadcrumb entry and set current page as 'website'
     if (WCF::isLandingPage()) {
         MetaTagHandler::getInstance()->addTag('og:url', 'og:url', LinkHandler::getInstance()->getLink('Linklist', array('application' => 'linklist')), 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);
     }
 }
 /**
  * @see	\wcf\page\IPage::readData()
  */
 public function readData()
 {
     parent::readData();
     // remove default breadcrumb entry and set current page as 'website'
     if (PageMenu::getInstance()->getLandingPage()->menuItem == 'ict.header.menu.tracker') {
         WCF::getBreadcrumbs()->remove(0);
         MetaTagHandler::getInstance()->addTag('og:url', 'og:url', LinkHandler::getInstance()->getLink('ProjectList', array('application' => 'ict')), 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);
     }
 }
 public function readData()
 {
     parent::readData();
     $categoryTree = new NewsCategoryNodeTree('de.codequake.cms.category.news');
     $this->categoryList = $categoryTree->getIterator();
     $this->categoryList->setMaxDepth(0);
     if (PageMenu::getInstance()->getLandingPage()->menuItem == 'cms.page.news') {
         WCF::getBreadcrumbs()->remove(0);
         MetaTagHandler::getInstance()->addTag('og:url', 'og:url', LinkHandler::getInstance()->getLink('NewsList', array('application' => 'cms')), 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', 'Fireball CMS');
     }
 }
示例#4
0
 /**
  * @see	\wcf\page\IPage::readData()
  */
 public function readData()
 {
     parent::readData();
     // add breadcrumbs
     if (MODULE_MEMBERS_LIST) {
         WCF::getBreadcrumbs()->add(new Breadcrumb(WCF::getLanguage()->get('wcf.user.members'), LinkHandler::getInstance()->getLink('MembersList')));
     }
     // get profile content
     if ($this->editOnInit) {
         // force 'about' tab as primary if editing profile
         UserProfileMenu::getInstance()->setActiveMenuItem('about');
     }
     $activeMenuItem = UserProfileMenu::getInstance()->getActiveMenuItem();
     $contentManager = $activeMenuItem->getContentManager();
     $this->profileContent = $contentManager->getContent($this->user->userID);
     $this->objectType = ObjectTypeCache::getInstance()->getObjectTypeByName('com.woltlab.wcf.user.profileEditableContent', 'com.woltlab.wcf.user.profileAbout');
     // get followers
     $this->followerList = new UserFollowerList();
     $this->followerList->getConditionBuilder()->add('user_follow.followUserID = ?', array($this->userID));
     $this->followerList->sqlLimit = 10;
     $this->followerList->readObjects();
     // get following
     $this->followingList = new UserFollowingList();
     $this->followingList->getConditionBuilder()->add('user_follow.userID = ?', array($this->userID));
     $this->followingList->sqlLimit = 10;
     $this->followingList->readObjects();
     // get visitors
     if (PROFILE_ENABLE_VISITORS) {
         $this->visitorList = new UserProfileVisitorList();
         $this->visitorList->getConditionBuilder()->add('user_profile_visitor.ownerID = ?', array($this->userID));
         $this->visitorList->sqlLimit = 10;
         $this->visitorList->readObjects();
     }
     MetaTagHandler::getInstance()->addTag('og:url', 'og:url', LinkHandler::getInstance()->getLink('User', array('object' => $this->user->getDecoratedObject(), 'appendSession' => false)), true);
     MetaTagHandler::getInstance()->addTag('og:type', 'og:type', 'profile', true);
     MetaTagHandler::getInstance()->addTag('profile:username', 'profile:username', $this->user->username, true);
     MetaTagHandler::getInstance()->addTag('og:title', 'og:title', $this->user->username . ' - ' . WCF::getLanguage()->get('wcf.user.members') . ' - ' . WCF::getLanguage()->get(PAGE_TITLE), true);
     MetaTagHandler::getInstance()->addTag('og:image', 'og:image', $this->user->getAvatar()->getURL(), true);
 }
 /**
  * @see	\wcf\page\IPage::readData()
  */
 public function readData()
 {
     parent::readData();
     // add breadcrumbs
     WCF::getBreadcrumbs()->add(new Breadcrumb(WCF::getLanguage()->get('cms.header.menu.news'), LinkHandler::getInstance()->getLink('NewsOverview', array('application' => 'cms'))));
     if ($this->entry->isArchived) {
         WCF::getBreadcrumbs()->add(new Breadcrumb(WCF::getLanguage()->get('cms.header.menu.news.archive'), LinkHandler::getInstance()->getLink('NewsArchive', array('application' => 'cms'))));
     }
     $categories = array();
     $leafCategories = $this->entry->getLeafCategories();
     $category = reset($leafCategories);
     while ($category !== null) {
         $categories[] = $category;
         $category = $category->getParentCategory();
     }
     foreach (array_reverse($categories) as $parentCategory) {
         WCF::getBreadcrumbs()->add($parentCategory->getBreadcrumb());
     }
     // update news view count
     $this->entry->updateVisits();
     // update news visit
     if ($this->entry->isNew()) {
         $entryAction = new EntryAction(array($this->entry->getDecoratedObject()), 'markAsRead', array('viewableEntry' => $this->entry));
         $entryAction->executeAction();
     }
     // fetch news likes
     if (MODULE_LIKE) {
         $objectType = LikeHandler::getInstance()->getObjectType('de.incendium.cms.like.likeableNews');
         LikeHandler::getInstance()->loadLikeObjects($objectType, array($this->entryID));
         $this->entryLikeData = LikeHandler::getInstance()->getLikeObjects($objectType);
     }
     // get news tags
     if (MODULE_TAGGING) {
         $this->tags = TagEngine::getInstance()->getObjectTags('de.incendium.cms.news.entry', $this->entry->entryID, array($this->entry->languageID === null ? LanguageFactory::getInstance()->getDefaultLanguageID() : ""));
     }
     // get news comments
     if ($this->commentManager === null) {
         $this->objectTypeID = CommentHandler::getInstance()->getObjectTypeID('de.incendium.cms.news.comment');
         $objectType = CommentHandler::getInstance()->getObjectType($this->objectTypeID);
         $this->commentManager = $objectType->getProcessor();
     }
     $this->commentList = CommentHandler::getInstance()->getCommentList($this->commentManager, $this->objectTypeID, $this->entryID);
     // more news from this category
     $this->moreEntryList = new AccessibleEntryList();
     $this->moreEntryList->getConditionBuilder()->add("news_entry.entryID IN (SELECT entryID FROM cms" . WCF_N . "_news_entry_to_category WHERE entryID != ? AND categoryID IN (?))", array($this->entryID, $this->entry->getCategoryIDs()));
     $this->moreEntryList->sqlLimit = CMS_DASHBOARD_SIDEBAR_NEWSENTRIES;
     $this->moreEntryList->readObjects();
     // meta tags
     MetaTagHandler::getInstance()->addTag('og:title', 'og:title', $this->entry->subject . ' - ' . WCF::getLanguage()->get(PAGE_TITLE), true);
     MetaTagHandler::getInstance()->addTag('og:url', 'og:url', LinkHandler::getInstance()->getLink('NewsEntry', array('application' => 'cms', 'object' => $this->entry)), true);
     MetaTagHandler::getInstance()->addTag('og:type', 'og:type', 'article', true);
     MetaTagHandler::getInstance()->addTag('og:description', 'og:description', StringUtil::decodeHTML(StringUtil::stripHTML($this->entry->getExcerpt())), true);
     // add tags as keywords
     if (!empty($this->tags)) {
         $keywords = '';
         foreach ($this->tags as $tag) {
             if (!empty($keywords)) {
                 $keywords .= ', ';
             }
             $keywords .= $tag->name;
         }
         MetaTagHandler::getInstance()->addTag('keywords', 'keywords', $keywords);
     }
     // quotes
     MessageQuoteManager::getInstance()->initObjects('de.incendium.cms.news.entry', array($this->entry->entryID));
 }
示例#6
0
 public function readData()
 {
     parent::readData();
     VisitCountHandler::getInstance()->count();
     WCF::getBreadcrumbs()->add(new Breadcrumb(WCF::getLanguage()->get('cms.page.news'), LinkHandler::getInstance()->getLink('NewsCategoryList', array('application' => 'cms'))));
     $this->commentObjectTypeID = CommentHandler::getInstance()->getObjectTypeID('de.codequake.cms.news.comment');
     $this->commentManager = CommentHandler::getInstance()->getObjectType($this->commentObjectTypeID)->getProcessor();
     $this->commentList = CommentHandler::getInstance()->getCommentList($this->commentManager, $this->commentObjectTypeID, $this->newsID);
     $newsEditor = new NewsEditor($this->news->getDecoratedObject());
     $newsEditor->update(array('clicks' => $this->news->clicks + 1));
     // get Tags
     if (MODULE_TAGGING) {
         $this->tags = $this->news->getTags();
     }
     if ($this->news->teaser != '') {
         MetaTagHandler::getInstance()->addTag('description', 'description', $this->news->teaser);
     } else {
         MetaTagHandler::getInstance()->addTag('description', 'description', StringUtil::decodeHTML(StringUtil::stripHTML($this->news->getExcerpt())));
     }
     if (!empty($this->tags)) {
         MetaTagHandler::getInstance()->addTag('keywords', 'keywords', implode(',', $this->tags));
     }
     MetaTagHandler::getInstance()->addTag('og:title', 'og:title', $this->news->subject . ' - ' . WCF::getLanguage()->get(PAGE_TITLE), true);
     MetaTagHandler::getInstance()->addTag('og:url', 'og:url', LinkHandler::getInstance()->getLink('News', array('application' => 'cms', 'object' => $this->news->getDecoratedObject())), true);
     MetaTagHandler::getInstance()->addTag('og:type', 'og:type', 'article', true);
     if ($this->news->getImage() != null) {
         MetaTagHandler::getInstance()->addTag('og:image', 'og:image', $this->news->getImage()->getLink(), true);
     }
     if ($this->news->getUserProfile()->facebook != '') {
         MetaTagHandler::getInstance()->addTag('article:author', 'article:author', 'https://facebook.com/' . $this->news->getUserProfile()->facebook, true);
     }
     if (FACEBOOK_PUBLIC_KEY != '') {
         MetaTagHandler::getInstance()->addTag('fb:app_id', 'fb:app_id', FACEBOOK_PUBLIC_KEY, true);
     }
     MetaTagHandler::getInstance()->addTag('og:description', 'og:description', StringUtil::decodeHTML(StringUtil::stripHTML($this->news->getExcerpt())), true);
     if ($this->news->isNew()) {
         $newsAction = new NewsAction(array($this->news->getDecoratedObject()), 'markAsRead', array('viewableNews' => $this->news));
         $newsAction->executeAction();
     }
     // fetch likes
     if (MODULE_LIKE) {
         $objectType = LikeHandler::getInstance()->getObjectType('de.codequake.cms.likeableNews');
         LikeHandler::getInstance()->loadLikeObjects($objectType, array($this->newsID));
         $this->likeData = LikeHandler::getInstance()->getLikeObjects($objectType);
     }
 }
 public function readData()
 {
     parent::readData();
     // update entry visit
     if ($this->entry->isNew()) {
         $entryAction = new EntryAction(array($this->entry->getDecoratedObject()), 'markAsRead', array('viewableEntry' => $this->entry));
         $entryAction->executeAction();
     }
     // get author's user profile
     $this->userProfile = $this->entry->getUserProfile();
     // get comments
     $this->commentObjectTypeID = CommentHandler::getInstance()->getObjectTypeID('de.incendium.linklist.entryComment');
     $this->commentManager = CommentHandler::getInstance()->getObjectType($this->commentObjectTypeID)->getProcessor();
     $this->commentList = CommentHandler::getInstance()->getCommentList($this->commentManager, $this->commentObjectTypeID, $this->entryID);
     // get other entries by this author
     $this->userEntryList = new AccessibleEntryList();
     $this->userEntryList->enableCategoryLoading(false);
     $this->userEntryList->getConditionBuilder()->add('entry.userID = ?', array($this->entry->userID));
     $this->userEntryList->getConditionBuilder()->add('entry.entryID <> ?', array($this->entry->entryID));
     $this->userEntryList->sqlLimit = 5;
     $this->userEntryList->readObjects();
     // get tags
     if (MODULE_TAGGING) {
         $this->tags = TagEngine::getInstance()->getObjectTags('de.incendium.linklist.entry', $this->entry->entryID, array($this->entry->languageID === null ? LanguageFactory::getInstance()->getDefaultLanguageID() : ""));
     }
     // fetch likes
     if (MODULE_LIKE) {
         $objectType = LikeHandler::getInstance()->getObjectType('de.incendium.linklist.likeableEntry');
         LikeHandler::getInstance()->loadLikeObjects($objectType, array($this->entryID));
         $this->entryLikeData = LikeHandler::getInstance()->getLikeObjects($objectType);
     }
     // add breadcrumbs
     $leafCategories = $this->entry->getLeafCategories();
     $category = reset($leafCategories);
     LINKLISTCore::getInstance()->setLocation($category->getParentCategories(), $category);
     MetaTagHandler::getInstance()->addTag('og:title', 'og:title', $this->entry->subject . ' - ' . WCF::getLanguage()->get(PAGE_TITLE), true);
     MetaTagHandler::getInstance()->addTag('og:url', 'og:url', LinkHandler::getInstance()->getLink('Entry', array('application' => 'linklist', 'object' => $this->entry)), true);
     MetaTagHandler::getInstance()->addTag('og:type', 'og:type', 'article', true);
     MetaTagHandler::getInstance()->addTag('og:description', 'og:description', $this->entry->teaser, true);
     // add tags as keywords
     if (!empty($this->tags)) {
         $keywords = '';
         foreach ($this->tags as $tag) {
             if (!empty($keywords)) {
                 $keywords .= ', ';
             }
             $keywords .= $tag->name;
         }
         MetaTagHandler::getInstance()->addTag('keywords', 'keywords', $keywords);
     }
 }
示例#8
0
 /**
  * @see	\wcf\page\IPage::readData()
  */
 public function readData()
 {
     parent::readData();
     // set active menu item
     CMSCore::setActiveMenuItem($this->page);
     // set breadcrumbs
     CMSCore::setBreadcrumbs($this->page);
     // change style
     if ($this->page->styleID && StyleHandler::getInstance()->getStyle()->styleID != $this->page->styleID) {
         StyleHandler::getInstance()->changeStyle($this->page->styleID, true);
     }
     // get contents
     $contents = $this->page->getContents();
     $this->contentNodeTree = $contents['body'];
     $this->sidebarNodeTree = $contents['sidebar'];
     // comments
     if ($this->page->isCommentable) {
         $this->commentObjectTypeID = CommentHandler::getInstance()->getObjectTypeID('de.codequake.cms.page.comment');
         $this->commentManager = CommentHandler::getInstance()->getObjectType($this->commentObjectTypeID)->getProcessor();
         $this->commentList = CommentHandler::getInstance()->getCommentList($this->commentManager, $this->commentObjectTypeID, $this->page->pageID);
     }
     // meta tags
     if ($this->page->metaKeywords !== '') {
         MetaTagHandler::getInstance()->addTag('keywords', 'keywords', WCF::getLanguage()->get($this->page->metaKeywords));
     }
     if ($this->page->metaDescription !== '') {
         MetaTagHandler::getInstance()->addTag('description', 'description', WCF::getLanguage()->get($this->page->metaDescription));
     }
     if ($this->page->metaDescription !== '') {
         MetaTagHandler::getInstance()->addTag('og:description', 'og:description', WCF::getLanguage()->get($this->page->metaDescription), true);
     }
     MetaTagHandler::getInstance()->addTag('generator', 'generator', 'Fireball CMS');
     MetaTagHandler::getInstance()->addTag('og:title', 'og:title', $this->page->getTitle() . ' - ' . WCF::getLanguage()->get(PAGE_TITLE), true);
     MetaTagHandler::getInstance()->addTag('og:url', 'og:url', $this->page->getLink(false), true);
     if (FACEBOOK_PUBLIC_KEY != '') {
         MetaTagHandler::getInstance()->addTag('fb:app_id', 'fb:app_id', FACEBOOK_PUBLIC_KEY, true);
     }
     MetaTagHandler::getInstance()->addTag('og:type', 'og:type', 'website', true);
 }
 /**
  * @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');
         }
     }
 }