帝国CMS的sitemap 网站地图 灵动标签轻松搞定

帝国CMS的sitemap 网站地图 灵动标签轻松搞定

V+变量
2024-12-08 / 0 评论 / 8 阅读 / 正在检测是否收录...

sitemap 网站地图 灵动标签轻松搞定

新建一个自定义页面.定义路径为: /sitemap.xml
自定义页面内容为:

<?='<?xml version="1.0" encoding="UTF-8"?>'?>

<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url>
<loc>[!--news.url--]</loc>
<priority>1.000</priority>
</url>
[e:loop={"select * from [!db.pre!]enewsclass order by myorder",0,24,0}]
<?
if($bqr['classurl']=='')
{
$sccurl=$public_r['newsurl'].$bqr['classpath']."/";
}
else
{
$sccurl=$bqr['classurl']."/";
}
?>
<url>
<loc><?=$sccurl?></loc>
<priority>0.6000</priority>
</url>
[/e:loop]
[e:loop={"select * from [!db.pre!]enewszt order by ztid",0,24,0}]
<?
if($bqr['zturl']=='')
{
$sccurl=$public_r['newsurl'].$bqr['ztpath']."/";
}
else
{
$sccurl=$bqr['zturl']."/";
}
?>
<url>
<loc><?=$sccurl?></loc>
<priority>0.6000</priority>
</url>
[/e:loop]
[e:loop={"select * from [!db.pre!]ecms_news where checked=1 order by newstime",0,24,0}]
<url>
<loc><?=$bqsr[titleurl]?></loc>
<priority>0.5000</priority>
</url>
[/e:loop]
</urlset>

如果有多个表,则继续,把[!db.pre!]ecms_news,改成相应的表名.

[e:loop={"select * from [!db.pre!]ecms_表名 where checked=1 order by newstime",0,24,0}]
<url>
  <loc><?=$bqsr[titleurl]?></loc>
  <priority>0.5000</priority>
</url>
[/e:loop]
0

评论 (0)

取消