自动生成网站地图xml
1、在帝国自定义的页面 顶部声明 格式
<?='<?xml version="1.0" encoding="UTF-8"?>'?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
2、调用首页地址
<url>
<loc>[!--news.url--]</loc>
<priority>1.000</priority>
</url>
3、循环栏目页地址
[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]
4、循环文章正文地址
[e:loop={"select * from [!db.pre!]ecms_news order by id desc",0,24,0}]
<url>
<loc><?=$bqsr[titleurl]?></loc>
<lastmod><?=format_datetime($bqr[newstime],'Y-m-d')?></lastmod>
<priority>0.7000</priority>
</url>
[/e:loop]
[e:loop={"select * from [!db.pre!]ecms_photo order by id desc",0,24,0}]
<url>
<loc><?=$bqsr[titleurl]?></loc>
<lastmod><?=format_datetime($bqr[newstime],'Y-m-d')?></lastmod>
<priority>0.7000</priority>
</url>
[/e:loop]
[e:loop={"select * from [!db.pre!]ecms_movie order by id desc",0,24,0}]
<url>
<loc><?=$bqsr[titleurl]?></loc>
<lastmod><?=format_datetime($bqr[newstime],'Y-m-d')?></lastmod>
<priority>0.7000</priority>
</url>
[/e:loop]
!!!注意:如果站点根地址设置的是“/”,则必须添加站点地址。
帝国cms(默认)系统模型
序号 模型名称
1 新闻系统数据表 ( phome_ecms_news )
2 下载系统数据表 ( phome_ecms_download )
3 图片系统数据表 ( phome_ecms_photo )
4 FLASH系统数据表 ( phome_ecms_flash )
5 电影系统数据表 ( phome_ecms_movie )
6 商城系统数据表 ( phome_ecms_shop )
7 文章系统数据表 ( phome_ecms_article )
8 分类信息数据表 ( phome_ecms_info )
如下示例是两个系统模型:既新闻模型和图片模型
<?='<?xml version="1.0" encoding="UTF-8"?>'?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url>
<loc>https://www.78moban.com[!--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>https://www.78moban.com<?=$sccurl?></loc>
<priority>0.6000</priority>
</url>
[/e:loop]
[e:loop={"select * from [!db.pre!]ecms_news order by id desc",0,24,0}]
<url>
<loc>https://www.78moban.com<?=$bqsr[titleurl]?></loc>
<lastmod><?=format_datetime($bqr[newstime],'Y-m-d')?></lastmod>
<priority>0.7000</priority>
</url>
[/e:loop]
[e:loop={"select * from [!db.pre!]ecms_photo order by id desc",0,24,0}]
<url>
<loc>https://www.78moban.com<?=$bqsr[titleurl]?></loc>
<lastmod><?=format_datetime($bqr[newstime],'Y-m-d')?></lastmod>
<priority>0.7000</priority>
</url>
[/e:loop]
</urlset>