out_class.php
上传用户:yttaitong
上传日期:2009-05-10
资源大小:128k
文件大小:1k
源码类别:

WEB源码(ASP,PHP,...)

开发平台:

PHP

  1. <?php
  2. /*
  3.     [BBWPS!] (C)2006-2010 小蜜蜂版权所有.
  4. This is NOT a freeware, use is subject to license terms
  5.     时间:2007年12月
  6.     描述:
  7. */
  8. class OUTFeed {
  9. var $m_OUTversion = '1.0';
  10. var $m_XMLversion = '1.0';
  11. var $m_channel = NULL;
  12. var $m_FeedItem = '';
  13. var $m_channelItem = '';
  14. function OUTFeed($OUTVersion="1.0") {
  15. $this->__construct($OUTVersion);
  16. }
  17. function __construct($OUTVersion){
  18. $this->m_OUTversion=$OUTVersion;
  19. $this->m_channel ="<?xml version="".$this->m_XMLversion."" encoding="gbk"?>n";
  20. $this->m_channel.="<out version="".$this->m_OUTversion."">n";
  21. }
  22. function __destruct(){
  23. unset($this->m_channelItem,$this->m_channel,$this->m_FeedItem);
  24. }
  25. function addFeedItem($ItemArray) {
  26. $this->m_FeedItem .= "t<item>n";
  27. foreach ($ItemArray as $tag=>$text){
  28. $text=rawurlencode($text);
  29. $this->m_FeedItem .= "tt<".$tag.">".$text."</".$tag.">n";
  30. }
  31. $this->m_FeedItem .= "t</item>n";
  32. }
  33. function releaseFeed() {
  34. header("Content-Type: text/xml");
  35. print $this->m_channel;
  36. print $this->m_FeedItem;
  37. print "</out>";
  38. }
  39. }
  40. ?>