sitemap的重要性,大家有目共睹,最近一些小伙伴跪求帝国CMS制作sitemap的方法教程,现在将教程分享如下:
其实原理就是利用帝国CMS自定义页面功能。分享代码如下,又不懂的小伙伴,欢迎留言。
<?='<?xml version="1.0" encoding="GBK"?>'?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url>
<loc>[!--news.url--]</loc>
<priority>1.0</priority>
<lastmod>[e:loop={'58,59,60,61,62,63,64,65,66',1,0,0,'','newstime DESC'}]<?=date('Y-m-d',$bqr[newstime])?>[/e:loop]</lastmod>
<changefreq>daily</changefreq>
</url>
[e:loop={'58,59,60,61,62,63,64,65,66',500,0,0,'','newstime DESC'}]
<url>
<priority>0.7</priority>
<loc><?=$bqsr[titleurl]?></loc>
<lastmod><?=date('Y-m-d',$bqr[newstime])?></lastmod>
<changefreq>daily</changefreq>
</url>
[/e:loop]
[e:loop={'58,59,60,61,62,63,64,65,66',500,0,0,'','newstime DESC'}]
<url>
<priority>0.7</priority>
<loc><?=$bqsr[titleurl]?></loc>
<lastmod><?=date('Y-m-d',$bqr[newstime])?></lastmod>
<changefreq>daily</changefreq>
</url>
[/e:loop]
[e:loop={"select * from [!db.pre!]enewsclass order by myorder",0,24,0}]
<?
if($bqr['classurl']=='')
{
$sccurl=$public_r['newsurl'].$bqr['classpath']."/";
$addtime=date('Y-m-d',$bqr[addtime]);
}
else
{
$sccurl=$bqr['classurl']."/";
$addtime=date('Y-m-d',$bqr[addtime]);
}
?>
<url>
<loc><?=$sccurl?></loc>
<priority>0.8</priority>
<lastmod><?=$addtime?></lastmod>
<changefreq>daily</changefreq>
</url>
[/e:loop]
</urlset>