public function getBoardList($db = DB_SLAVE) { $boardTitles = $this->getListTitles($db, NS_WIKIA_FORUM_BOARD); $titlesBatch = new TitleBatch($boardTitles); $orderIndexes = $titlesBatch->getWikiaProperties(WPP_WALL_ORDER_INDEX, $db); $boards = array(); /** @var $title Title */ foreach ($boardTitles as $title) { /** @var $board ForumBoard */ $board = ForumBoard::newFromTitle($title); $title = $board->getTitle(); $id = $title->getArticleID(); $boardInfo = $board->getBoardInfo(); $boardInfo['id'] = $title->getArticleID(); $boardInfo['name'] = $title->getText(); $boardInfo['description'] = $board->getDescriptionWithoutTemplates(); $boardInfo['url'] = $title->getFullURL(); $orderIndex = $orderIndexes[$id]; $boards[$orderIndex] = $boardInfo; } krsort($boards); return $boards; }
public function header() { $forum = new Forum(); $this->response->setVal('threads', $forum->getTotalThreads()); $this->response->setVal('activeThreads', $forum->getTotalActiveThreads()); $title = $this->wg->Title; $pageHeading = wfMessage('forum-specialpage-heading')->escaped(); $pageDescription = ''; $this->showStats = true; $nameSpace = $title->getNamespace(); if ($nameSpace === NS_WIKIA_FORUM_BOARD) { $this->showStats = false; $pageHeading = wfMessage('forum-board-title', $title->getText())->escaped(); $board = ForumBoard::newFromTitle($title); $pageDescription = $board->getDescription(); } else { if ($nameSpace === NS_USER_WALL_MESSAGE) { $this->showStats = false; $messageKey = $title->getText(); $message = WallMessage::newFromId($messageKey); if (!empty($message)) { $message->load(); $pageHeading = $message->getMetaTitle(); } } } $this->pageHeading = $pageHeading; $this->pageDescription = $pageDescription; }