コード例 #1
0
function wikiplugin_posts($data, $params) {
	global $smarty, $prefs, $tikilib;

	if (isset($params['rssId'])) {
		$rssId = $params['rssId'];
	} else {
		return tra('rssId is mandatory');
	}
	
	$rsslib = new RssLib;
		
	$max = isset($params['max']) ? $params['max'] : 5;
	
	$blog = $rsslib->get_rss_module($rssId);
	$items = $rsslib->get_feed_items($rssId, $max);

	$smarty->assign('blog', $blog);
	$smarty->assign('posts', $items);
	return "~np~ ".$smarty->fetch('pe-rss_posts.tpl')." ~/np~";
}
コード例 #2
0
if (isset($_REQUEST["rssId"])) {
    $smarty->assign('rssId', $_REQUEST["rssId"]);
}
$smarty->assign('preview', 'n');
if (isset($_REQUEST["view"])) {
    $smarty->assign('preview', 'y');
    $data = $rsslib->get_rss_module_content($_REQUEST["view"]);
    $items = $rsslib->parse_rss_data($data, $_REQUEST["view"]);
    if ($items[0]["isTitle"] == "y") {
        $smarty->assign_by_ref('feedtitle', $items[0]);
        $items = array_slice($items, 1);
    }
    $smarty->assign_by_ref('items', $items);
}
if (isset($_REQUEST["rssId"])) {
    $info = $rsslib->get_rss_module($_REQUEST["rssId"]);
} else {
    $info = array();
    // default for new rss feed:
    $info["name"] = '';
    $info["description"] = '';
    $info["url"] = '';
    $info["refresh"] = 1;
    $info["showTitle"] = 'n';
    $info["showPubDate"] = 'n';
}
$smarty->assign('name', $info["name"]);
$smarty->assign('description', $info["description"]);
$smarty->assign('url', $info["url"]);
$smarty->assign('refresh', $info["refresh"]);
$smarty->assign('showTitle', $info["showTitle"]);
コード例 #3
0
require_once 'tiki-setup.php';
include_once 'lib/rss/rsslib.php';
//get_strings tra('External Feeds')
$auto_query_args = array('rssId', 'offset', 'maxRecords', 'sort_mode', 'find');
if (!isset($rsslib)) {
    $rsslib = new RssLib();
}
$access->check_permission('tiki_p_admin_rssmodules');
if (isset($_REQUEST["rssId"])) {
    $smarty->assign('rssId', $_REQUEST["rssId"]);
    $cookietab = 2;
}
$smarty->assign('preview', 'n');
if (isset($_REQUEST["view"])) {
    $smarty->assign('preview', 'y');
    $data = $rsslib->get_rss_module($_REQUEST["view"]);
    if ($data['sitetitle']) {
        $smarty->assign('feedtitle', array('title' => $data['sitetitle'], 'link' => $data['siteurl']));
    }
    $smarty->assign('items', $rsslib->get_feed_items($_REQUEST['view']));
}
if (isset($_REQUEST["rssId"])) {
    $info = $rsslib->get_rss_module($_REQUEST["rssId"]);
} else {
    $info = array();
    // default for new rss feed:
    $info["name"] = '';
    $info["description"] = '';
    $info["url"] = '';
    $info["refresh"] = 1800;
    $info["showTitle"] = 'n';
コード例 #4
0
ファイル: admin_rssmodules.php プロジェクト: bitweaver/rss
// Copyright (c) 2002-2003, Luis Argerich, Garland Foster, Eduardo Polidor, et. al.
// All Rights Reserved. See below for details and a complete list of authors.
// Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See http://www.gnu.org/copyleft/lesser.html for details.
// Initialization
require_once '../../kernel/setup_inc.php';
include_once RSS_PKG_PATH . 'rss_lib.php';
if (!isset($rsslib)) {
    $rsslib = new RssLib();
}
$gBitSystem->verifyPermission('p_admin');
if (!isset($_REQUEST["rss_id"])) {
    $_REQUEST["rss_id"] = 0;
}
$gBitSmarty->assign('rss_id', $_REQUEST["rss_id"]);
if (isset($_REQUEST["view"])) {
    $feedHash = $rsslib->get_rss_module($_REQUEST["view"]);
    $url = $feedHash['url'];
    //load up SimplePie
    require_once UTIL_PKG_PATH . 'simplepie/simplepie.inc';
    $feed = new SimplePie();
    $feed->set_feed_url($url);
    $feed->enable_cache(FALSE);
    //we don't cache these previews since in theory we want to confirm that we are getting the feed ok
    $feed->init();
    $feed->handle_content_type();
    $items = $feed->get_items();
    $gBitSmarty->assignByRef('items', $items);
}
if ($_REQUEST["rss_id"]) {
    $info = $rsslib->get_rss_module($_REQUEST["rss_id"]);
} else {