帝国ECMS6.x的网站地图, 虽然官方的WC发了一个插件, 但是只是动态调用的. 所以用灵动标签做一个单页面的网站地图 sitemap.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>[!--news.url--]</loc>
<lastmod><?=format_datetime($bqr[newstime],'Y-m-d')?></lastmod>
<changefreq>daily</changefreq>
<priority>1.0</priority>
</url>
[e:loop={"select * from [!db.pre!]enewsclass order by classid limit 1000",1000,24,0}]
<url>
<loc><?=$public_r[newsurl]?><?=$bqr[classpath]?>/</loc>
<lastmod><?=format_datetime($bqr[newstime],'Y-m-d')?></lastmod>
<changefreq>Weekly</changefreq>
<priority>0.7</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>
<lastmod><?=format_datetime($bqr[newstime],'Y-m-d')?></lastmod>
<changefreq>Weekly</changefreq>
<priority>0.5</priority>
</url>
[/e:loop]
</urlset>
这是按照默认新闻表的, 如果其他文章表, 下载表的信息调用, 把 ecms_news 改为相应的表名就行了。
Update: ECMS 7.0 要把 where checked=1 去掉.
英文 SEO & SEM Journal