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


PHP EasyBlogRouter::getItemId方法代码示例

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


在下文中一共展示了EasyBlogRouter::getItemId方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getItemId

 public function getItemId()
 {
     $id = '';
     $app = JFactory::getApplication();
     if ($app->isAdmin()) {
         $id = '&Itemid=' . EasyBlogRouter::getItemId('latest');
     }
     return $id;
 }
开发者ID:Tommar,项目名称:vino2,代码行数:9,代码来源:mightytouch.php

示例2: getUnsubscribeLink

 public static function getUnsubscribeLink($subdata, $external = false, $isAllType = false, $email = '')
 {
     $easyblogItemId = EasyBlogRouter::getItemId('latest');
     if ($isAllType && $email) {
         $types = array();
         $ids = array();
         $created = array();
         foreach ($subdata as $type => $id) {
             $types[] = $type;
             $tmpId = explode('|', $id);
             $ids[] = $tmpId[0];
             $created[] = $tmpId[1];
         }
         $stype = implode(',', $types);
         $sid = implode(',', $ids);
         $screated = implode(',', $created);
         $unsubdata = base64_encode("type=" . $stype . "\r\nsid=" . $sid . "\r\nuid=" . $email . "\r\ntoken=" . $screated);
     } else {
         $unsubdata = base64_encode("type=" . $subdata->type . "\r\nsid=" . $subdata->id . "\r\nuid=" . $subdata->user_id . "\r\ntoken=" . md5($subdata->id . $subdata->created));
     }
     return EasyBlogRouter::getRoutedURL('index.php?option=com_easyblog&task=subscription.unsubscribe&data=' . $unsubdata . '&Itemid=' . $easyblogItemId, false, $external);
 }
开发者ID:knigherrant,项目名称:decopatio,代码行数:22,代码来源:easyblog.php

示例3:

			</li>
			<li>
				<a href="<?php 
        echo EasyBlogRouter::_('index.php?option=com_easyblog&view=dashboard&layout=entries&Itemid=' . EasyBlogRouter::getItemId('dashboard'));
        ?>
">
					<i class="ies-newspaper ies-small"></i>
					<span><?php 
        echo JText::_('MOD_EASYSOCIAL_MENU_EASYBLOG_POSTS');
        ?>
</span>
				</a>
			</li>
			<li>
				<a href="<?php 
        echo EasyBlogRouter::_('index.php?option=com_easyblog&view=dashboard&layout=drafts&Itemid=' . EasyBlogRouter::getItemId('dashboard'));
        ?>
">
					<i class="ies-upload-5 ies-small"></i>
					<span><?php 
        echo JText::_('MOD_EASYSOCIAL_MENU_EASYBLOG_DRAFTS');
        ?>
