Пример #1
0
/**
* Function called to generate and generate the tree. Created specially to
* use with the cache call method
* The params locale and sef are only for cache purppses
*/
function xmapCallShowSitemap($view, $sitemapid, $locale = '', $sef = '')
{
    global $xmapCache, $mosConfig_absolute_path, $mosConfig_live_site, $xSitemap, $xConfig;
    switch ($view) {
        case 'xml':
            // XML Sitemaps output
            require_once $mosConfig_absolute_path . '/components/com_xmap/xmap.xml.php';
            $xmap = new XmapXML($xConfig, $xSitemap);
            $xmap->generateSitemap($view, $xConfig, $xmapCache);
            $xSitemap->count_xml = $xmap->count;
            break;
        default:
            // Html output
            global $mainframe;
            require_once $mainframe->getPath('front_html');
            if (!$xConfig->exclude_css) {
                $mainframe->addCustomHeadTag('<link rel="stylesheet" type="text/css" media="all" href="' . $mosConfig_live_site . '/components/com_xmap/css/xmap.css" />');
            }
            $xmap = new XmapHtml($xConfig, $xSitemap);
            $xmap->generateSitemap($view, $xConfig, $xmapCache);
            $xSitemap->count_html = $xmap->count;
            break;
    }
}
Пример #2
0
/**
* Function called to generate and generate the tree. Created specially to
* use with the cache call method
* The params locale and sef are only for cache purppses
*/
function xmapCallShowSitemap($view, $sitemapid, $excluded_items, $locale = '', $sef = '', $userid = 0, $news = 0)
{
    global $xmapCache, $xSitemap, $xConfig;
    $xSitemap->loadItems($view);
    $live_site = substr_replace(JURI::root(), "", -1, 1);
    switch ($view) {
        case 'xml':
            // XML Sitemaps output
            // Turn off all error reporting
            ini_set('display_errors', 'Off');
            // Set a high time limit to avoid problems. I think 600 seconds should be enough
            set_time_limit(600);
            require_once JPATH_COMPONENT_SITE . '/xmap.xml.php';
            $xmap = new XmapXML($xConfig, $xSitemap);
            $xmap->generateSitemap($view, $xConfig, $xmapCache);
            $xSitemap->count_xml = $xmap->count;
            break;
        default:
            // Html output
            global $mainframe;
            require_once $mainframe->getPath('front_html');
            if (!$xConfig->exclude_css) {
                $mainframe->addCustomHeadTag('<link rel="stylesheet" type="text/css" media="all" href="' . $live_site . '/components/com_xmap/css/xmap.css" />');
            }
            $xmap = new XmapHtml($xConfig, $xSitemap);
            $xmap->generateSitemap($view, $xConfig, $xmapCache);
            $xSitemap->count_html = $xmap->count;
            break;
    }
}
Пример #3
0
/**
 * Function called to generate and generate the tree. Created specially to
 * use with the cache call method
 * The params locale and sef are only for cache purppses
 */
function xmapCallShowSitemap($view, $sitemapid, $excluded_items, $locale = '', $sef = '', $userid = 0, $news = 0, $compress = false)
{
    global $xmapCache, $xSitemap, $xConfig;
    $xSitemap->loadItems($view);
    $live_site = substr_replace(JURI::root(), "", -1, 1);
    switch ($view) {
        case 'xml':
            // XML Sitemaps output
            require_once JPATH_COMPONENT_SITE . '/xmap.xml.php';
            $xmap = new XmapXML($xConfig, $xSitemap);
            $xmap->generateSitemap($view, $xConfig, $xmapCache);
            $xSitemap->count_xml = $xmap->count;
            break;
        default:
            // Html output
            global $mainframe;
            require_once $mainframe->getPath('front_html');
            if (!$xConfig->exclude_css) {
                $mainframe->addCustomHeadTag('<link rel="stylesheet" type="text/css" media="all" href="' . $live_site . '/components/com_xmap/css/xmap.css" />');
            }
            $xmap = new XmapHtml($xConfig, $xSitemap);
            $xmap->generateSitemap($view, $xConfig, $xmapCache);
            $xSitemap->count_html = $xmap->count;
            break;
    }
}