1 | <?php |
---|
2 | // Chech whether we are indeed included by Piwigo. |
---|
3 | if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!'); |
---|
4 | |
---|
5 | include_once(PHPWG_ROOT_PATH.'include/feedcreator.class.php'); |
---|
6 | $rss = new UniversalFeedCreator(); |
---|
7 | $rss->encoding=get_pwg_charset(); |
---|
8 | $rss->title = $page['evil_blog']['blog_name']; |
---|
9 | $rss->link = get_gallery_home_url(); |
---|
10 | $rss->description = $page['evil_blog']['blog_description']; |
---|
11 | |
---|
12 | $result = pwg_query(" |
---|
13 | SELECT id, UNIX_TIMESTAMP(date) AS date, header, text |
---|
14 | FROM `".Evil_Blog_Table."` |
---|
15 | WHERE 1 |
---|
16 | ORDER BY `date` DESC |
---|
17 | "); |
---|
18 | while ($row = pwg_db_fetch_assoc($result)) { |
---|
19 | if($ExDesc['state'] == 'active') { |
---|
20 | $row['text'] = get_extended_desc($row['text']); |
---|
21 | $row['header'] = get_user_language_desc($row['header']); |
---|
22 | } |
---|
23 | $item = new FeedItem(); |
---|
24 | $item->title = $row['header']; |
---|
25 | $item->description = $row['text']; |
---|
26 | $item->date = $row['date']; |
---|
27 | $item->descriptionHtmlSyndicated = true; |
---|
28 | $rss->addItem($item); |
---|
29 | } |
---|
30 | |
---|
31 | $fileName= PHPWG_ROOT_PATH.$conf['data_location'].'tmp'; |
---|
32 | mkgetdir($fileName); // just in case |
---|
33 | $fileName.='/evil_blog_feed.xml'; |
---|
34 | // send XML feed |
---|
35 | echo $rss->saveFeed('RSS2.0', $fileName, true); |
---|
36 | |
---|
37 | /*$item = new FeedItem(); |
---|
38 | foreach ($item as $key => $value) { |
---|
39 | echo $key.' = '. $value . '<br>'; |
---|
40 | }*/ |
---|
41 | ?> |
---|