Exemple #1
0
 /**
  * Cleans the cache
  */
 function cleanCache(&$sitemap)
 {
     $cache =& XmapCache::getCache($sitemap);
     if (class_exists('JFactory')) {
         return $cache->clean();
     } else {
         return $cache->clean($cache->_group);
     }
 }
}
$database =& JFactory::getDBO();
$xSitemap = new XmapSitemap($database);
$xSitemap->load($sitemapid);
//$database->setQuery('alter table #__xmap_sitemap add excluded_items text');
//$database->query();
if (!$xSitemap->id) {
    echo _XMAP_MSG_NO_SITEMAP;
    return;
}
if ($view == 'xml') {
    Header("Content-type: text/xml; charset=UTF-8");
    Header("Content-encoding: UTF-8");
}
global $xmap;
$xmapCache = XmapCache::getCache($xSitemap);
$excluded_items = $xSitemap->getExcludedItems();
if ($xSitemap->usecache) {
    $lang = JFactory::getLanguage();
    $xmapCache->call('xmapCallShowSitemap', $view, $xSitemap->id, $excluded_items, $lang->getName(), $mainframe->getCfg('sef'), $user->get('id'), $news);
    // call plugin's handler function
} else {
    xmapCallShowSitemap($view, $xSitemap->id, $excluded_items);
}
switch ($view) {
    case 'html':
        $xSitemap->views_html++;
        $xSitemap->lastvisit_html = time();
        $xSitemap->save();
        break;
    case 'xml':