<?php
header("Content-type: text/xml");
include ("config.php");
include ("include/fungction.php");
echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n
<urlset xmlns=\"http://www.sitemaps.org/schemas/sitemap/0.9\">\n
";
$sqlArtikel=mysql_query("select * from artikel where active='1'");
while ($dataArtikel=mysql_fetch_array($sqlArtikel))
{
echo "<url>
<loc>".$M_LINK_ARTIKEL."".format_str($dataArtikel['title'])."-".$dataArtikel['id']."</loc>
<lastmod>".date('Y-m-d',$dataArtikel['date'])."</lastmod>
<changefreq>daily</changefreq>
<priority>1.0</priority>
</url>";
}
$sqlPen=mysql_query("select * from search order by id asc");
while($dataPen=mysql_fetch_array($sqlPen))
{
echo "<url>
<loc>http://".$DOMAIN."/".str_replace(" ","-",$dataPen['keyword']).".html</loc>
<changefreq>daily</changefreq>
<priority>1.0</priority>
</url>";
}
$sql=mysql_query("select * from page where active='1'");
while ($data=mysql_fetch_array($sql))
{
if ($data["url"]=="file")
{
$strLink="index.php?page=".$data["file"]."&file=".$data["id"];
echo "<url>
<loc>http://".$DOMAIN."/".$strLink."</loc>
<changefreq>daily</changefreq>
<priority>1.0</priority>
</url>";
}
else if ($data["url"]==""||$data["url"]=="0")
{
$strLink="index.php?page=html&id=".$data["id"];
echo "<url>
<loc>http://".$DOMAIN."/".$strLink."</loc>
<changefreq>daily</changefreq>
<priority>1.0</priority>
</url>";
}
}
echo "</urlset>";
?>