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

MBOXCreator::createFeed (  ) 

Builds the MBOX contents.

Returns:
string the feed's complete text

Reimplemented from FeedCreator.

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

References FeedCreator::iTrunc().

                          {
        global $config;
        for ($i=0;$i<count($this->items);$i++) {
            if ($this->items[$i]->author!="") {
                $from = $this->items[$i]->author;
            } else {
                $from = $this->title;
            }
            $itemDate = new FeedDate($this->items[$i]->date);
            $feed.= "From ".strtr(MBOXCreator::qp_enc($from)," ","_")." ".date("D M d H:i:s Y",$itemDate->unix())."\n";
            $feed.= "Content-Type: text/plain;\n";
            $feed.= "    charset=\"".$config->outputEnc."\"\n";
            $feed.= "Content-Transfer-Encoding: quoted-printable\n";
            $feed.= "Content-Type: text/plain\n";
            $feed.= "From: \"".MBOXCreator::qp_enc($from)."\"\n";
            $feed.= "Date: ".$itemDate->rfc822()."\n";
            $feed.= "Subject: ".MBOXCreator::qp_enc(FeedCreator::iTrunc($this->items[$i]->title,100))."\n";
            $feed.= "\n";
            $body = chunk_split(MBOXCreator::qp_enc($this->items[$i]->description));
            $feed.= preg_replace("~\nFrom ([^\n]*)(\n?)~","\n>From $1$2\n",$body);
            $feed.= "\n";
            $feed.= "\n";
        }
        return $feed;
    }


Generated by  Doxygen 1.6.0   Back to index