/lib/exe */ require_once DOKU_INC . "lib/plugins/news/scripts/feedData.php"; class externalNewsFeed extends feedData { var $ttl; function __construct($outfile=null,$ttl=720, $subfeed = "") { $this->ttl = $ttl; parent::__construct($subfeed); $handle = null; if($outfile) { $handle = fopen($outfile,'wb'); if(!flock($handle,LOCK_EX)) { fclose($handle); return; } } if($handle) { fwrite($handle,$this->write_header()); while($this->feed_data()) { fwrite($handle,$this->write_item()); } fwrite($handle,$this->footer()); flock($handle,LOCK_UN); fclose($handle); } else { echo $this->write_header(); while($this->feed_data()) { echo $this->write_item(); } echo $this->footer(); } } function write_item() { $src_url=$this->news_feed_url(); $src_title = $this->title(); ; $link = $this->url() . '#' . $this->rss_id() ; $title = $this->title(); $date = $this->date(); $guid = $link; $desc = $this->description(); return << <![CDATA[$title]]> $date $guid ITEM; } function write_header () { global $lib_exe; global $newsFeedURL; $date = $this->news_feed_date(); if($lib_exe) { $link = $newsFeedURL; } else { $link = $this->news_feed_url(); } $title = $this->channel_title(); $desc = $this->channel_description(); $ttl = $this->channel_ttl(); return << $title $link $desc en-us $date $ttl HEAD; } function footer() { return "\n\n\n"; } } ?>