$result = @mysql_query("SELECT id, link FROM jos_menu WHERE published='1' ORDER BY id DESC");
while ($sonuc = @mysql_fetch_assoc($result))
{
$xml_ciktisi .= "\n
<url>\n<loc>http://www.siteadi.com/".$sonuc['link']."&Itemid=".$sonuc['id']."</loc>\n
<changefreq>monthly</changefreq>\n
<priority>0.60</priority>\n</url>";
}
echo $xml_ciktisi ."\n</urlset>"; Çözemediğim Bir PHP Mantığı
27
●1.791
- 13-03-2010, 15:10:37
- 13-03-2010, 15:14:13edit : bir üstteki mesajda zaten verilmiş, görmemişim.
şu şekilde dene birde;
$result = mysql_query("SELECT id, link FROM jos_menu WHERE published='1' ORDER BY id DESC"); while ($veri = mysql_fetch_assoc($result)) { $xml_ciktisi .= "\n<url>\n<loc>http://www.siteadi.com/".$veri['link']."&Itemid=".$veri['id']."</loc>\n <changefreq>monthly</changefreq>\n <priority>0.60</priority>\n</url>"; }; echo $xml_ciktisi ."\n</urlset>"; - 13-03-2010, 15:18:45Homa,Haymac adlı üyeden alıntı: mesajı görüntüle
<loc>http://www.siteadi.com/index.php?option=com_content&view=article&id=5&Itemid=17</loc>
Bu şekilde tek satır yazdırıyor, devamı gelmiyor.
---------------------------------^ şeklinde bir çizgi çıkıyor altında, o kadar. - 13-03-2010, 15:30:17Sanırım şunu belirtmeliyim.
Aşağıda bütün sitemap.php dosyasını paylaşıyorum sizinle. Bu dosyayı başka bir sitede şu şekilde kullanıyorum ve sorunsuz çalışıyor:
<?php include_once("veri_tabani.php"); header('Content-type: text/xml'); echo "<?xml version=\"1.0\" encoding=\"ISO-8859-9\" ?>\n"; 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\">"; $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, title, created, sectionid FROM jos_content WHERE sectionid!='4' AND state='1' ORDER BY created DESC"); while (list($id, $title, $created) = @mysql_fetch_row($result)) { $saat= $created; $s = explode(" " ,$saat); $zaman = $s[0]."T".$s[1]."+00:00"; $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>"; }; echo $xml_ciktisi ."\n</urlset>"; ?>İkisi arasında bir XML farkı yok, sadece bazı MySQL bilgileri ve PHP değişkenleri değişiyor, XML hatası bu nedenle anlamsız geliyor bana. - 13-03-2010, 21:16:17Üyeliği durduruldubende denediğimde explorerda dediğiniz gibi hata verdi sadece id veya sadece isim çektiğimde sorunsuz çalışıyor ama 2 veri birden çekince hata veriyor.
ilginç