当前位置: 首页>>代码示例>>PHP>>正文


PHP EasyBlogRouter::getItemIdByTeamBlog方法代码示例

本文整理汇总了PHP中EasyBlogRouter::getItemIdByTeamBlog方法的典型用法代码示例。如果您正苦于以下问题:PHP EasyBlogRouter::getItemIdByTeamBlog方法的具体用法?PHP EasyBlogRouter::getItemIdByTeamBlog怎么用?PHP EasyBlogRouter::getItemIdByTeamBlog使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在EasyBlogRouter的用法示例。


在下文中一共展示了EasyBlogRouter::getItemIdByTeamBlog方法的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::getItemIdByTeamBlog方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。