Newer
Older
<?php
/***************************************************************************
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
* FeedCreator class v1.7.2-ppt
* originally (c) Kai Blankenhorn
* www.bitfolge.de
* kaib@bitfolge.de
* v1.3 work by Scott Reynen (scott@randomchaos.com) and Kai Blankenhorn
* v1.5 OPML support by Dirk Clemens
* v1.7.2-mod on-the-fly feed generation by Fabian Wolf (info@f2w.de)
* v1.7.2-ppt ATOM 1.0 support by Mohammad Hafiz bin Ismail (mypapit@gmail.com)
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* @author www.bitfolge.de
*
* Changelog:
*
* this version contains some smaller modifications for DokuWiki as well
*
* v1.7.2-ppt 11-21-05
* added Atom 1.0 support
* added enclosure support for RSS 2.0/ATOM 1.0
* added docs for v1.7.2-ppt only!
*
* v1.7.2-mod 03-12-05
* added output function outputFeed for on-the-fly feed generation
*
* v1.7.2 10-11-04
* license changed to LGPL
*
* v1.7.1
* fixed a syntax bug
* fixed left over debug code
*
* v1.7 07-18-04
* added HTML and JavaScript feeds (configurable via CSS) (thanks to Pascal Van Hecke)
* added HTML descriptions for all feed formats (thanks to Pascal Van Hecke)
* added a switch to select an external stylesheet (thanks to Pascal Van Hecke)
* changed default content-type to application/xml
* added character encoding setting
* fixed numerous smaller bugs (thanks to Sören Fuhrmann of golem.de)
* improved changing ATOM versions handling (thanks to August Trometer)
* improved the UniversalFeedCreator's useCached method (thanks to Sören Fuhrmann of golem.de)
* added charset output in HTTP headers (thanks to Sören Fuhrmann of golem.de)
* added Slashdot namespace to RSS 1.0 (thanks to Sören Fuhrmann of golem.de)
*
* See www.bitfolge.de for additional changelog info
*/
define("TIME_ZONE",date("O", time()));
define("FEEDCREATOR_VERSION", "FeedCreator 1.7.2-ppt DokuWiki");
/**
* A FeedItem is a part of a FeedCreator feed.
*
* @author Kai Blankenhorn <kaib@bitfolge.de>
* @since 1.3
*/
class FeedItem extends HtmlDescribable {
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
/**
* Mandatory attributes of an item.
*/
var $title, $description, $link;
/**
* Optional attributes of an item.
*/
var $author, $authorEmail, $image, $category, $comments, $guid, $source, $creator;
/**
* Publishing date of an item. May be in one of the following formats:
*
* RFC 822:
* "Mon, 20 Jan 03 18:05:41 +0400"
* "20 Jan 03 18:05:41 +0000"
*
* ISO 8601:
* "2003-01-20T18:05:41+04:00"
*
* Unix:
* 1043082341
*/
var $date;
/**
* Add <enclosure> element tag RSS 2.0
* modified by : Mohammad Hafiz bin Ismail (mypapit@gmail.com)
*
*
* display :
* <enclosure length="17691" url="http://something.com/picture.jpg" type="image/jpeg" />
*
*/
var $enclosure;
/**
* Any additional elements to include as an assiciated array. All $key => $value pairs
* will be included unencoded in the feed item in the form
* <$key>$value</$key>
* Again: No encoding will be used! This means you can invalidate or enhance the feed
* if $value contains markup. This may be abused to embed tags not implemented by
* the FeedCreator class used.
*/
var $additionalElements = Array();
// on hold
// var $source;
class EnclosureItem extends HtmlDescribable {
/*
*
* core variables
*
**/
var $url,$length,$type;
/*
* For use with another extension like Yahoo mRSS
* Warning :
* These variables might not show up in
* later release / not finalize yet!
*
*/
var $width, $height, $title, $description, $keywords, $thumburl;
var $additionalElements = Array();
}
/**
* An FeedImage may be added to a FeedCreator feed.
* @author Kai Blankenhorn <kaib@bitfolge.de>
* @since 1.3
*/
class FeedImage extends HtmlDescribable {
/**
* Mandatory attributes of an image.
*/
var $title, $url, $link;
/**
* Optional attributes of an image.
*/
var $width, $height, $description;
}
/**
* An HtmlDescribable is an item within a feed that can have a description that may
* include HTML markup.
*/
class HtmlDescribable {
/**
* Indicates whether the description field should be rendered in HTML.
*/
var $descriptionHtmlSyndicated;
/**
* Indicates whether and to how many characters a description should be truncated.
*/
var $descriptionTruncSize;
/**
* Returns a formatted description field, depending on descriptionHtmlSyndicated and
* $descriptionTruncSize properties
* @return string the formatted description
*/
function getDescription() {
$descriptionField = new FeedHtmlField($this->description);
$descriptionField->syndicateHtml = $this->descriptionHtmlSyndicated;
$descriptionField->truncSize = $this->descriptionTruncSize;
return $descriptionField->output();
}
Loading
Loading full blame...