Logo Search packages:      
Sourcecode: websvn version File versions  Download package

AtomCreator03::createFeed (  ) 

Builds the feed's text.

Returns:
string the feed's complete text

Reimplemented from FeedCreator.

Definition at line 914 of file feedcreator.class.php.

References FeedCreator::_createAdditionalElements(), and FeedCreator::_createGeneratorComment().

                          {
        $feed = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n";
        $feed.= $this->_createGeneratorComment();
        $feed.= "<feed version=\"0.3\" xmlns=\"http://purl.org/atom/ns#\"";
        if ($this->language!="") {
            $feed.= " xml:lang:\"".$this->language."\"";
        }
        $feed.= ">\n";
        $feed.= "    <title>".htmlspecialchars($this->title)."</title>\n";
        $feed.= "    <tagline>".htmlspecialchars($this->description)."</tagline>\n";
        $feed.= "    <link rel=\"alternate\" type=\"text/html\" href=\"".htmlspecialchars($this->link)."\"/>\n";
        $feed.= "    <id>".$this->link."</id>\n";
        $now = new FeedDate();
        $feed.= "    <modified>".htmlspecialchars($now->iso8601())."</modified>\n";
        if ($this->editor!="") {
            $feed.= "    <author>\n";
            $feed.= "        <name>".$this->editor."</name>\n";
            if ($this->editorEmail!="") {
                $feed.= "        <email>".$this->editorEmail."</email>\n";
            }
            $feed.= "    </author>\n";
        }
        $feed.= "    <generator>".FEEDCREATOR_VERSION."</generator>\n";
        $feed.= $this->_createAdditionalElements($this->additionalElements, "    ");
        for ($i=0;$i<count($this->items);$i++) {
            $feed.= "    <entry>\n";
            $feed.= "        <title>".htmlspecialchars(strip_tags($this->items[$i]->title))."</title>\n";
            $feed.= "        <link rel=\"alternate\" type=\"text/html\" href=\"".htmlspecialchars($this->items[$i]->link)."\"/>\n";
            if ($this->items[$i]->date=="") {
                $this->items[$i]->date = time();
            }
            $itemDate = new FeedDate($this->items[$i]->date);
            $feed.= "        <created>".htmlspecialchars($itemDate->iso8601())."</created>\n";
            $feed.= "        <issued>".htmlspecialchars($itemDate->iso8601())."</issued>\n";
            $feed.= "        <modified>".htmlspecialchars($itemDate->iso8601())."</modified>\n";
            $feed.= "        <id>".$this->items[$i]->link."</id>\n";
            $feed.= $this->_createAdditionalElements($this->items[$i]->additionalElements, "        ");
            if ($this->items[$i]->author!="") {
                $feed.= "        <author>\n";
                $feed.= "            <name>".htmlspecialchars($this->items[$i]->author)."</name>\n";
                $feed.= "        </author>\n";
            }
            if ($this->items[$i]->description!="") {
                $feed.= "        <summary>".htmlspecialchars($this->items[$i]->description)."</summary>\n";
            }
            $feed.= "    </entry>\n";
        }
        $feed.= "</feed>\n";
        return $feed;
    }


Generated by  Doxygen 1.6.0   Back to index