當前位置: 首頁>>代碼示例>>PHP>>正文


PHP XenForo_Link::buildIntegerAndTitleUrlComponent方法代碼示例

本文整理匯總了PHP中XenForo_Link::buildIntegerAndTitleUrlComponent方法的典型用法代碼示例。如果您正苦於以下問題:PHP XenForo_Link::buildIntegerAndTitleUrlComponent方法的具體用法?PHP XenForo_Link::buildIntegerAndTitleUrlComponent怎麽用?PHP XenForo_Link::buildIntegerAndTitleUrlComponent使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在XenForo_Link的用法示例。


在下文中一共展示了XenForo_Link::buildIntegerAndTitleUrlComponent方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: buildLink

 /**
  * Method to build a link to the specified page/action with the provided
  * data and params.
  *
  * @see XenForo_Route_BuilderInterface
  */
 public function buildLink($originalPrefix, $outputPrefix, $action, $extension, $data, array &$extraParams)
 {
     // for situations such as an array with thread and node info
     if (isset($data['node_title'])) {
         $data['title'] = $data['node_title'];
     }
     if ($data && isset($data['node_id']) && $data['depth'] === 0) {
         if (!XenForo_Application::get('options')->categoryOwnPage) {
             return new XenForo_Link('#' . XenForo_Link::buildIntegerAndTitleUrlComponent($data['node_id'], $data['title'], true));
         }
     }
     return XenForo_Link::buildBasicLinkWithIntegerParam($outputPrefix, $action, $extension, $data, 'node_id', 'title');
 }
開發者ID:hahuunguyen,項目名稱:DTUI_201105,代碼行數:19,代碼來源:Categories.php

示例2: actionList

 public function actionList()
 {
     //########################################
     // list
     //########################################
     // get permission
     if (!XenForo_Visitor::getInstance()->hasPermission('bookmarkGroupID', 'bookmarkID')) {
         throw $this->getNoPermissionResponseException();
     }
     // get userId
     $userId = XenForo_Visitor::getUserId();
     // get options from Admin CP -> Options -> Bookmark -> Sort By
     $sortBy = XenForo_Application::get('options')->bookmarkSortBy;
     // get options from Admin CP -> Options -> Bookmark -> Sort Order
     $sortOrder = XenForo_Application::get('options')->bookmarkSortOrder;
     if ($sortBy == 'postDate') {
         $orderBy = 'xf_post.post_date';
     }
     if ($sortBy == 'bookmarkDate') {
         $orderBy = 'xf_bookmark.bookmark_id';
     }
     if ($sortOrder == 'desc') {
         $orderSort = ' DESC';
     }
     if ($sortOrder == 'asc') {
         $orderSort = ' ASC';
     }
     // get database
     $db = XenForo_Application::get('db');
     // run query
     $bookmarkResults = $db->fetchAll("\n\t\tSELECT xf_bookmark.bookmark_id,\n\t\txf_post.post_id,\n\t\txf_post.user_id,\n\t\txf_post.username,\n\t\txf_node.node_id AS forum_id,\n\t\txf_node.title AS forum_title,\n\t\txf_thread.title,\t\t\n\t\txf_post.post_date,\n\t\txf_bookmark.note\n\t\tFROM xf_bookmark\n\t\tINNER JOIN xf_post ON xf_post.post_id = xf_bookmark.post_id\n\t\tINNER JOIN xf_thread ON xf_thread.thread_id = xf_post.thread_id\n\t\tINNER JOIN xf_node ON xf_node.node_id = xf_thread.node_id\n\t\tWHERE xf_bookmark.user_id = " . $userId . "\n\t\tAND xf_post.message_state = 'visible'\n\t\tORDER BY " . $orderBy . $orderSort . "\n\t\t");
     // declare variable
     $i = 0;
     // get child node titles
     foreach ($bookmarkResults as $k => $v) {
         // includeTitleInUrls option
         $forum_link = XenForo_Link::buildIntegerAndTitleUrlComponent($v['forum_id'], $v['forum_title'], true);
         // merge arrays
         $bookmarkResults[$i] = array_merge($bookmarkResults[$i], array('forum_link' => $forum_link));
         // increment variable
         $i = $i + 1;
     }
     // prepare viewParams
     $viewParams = array('bookmarkResults' => $bookmarkResults);
     // send to template
     return $this->responseView('Andy_Bookmark_ViewPublic_Bookmark', 'andy_bookmark_list', $viewParams);
 }
開發者ID:Sywooch,項目名稱:forums,代碼行數:47,代碼來源:Bookmark.php


注:本文中的XenForo_Link::buildIntegerAndTitleUrlComponent方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。