本文整理汇总了PHP中EasyBlogRouter::isSefEnabled方法的典型用法代码示例。如果您正苦于以下问题:PHP EasyBlogRouter::isSefEnabled方法的具体用法?PHP EasyBlogRouter::isSefEnabled怎么用?PHP EasyBlogRouter::isSefEnabled使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类EasyBlogRouter
的用法示例。
在下文中一共展示了EasyBlogRouter::isSefEnabled方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getFeedURL
/**
* Appends the necessary rss fragments on existing url
*
* @since 4.0
* @access public
* @param string
* @return
*/
public function getFeedURL($url, $atom = false, $type = 'site')
{
if ($this->config->get('main_feedburner') && $type == 'site' && $this->config->get('main_feedburner_url') != '') {
return $this->config->get('main_feedburner_url');
}
$join = EasyBlogRouter::isSefEnabled() ? '?' : '&';
// Append the necessary queries
$url = EBR::_($url) . $join . 'format=feed';
$url .= $atom ? '&type=atom' : '&type=rss';
return $url;
}
示例2: getFeedURL
function getFeedURL($url, $atom = false, $type = 'site')
{
$config = EasyBlogHelper::getConfig();
$enabled = $config->get('main_feedburner');
if ($enabled && $type == 'site' && $config->get('main_feedburner_url') != '') {
$url = $config->get('main_feedburner_url');
if (!empty($url)) {
return EasyBlogHelper::getHelper('String')->escape($url);
}
}
require_once EBLOG_HELPERS . DIRECTORY_SEPARATOR . 'router.php';
$sef = EasyBlogRouter::isSefEnabled();
$join = $sef ? '?' : '&';
$url = EasyBlogRouter::_($url) . $join . 'format=feed';
$url .= $atom ? '&type=atom' : '&type=rss';
return $url;
}
示例3: getRoutedURL
public static function getRoutedURL($url, $xhtml = false, $external = false, $isCanonical = false)
{
if (!$external) {
return EasyBlogRouter::_($url, $xhtml, null, false, $isCanonical);
}
$mainframe = JFactory::getApplication();
$uri = JURI::getInstance();
$isDashboard = false;
if (!$mainframe->isAdmin()) {
$menu = JFactory::getApplication()->getMenu();
$item = $menu->getActive();
if (isset($item->link)) {
$pos = strpos($item->link, 'view=dashboard');
if ($pos !== false) {
$isDashboard = true;
}
}
}
//To fix 1.6 Jroute issue as it will include the administrator into the url path.
$oriURL = $url;
if ($mainframe->isAdmin() && EasyBlogRouter::isSefEnabled()) {
if (EasyBlogHelper::getJoomlaVersion() >= '1.6') {
JFactory::$application = JApplication::getInstance('site');
}
if (EasyBlogHelper::getJoomlaVersion() >= '3.0') {
jimport('joomla.libraries.cms.router');
} else {
require_once JPATH_ROOT . DIRECTORY_SEPARATOR . 'includes' . DIRECTORY_SEPARATOR . 'router.php';
require_once JPATH_ROOT . DIRECTORY_SEPARATOR . 'includes' . DIRECTORY_SEPARATOR . 'application.php';
}
$router = new JRouterSite(array('mode' => JROUTER_MODE_SEF));
$urls = str_replace('/administrator/', '/', EasyBlogRouter::_($oriURL, $xhtml, null, $isDashboard, $isCanonical));
$urls = rtrim(JURI::root(), '/') . '/' . ltrim(str_replace('/administrator/', '/', $urls), '/');
$container = explode('/', $urls);
$container = array_unique($container);
$urls = implode('/', $container);
if (EasyBlogHelper::getJoomlaVersion() >= '1.6') {
JFactory::$application = JApplication::getInstance('administrator');
}
return $urls;
} else {
$url = str_replace('/administrator/', '/', EasyBlogRouter::_($url, $xhtml, null, $isDashboard, $isCanonical));
}
// We need to use $uri->toString() because JURI::root() may contain a subfolder which will be duplicated
// since $url already has the subfolder.
if ($mainframe->isAdmin()) {
return $uri->toString(array('scheme', 'host', 'port')) . '/' . ltrim($url, '/');
}
return $uri->toString(array('scheme', 'host', 'port')) . '/' . ltrim($url, '/');
}
示例4: getWeeverURL
public function getWeeverURL($url)
{
require_once EBLOG_HELPERS . DIRECTORY_SEPARATOR . 'router.php';
$sef = EasyBlogRouter::isSefEnabled();
$join = $sef ? '?' : '&';
$url = EasyBlogRouter::getRoutedUrl($url, false, true) . $join . 'format=weever';
return $url;
}