<?php
/**
 * /sitemap.php — livesportswatch.com
 *
 * NOTE: this architecture (cloned from liveiptv.tv) keeps its 30-country
 * list hardcoded directly inside index.php, not in a separate
 * country-data.php file the way 4kiptv.in's does. This sitemap
 * duplicates that same list so it stays in sync — if you ever add or
 * remove a country in index.php's $allowed_countries array, update the
 * matching array below too. This file was not part of what was
 * confirmed to exist on the original liveiptv.tv either; worth adding
 * the same file there if it's missing.
 */
header('Content-Type: application/xml; charset=utf-8');

// Keep this in sync with $allowed_countries in index.php.
$allowed_countries = [
    'usa', 'uk', 'uae', 'canada', 'australia', 'germany', 'france', 'netherlands',
    'spain', 'italy', 'saudiarabia', 'qatar', 'oman', 'kuwait', 'bahrain', 'dubai',
    'sweden', 'norway', 'denmark', 'finland', 'switzerland', 'austria', 'belgium',
    'ireland', 'portugal', 'algeria', 'morocco', 'egypt', 'brazil', 'argentina'
];

$today = date('Y-m-d');
$base = 'https://livesportswatch.com';
echo '<?xml version="1.0" encoding="UTF-8"?>' . "\n";
?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd">
  <url>
    <loc><?php echo $base; ?>/</loc>
    <lastmod><?php echo $today; ?></lastmod>
    <changefreq>daily</changefreq>
    <priority>1.00</priority>
  </url>
  <url>
    <loc><?php echo $base; ?>/privacy-policy</loc>
    <lastmod><?php echo $today; ?></lastmod>
    <changefreq>monthly</changefreq>
    <priority>0.30</priority>
  </url>
  <url>
    <loc><?php echo $base; ?>/refund-policy</loc>
    <lastmod><?php echo $today; ?></lastmod>
    <changefreq>monthly</changefreq>
    <priority>0.30</priority>
  </url>
  <?php foreach ($allowed_countries as $slug): ?>
  <url>
    <loc><?php echo $base; ?>/<?php echo htmlspecialchars($slug, ENT_QUOTES, 'UTF-8'); ?></loc>
    <lastmod><?php echo $today; ?></lastmod>
    <changefreq>daily</changefreq>
    <priority>0.90</priority>
  </url>
  <?php endforeach; ?>
</urlset>