/** * 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; }
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; }
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, '/'); }
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; }