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


PHP EasyBlogRouter::isMenuABloggerMode方法代碼示例

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


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

示例1: _

 public static function _($url, $xhtml = true, $ssl = null, $search = false, $isCanonical = false)
 {
     $mainframe = JFactory::getApplication();
     $config = EasyBlogHelper::getConfig();
     static $loaded = array();
     static $eUri = array();
     $useXHTML = (int) $xhtml . (int) $isCanonical;
     if (isset($loaded[$url . $useXHTML])) {
         return $loaded[$url . $useXHTML];
     }
     $rawURL = $url;
     $blogger = JRequest::getVar('blogger', '');
     if (!empty($blogger)) {
         $url .= '&blogger=' . $blogger;
     }
     //$jURL	= JRoute::_($url, false);
     $jURL = $url;
     // convert the string to variable so that we can access it.
     parse_str($jURL, $post);
     $view = isset($post['view']) ? $post['view'] : 'latest';
     $Itemid = isset($post['Itemid']) ? $post['Itemid'] : '';
     $routingBehavior = $config->get('main_routing', 'currentactive');
     $exItemid = '';
     $findItemId = false;
     $dropSegment = false;
     if (($routingBehavior == 'currentactive' || $routingBehavior == 'menuitemid') && !$isCanonical) {
         $routingMenuItem = $config->get('main_routing_itemid', '');
         if ($routingBehavior == 'menuitemid' && $routingMenuItem != '') {
             $exItemid = $routingMenuItem;
         }
         // @rule: If there is already an item id, try to use the explicitly set one.
         if (empty($exItemid)) {
             if ($view == 'entry') {
                 $blogId = $post['id'];
                 $blog = EasyBlogHelper::getTable('Blog', 'Table');
                 $blog->load($blogId);
                 $author = $blog->created_by;
                 if (!empty($author)) {
                     $tmpItemid = EasyBlogRouter::getItemIdByBlogger($author);
                     if (!empty($tmpItemid)) {
                         $isBloggerMode = EasyBlogRouter::isMenuABloggerMode($tmpItemid);
                         if ($isBloggerMode) {
                             $exItemid = $tmpItemid;
                         }
                     }
                 }
             }
             // @rule: If it is not a blogger mode, we just use the current one.
             if (!$mainframe->isAdmin()) {
                 // Retrieve the active menu item.
                 $menu = JFactory::getApplication()->getMenu();
                 $item = $menu->getActive();
                 if (isset($item->id)) {
                     $isBloggerMode = EasyBlogRouter::isMenuABloggerMode($item->id);
                     if (!$isBloggerMode) {
                         $exItemid = $item->id;
                     }
                 }
             }
         }
     } else {
         switch ($view) {
             case 'entry':
                 $routingOrder = EasyBlogRouter::getDefaultRoutingOrder();
                 $exItemid = '';
                 if (!empty($routingOrder)) {
                     $blogId = $post['id'];
                     $blog = EasyBlogHelper::getTable('Blog', 'Table');
                     $blog->load($blogId);
                     $authorId = $blog->created_by;
                     $categoryId = $blog->category_id;
                     foreach ($routingOrder as $key => $val) {
                         switch ($key) {
                             case 'bloggerstandalone':
                                 $bloggerId = EasyBlogRouter::isBloggerMode();
                                 if ($bloggerId !== false) {
                                     $exItemid = EasyBlogRouter::getItemIdByBlogger($bloggerId);
                                 }
                                 break;
                             case 'entry':
                                 $exItemid = EasyBlogRouter::getItemIdByEntry($blogId);
                                 break;
                             case 'category':
                                 $exItemid = EasyBlogRouter::getItemIdByCategories($categoryId);
                                 break;
                             case 'blogger':
                                 $exItemid = EasyBlogRouter::getItemIdByBlogger($authorId);
                                 break;
                             case 'teamblog':
                                 $teamId = $blog->getTeamContributed();
                                 if (!empty($teamId)) {
                                     $exItemid = EasyBlogRouter::getItemIdByTeamBlog($teamId);
                                 }
                                 break;
                         }
                         if (!empty($exItemid)) {
                             break;
                         }
                     }
                 }
//.........這裏部分代碼省略.........
開發者ID:alexinteam,項目名稱:joomla3,代碼行數:101,代碼來源:router.php


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