</span>
				</a>
			</li>
			<?php 
    }
    ?>

			<?php 
    if ($params->get('show_signout', true)) {
开发者ID:ppantilla,项目名称:bbninja,代码行数:31,代码来源:default.php

示例4: getUnsubscribeLink

 public static function getUnsubscribeLink($subdata, $external = false)
 {
     $easyblogItemId = EasyBlogRouter::getItemId('latest');
     $unsubdata = base64_encode("type=" . $subdata->type . "\r\nsid=" . $subdata->id . "\r\nuid=" . $subdata->user_id . "\r\ntoken=" . md5($subdata->id . $subdata->created));
     return EasyBlogRouter::getRoutedURL('index.php?option=com_easyblog&controller=subscription&task=unsubscribe&data=' . $unsubdata . '&Itemid=' . $easyblogItemId, false, $external);
 }
开发者ID:Tommar,项目名称:vino2,代码行数:6,代码来源:helper.php

示例5: shAddToGETVarsList

                break;
            case 'categories':
                $idname = EasyBlogRouter::getCategoryPermalink($id);
                break;
            case 'tags':
                $idname = EasyBlogRouter::getTagPermalink($id);
                break;
            case 'teamblog':
                $idname = EasyBlogRouter::getTeamBlogPermalink($id);
                break;
            default:
                $idname = '';
        }
    }
    if (empty($Itemid)) {
        $Itemid = EasyBlogRouter::getItemId($view);
        shAddToGETVarsList('Itemid', $Itemid);
    }
}
$easyblogName = shGetComponentPrefix($option);
$easyblogName = empty($easyblogName) ? getMenuTitle($option, $task, $Itemid, null, $shLangName) : $easyblogName;
$easyblogName = empty($easyblogName) || $easyblogName == '/' ? 'EasyBlog' : $easyblogName;
$title[] = $easyblogName;
$validViews = array('archive', 'blogger', 'categories', 'dashboard', 'entry', 'featured', 'images', 'latest', 'login', 'myblog', 'ratings', 'search', 'subscription', 'tags', 'teamblog', 'trackback');
$add_idname = true;
if (isset($view) && $view == 'entry') {
    unset($view);
    shRemoveFromGETVarsList('view');
}
if (isset($view)) {
    if ($config->get('main_sef') != 'simple' || $view != 'entry') {
开发者ID:Tommar,项目名称:vino2,代码行数:31,代码来源:com_easyblog.php

示例6: getEntryRoute

 public static function getEntryRoute($id)
 {
     $url = 'index.php?option=com_easyblog&view=entry&id=' . $id;
     $url .= '&Itemid=' . EasyBlogRouter::getItemId('entry');
     return $url;
 }
开发者ID:alexinteam,项目名称:joomla3,代码行数:6,代码来源:router.php

示例7: revert

 /**
  * Reverts to the query string out of the SEF Advance URL
  * Input:
  *    $url_array, array, The SEF Advance URL split in arrays
  *    $pos, int, The position offset for virtual directories (first virtual directory, which is the component name, begins at $pos+1)
  * Output: $QUERY_STRING, string, query string (var1=$var1&var2=$var2)
  *    Note that this will be added to already defined first part (option=com_example&Itemid=$Itemid)
  **/
 function revert($url_array, $pos)
 {
     require_once JPATH_ROOT . DIRECTORY_SEPARATOR . 'components' . DIRECTORY_SEPARATOR . 'com_easyblog' . DIRECTORY_SEPARATOR . 'helpers' . DIRECTORY_SEPARATOR . 'helper.php';
     $config = EasyBlogHelper::getConfig();
     $seftype = $config->get('main_sef', 'default');
     global $database;
     if (empty($database)) {
         // Joomla! 1.5 native
         $database = EasyBlogHelper::db();
     }
     $QUERY_STRING = '';
     $view = '';
     $totalSegment = count(array_filter($url_array)) - $pos;
     // If user chooses to use the simple sef setup, we need to add the proper view
     if ($config->get('main_sef') == 'simple' && $totalSegment == 2) {
         $views = JFolder::folders(JPATH_ROOT . DIRECTORY_SEPARATOR . 'components' . DIRECTORY_SEPARATOR . 'com_easyblog' . DIRECTORY_SEPARATOR . 'views');
         if (!in_array($url_array[$pos + 2], $views)) {
             array_splice($url_array, $pos + 2, 0, 'entry');
         }
     }
     // We need to remove limitstart from the result
     foreach ($url_array as $index => $field) {
         if (preg_match('/limitstart-/i', $field)) {
             $temp = explode('limitstart-', $field);
             $temp = explode('&', $temp[1]);
             $limitstart = $temp[0];
             $_GET['limitstart'] = $_REQUEST['limitstart'] = $limitstart;
             $QUERY_STRING .= '&limitstart=' . $limitstart;
             unset($url_array[$index]);
         }
     }
     if (isset($url_array[$pos + 2]) && $url_array[$pos + 2] != '') {
         // .../mydir/$category/
         $view = sefdecode($url_array[$pos + 2]);
         $_GET['view'] = $_REQUEST['view'] = $view;
         $QUERY_STRING .= "&view={$view}";
         if (!empty($view) && file_exists(JPATH_ROOT . DIRECTORY_SEPARATOR . 'components' . DIRECTORY_SEPARATOR . 'com_easyblog' . DIRECTORY_SEPARATOR . 'helpers' . DIRECTORY_SEPARATOR . 'router.php')) {
             require_once JPATH_ROOT . DIRECTORY_SEPARATOR . 'components' . DIRECTORY_SEPARATOR . 'com_easyblog' . DIRECTORY_SEPARATOR . 'helpers' . DIRECTORY_SEPARATOR . 'helper.php';
             require_once JPATH_ROOT . DIRECTORY_SEPARATOR . 'components' . DIRECTORY_SEPARATOR . 'com_easyblog' . DIRECTORY_SEPARATOR . 'helpers' . DIRECTORY_SEPARATOR . 'router.php';
             $Itemid = EasyBlogRouter::getItemId($view);
         } else {
             $Itemid = '';
         }
     }
     switch ($view) {
         case 'entry':
             if ($seftype == 'date') {
                 $sector = 6;
             } elseif ($seftype == 'category') {
                 $sector = 4;
             } elseif ($seftype == 'datecategory') {
                 $sector = 7;
             } else {
                 $sector = 3;
             }
             if (!empty($url_array[$pos + $sector])) {
                 $entryId = '';
                 if ($config->get('main_sef_unicode')) {
                     // perform manual split on the string.
                     $permalinkSegment = $url_array[$pos + $sector];
                     $permalinkArr = explode(':', $permalinkSegment);
                     $id = $permalinkArr[0];
                 } else {
                     $id = $this->revertPermalink($url_array[$pos + $sector], 'blog');
                 }
                 $_GET['id'] = $_REQUEST['id'] = $id;
                 $QUERY_STRING .= "&id=" . $id;
             }
             break;
         case 'blogger':
             if (!empty($url_array[$pos + 4]) && $url_array[$pos + 4] == 'statistic') {
                 $_GET['layout'] = $_REQUEST['layout'] = 'statistic';
                 $QUERY_STRING .= "&layout=statistic";
                 if (!empty($url_array[$pos + 3])) {
                     if ($config->get('main_sef_unicode')) {
                         // perform manual split on the string.
                         $permalinkSegment = $url_array[$pos + 3];
                         $permalinkArr = explode(':', $permalinkSegment);
                         $id = $permalinkArr[0];
                     } else {
                         $id = $this->revertPermalink($url_array[$pos + 3], 'blogger');
                     }
                     $_GET['id'] = $_REQUEST['id'] = $id;
                     $QUERY_STRING .= "&id=" . $id;
                 }
                 if (!empty($url_array[$pos + 5])) {
                     $stat = sefdecode($url_array[$pos + 5]);
                     $_GET['stat'] = $_REQUEST['stat'] = $stat;
                     $QUERY_STRING .= "&stat=" . $stat;
                 }
                 if (!empty($url_array[$pos + 6]) && !empty($stat)) {
                     switch ($stat) {
//.........这里部分代码省略.........
开发者ID:alexinteam,项目名称:joomla3,代码行数:101,代码来源:sef_ext.php

示例8: addStreamJomsocial

 private function addStreamJomsocial($blog, $isNew, $uid, $source)
 {
     $jsCoreFile = JPATH_ROOT . DIRECTORY_SEPARATOR . 'components' . DIRECTORY_SEPARATOR . 'com_community' . DIRECTORY_SEPARATOR . 'libraries' . DIRECTORY_SEPARATOR . 'core.php';
     $config = EasyBlogHelper::getConfig();
     // Somehow the blog contribution is in an array.
     $uid = $uid[0];
     JFactory::getLanguage()->load('com_easyblog', JPATH_ROOT);
     if (!JFile::exists($jsCoreFile)) {
         return false;
     }
     require_once $jsCoreFile;
     $app = JFactory::getApplication();
     $title = JString::substr($blog->title, 0, 30) . '...';
     $easyBlogItemid = '';
     if ($app->isAdmin()) {
         $easyBlogItemid = EasyBlogRouter::getItemId('latest');
         $easyBlogItemid = '&Itemid=' . $easyBlogItemid;
     }
     $blogLink = EasyBlogRouter::getRoutedURL('index.php?option=com_easyblog&view=entry&id=' . $blog->id . $easyBlogItemid, false, true);
     $my = JFactory::getUser();
     $blogContent = $blog->intro . $blog->content;
     $blogContent = EasyBlogHelper::getHelper('Videos')->strip($blogContent);
     $pattern = '#<img[^>]*>#i';
     preg_match($pattern, $blogContent, $matches);
     // Remove all html tags from the content as we want to chop it down.
     $blogContent = strip_tags($blogContent);
     if (JString::strlen($blogContent) > $config->get('integrations_jomsocial_blogs_length', 250)) {
         $blogContent = JString::substr($blogContent, 0, $config->get('integrations_jomsocial_blogs_length', 250)) . ' ...';
     }
     if ($matches) {
         $matches[0] = JString::str_ireplace('img ', 'img style="margin: 0 5px 5px 0;float: left; height: auto; width: 120px !important;"', $matches[0]);
         $blogContent = $matches[0] . $blogContent . '<div style="clear: both;"></div>';
     }
     $blogContent .= '<div style="text-align: right;"><a href="' . $blogLink . '">' . JText::_('COM_EASYBLOG_CONTINUE_READING') . '</a></div>';
     $eventLink = CRoute::_('index.php?option=com_community&view=events&task=viewevent&eventid=' . $uid);
     JTable::addIncludePath(JPATH_ROOT . DIRECTORY_SEPARATOR . 'components' . DIRECTORY_SEPARATOR . 'com_community' . DIRECTORY_SEPARATOR . 'tables');
     $event = JTable::getInstance('Event', 'CTable');
     $event->load($uid);
     $title = JText::sprintf('COM_EASYBLOG_JS_ACTIVITY_EVENT_BLOG_ADDED', $blogLink, $title, $eventLink, $event->title);
     $obj = new stdClass();
     $obj->title = $title;
     $obj->content = $blogContent;
     $obj->cmd = 'event.blog.added';
     if ($config->get('integrations_jomsocial_activity_likes')) {
         $obj->like_id = $blog->id;
         $obj->like_type = 'com_easyblog';
     }
     if ($config->get('integrations_jomsocial_activity_comments')) {
         $obj->comment_id = $blog->id;
         $obj->comment_type = 'com_easyblog';
     }
     $obj->actor = $my->id;
     $obj->target = $uid;
     $obj->app = 'easyblog';
     $obj->cid = $uid;
     $obj->eventid = $uid;
     // add JomSocial activities
     CFactory::load('libraries', 'activities');
     CActivityStream::add($obj);
 }
开发者ID:Tommar,项目名称:vino2,代码行数:60,代码来源:event.php

示例9: EasyBlogBuildRoute


//.........这里部分代码省略.........
            }
        } else {
            $segments[] = EasyBlogRouter::getTeamBlogPermalink($query['id']);
        }
        unset($query['id']);
        unset($query['stat']);
        unset($query['layout']);
        unset($query['view']);
    }
    if (isset($query['view']) && $query['view'] == 'blogger' && isset($query['id'])) {
        $segments[] = EasyBlogSEFTranslation::_($query['view']);
        if (isset($query['layout'])) {
            if ($query['layout'] == "statistic") {
                $segments[] = EasyBlogRouter::getBloggerPermalink($query['id']);
                $segments[] = EasyBlogSEFTranslation::_($query['layout']);
                $segments[] = $query['stat'];
                if ($query['stat'] == 'category') {
                    $segments[] = EasyBlogRouter::getCategoryPermalink($query['catid']);
                    unset($query['catid']);
                }
                if ($query['stat'] == 'tag') {
                    $segments[] = EasyBlogRouter::getTagPermalink($query['tagid']);
                    unset($query['tagid']);
                }
            } else {
                $segments[] = EasyBlogSEFTranslation::_($query['layout']);
                $segments[] = EasyBlogRouter::getBloggerPermalink($query['id']);
            }
        } else {
            $segments[] = EasyBlogRouter::getBloggerPermalink($query['id']);
        }
        unset($query['id']);
        unset($query['stat']);
        unset($query['view']);
        unset($query['layout']);
    }
    if (isset($query['view']) && $query['view'] == 'dashboard' && isset($query['layout'])) {
        $segments[] = EasyBlogSEFTranslation::_($query['view']);
        $segments[] = EasyBlogSEFTranslation::_($query['layout']);
        if (isset($query['filter'])) {
            $segments[] = $query['filter'];
            unset($query['filter']);
        }
        if (isset($query['postType'])) {
            $segments[] = $query['postType'];
            unset($query['postType']);
        }
        unset($query['view']);
        unset($query['layout']);
    }
    /**
     * Route for archive links
     **/
    if (isset($query['view']) && $query['view'] == 'archive') {
        $segments[] = EasyBlogSEFTranslation::_($query['view']);
        unset($query['view']);
        if (isset($query['layout'])) {
            $segments[] = $query['layout'];
            unset($query['layout']);
        }
        if (isset($query['archiveyear'])) {
            $segments[] = $query['archiveyear'];
            unset($query['archiveyear']);
        }
        if (isset($query['archivemonth'])) {
            $segments[] = $query['archivemonth'];
            unset($query['archivemonth']);
        }
        if (isset($query['archiveday'])) {
            $segments[] = $query['archiveday'];
            unset($query['archiveday']);
        }
    }
    if (isset($query['view']) && $query['view'] == 'search') {
        $segments[] = EasyBlogSEFTranslation::_($query['view']);
        unset($query['view']);
        if (isset($query['layout'])) {
            $segments[] = $query['layout'];
            unset($query['layout']);
        }
        if (isset($query['query'])) {
            $segments[] = $query['query'];
            unset($query['query']);
        }
    }
    if (isset($query['view']) && $query['view'] != 'images') {
        $segments[] = EasyBlogSEFTranslation::_($query['view']);
        unset($query['view']);
    }
    if (isset($query['type'])) {
        if (!isset($query['format']) && !isset($query['controller'])) {
            $segments[] = $query['type'];
            unset($query['type']);
        }
    }
    if (!isset($query['Itemid'])) {
        $query['Itemid'] = EasyBlogRouter::getItemId();
    }
    return $segments;
}
开发者ID:alexinteam,项目名称:joomla3,代码行数:101,代码来源:router.php

示例10:

                	<?php 
        }
        ?>
                <?php 
    }
    ?>
				</button>

    		<?php 
}
?>
        </div>

        <span class="has-tooltip">
			<a href="javascript:void(0)" onclick="eblog.dashboard.preview('<?php 
