到自定义页面处生成文件名为 sitemap.xml
生成代码如下:测试可用。
[code lang=”xml”]
<?='<?xml version="1.0" encoding="UTF-8"?>’?>
<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">
<url>
<loc><?=$public_r[‘shanmaome’]?></loc>
<priority>1.000</priority>
</url>
[e:loop={"select * from {$dbtbpre}enewsclass",0,24,0}]
<?
if($bqr[‘classurl’]=="")
{
$sccurl=$public_r[‘newsurl’].$bqr[‘classpath’]."/";
}
else
{
$sccurl=$bqr[‘classurl’]."/";
}
?>
<url>
<loc><?=$public_r[‘shanmaome’]?><?=$sccurl?></loc>
<priority>0.6000</priority>
</url>
[/e:loop]
[e:loop={"select * from {$dbtbpre}enewszt order by ztid desc",0,24,0}]
<?
if($bqr[‘zturl’]=="")
{
$sccurl=$public_r[‘newsurl’].$bqr[‘ztpath’]."/";
}
else
{
$sccurl=$bqr[‘zturl’]."/";
}
?>
<url>
<loc><?=$public_r[‘shanmaome’]?><?=$sccurl?></loc>
<priority>0.6000</priority>
</url>
[/e:loop]
[e:loop={"select * from {$dbtbpre}ecms_news order by newstime desc",0,24,0}]
<url>
<loc><?=$public_r[‘shanmaome’]?><?=$bqsr[titleurl]?></loc>
<priority>0.5000</priority>
</url>
[/e:loop]
</urlset>
[/code]