load_class('/items/model/_itemlistlight.class.php', 'ItemListLight'); // Use a LIGHT Item List: (Sitemap = 50000 entries max) $MainList = new ItemListLight($Blog, $Blog->get_timestamp_min(), $Blog->get_timestamp_max(), 50000); // By default we only want items that have the MAIN cat in this blog, // i-e with its canonical URL in this blog (cross posted stuff will be listed in its main blog) // However this may be overriden in a stub (or param) param('cat_focus', 'string', 'main'); // Filter list: $MainList->set_filters(array('visibility_array' => array('published'), 'types' => '-' . implode(',', $posttypes_nopermanentURL), 'unit' => 'all', 'cat_focus' => $cat_focus)); // pre_dump( $cat_focus, $MainList->filters ); // Run the query: $MainList->query(); // Old style globals for category.funcs: // TODO: dh> check if still required. $postIDlist = $MainList->get_page_ID_list(); $postIDarray = $MainList->get_page_ID_array(); $Timer->stop('prepare list'); $Timer->resume('display list'); // TODO: dh> add entry for homepage (lastmod of latest item) // TODO: dh> take comments into consideration for prio // TODO: dh> use main Blog URL only, since google requires them to be on the same domain/path // (see sitemap_plugin) // Note: since URLs are likely to be clean ASCII, $io_charset can probably be faked to UTF-8 here headers_content_mightcache('application/xml', '#', 'UTF-8'); // In most situations, you do NOT want to cache dynamic content! echo '<?xml version="1.0" encoding="UTF-8"?' . '>'; ?> <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"> <?php while ($Item =& mainlist_get_item()) {