Exemplo n.º 1
0
 /**
  *
  * @see XenForo_Route_Prefix_Forums::buildLink()
  */
 public function buildLink($originalPrefix, $outputPrefix, $action, $extension, $data, array &$extraParams)
 {
     if (is_array($data) && !empty($data['node_name'])) {
         return parent::buildLink($originalPrefix, $outputPrefix, $action, $extension, $data, $extraParams);
     } else {
         $action = XenForo_Link::getPageNumberAsAction($action, $extraParams);
         // for situations such as an array with thread and node info
         if (isset($data['node_title'])) {
             $data['title'] = $data['node_title'];
         }
         return ThemeHouse_ShorterRoutes_Link::buildShorterLinkWithIntegerParam('f', $action, $extension, $data, 'node_id', 'title');
     }
 }
Exemplo n.º 2
0
 /**
  *
  * @see XenForo_Route_Prefix_Forums::buildLink()
  */
 public function buildLink($originalPrefix, $outputPrefix, $action, $extension, $data, array &$extraParams)
 {
     $postHash = '';
     if ($action == 'post-permalink' && !empty($extraParams['post'])) {
         $post = $extraParams['post'];
         unset($extraParams['post']);
         if (!empty($post['post_id']) && isset($post['position'])) {
             if ($post['position'] > 0) {
                 $postHash = '#post-' . intval($post['post_id']);
                 $extraParams['page'] = floor($post['position'] / XenForo_Application::get('options')->messagesPerPage) + 1;
             }
         }
         $action = '';
     }
     $action = XenForo_Link::getPageNumberAsAction($action, $extraParams);
     return ThemeHouse_ShorterRoutes_Link::buildShorterLinkWithIntegerParam('t', $action, $extension, $data, 'thread_id', 'title') . $postHash;
 }