source: extensions/Evil_Blog/feed.php @ 19048

Last change on this file since 19048 was 19048, checked in by EvilKant, 11 years ago
File size: 1.2 KB
Line 
1<?php
2        include_once(PHPWG_ROOT_PATH.'include/feedcreator.class.php');
3        $rss = new UniversalFeedCreator();
4        $rss->encoding=get_pwg_charset();
5        $rss->title = $page['evil_blog']['blog_name'];
6        $rss->link = get_gallery_home_url();
7        $rss->description = $page['evil_blog']['blog_description'];
8       
9        $result = pwg_query("
10                SELECT id, UNIX_TIMESTAMP(date) AS date, header, text
11                FROM `".Evil_Blog_Table."`
12                WHERE 1
13                ORDER BY `date` DESC
14        ");
15        while ($row = pwg_db_fetch_assoc($result)) {
16                if($ExDesc['state'] == 'active') {
17                                $row['text'] = get_extended_desc($row['text']);
18                                $row['header'] = get_user_language_desc($row['header']);
19                                }
20                $item = new FeedItem();
21                $item->title = $row['header'];
22                $item->description = $row['text'];
23                $item->date = $row['date'];
24                $item->descriptionHtmlSyndicated = true;
25                $rss->addItem($item);
26        }
27       
28        $fileName= PHPWG_ROOT_PATH.$conf['data_location'].'tmp';
29        mkgetdir($fileName); // just in case
30        $fileName.='/evil_blog_feed.xml';
31        // send XML feed
32        echo $rss->saveFeed('RSS2.0', $fileName, true);
33       
34        /*$item = new FeedItem();
35        foreach ($item as $key => $value) {
36                echo $key.' = '. $value . '<br>';
37        }*/
38?>
Note: See TracBrowser for help on using the repository browser.