コード例 #1
0
ファイル: feed.php プロジェクト: Harvie/dokuwiki
// create new feed
$rss = new DokuWikiFeedCreator();
$rss->title = $conf['title'] . ($opt['namespace'] ? ' ' . $opt['namespace'] : '');
$rss->link = DOKU_URL;
$rss->syndicationURL = DOKU_URL . 'feed.php';
$rss->cssStyleSheet = DOKU_URL . 'lib/exe/css.php?s=feed';
$image = new FeedImage();
$image->title = $conf['title'];
$image->url = DOKU_URL . "lib/images/favicon.ico";
$image->link = DOKU_URL;
$rss->image = $image;
$data = null;
if ($opt['feed_mode'] == 'list') {
    $data = rssListNamespace($opt);
} elseif ($opt['feed_mode'] == 'search') {
    $data = rssSearch($opt);
} else {
    $eventData = array('opt' => &$opt, 'data' => &$data);
    $event = new Doku_Event('FEED_MODE_UNKNOWN', $eventData);
    if ($event->advise_before(true)) {
        $data = rssRecentChanges($opt);
    }
    $event->advise_after();
}
rss_buildItems($rss, $data, $opt);
$feed = $rss->createFeed($opt['feed_type'], 'utf-8');
// save cachefile
$cache->storeCache($feed);
// finally deliver
print $feed;
// ---------------------------------------------------------------- //
コード例 #2
0
}
// create new feed
$rss = new DokuWikiFeedCreator();
$rss->title = $conf['title'] . ($opt['namespace'] ? ' ' . $opt['namespace'] : '');
$rss->link = DOKU_URL;
$rss->syndicationURL = DOKU_URL . 'feed.php';
$rss->cssStyleSheet = DOKU_URL . 'lib/exe/css.php?s=feed';
$image = new FeedImage();
$image->title = $conf['title'];
$image->url = DOKU_URL . "lib/images/favicon.ico";
$image->link = DOKU_URL;
$rss->image = $image;
if ($opt['feed_mode'] == 'list') {
    rssListNamespace($rss, $opt);
} elseif ($opt['feed_mode'] == 'search') {
    rssSearch($rss, $opt);
} else {
    rssRecentChanges($rss, $opt);
}
$feed = $rss->createFeed($opt['feed_type'], 'utf-8');
// save cachefile
io_saveFile($cache, $feed);
// finally deliver
print $feed;
// ---------------------------------------------------------------- //
/**
 * Get URL parameters and config options and return a initialized option array
 *
 * @author Andreas Gohr <*****@*****.**>
 */
function rss_parseOptions()