rss10.php 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. <?
  2. if(!defined('InEmpireCMS'))
  3. {
  4. exit();
  5. }
  6. header("Content-type: application/xml");
  7. echo"<?xml version=\"1.0\" encoding=\"$pagecode\"?>\n";
  8. ?>
  9. <rdf:RDF
  10. xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
  11. xmlns:dc="http://purl.org/dc/elements/1.1/"
  12. xmlns:syn="http://purl.org/rss/1.0/modules/syndication/"
  13. xmlns="http://purl.org/rss/1.0/">
  14. <channel rdf:about="<?=$public_r['newsurl']?>">
  15. <title><?=$pagetitle?></title>
  16. <link><?=$pageurl?></link>
  17. <description>Latest <?=$public_r['rssnum']?> infos of <?=$pagetitle?></description>
  18. <syn:updatePeriod>hourly</syn:updatePeriod>
  19. <syn:updateFrequency>1</syn:updateFrequency>
  20. <syn:updateBase>1970-01-01T00:00Z</syn:updateBase>
  21. <dc:creator>Empire CMS</dc:creator>
  22. <dc:date><?=gmdate('Y-m-d\TH:i:s',time())?>Z</dc:date>
  23. <items>
  24. <rdf:Seq>
  25. <rdf:li rdf:resource="<?=$public_r['newsurl']?>" />
  26. </rdf:Seq>
  27. </items>
  28. </channel>
  29. <?
  30. $field="";
  31. while($r=$empire->fetch($sql))
  32. {
  33. if(empty($field))
  34. {
  35. $field=ReturnTheIntroField($r);
  36. }
  37. //简介
  38. $smalltext=RepSpeRssStr(sub(strip_tags($r[$field]),0,$sublen,false));
  39. //标题链接
  40. $titleurl=RepSpeRssStr(sys_ReturnBqTitleLink($r));
  41. if(!stristr($titleurl,'://'))
  42. {
  43. $titleurl=$sitedomain.$titleurl;
  44. }
  45. $cname=RepSpeRssStr($class_r[$r[classid]]['classname']);
  46. $newstime=gmdate('Y-m-d\TH:i:s',$r['newstime']);
  47. ?>
  48. <item rdf:about="<?=$titleurl?>">
  49. <title><![CDATA[<?=RepSpeRssStr($r['title'])?>]]></title>
  50. <link><?=$titleurl?></link>
  51. <description><![CDATA[ <?=$smalltext?> ]]></description>
  52. <dc:subject><?=$cname?></dc:subject>
  53. <dc:creator><![CDATA[<?=RepSpeRssStr($r['writer'])?>]]></dc:creator>
  54. <dc:date><?=$newstime?>Z</dc:date>
  55. </item>
  56. <?
  57. }
  58. ?>
  59. </rdf:RDF>