帝国cms制作xml网站地图sitemap方法

毒药      197阅读

<?='<?xml version="1.0" encoding="UTF-8"?>'?>
 
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url>
<loc>https://www.zbapk.com</loc>
<changefreq>always</changefreq>
<priority>1.0</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>
<lastmod><?=date("Y-m-d")?></lastmod>
<changefreq>always</changefreq>
<priority>0.6</priority>
</url>
[/e:loop]
 
[e:loop={0,3000,3,0,'','newstime DESC'}]
<url>
<loc><?=$bqsr['titleurl']?></loc>
<lastmod><?=date("Y-m-d")?></lastmod>
<changefreq>always</changefreq>
<priority>0.8</priority>
</url>
[/e:loop]
 
[e:loop={"select * from [!db.pre!]enewstags order by tagid",0,24,0}]
<url>
<loc>https://www.zbapk.com/tags-<?=$bqr['tagid']?>-0.html</loc>
<lastmod><?=date("Y-m-d")?></lastmod>
<changefreq>always</changefreq>
<priority>0.5</priority>
</url>
[/e:loop]
 
[e:loop={'select * from [!db.pre!]enewspage order by id',20,24,0}]
<?php
$pageurl=$public_r['newsurl'].str_replace('../../','',$bqr['path']);
$css='pagecss';
if($classid=='page'.$bqr[id])
{
$css='selfpagecss';
}
?>
<url>
<loc><?=$pageurl?></loc>
<lastmod><?=date("Y-m-d")?></lastmod>
<changefreq>always</changefreq>
<priority>0.4</priority>
</url>
[/e:loop]
</urlset>

注:
1、在自定义页面新建自定义页面
2、内容输入上述代码
3、[e:loop={0,3000,3,0,'','newstime DESC'}] 所有文章。3000为文章数量,更具自己网站的需求改。

[e:loop={"select * from [!db.pre!]enewstags order by tagid",0,24,0}] 调取tags里所有信息。
4、计划任务》 刷新自定页面

   197阅读
目前尚无回复
登录 后发表评论