-
Notifications
You must be signed in to change notification settings - Fork 2
/
rss.php
44 lines (38 loc) · 1.56 KB
/
rss.php
1
2
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
<?php
/**
* Generating an RSS feed
*
* @copyright http://smartfactory.ca The SmartFactory
* @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU General Public License (GPL)
* @since 1.0
* @author marcan aka Marc-André Lanciault <marcan@smartfactory.ca>
* @package imblogging
*
*/
/**
* Include the module's header for all pages
*/
include_once 'header.php';
include_once ICMS_ROOT_PATH . '/header.php';
$clean_post_uid = isset($_GET['uid']) ? (int) $_GET['uid'] : false;
$clean_cat_id = isset($_GET['cid']) ? (int) $_GET['cid'] : false;
$imblogging_feed = new icms_feeds_Rss();
$imblogging_feed->title = $icmsConfig['sitename'] . ' - ' . icms::$module->getVar("name");
$imblogging_feed->url = ICMS_URL;
$imblogging_feed->description = htmlspecialchars($icmsConfig['slogan'], ENT_QUOTES);
$imblogging_feed->language = _LANGCODE;
$imblogging_feed->charset = _CHARSET;
$imblogging_feed->category = icms::$module->getVar("name");
$imblogging_post_handler = icms_getModuleHandler('post', $moddir, 'imblogging');
$postsArray = $imblogging_post_handler->getPosts(0, 10, $clean_post_uid, $clean_cat_id);
foreach ($postsArray as $postArray) {
$imblogging_feed->feeds[] = array(
'title' => $postArray['post_title'],
'link' => str_replace('&', '&', $postArray['itemUrl']),
'description' => htmlspecialchars(str_replace('&', '&', $postArray['post_lead']), ENT_QUOTES),
'pubdate' => date('r', $postArray['post_published_date_int']),
'guid' => str_replace('&', '&', $postArray['itemUrl']),
'author' => '',
'category' => '');
}
$imblogging_feed->render();