Exemplo n.º 1
0
     $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 .= '<loc>' . $globalURL . '/date/' . date("Y-m-d", strtotime($date_item['date'])) . '</loc>';
             $output .= '<lastmod>' . date("c", time()) . '</lastmod>';
             $output .= '<changefreq>daily</changefreq>';
             $output .= '</url>';
         }
         $output .= '</urlset>';
     } else {
         if ($_GET['type'] == "route") {
             $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">';
             $route_names = Spotter::getAllRoutes();
             foreach ($route_names as $route_item) {
                 $output .= '<url>';
Exemplo n.º 2
0
     $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();
         foreach ($date_names as $date_item) {
             $output .= '<url>';
             $output .= '<loc>' . 'http://' . $_SERVER['HTTP_HOST'] . $globalURL . '/date/' . date("Y-m-d", strtotime($date_item['date'])) . '</loc>';
             $output .= '<lastmod>' . date("c", time()) . '</lastmod>';
             $output .= '<changefreq>daily</changefreq>';
             $output .= '</url>';
         }
         $output .= '</urlset>';
     } else {
         if (isset($_GET['type']) && $_GET['type'] == "route") {
             $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">';
             $route_names = $Spotter->getAllRoutes();
             foreach ($route_names as $route_item) {
                 $output .= '<url>';