仿站咨询QQ:2587483189

手机微信同号:15850888840

帝国ECMS:灵动标签写的百度新闻协议XML(sitemap)

找了论坛关于百度新闻协议xml,不是非常直观,自己写了个自定义页面的分享给菜鸟朋友们

首先在模板管理选项里新建自定义页面例如:baidumap.xml

下面的代码复制到自定义页面里

<?='<?xml version="1.0" encoding="GB2312"?>'?>

<document>
  <webSite>http://www.xxxxxx.net</webSite>
  <webMaster>admin@admin.com</webMaster>
  <updatePeri>1440</updatePeri>
[e:loop={"select * from [!db.pre!]ecms_news where checked=1 order by newstime",0,24,0}]
<item>
  <link>http://www.xxxxxx.net<?=$bqsr[titleurl]?></link>
  <title><?=$bqr[title]?></title>
  <text><?=sub($bqr[smalltext],0,300,false)?></text>
  <image><?=$bqr[titlepic]?></image>
  <category><?=$bqsr[classname]?></category>
  <pubDate><?=$bqsr[newstime]?></pubDate>
  </item>
[/e:loop]
[e:loop={"select * from [!db.pre!]ecms_download where checked=1 order by newstime",0,24,0}]
<item>
  <link>http://www.xxxxxx.net<?=$bqsr[titleurl]?></link>
  <title><?=$bqr[title]?></title>
  <text><?=sub($bqr[smalltext],0,300,false)?></text>
  <image><?=$bqr[titlepic]?></image>
  <category><?=$bqsr[classname]?></category>
  <pubDate><?=$bqsr[newstime]?></pubDate>
  </item>
[/e:loop]
[e:loop={"select * from [!db.pre!]ecms_article where checked=1 order by newstime",0,24,0}]
<item>
  <link>http://www.xxxxxx.net<?=$bqsr[titleurl]?></link>
  <title><?=$bqr[title]?></title>
  <text><?=sub($bqr[softsay],0,120,false)?></text>
  <image><?=$bqr[titlepic]?></image>
  <category><?=$bqsr[classname]?></category>
  <pubDate><?=$bqsr[newstime]?></pubDate>
  </item>
[/e:loop]

</document>

其中的www.xxxxxx.net改成自己的域名,admin@admin.com改成自己的邮箱,我写的代码里面有3个表,分别是news(新闻),doanload(下载),artucle(文章)
想加入其它的表内容,请复制下面的代码加在</document>之前即可,记住替换你的表名。
[e:loop={"select * from [!db.pre!]ecms_你的表名 where checked=1 order by newstime",0,24,0}]
<item>
  <link>http://www.xxxxxx.net<?=$bqsr[titleurl]?></link>
  <title><?=$bqr[title]?></title>
  <text><?=sub($bqr[softsay],0,120,false)?></text>
  <image><?=$bqr[titlepic]?></image>
  <category><?=$bqsr[classname]?></category>
  <pubDate><?=$bqsr[newstime]?></pubDate>
  </item>
[/e:loop]
之后刷新自定义页面,http://www.xxxxxx.net/baidumap.xml  浏览下效果吧

  • 上一篇:帝国CMS实现文章和图片随即调用效果
  • 下一篇:没有了
  • 来源:未知//所属分类: 帝国仿站 /更新时间:2011-04-24
    相关仿站教程