atom.php 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. <?php
  2. if(!defined('InEmpireCMS'))
  3. {
  4. exit();
  5. }
  6. header("Content-type: application/xml");
  7. //取得网址
  8. $idurl=substr($public_r['newsurl'],7,-1);
  9. $year=date("Y");
  10. echo"<?xml version=\"1.0\" encoding=\"$pagecode\"?>\n";
  11. ?>
  12. <feed version="0.3" xmlns="http://purl.org/atom/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xml:lang="en">
  13. <title><?=$pagetitle?></title>
  14. <link rel="alternate" type="text/html" href="<?=$pageurl?>" />
  15. <modified><?=gmdate('Y-m-d\TH:i:s',time())?>Z</modified>
  16. <tagline>Latest <?=$public_r['rssnum']?> infos of <?=$pagetitle?></tagline>
  17. <id>tag:<?=$idurl?>,<?=$year?>://1</id>
  18. <generator url="http://www.movabletype.org/" version="3.2">Movable Type</generator>
  19. <copyright>Copyright(C) Empire CMS</copyright>
  20. <?
  21. $field="";
  22. while($r=$empire->fetch($sql))
  23. {
  24. if(empty($field))
  25. {
  26. $field=ReturnTheIntroField($r);
  27. }
  28. //简介
  29. $smalltext=RepSpeRssStr(sub(strip_tags($r[$field]),0,$sublen,false));
  30. //标题链接
  31. $titleurl=RepSpeRssStr(sys_ReturnBqTitleLink($r));
  32. if(!stristr($titleurl,'://'))
  33. {
  34. $titleurl=$sitedomain.$titleurl;
  35. }
  36. $cname=RepSpeRssStr($class_r[$r[classid]]['classname']);
  37. $newstime=gmdate('Y-m-d\TH:i:s',$r['newstime']);
  38. ?>
  39. <entry>
  40. <title><![CDATA[<?=RepSpeRssStr($r['title'])?>]]></title>
  41. <link rel="alternate" type="text/html" href="<?=$titleurl?>" />
  42. <modified><?=$newstime?>Z</modified>
  43. <id>tag:<?=$idurl?>,<?=$year?>://1</id>
  44. <created><?=$newstime?>Z</created>
  45. <author><![CDATA[<?=RepSpeRssStr($r['writer'])?>]]></author>
  46. <dc:subject><?=$cname?></dc:subject>
  47. <content type="text/html" mode="escaped" xml:lang="en" xml:base="<?=$pageurl?>"><![CDATA[ <?=$smalltext?> ]]></content>
  48. </entry>
  49. <?
  50. }
  51. ?>
  52. </feed>