帝国CMS本身不带有网站地图生成功能,但我们可以通过自定义页面来实现它。
栏目-》自定义页面-》 添加自定义页面 ( 网站地图 文件名(*) ../../sitemap.xml)
添加如下代码,需要生成 网站地图的时候刷新一下这个页面就可以了,
网站地图代码如下:
<?='<?xml version="1.0" encoding="UTF-8"?>'?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url>
<loc>[!--news.url--]</loc>
<lastmod>
[e:loop={"select * from [!db.pre!]ecms_news order by newstime desc limit 1",0,24,0}]
<?=date('Y-m-d',$bqr[newstime])?>
[/e:loop]
</lastmod>
<changefreq>
daily
</changefreq>
<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>
<changefreq>
daily
</changefreq>
<priority>
0.8000
</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>
<lastmod>
<?=date('Y-m-d',$bqr[newstime])?>
</lastmod>
<changefreq>
monthly
</changefreq>
<priority>
0.6000
</priority>
</url>
[/e:loop]
[e:loop={"select * from [!db.pre!]ecms_news order by newstime desc",0,24,0}]
<url>
<loc>
<?=$bqsr[titleurl]?>
</loc>
<lastmod>
<?=date('Y-m-d',$bqr[newstime])?>
</lastmod>
<changefreq>
monthly
</changefreq>
<priority>
0.5000
</priority>
</url>
[/e:loop]
</urlset>
- 上一篇:抛砖引玉!建站优质内容门径共享
- 下一篇:网站侧边栏如何添加QQ在线客服
请立即点击咨询我们或拨打咨询热线: 18261116466,我们会详细为你一一解答你心中的疑难。项目经理在线