$output .= '<?xml version="1.0" encoding="UTF-8"?>'; $output .= '<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:image="http://www.google.com/schemas/sitemap-image/1.1">'; $country_names = Spotter::getAllCountries(); foreach ($country_names as $country_item) { $output .= '<url>'; $output .= '<loc>' . $globalURL . '/country/' . strtolower(str_replace(" ", "-", $country_item['country'])) . '</loc>'; $output .= '<lastmod>' . date("c", time()) . '</lastmod>'; $output .= '<changefreq>daily</changefreq>'; $output .= '</url>'; } $output .= '</urlset>'; } else { if ($_GET['type'] == "ident") { $output .= '<?xml version="1.0" encoding="UTF-8"?>'; $output .= '<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:image="http://www.google.com/schemas/sitemap-image/1.1">'; $ident_names = Spotter::getAllIdents(); foreach ($ident_names as $ident_item) { $output .= '<url>'; $output .= '<loc>' . $globalURL . '/ident/' . $ident_item['ident'] . '</loc>'; $output .= '<lastmod>' . date("c", time()) . '</lastmod>'; $output .= '<changefreq>daily</changefreq>'; $output .= '</url>'; } $output .= '</urlset>'; } else { if ($_GET['type'] == "date") { $output .= '<?xml version="1.0" encoding="UTF-8"?>'; $output .= '<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:image="http://www.google.com/schemas/sitemap-image/1.1">'; $date_names = Spotter::getAllDates(); foreach ($date_names as $date_item) { $output .= '<url>';
$output .= '<?xml version="1.0" encoding="UTF-8"?>'; $output .= '<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:image="http://www.google.com/schemas/sitemap-image/1.1">'; $country_names = $Spotter->getAllCountries(); foreach ($country_names as $country_item) { $output .= '<url>'; $output .= '<loc>' . 'http://' . $_SERVER['HTTP_HOST'] . $globalURL . '/country/' . strtolower(str_replace(" ", "-", $country_item['country'])) . '</loc>'; $output .= '<lastmod>' . date("c", time()) . '</lastmod>'; $output .= '<changefreq>daily</changefreq>'; $output .= '</url>'; } $output .= '</urlset>'; } else { if (isset($_GET['type']) && $_GET['type'] == "ident") { $output .= '<?xml version="1.0" encoding="UTF-8"?>'; $output .= '<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:image="http://www.google.com/schemas/sitemap-image/1.1">'; $ident_names = $Spotter->getAllIdents(); foreach ($ident_names as $ident_item) { if (ctype_alnum($ident_item['ident'])) { $output .= '<url>'; $output .= '<loc>' . 'http://' . $_SERVER['HTTP_HOST'] . $globalURL . '/ident/' . $ident_item['ident'] . '</loc>'; $output .= '<lastmod>' . date("c", time()) . '</lastmod>'; $output .= '<changefreq>daily</changefreq>'; $output .= '</url>'; } } $output .= '</urlset>'; } else { if (isset($_GET['type']) && $_GET['type'] == "date") { $output .= '<?xml version="1.0" encoding="UTF-8"?>'; $output .= '<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:image="http://www.google.com/schemas/sitemap-image/1.1">'; $date_names = $Spotter->getAllDates();