xml.php 965 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  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. <source>
  10. <url><?=$pageurl?></url>
  11. <?
  12. $field="";
  13. while($r=$empire->fetch($sql))
  14. {
  15. if(empty($field))
  16. {
  17. $field=ReturnTheIntroField($r);
  18. }
  19. //简介
  20. $smalltext=RepSpeRssStr(sub(strip_tags($r[$field]),0,$sublen,false));
  21. //标题链接
  22. $titleurl=RepSpeRssStr(sys_ReturnBqTitleLink($r));
  23. if(!stristr($titleurl,'://'))
  24. {
  25. $titleurl=$sitedomain.$titleurl;
  26. }
  27. $cname=RepSpeRssStr($class_r[$r[classid]]['classname']);
  28. $thetime=$r['newstime'];
  29. $mydate=gmdate('Y-m-d',$thetime);
  30. $mytime=gmdate('H:i',$thetime);
  31. ?>
  32. <info id="<?=$r['id']?>">
  33. <title><![CDATA[<?=RepSpeRssStr($r['title'])?>]]></title>
  34. <url><?=$titleurl?></url>
  35. <author><![CDATA[ <?=RepSpeRssStr($r['writer'])?> ]]></author>
  36. <classname><?=$cname?></classname>
  37. <date><?=$mydate?></date>
  38. <time><?=$mytime?></time>
  39. </info>
  40. <?
  41. }
  42. ?>
  43. </source>