contentType = "application/atom+xml"; $this->encoding = "utf-8"; } /** @inheritdoc */ public function createFeed() { $feed = "encoding."\"?>\n"; $feed .= $this->_createGeneratorComment(); $feed .= $this->_createStylesheetReferences(); $feed .= "items[0]->lat)) { $feed .= " xmlns:georss=\"http://www.georss.org/georss\"\n"; } if ($this->language != "") { $feed .= " xml:lang=\"".$this->language."\""; } $feed .= ">\n"; $feed .= " ".htmlspecialchars((string) $this->title)."\n"; $feed .= " ".htmlspecialchars($this->description)."\n"; $feed .= " link)."\"/>\n"; $feed .= " ".htmlspecialchars((string) $this->link)."\n"; $now = new FeedDate(); $feed .= " ".htmlspecialchars($now->iso8601())."\n"; if ($this->editor != "") { $feed .= " \n"; $feed .= " ".$this->editor."\n"; if ($this->editorEmail != "") { $feed .= " ".$this->editorEmail."\n"; } $feed .= " \n"; } if ($this->category != "") { $feed .= " category)."\" />\n"; } if ($this->copyright != "") { $feed .= " ".FeedCreator::iTrunc(htmlspecialchars($this->copyright), 100)."\n"; } $feed .= " ".$this->version()."\n"; $feed .= " syndicationURL )."\" />\n"; $feed .= $this->_createAdditionalElements($this->additionalElements, " "); for ($i = 0; $i < count($this->items); $i++) { $feed .= " \n"; $feed .= " ".htmlspecialchars(strip_tags((string) $this->items[$i]->title))."\n"; $feed .= " items[$i]->link )."\"/>\n"; if ($this->items[$i]->date == "") { $this->items[$i]->date = time(); } $itemDate = new FeedDate($this->items[$i]->date); $feed .= " ".htmlspecialchars($itemDate->iso8601())."\n"; $feed .= " ".htmlspecialchars($itemDate->iso8601())."\n"; $tempguid = $this->items[$i]->link; if ($this->items[$i]->guid != "") { $tempguid = $this->items[$i]->guid; } $feed .= " ".htmlspecialchars((string) $tempguid)."\n"; $feed .= $this->_createAdditionalElements($this->items[$i]->additionalElements, " "); if ($this->items[$i]->author != "") { $feed .= " \n"; $feed .= " ".htmlspecialchars($this->items[$i]->author)."\n"; if ($this->items[$i]->authorEmail != "") { $feed .= " ".htmlspecialchars($this->items[$i]->authorEmail)."\n"; } if ($this->items[$i]->authorURL != "") { $feed .= " ".htmlspecialchars($this->items[$i]->authorURL)."\n"; } $feed .= " \n"; } if (!empty($this->items[$i]->category)) { foreach ((array) $this->items[$i]->category as $category) { $feed .= " items[$i]->categoryScheme != "") { $feed .= " scheme=\"".htmlspecialchars($this->items[$i]->categoryScheme)."\" "; } $feed .= " term=\"".htmlspecialchars($category)."\" />\n"; } } if ($this->items[$i]->description != "") { /* * ATOM should have at least summary tag, however this implementation may be inaccurate */ $tempdesc = $this->items[$i]->getDescription(); $temptype = ""; if ($this->items[$i]->descriptionHtmlSyndicated) { $temptype = " type=\"html\""; $tempdesc = $this->items[$i]->getDescription(); } if (empty($this->items[$i]->descriptionTruncSize)) { $feed .= " ".$tempdesc."\n"; } $feed .= " ".$tempdesc."\n"; } else { $feed .= " no summary\n"; } if ($this->items[$i]->enclosure != null) { $feed .= " items[$i]->enclosure->url."\" type=\"".$this->items[$i]->enclosure->type."\" length=\"".$this->items[$i]->enclosure->length."\""; if ($this->items[$i]->enclosure->language != "") { $feed .= " xml:lang=\"".$this->items[$i]->enclosure->language."\" "; } if ($this->items[$i]->enclosure->title != "") { $feed .= " title=\"".$this->items[$i]->enclosure->title."\" "; } $feed .= " /> \n"; } if ($this->items[$i]->lat != "") { $feed .= " ".$this->items[$i]->lat." ".$this->items[$i]->long."\n"; } $feed .= " \n"; } $feed .= "\n"; return $feed; } }