<?php
include("mainfile.php");
global $prefix, $db, $nukeurl;
$harita = '<' . '?xml version="1.0" encoding="UTF-8"?' . '>' . "\n";
$harita .= '<urlset xmlns="http://www.google.com/schemas/sitemap/0.84">' . "\n";
$haber = $db->sql_query("SELECT sid,  time FROM " . $prefix . "_stories ORDER BY sid DESC");
$sid = intval($sid);
while($sonuclar = $db->sql_fetchrow($haber, MYSQL_ASSOC)){
$tarih = explode(" ", $sonuclar["time"]);
   $harita .= "<url>\n";
   $harita .= "\t<loc>$nukeurl/modules.php?name=News&amp;file=article&amp;sid=" . $sonuclar["sid"] . "</loc>\n";
   $harita .= "\t<lastmod>" . $tarih[0] . "T12:00:35+00:00</lastmod>\n";
   $harita .= "\t<changefreq>weekly</changefreq>\n";
   $harita .= "\t<priority>0.5</priority>\n";
   $harita .= "</url>\n\n";
}
   $harita .= "</urlset>\n";
header('Content-type: application/xml');
echo $harita;
?>

kodları sitemap-haberler.php olarak kaydedip roota atın. google sitemap sayfasında siteisminiz.com/sitemap-haberler.php olarak kaydedebilirsiniz.


xml olarak kaydetmek istiyorsanız .httacces dosyasına

RewriteRule ^sitemap-haberler.xml$ sitemap-haberler.php [L]
kodunu ekleyin siteismi.com/sitemap-haberler.xml olarak kaydedin.