sheep 发表于 2023-4-18 19:12:44

帝国cms自制网站sitemap地图(xml、txt、html)

帝国sitemap如何制作?通过自定义页面自制帝国网站地图,含xml、txt、html三种格式,默认调用首页、栏目页及文章页链接
注意:xml中<mobile:mobile type="pc,mobile"/>是百度移动sitemap协议,非自适应请修改,pc删除,移动:type="mobile"
默认-sitemapXML:
<?='<?xml version="1.0" encoding="UTF-8"?>'?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:mobile="http://www.baidu.com/schemas/sitemap-mobile/1/">
<url>
<loc>[!--news.url--]</loc>
<mobile:mobile type="pc,mobile"/>
<lastmod><?php echo date("Y-m-d H:i:s") ; ?></lastmod>
<changefreq>Always</changefreq>
<priority>1.00</priority>
</url>
enewsclass order by myorder",0,24,0}]
<?if($bqr['classurl']==''){$sccurl=$public_r['newsurl'].$bqr['classpath']."/";}else{$sccurl=$bqr['classurl']."/";}?>
<url>
<loc><?=$sccurl?></loc>
<mobile:mobile type="pc,mobile"/>
<lastmod><?php echo date("Y-m-d H:i:s") ; ?></lastmod>
<changefreq>Always</changefreq>
<priority>0.80</priority>
</url>

enewstags order by num DESC",0,24,0}]
<url>
<loc>[!--news.url--]<?echo 'tags/'.urlencode($bqr['tagname']).'/';?></loc>
<mobile:mobile type="pc,mobile"/>
<lastmod><?php echo date("Y-m-d H:i:s") ; ?></lastmod>
<changefreq>Always</changefreq>
<priority>0.60</priority>
</url>

ecms_news order by newstime desc",0,24,0}]
<url>
<loc><?=$bqsr?></loc>
<mobile:mobile type="pc,mobile"/>
<lastmod><?=date('Y-m-d H:i:s',$bqr)?></lastmod>
<changefreq>Always</changefreq>
<priority>0.60</priority>
</url>

</urlset>
默认-sitemapTXT:
[!--news.url--]
enewsclass order by myorder",0,24,0}]
<?if($bqr['classurl']==''){$sccurl=$public_r['newsurl'].$bqr['classpath']."/";}else{$sccurl=$bqr['classurl']."/";}?>
<?=$sccurl?>

enewstags order by num DESC",0,24,0}]
[!--news.url--]<?echo 'tags/'.urlencode($bqr['tagname']).'/';?>

ecms_news order by newstime desc",0,24,0}]
<?=$bqsr?>


默认-sitemapHTML:
注意栏目标题调用的是别名,栏目名称用<?=$bqr['classname']?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>站点地图 - <?=$public_r['sitename']?></title>
</head>
<body>
<a href="[!--news.url--]" title="<?=$public_r['sitename']?>"><?=$public_r['sitename']?></a><br>
enewsclass order by myorder",0,24,0}]
<?if($bqr['classurl']==''){$sccurl=$public_r['newsurl'].$bqr['classpath']."/";}else{$sccurl=$bqr['classurl']."/";}?>
<a href="<?=$sccurl?>" title="<?=$bqr['bname']?>"><?=$bqr['bname']?></a><br>

enewstags order by num DESC",0,24,0}]
<a href="[!--news.url--]<?echo 'tags/'.urlencode($bqr['tagname']).'/';?>" title="<?=$bqr?>"><?=$bqr?></a><br>

ecms_news order by newstime desc",0,24,0}]
<a href="<?=$bqsr?>" title="<?=$bqr?>"><?=$bqr?></a><br>

</body>
</html>
static/image/hrline/5.gif


自定页页面链接调用:

提示:where id!=1 and id!=2 and id!=3可排除不需要调用的自定义页面

XML(粘贴至默认map的</urlset>上面):
enewspage where id!=1 and id!=2 and id!=3 order by id',0,24,0}]
<?php $pageurl=$public_r['newsurl'].str_replace('../../','',$bqr['path']);?>
<url>
<loc><?=$pageurl?></loc>
<mobile:mobile type="pc,mobile"/>
<lastmod><?php echo date("Y-m-d H:i:s") ; ?></lastmod>
<changefreq>Always</changefreq>
<priority>0.60</priority>
</url>


TXT(粘贴至默认map的尾部):
enewspage where id!=1 and id!=2 and id!=3 order by id',0,24,0}]
<?php $pageurl=$public_r['newsurl'].str_replace('../../','',$bqr['path']);?>
<?=$pageurl?>


HTML(粘贴至默认map的</body>上面):

enewspage where id!=1 and id!=2 and id!=3 order by id',0,24,0}]
<?php $pageurl=$public_r['newsurl'].str_replace('../../','',$bqr['path']);?>
<a href="<?=$pageurl?> " title="<?=$bqr?>"><?=$bqr?></a><br/>


static/image/hrline/5.gif


专题链接调用:
xml(粘贴至默认map的</urlset>上面):
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><?php echo date("Y-m-d H:i:s") ; ?></lastmod>
<changefreq>daily</changefreq>
<priority>0.6000</priority>
</url>


txt(粘贴至默认map的尾部):
enewszt order by ztid",0,24,0}]
<?if($bqr['zturl']==''){$sccurl=$public_r['newsurl'].$bqr['ztpath']."/";}else{$sccurl=$bqr['zturl']."/";}?>
<?=$sccurl?>


html(粘贴至默认map的</body>上面):
enewszt order by ztid",0,24,0}]
<?if($bqr['zturl']==''){$sccurl=$public_r['newsurl'].$bqr['ztpath']."/";}else{$sccurl=$bqr['zturl']."/";}?>
<a href="<?=$sccurl?>" title="<?=$bqr?>"><?=$bqr?></a><br>




static/image/hrline/line3.png
页: [1]
查看完整版本: 帝国cms自制网站sitemap地图(xml、txt、html)