echo EasyBlogRouter::getItemId('entry');
?>
');return false;" class="buttons for-preview as-icon">
				<i><?php 
echo JText::_('COM_EASYBLOG_ENTRY_PREVIEW_BUTTON');
?>
</i>
			</a>
			<div class="tip-item">
				<i></i>
				<div>
					<b><?php 
echo JText::_('COM_EASYBLOG_ENTRY_PREVIEW_BUTTON');
?>
</b>
					<?php 
开发者ID:Tommar,项目名称:vino2,代码行数:31,代码来源:dashboard.write.php

示例11: addStreamJomsocial

 private function addStreamJomsocial($blog, $isNew, $key, $source)
 {
     $jsCoreFile = JPATH_ROOT . DIRECTORY_SEPARATOR . 'components' . DIRECTORY_SEPARATOR . 'com_community' . DIRECTORY_SEPARATOR . 'libraries' . DIRECTORY_SEPARATOR . 'core.php';
     $config = EasyBlogHelper::getConfig();
     // Somehow the blog contribution is in an array.
     $key = $key[0];
     JFactory::getLanguage()->load('com_easyblog', JPATH_ROOT);
     if (!JFile::exists($jsCoreFile)) {
         return false;
     }
     require_once $jsCoreFile;
     $app = JFactory::getApplication();
     $title = JString::substr($blog->title, 0, 30) . '...';
     $easyBlogItemid = '';
     if ($app->isAdmin()) {
         $easyBlogItemid = EasyBlogRouter::getItemId('latest');
         $easyBlogItemid = '&Itemid=' . $easyBlogItemid;
     }
     $blogLink = EasyBlogRouter::getRoutedURL('index.php?option=com_easyblog&view=entry&id=' . $blog->id . $easyBlogItemid, false, true);
     $my = JFactory::getUser();
     $blogContent = $blog->intro . $blog->content;
     // Get blog's image and use it as the cover photo.
     $image = '';
     if ($blog->getImage()) {
         $imageSource = $blog->getImage()->getSource('frontpage');
         if ($imageSource) {
             $image = '<a href="' . $blogLink . '"><img src="' . $imageSource . '" style="margin: 0 5px 5px 0;float: left; height: auto; width: 120px !important;"/></a>';
         }
     } else {
         // Try to find for an image in the content.
         $pattern = '#<img[^>]*>#i';
         preg_match($pattern, $blogContent, $matches);
         if ($matches) {
             $matches[0] = JString::str_ireplace('img ', 'img style="margin: 0 5px 5px 0;float: left; height: auto; width: 120px !important;"', $matches[0]);
             $image = '<a href="' . $blogLink . '">' . $matches[0] . '</a>';
         }
     }
     // Strip unwanted data.
     $blogContent = EasyBlogHelper::getHelper('Videos')->strip($blogContent);
     $blogContent = EasyBlogGoogleAdsense::stripAdsenseCode($blogContent);
     $blogContent = JString::substr($blogContent, 0, $config->get('integrations_jomsocial_blogs_length', 250)) . ' ...';
     // Remove all html tags from the content as we want to chop it down.
     $blogContent = strip_tags($blogContent);
     if (!empty($image)) {
         $blogContent = $image . $blogContent . '<div style="clear: both;"></div>';
     }
     $blogContent .= '<div style="text-align: right;"><a href="' . $blogLink . '">' . JText::_('COM_EASYBLOG_CONTINUE_READING') . '</a></div>';
     $groupLink = CRoute::_('index.php?option=com_community&view=groups&task=viewgroup&groupid=' . $key);
     JTable::addIncludePath(JPATH_ROOT . DIRECTORY_SEPARATOR . 'components' . DIRECTORY_SEPARATOR . 'com_community' . DIRECTORY_SEPARATOR . 'tables');
     $group = JTable::getInstance('Group', 'CTable');
     $group->load($key);
     $title = JText::sprintf('COM_EASYBLOG_JS_ACTIVITY_GROUP_BLOG_ADDED', $blogLink, $title, $groupLink, $group->name);
     $obj = new stdClass();
     $obj->title = $title;
     $obj->content = $blogContent;
     $obj->cmd = 'group.blog.added';
     if ($config->get('integrations_jomsocial_activity_likes')) {
         $obj->like_id = $blog->id;
         $obj->like_type = 'com_easyblog';
     }
     if ($config->get('integrations_jomsocial_activity_comments')) {
         $obj->comment_id = $blog->id;
         $obj->comment_type = 'com_easyblog';
     }
     $obj->group_access = $group->approvals;
     $obj->actor = $my->id;
     $obj->target = $key;
     $obj->app = 'easyblog';
     $obj->cid = $key;
     $obj->groupid = $key;
     // add JomSocial activities
     CFactory::load('libraries', 'activities');
     CActivityStream::add($obj);
 }
开发者ID:Tommar,项目名称:vino2,代码行数:74,代码来源:groups.php


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