<?
include("ayarzamani.php");
header("Content-Type: text/xml");
if(! isset($_GET[sayfa])) $sayfa=1; else $sayfa=$_GET[sayfa];
$date=date("Y-m-d");
if($sayfa=="index"):
$index_sayi=mysql_num_rows(mysql_query("SELECT id FROM video"));
$index_sayi=ceil($index_sayi / 6000);
echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?> <sitemapindex xmlns=\"http://www.sitemaps.org/schemas/sitemap/0.9\">\n";
for($i=0; $i<$index_sayi; $i++){
echo "<sitemap> <loc>http://".$asiteadresi."/sitemap.php?sayfa=".($i+1)."</loc> <lastmod>$date</lastmod> </sitemap>\n";
}
echo "</sitemapindex>";
else:
$sorgu=mysql_query("SELECT id,title,vid FROM video ORDER BY id ASC LIMIT ".(($sayfa-1)*6000).",5000");
echo "<?xml version=\"1.0\" encoding=\"UTF-8\" ?> <urlset xmlns=\"http://www.sitemaps.org/schemas/sitemap/0.9\" xmlns:video=\"http://www.google.com/schemas/sitemap-video/1.0\">\n";
while($sonuc=mysql_fetch_assoc($sorgu)):
echo "
<url>
<loc>http://".$site."/".linkvideo($sonuc[vid],$sonuc[title])."</loc>
<video:video>
<video:thumbnail_loc>http://i.ytimg.com/vi/".$sonuc[vid]."/default.jpg</video:thumbnail_loc>
<video:title>".$sonuc[title]."</video:title>
</video:video>
</url>\n
";
endwhile;
echo '</urlset>';
endif;
?>hata :
This page contains the following errors:
error on line 2 at column 1: Extra content at the end of the document
Below is a rendering of the page up to the first error.
burda sorun nerede arkadaşlar. youtube api script için sitemap yapmaya çalışıyorum..