コード例 #1
0
 /**
  * Fills the $info parameter with a human readable article title and a URL that links directly to
  * a wall or forum post
  *
  * @param $info - Associative array to hold the result
  * @param $title - The article title of the wall/forum post
  * @param $ns - The namespace of the wall/forum post
  * @return bool - The status of the hook
  */
 public static function onFormatForumLinks(&$info, $title, $ns)
 {
     // Handle message wall and forum board links
     if (isset($ns) && in_array($ns, array(NS_USER_WALL_MESSAGE, NS_WIKIA_FORUM_BOARD_THREAD))) {
         // The method expects a DB result row. Set the data and then pass it as an object
         $row['page_namespace'] = $ns;
         $row['page_title'] = $title;
         $opts = WallHelper::getWallTitleData(null, (object) $row);
         // Set the human readable title and a link
         $info['titleText'] = $opts['articleTitleTxt'];
         $info['url'] = $opts['articleFullUrl'];
     }
     return true;
 }
コード例 #2
0
 public static function onFilePageImageUsageSingleLink(&$link, &$element)
 {
     if ($element->page_namespace == NS_WIKIA_FORUM_BOARD_THREAD) {
         $titleData = WallHelper::getWallTitleData(null, $element);
         $boardText = wfMessage('forum-wiki-activity-msg')->rawParams('<a href="' . $titleData['wallPageFullUrl'] . '">' . wfMessage('forum-wiki-activity-msg-name', $titleData['wallPageName'])->escaped() . '</a>')->escaped();
         $link = '<a href="' . $titleData['articleFullUrl'] . '">' . $titleData['articleTitleTxt'] . '</a> ' . $boardText;
     }
     return true;
 }