public function readData() { parent::readData(); $this->news = new News($this->newsID); if (WCF::getSession()->getPermission('user.cms.news.canStartPoll') && MODULE_POLL) { PollManager::getInstance()->setObject('de.codequake.cms.news', $this->news->newsID, $this->news->pollID); } $time = $this->news->time; $dateTime = DateUtil::getDateTimeByTimestamp($time); $dateTime->setTimezone(WCF::getUser()->getTimeZone()); $this->time = $dateTime->format('c'); $this->subject = $this->news->subject; $this->teaser = $this->news->teaser; $this->text = $this->news->message; $this->enableBBCodes = $this->news->enableBBCodes; $this->enableHtml = $this->news->enableHtml; $this->enableSmilies = $this->news->enableSmilies; $this->imageID = $this->news->imageID; WCF::getBreadcrumbs()->add(new Breadcrumb($this->news->subject, LinkHandler::getInstance()->getLink('News', array('application' => 'cms', 'object' => $this->news)))); foreach ($this->news->getCategories() as $category) { $this->categoryIDs[] = $category->categoryID; } // tagging if (MODULE_TAGGING) { $tags = $this->news->getTags(); foreach ($tags as $tag) { $this->tags[] = $tag->name; } } }
public function readData() { parent::readData(); WCF::getBreadcrumbs()->add(new Breadcrumb(WCF::getLanguage()->get('cms.page.news'), LinkHandler::getInstance()->getLink('NewsCategoryList', array('application' => 'cms')))); $excludedCategoryIDs = array_diff(NewsCategory::getAccessibleCategoryIDs(), NewsCategory::getAccessibleCategoryIDs(array('canAddNews'))); $categoryTree = new NewsCategoryNodeTree('de.codequake.cms.category.news', 0, false, $excludedCategoryIDs); $this->categoryList = $categoryTree->getIterator(); $this->categoryList->setMaxDepth(0); if (empty($_POST)) { $dateTime = DateUtil::getDateTimeByTimestamp(TIME_NOW); $dateTime->setTimezone(WCF::getUser()->getTimeZone()); $this->time = $dateTime->format('c'); } else { $dateTime = DateUtil::getDateTimeByTimestamp(@strtotime($this->time)); $dateTime->setTimezone(WCF::getUser()->getTimeZone()); $this->time = $dateTime->format('c'); } // default values if (empty($_POST)) { $this->username = WCF::getSession()->getVar('username'); // 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); } } } }
/** * @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'))); } }
/** * @see \wcf\page\IPage::readData() */ public function readData() { parent::readData(); // remove default breadcrumb entry if (PageMenu::getInstance()->getLandingPage()->menuItem == 'wcf.user.dashboard') { WCF::getBreadcrumbs()->remove(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')))); // get categories $categoryTree = new NewsCategoryNodeTree('de.codequake.cms.category.news'); $this->categoryList = $categoryTree->getIterator(); $this->categoryList->setMaxDepth(0); }
/** * @see \wcf\page\IPage::readData() */ public function readData() { parent::readData(); $this->eventList = new ViewableUserActivityEventList(); $this->eventList->readObjects(); // add breadcrumbs if (MODULE_MEMBERS_LIST) { WCF::getBreadcrumbs()->add(new Breadcrumb(WCF::getLanguage()->get('wcf.user.members'), LinkHandler::getInstance()->getLink('MembersList'))); } }
/** * @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); } }
/** * Sets breadcrumbs for the given page. * * @param \cms\data\page\Page $page */ public static function setBreadcrumbs(Page $page) { if (PageMenu::getInstance()->getLandingPage()->getProcessor() instanceof CMSPageMenuItemProvider) { $pageID = PageMenu::getInstance()->getLandingPage()->getProcessor()->getPage()->pageID; } if (isset($pageID) && $pageID == $page->pageID) { WCF::getBreadcrumbs()->remove(0); } // add breadcrumbs foreach ($page->getParentPages() as $child) { WCF::getBreadcrumbs()->add($child->getBreadcrumb()); } }
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'); } }
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); } }
/** * Sets the breadcrumbs. * * @param \news\data\category\NewsCategory $category * @param \news\data\news\News $news */ public function setBreadcrumbs(array $parentCategories = array(), NewsCategory $category = null, News $news = null) { if (PageMenu::getInstance()->getLandingPage()->menuItem != 'news.header.menu.news') { WCF::getBreadcrumbs()->add(new Breadcrumb(WCF::getLanguage()->get('news.header.menu.news'), LinkHandler::getInstance()->getLink('NewsOverview', array('application' => 'news')))); } foreach ($parentCategories as $parentCategory) { WCF::getBreadcrumbs()->add($parentCategory->getBreadcrumb()); } if ($category !== null) { WCF::getBreadcrumbs()->add($category->getBreadcrumb()); } if ($news !== null) { if ($news->isArchived) { WCF::getBreadcrumbs()->add(new Breadcrumb(WCF::getLanguage()->get('news.header.menu.news.archive'), LinkHandler::getInstance()->getLink('NewsArchive', array('application' => 'news')))); } WCF::getBreadcrumbs()->add($news->getBreadcrumb()); } }
/** * @see \wcf\page\IPage::readData() */ public function readData() { parent::readData(); if ($this->filter != '') { // add breadcrumbs WCF::getBreadcrumbs()->add(new Breadcrumb(WCF::getLanguage()->get('wcf.conversation.conversations'), LinkHandler::getInstance()->getLink('ConversationList'))); } // read stats if (!$this->labelID) { switch ($this->filter) { case '': $this->conversationCount = $this->items; break; case 'draft': $this->draftCount = $this->items; break; case 'hidden': $this->hiddenCount = $this->items; break; case 'outbox': $this->outboxCount = $this->items; break; } } if ($this->filter != '' || $this->labelID) { $conversationList = new UserConversationList(WCF::getUser()->userID, ''); $this->conversationCount = $conversationList->countObjects(); } if ($this->filter != 'draft' || $this->labelID) { $conversationList = new UserConversationList(WCF::getUser()->userID, 'draft'); $this->draftCount = $conversationList->countObjects(); } if ($this->filter != 'hidden' || $this->labelID) { $conversationList = new UserConversationList(WCF::getUser()->userID, 'hidden'); $this->hiddenCount = $conversationList->countObjects(); } if ($this->filter != 'outbox' || $this->labelID) { $conversationList = new UserConversationList(WCF::getUser()->userID, 'outbox'); $this->outboxCount = $conversationList->countObjects(); } }
/** * @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'))); } // load locations foreach (ObjectTypeCache::getInstance()->getObjectTypes('com.woltlab.wcf.user.online.location') as $objectType) { $this->locations[$objectType->controller] = $objectType; } // cache data foreach ($this->objectList as $userOnline) { if (isset($this->locations[$userOnline->controller]) && $this->locations[$userOnline->controller]->getProcessor()) { $this->locations[$userOnline->controller]->getProcessor()->cache($userOnline); } } // set locations foreach ($this->objectList as $userOnline) { if (isset($this->locations[$userOnline->controller])) { if ($this->locations[$userOnline->controller]->getProcessor()) { $userOnline->setLocation($this->locations[$userOnline->controller]->getProcessor()->get($userOnline, $this->locations[$userOnline->controller]->languagevariable)); } else { $userOnline->setLocation(WCF::getLanguage()->get($this->locations[$userOnline->controller]->languagevariable)); } } } }
/** * @see \wcf\page\IPage::readData() */ public function readData() { parent::readData(); if (!count($_POST)) { $this->subject = $this->entry->subject; $this->text = $this->entry->message; $this->languageID = $this->entry->languageID; $this->tags = $this->entry->tags; $this->enableBBCodes = $this->entry->enableBBCodes; $this->enableHtml = $this->entry->enableHtml; $this->enableSmilies = $this->entry->enableSmilies; $this->isFeatured = $this->entry->isFeatured; if (!$this->entry->isPublished) { $this->enableDelayedPublication = 1; $dateTime = DateUtil::getDateTimeByTimestamp($this->entry->publicationDate); $dateTime->setTimezone(WCF::getUser()->getTimeZone()); $this->publicationDate = $dateTime->format('c'); } foreach ($this->entry->getCategories() as $category) { $this->categoryIDs[] = $category->categoryID; } // tagging if (MODULE_TAGGING) { $tags = TagEngine::getInstance()->getObjectTags('de.incendium.cms.news.entry', $this->entry->entryID, array($this->entry->languageID)); foreach ($tags as $tag) { $this->tags[] = $tag->name; } } } // add breadcrumbs if ($this->entry->isArchived) { WCF::getBreadcrumbs()->add(new Breadcrumb(WCF::getLanguage()->get('cms.header.menu.news.archive'), LinkHandler::getInstance()->getLink('NewsArchive', array('application' => 'cms')))); } WCF::getBreadcrumbs()->add($this->entry->getBreadcrumb()); }
/** * @see \wcf\page\IPage::readData() */ public function readData() { parent::readData(); if (!count($_POST)) { $this->subject = $this->news->subject; $this->text = $this->news->text; $this->teaser = $this->news->teaser; $this->languageID = $this->news->languageID; $this->pictureID = $this->news->pictureID; $this->tags = $this->news->tags; $this->enableBBCodes = $this->news->enableBBCodes; $this->enableHtml = $this->news->enableHtml; $this->enableSmilies = $this->news->enableSmilies; $this->editReason = $this->news->editReason; $this->editNoteSuppress = $this->news->editNoteSuppress; $this->isHot = $this->news->isHot; if (!$this->news->isPublished) { $this->enableDelayedPublication = 1; $dateTime = DateUtil::getDateTimeByTimestamp($this->news->publicationDate); $dateTime->setTimezone(WCF::getUser()->getTimeZone()); $this->publicationDate = $dateTime->format('c'); } if ($this->news->archivingDate) { $this->enableAutomaticArchiving = 1; $dateTime = DateUtil::getDateTimeByTimestamp($this->news->archivingDate); $dateTime->setTimezone(WCF::getUser()->getTimeZone()); $this->archivingDate = $dateTime->format('c'); } foreach ($this->news->getCategories() as $category) { $this->categoryIDs[] = $category->categoryID; } // tagging if (MODULE_TAGGING) { $tags = TagEngine::getInstance()->getObjectTags('de.voolia.news.entry', $this->news->newsID, array($this->news->languageID)); foreach ($tags as $tag) { $this->tags[] = $tag->name; } } // load sources if (NEWS_ENTRY_ENABLE_SOURCES) { foreach ($this->news->getSources() as $source) { $this->sources[] = array('sourceText' => $source->sourceText, 'sourceLink' => $source->sourceLink); } } } // get news picture if ($this->pictureID) { $this->picture = new NewsPicture($this->pictureID); } // add breadcrumbs WCF::getBreadcrumbs()->add($this->news->getBreadcrumb()); }
/** * @see \wcf\page\IPage::readData() */ public function readData() { parent::readData(); WCF::getBreadcrumbs()->add($this->user->getBreadcrumb()); }
/** * @see \wcf\page\IPage::readData() */ public function readData() { parent::readData(); if (empty($_POST)) { $this->assignedUserID = $this->queue->assignedUserID; } WCF::getBreadcrumbs()->add(new Breadcrumb(WCF::getLanguage()->get('wcf.moderation.moderation'), LinkHandler::getInstance()->getLink('ModerationList'))); $this->commentObjectTypeID = CommentHandler::getInstance()->getObjectTypeID('com.woltlab.wcf.moderation.queue'); $this->commentManager = CommentHandler::getInstance()->getObjectType($this->commentObjectTypeID)->getProcessor(); $this->commentList = CommentHandler::getInstance()->getCommentList($this->commentManager, $this->commentObjectTypeID, $this->queueID); // update queue visit if ($this->queue->isNew()) { $action = new ModerationQueueAction(array($this->queue->getDecoratedObject()), 'markAsRead', array('visitTime' => TIME_NOW)); $action->executeAction(); } }
/** * @see \wcf\page\IPage::readData() */ public function readData() { parent::readData(); // cache message data $this->cacheMessageData(); // get messages $this->readMessages(); // set active menu item if (isset($this->searchData['selectedObjectTypes']) && count($this->searchData['selectedObjectTypes']) == 1) { $objectType = SearchEngine::getInstance()->getObjectType(reset($this->searchData['selectedObjectTypes'])); if ($activeMenuItem = $objectType->getActiveMenuItem()) { PageMenu::getInstance()->setActiveMenuItem($activeMenuItem); } } // add breadcrumbs WCF::getBreadcrumbs()->add(new Breadcrumb(WCF::getLanguage()->get('wcf.search.title'), LinkHandler::getInstance()->getLink('Search'))); }
/** * @see \wcf\page\IPage::readData() */ public function readData() { parent::readData(); // get the accessible news categories $categoryTree = new NewsCategoryNodeTree('de.incendium.cms.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 WCF::getBreadcrumbs()->add(new Breadcrumb(WCF::getLanguage()->get('cms.header.menu.news'), LinkHandler::getInstance()->getLink('NewsOverview', array('application' => 'cms')))); }
/** * @see wcf\page\IPage::readData() */ public function readData() { MultipleLinkPage::readData(); WCF::getBreadcrumbs()->add(new Breadcrumb(WCF::getLanguage()->get('cms.header.menu.news'), LinkHandler::getInstance()->getLink('NewsOverview', array('application' => 'cms')))); }
/** * @see \wcf\page\IPage::readData() */ public function readData() { MessageForm::readData(); if (empty($_POST)) { $this->text = $this->message->message; if ($this->isFirstMessage) { $this->participantCanInvite = $this->conversation->participantCanInvite; $this->subject = $this->conversation->subject; if ($this->conversation->isDraft && $this->conversation->draftData) { $draftData = @unserialize($this->conversation->draftData); if (!empty($draftData['participants'])) { foreach (UserProfile::getUserProfiles($draftData['participants']) as $user) { if (!empty($this->participants)) { $this->participants .= ', '; } $this->participants .= $user->username; } } if (!empty($draftData['invisibleParticipants'])) { foreach (UserProfile::getUserProfiles($draftData['invisibleParticipants']) as $user) { if (!empty($this->invisibleParticipants)) { $this->invisibleParticipants .= ', '; } $this->invisibleParticipants .= $user->username; } } } } } // add breadcrumbs WCF::getBreadcrumbs()->add(new Breadcrumb(WCF::getLanguage()->get('wcf.conversation.conversations'), LinkHandler::getInstance()->getLink('ConversationList'))); WCF::getBreadcrumbs()->add($this->conversation->getBreadcrumb()); // get message list $this->messageList = new ViewableConversationMessageList(); $this->messageList->setConversation($this->conversation); $this->messageList->sqlLimit = CONVERSATION_REPLY_SHOW_MESSAGES_MAX; $this->messageList->sqlOrderBy = 'conversation_message.time DESC'; $this->messageList->getConditionBuilder()->add('conversation_message.conversationID = ?', array($this->message->conversationID)); $this->messageList->getConditionBuilder()->add("conversation_message.messageID <> ?", array($this->message->messageID)); $this->messageList->readObjects(); }
/** * @see \wcf\system\edit\IHistorySavingObject::addBreadcrumbs() */ public function addBreadcrumbs() { WCF::getBreadcrumbs()->add(new Breadcrumb(WCF::getLanguage()->get('cms.header.menu.news'), LinkHandler::getInstance()->getLink('NewsOverview', array('application' => 'cms')))); if ($this->getDecoratedObject()->isArchived) { WCF::getBreadcrumbs()->add(new Breadcrumb(WCF::getLanguage()->get('cms.header.menu.news.archive'), LinkHandler::getInstance()->getLink('NewsArchive', array('application' => 'cms')))); } foreach ($this->getDecoratedObject()->getCategories() as $parentCategory) { WCF::getBreadcrumbs()->add($parentCategory->getBreadcrumb()); } }
/** * @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.incendium.cms.news.comment')); // users online list if (MODULE_USERS_ONLINE && CMS_NEWS_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 WCF::getBreadcrumbs()->add(new Breadcrumb(WCF::getLanguage()->get('cms.header.menu.news'), LinkHandler::getInstance()->getLink('NewsOverview', array('application' => 'cms')))); if ($this->category !== null) { foreach ($this->category->getParentCategories() as $parentCategory) { WCF::getBreadcrumbs()->add($parentCategory->getBreadcrumb()); } } }
/** * @see \wcf\page\IPage::readData() */ public function readData() { parent::readData(); $this->readOptionTree(); // add breadcrumbs WCF::getBreadcrumbs()->add(new Breadcrumb(WCF::getLanguage()->get('wcf.user.members'), LinkHandler::getInstance()->getLink('MembersList'))); }
/** * @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')))); WCF::getBreadcrumbs()->add($this->entry->getDecoratedObject()->getBreadcrumb()); }
/** * @see \wcf\page\IPage::readData() */ public function readData() { parent::readData(); // add breadcrumbs WCF::getBreadcrumbs()->add(new Breadcrumb(WCF::getLanguage()->get('wcf.conversation.conversations'), LinkHandler::getInstance()->getLink('ConversationList'))); }
/** * @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)); }
/** * @see \wcf\page\IPage::readData() */ public function readData() { parent::readData(); if (empty($_POST)) { // check for quick reply message $this->text = QuickReplyManager::getInstance()->getMessage('conversation', $this->conversation->conversationID); if (empty($this->text)) { if (MessageQuoteManager::getInstance()->getQuoteMessageID()) { $message = new ConversationMessage(MessageQuoteManager::getInstance()->getQuoteMessageID()); if (!$message->messageID) { throw new IllegalLinkException(); } if ($message->conversationID == $this->conversation->conversationID) { $message->setConversation($this->conversation); $this->text = MessageQuoteManager::getInstance()->renderQuote($message, $message->message); } } if (empty($this->text)) { // get all message ids from current conversation $sql = "SELECT\tmessageID\n\t\t\t\t\t\tFROM\twcf" . WCF_N . "_conversation_message\n\t\t\t\t\t\tWHERE\tconversationID = ?"; $statement = WCF::getDB()->prepareStatement($sql); $statement->execute(array($this->conversation->conversationID)); $messageIDs = array(); while ($row = $statement->fetchArray()) { $messageIDs[] = $row['messageID']; } $renderedQuotes = MessageQuoteManager::getInstance()->getQuotesByObjectIDs('com.woltlab.wcf.conversation.message', $messageIDs); if (!empty($renderedQuotes)) { $this->text = implode("\n", $renderedQuotes); } } } } // add breadcrumbs WCF::getBreadcrumbs()->add(new Breadcrumb(WCF::getLanguage()->get('wcf.conversation.conversations'), LinkHandler::getInstance()->getLink('ConversationList'))); WCF::getBreadcrumbs()->add($this->conversation->getBreadcrumb()); // get message list $this->messageList = new ViewableConversationMessageList(); $this->messageList->setConversation($this->conversation); $this->messageList->sqlLimit = CONVERSATION_REPLY_SHOW_MESSAGES_MAX; $this->messageList->sqlOrderBy = 'conversation_message.time DESC'; $this->messageList->getConditionBuilder()->add('conversation_message.conversationID = ?', array($this->conversation->conversationID)); $this->messageList->readObjects(); }
/** * @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'); } } }