1500字范文,内容丰富有趣,写作好帮手!
1500字范文 > 【帝国CMS】网站地图sitemap制作与自动更新

【帝国CMS】网站地图sitemap制作与自动更新

时间:2023-01-30 06:39:14

相关推荐

【帝国CMS】网站地图sitemap制作与自动更新

代码如下:

<?='<?xml version="1.0" encoding="UTF-8"?>'?><urlset xmlns="/schemas/sitemap/0.9"><url><loc></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>/e/tags/?tagname=<?=$bqr['tagname']?></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>

网址修改成自己网站的域名。

[e:loop={0,3000,3,0,'','newstime DESC'}] 所有文章。3000为文章数量,更具自己网站的需求改。

[e:loop={"select * from [!db.pre!]enewstags order by tagid",0,24,0}] 调取tags里所有信息。

登录网站的后台http://你的域名/e/admin/

进入后台栏目 =》增加自定义页面 =》选择直接页面,页面名称为:网站地图,文件名修改为 ../../sitemap.xml

最后一步设置自动更新:

系统 =》计划任务 =》 管理计划任务 =》 刷新自定页面 =》

多多少少还是有一些页面链接没有被生成在网站地图里(sitemap.xml)。 还需要继续琢磨琢磨,待有最新的,再更新给大家看。

关于sitemap.xml参考资料:

/wiki/44

/college/courseinfo?id=267&page=2

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。