Lütfen bir avuç kod
27
●1.791
<?php
$xml_ciktisi .= "\n<url>\n<loc>http://www.siteadi.com/devami.php?id=$id</loc>\n
<lastmod>$zaman</lastmod>\n
<changefreq>hourly</changefreq>\n
<priority>0.50</priority>\n</url>";
?><?php
$link = 'http://www.siteadi.com/devami.php?id='.$id;
$link = str_replace('&','&',$link);
$xml_ciktisi .= "\n<url>\n<loc>$link</loc>\n
<lastmod>$zaman</lastmod>\n
<changefreq>hourly</changefreq>\n
<priority>0.50</priority>\n</url>";
?>yaparsan sorun hallolur. Tabii bunun dışında>,<,",'karakterlerini de escape halleriyle değişmelisin.
$xml_ciktisi .= "\n<url>\n<loc>http://www.siteadi.com</loc>\n<changefreq>daily</changefreq>\n<priority>1.00</priority>\n</url>";
$result = @mysql_query("SELECT id, link, published FROM jos_menu WHERE published='1' ORDER BY id DESC");
while (list($id, $link) = @mysql_fetch_row($result))
{
$xml_ciktisi .= "\n<url>\n<loc>http://www.siteadi.com/$link</loc>\n
<changefreq>weekly</changefreq>\n
<priority>0.50</priority>\n</url>";
};
echo $xml_ciktisi ."\n</urlset>"; <?php
function zaman_yaz($zaman) {
$parca = explode(" " ,$zaman);
$zaman = $parca[0]."T".$parca[1]."+00:00";
return $zaman;
}
# header('Content-type: text/xml');
include_once("veri_tabani.php");
echo '<?xml version="1.0" encoding="ISO-8859-9" ?>';
echo '<urlset xmlns="http://www.google.com/schemas/sitemap/0.84"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.google.com/schemas/sitemap/0.84 http://www.google.com/schemas/sitemap/0.84/sitemap.xsd">';
echo '<url>';
echo '<loc>http://www.siteadi.com/</loc>';
echo '<changefreq>daily</changefreq>';
echo '<priority>1.00</priority>';
echo '</url>';
########################
$sorgu = mysql_query("SELECT id,title,created,sectionid FROM jos_content WHERE sectionid!='4' AND state='1' ORDER BY created DESC");
while($veri = mysql_fetch_assoc($sorgu)) {
echo '<url>';
echo '<loc>'.urlencode('http://www.siteadi.com/devami.php?id='.$veri['id'].'').'</loc>';
echo '<lastmod>'.zaman_yaz($veri['created']).'</lastmod>';
echo '<changefreq>hourly</changefreq>';
echo '<priority>0.50</priority>';
echo '</url>';
}
########################
echo '</urlset>';
?>bu şekilde bi dene sayfanın kaynağını bizimle paylaş bakalım :\
$xml_ciktisi .= "\n<url>\n<loc>http://www.siteadi.com</loc>\n<changefreq>daily</changefreq>\n<priority>1.00</priority>\n</url>";
$result = @mysql_query("SELECT id, link, published FROM jos_menu WHERE published='1' ORDER BY id DESC");
while (list($id, $link) = @mysql_fetch_row($result))
{
$xml_ciktisi .= "\n<url>\n<loc>http://www.siteadi.com/$link</loc>\n
<changefreq>weekly</changefreq>\n
<priority>0.50</priority>\n</url>";
};
echo $xml_ciktisi ."\n</urlset>"; <?php
include_once("veri_tabani.php");
header('Content-type: text/xml');
echo '<?xml version="1.0" encoding="ISO-8859-9"?>
<urlset 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" xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">';
echo "\t<url>\n";
echo "\t\t<loc>http://www.siteadi.com</loc>\n";
echo "\t\t<changefreq>daily</changefreq>\n";
echo "\t\t<priority>1.00</priority>\n";
echo "\t</url>\n";
$result = @mysql_query("SELECT id, link FROM jos_menu WHERE published='1' ORDER BY id DESC");
while(list($id, $link) = mysql_fetch_row($result)) {
$link = str_replace('&','&',$link);
echo "\t<url>\n";
echo "\t\t<loc>http://www.siteadi.com/".$link."</loc>\n";
echo "\t\t<changefreq>weekly</changefreq>\n";
echo "\t\t<priority>0.50</priority>\n";
echo "\t</url>\n";
}
echo "</urlset>";
?> $xml_ciktisi .= "\n<url>\n<loc>http://www.siteadi.com</loc>\n<changefreq>daily</changefreq>\n<priority>1.00</priority>\n</url>";
$result = @mysql_query("SELECT id, link FROM jos_menu WHERE published='1' ORDER BY id DESC");
while (list($id, $link) = @mysql_fetch_row($result))
{
/*
//eğer ilk sayfada ki gibi kullanıyorsan:
//bu şekilde de yapabilirsin
$site_link = 'http://www.siteadi.com/'.$link.'&Itemid='.$id;
<loc>$site_link</loc>
*/
$link = str_replace('&','&',$link);
$xml_ciktisi .= "\n<url>\n<loc>http://www.siteadi.com/$link</loc>\n
<changefreq>weekly</changefreq>\n
<priority>0.50</priority>\n</url>";
};
echo $xml_ciktisi ."\n</urlset>";