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

@ -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>";