forked from VariousImpressCMSModulesBox/wiwimod
-
Notifications
You must be signed in to change notification settings - Fork 0
/
rss.php
53 lines (44 loc) · 1.96 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
45
46
47
48
49
50
51
52
53
<?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 SimplyWiki 1.2
* @package SimplyWiki
* @version $Id$
*/
/** Include the module's header for all pages */
include_once 'header.php';
/** Include the header for the site */
include_once ICMS_ROOT_PATH . '/header.php';
$clean_author = isset($_GET['author']) ? (int) $_GET['author'] : FALSE;
$clean_type = isset($_GET['type']) ? $_GET['type'] : FALSE;
$module_name = $icmsModule->name();
/** Include the core rss class and create a new feed instance */
include_once ICMS_ROOT_PATH . '/class/icmsfeed.php';
$wiki_feed = new IcmsFeed();
$wiki_feed->title = $module_name . ' - ' . $icmsConfig['sitename'];
$wiki_feed->url = ICMS_URL. '/modules/' . $wikiModDir . '/';
$wiki_feed->description = $icmsConfig['slogan'];
$wiki_feed->language = _LANGCODE;
$wiki_feed->charset = _CHARSET;
$wiki_feed->category = $module_name;
/** Include the SimplyWiki class and create a new instance */
include_once 'class/wiwiRevision.class.php';
$wiki_page_handler = new WiwiRevisionHandler();
/** Establish a handler for determining the page author */
$wiki_author_handler = new XoopsMemberHandler($xoopsDB);
$pages = $wiki_page_handler->getRevisions($clean_author, $clean_type);
foreach($pages as $page) {
$wiki_feed->feeds[] = array (
'title' => $page->title,
'link' => str_replace('&', '&', ICMS_URL . '/modules/' . $wikiModDir . '/index.php?page=' . $page->keyword),
'description' => htmlspecialchars(str_replace('&', '&', ICMS_URL . '/modules/' . $wikiModDir . '/index.php?page=' . $page->keyword), ENT_QUOTES),
'pubdate' => $page->lastmodified,
'guid' => str_replace('&', '&', ICMS_URL . '/modules/' . $wikiModDir . '/index.php?page=' . $page->keyword),
'category' => $module_name,
'author' => $wiki_author_handler->getUser($page->creator)->uname()
);
}
$wiki_feed->render();