<?php
$path="../../../";
if(file_exists("".$path."config/map.php")){$path2="config/"; include("".$path."config/map.php"); include("".$path."config/subdomain.php"); }else{include("".$path."map.php");}
include("fonksiyon".$ver.".php");
include("cevir.php");
header('Content-type: text/xml');
echo '<?xml version="1.0" encoding="UTF-8"?>';
$weburl="https://".$_SERVER['HTTP_HOST'];
$ucats = json_decode(GetArr("u", "categories"), true);
?>
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
  <sitemap>
    <loc><?php echo $weburl?>/sitemap-pages.xml</loc>
    <lastmod><?= date('Y-m-d') ?></lastmod>
  </sitemap>
<?php $sqlx=mysqli_query($conn, "select * from genel where ne='xmodules' and s11=1 order by s10 asc,id desc");?>
<?php if(mysqli_num_rows($sqlx) > 0) { ?>
  <sitemap>
    <loc><?php echo $weburl?>/sitemap-xmodules.xml</loc>
    <lastmod><?= date('Y-m-d') ?></lastmod>
  </sitemap>
<?php }?>
<?php $seo=mysqli_query($conn, "select * from genel where ne='seo' order by s10 asc");?>
<?php if(mysqli_num_rows($seo) > 0) { ?>
  <sitemap>
    <loc><?php echo $weburl?>/sitemap-keys.xml</loc>
    <lastmod><?= date('Y-m-d') ?></lastmod>
  </sitemap>
<?php }?>
<?php if($m14==1){?>
<?php
if ($ucats && is_array($ucats)) {
    foreach ($ucats as $xkey => $xvalue) {
        if ($xvalue["ne"] == "ukategori"){
?>
  <sitemap>
    <loc><?php echo $weburl?>/sitemap-products-<?php echo $xvalue["id"]?>.xml</loc>
    <lastmod><?= date('Y-m-d') ?></lastmod>
  </sitemap>
<?php }}}?>
<?php if($a4<>0){?>
  <sitemap>
    <loc><?php echo $weburl?>/sitemap-categories.xml</loc>
    <lastmod><?= date('Y-m-d') ?></lastmod>
  </sitemap>
<?php }}?>
<?php if($m11==1){?>
  <sitemap>
    <loc><?php echo $weburl?>/sitemap-blogs.xml</loc>
    <lastmod><?= date('Y-m-d') ?></lastmod>
  </sitemap>
<?php }?>
<?php $sqld=mysqli_query($conn, "select id,t1,t4,n2,n3,n4,n5,n6 from genel where ne='tanim' and t2='domain' and n3<>''");?>
<?php if(mysqli_num_rows($sqld)>1){?>
  <sitemap>
    <loc><?php echo $weburl?>/sitemap-sub.xml</loc>
    <lastmod><?= date('Y-m-d') ?></lastmod>
  </sitemap>
<?php }?>
</sitemapindex>