limit = intval($_POST['limit']);
$map->news_priority = strip_tags(stripslashes($_POST['priority']));
$map->stat_priority = strip_tags(stripslashes($_POST['stat_priority']));
$map->cat_priority = strip_tags(stripslashes($_POST['cat_priority']));
$row = $db->super_query( "SELECT COUNT(*) as count FROM " . PREFIX . "_post" );
if ( !$map->limit ) $map->limit = $row['count'];
if ( $map->limit > 45000 ) {
$pages_count = @ceil( $row['count'] / 40000 );
$sitemap = $map->build_index( $pages_count );
$handler = fopen(ROOT_DIR. "/uploads/sitemap.xml", "wb+");
fwrite($handler, $sitemap);
fclose($handler);
@chmod(ROOT_DIR. "/uploads/sitemap.xml", 0666);
$sitemap = $map->build_stat();
$handler = fopen(ROOT_DIR. "/uploads/sitemap1.xml", "wb+");
fwrite($handler, $sitemap);
fclose($handler);
@chmod(ROOT_DIR. "/uploads/sitemap1.xml", 0666);
for ($i =0; $i < $pages_count; $i++) {
$t = $i+2;
$n = $n+1;
$sitemap = $map->build_map_news( $n );
$handler = fopen(ROOT_DIR. "/uploads/sitemap{$t}.xml", "wb+");
fwrite($handler, $sitemap);
fclose($handler);
@chmod(ROOT_DIR. "/uploads/sitemap{$t}.xml", 0666);
}
} else {
$sitemap = $map->build_map();
$handler = fopen(ROOT_DIR. "/uploads/sitemap.xml", "wb+");
fwrite($handler, $sitemap);
fclose($handler);
@chmod(ROOT_DIR. "/uploads/sitemap.xml", 0666);
}
}
echoheader("", "");
echo <<
HTML;
echofooter();
?>