sitemap fix

This commit is contained in:
Vitalychez 2014-11-18 15:44:21 +04:00
commit 0804706fd7
2 changed files with 5 additions and 5 deletions

View file

@ -253,10 +253,10 @@ define('BB_PATH', realpath(BB_ROOT) );
define('ADMIN_DIR', BB_PATH .'/admin/' );
define('DATA_DIR', BB_PATH .'/data/' );
define('INT_DATA_DIR', BB_PATH .'/internal_data/' );
define('AJAX_HTML_DIR', BB_ROOT .'/internal_data/ajax_html/' );
define('AJAX_HTML_DIR', BB_ROOT .'internal_data/ajax_html/' );
define('CACHE_DIR', BB_PATH .'/internal_data/cache/' );
define('LOG_DIR', BB_PATH .'/internal_data/log/' );
define('SITEMAP_DIR', BB_PATH .'/internal_data/sitemap/' );
define('SITEMAP_DIR', BB_PATH .'internal_data/sitemap/' );
define('TRIGGERS_DIR', BB_PATH .'/internal_data/triggers/' );
define('AJAX_DIR', BB_ROOT .'/library/ajax/' );
define('ATTACH_DIR', BB_PATH .'/library/attach_mod/' );

View file

@ -13,7 +13,7 @@ class sitemap
function sitemap () {
global $bb_cfg;
$this->home = 'http://'.$bb_cfg['server_name'].'/';
$this->home = make_url('');
}
function build_map () {
@ -29,10 +29,10 @@ class sitemap
function build_index ($count) {
$lm = date('c');
$map = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<sitemapindex xmlns=\"http://www.sitemaps.org/schemas/sitemap/0.9\">\n";
$map .= "<sitemap>\n<loc>{$this->home}sitemap/sitemap1.xml</loc>\n<lastmod>{$lm}</lastmod>\n</sitemap>\n";
$map .= "<sitemap>\n<loc>".make_url(substr(SITEMAP_DIR, 2))."/sitemap1.xml</loc>\n<lastmod>{$lm}</lastmod>\n</sitemap>\n";
for ($i = 0; $i < $count; $i++) {
$t = $i + 2;
$map .= "<sitemap>\n<loc>{$this->home}sitemap/sitemap{$t}.xml</loc>\n<lastmod>{$lm}</lastmod>\n</sitemap>\n";
$map .= "<sitemap>\n<loc>".make_url(substr(SITEMAP_DIR, 2))."/sitemap{$t}.xml</loc>\n<lastmod>{$lm}</lastmod>\n</sitemap>\n";
}
$map .= "</sitemapindex>";