Beispiel #1
0
/**
 * feed_list_table() - {@internal Missing Short Description}}
 *
 * {@internal Missing Long Description}}
 */
function feed_list_table()
{
    //Defined in admin panel
    $feeds = get_feeds();
    $j = 0;
    $table = '';
    if (is_array($feeds) && !empty($feeds)) {
        foreach ($feeds as $this_feed) {
            $table .= '
		<tr id="feed-' . $j . '" class="' . ($j % 2 ? 'alt' : '') . '">
			<td class="name-col">' . stripslashes($this_feed['name']) . '</td>
			<td class="url-col">' . $this_feed['feed'] . '</td>
			<td class="cat-col">' . $this_feed['cat'] . '</td>
			' . apply_filters('admin-feeds-infocol', '', $this_feed, $j) . '
			<td class="change-col"><a href="feeds.php?change=' . $j . '&amp;action=change" class="change_link">' . _r('Change') . '</a></td>
			<td class="remove-col"><a href="feeds.php?remove=' . $j . '&amp;action=remove">' . _r('Remove') . '</a></td>
			' . apply_filters('admin-feeds-actioncol', '', $this_feed, $j) . '
		</tr>';
            ++$j;
        }
    } else {
        $table = '<tr id="nofeeds"><td>' . _r('You don\'t currently have any feeds. Try <a href="#add_form">adding some</a>.') . '</td></tr>';
    }
    return $table;
}
/**
* OPML feeds export, different to the items export on rss.php
*
* @author Ryan McCue <*****@*****.**>
* @package Lilina
* @version 1.0
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*/
function export_opml()
{
    header('Content-Type: application/xml; charset=utf-8');
    echo '<?xml version="1.0" encoding="' . get_option('encoding', 'utf-8') . '"?' . '>';
    ?>

<opml version="1.1">
	<head>
		<title><?php 
    echo get_option('sitename');
    ?>
</title>
		<dateModified><?php 
    /** This is unclean */
    echo date('D, j M Y G:i:s O');
    ?>
</dateModified>
	</head>
	<body>
<?php 
    if (has_feeds()) {
        foreach (get_feeds() as $feed) {
            $feed = array_map('htmlspecialchars', $feed);
            ?>
		<outline text="<?php 
            echo $feed['name'];
            ?>
" title="<?php 
            echo $feed['name'];
            ?>
" type="rss" xmlUrl="<?php 
            echo $feed['feed'];
            ?>
" htmlUrl="<?php 
            echo $feed['url'];
            ?>
" />
		<?php 
        }
    }
    ?>
	</body>
</opml>
<?php 
}
Beispiel #3
0
    if (!empty($children)) {
        foreach ($children as $id => $feed_cat) {
            $url = $feed_cat->get_url($feed_type);
            $urls[] = array('name' => $feed_cat->get_category_name(), 'url' => $url, 'level' => $level, 'feed_name' => $feed_type, 'selected' => $feed_url_edit == $url);
        }
        return array_merge($urls, get_feeds_children($feed_cat->get_children(), $module_id, $feed_type, $feed_url_edit, $level + 1));
    }
    return array();
}
$feeds_modules = AppContext::get_extension_provider_service()->get_providers(FeedProvider::EXTENSION_POINT);
foreach (ModulesManager::get_installed_modules_map_sorted_by_localized_name() as $id => $module) {
    if (array_key_exists($module->get_id(), $feeds_modules)) {
        $list = $feeds_modules[$module->get_id()]->get_extension_point(FeedProvider::EXTENSION_POINT);
        $list = $list->get_feeds_list();
        foreach ($list->get_feeds_list() as $feed_type => $object) {
            $urls = get_feeds($object, $module->get_id(), $feed_type, $feed_url);
            $root[0] = array('name' => $object->get_category_name(), 'url' => $object->get_url($feed_type), 'level' => 0, 'feed_name' => null, 'selected' => $feed_url == $object->get_url($feed_type));
        }
        $urls = array_merge($root, $urls);
        $tpl->assign_block_vars('modules', array('NAME' => ucfirst($module->get_configuration()->get_name())));
        foreach ($urls as $url) {
            $tpl->assign_block_vars('modules.feeds_urls', array('URL' => $url['url'], 'NAME' => $url['name'], 'SPACE' => str_repeat('--', $url['level']), 'FEED_NAME' => $url['feed_name'] != 'master' ? $url['feed_name'] : null, 'SELECTED' => $url['selected'] ? ' selected="selected"' : ''));
        }
    }
}
$locations = '';
foreach ($array_location as $key => $name) {
    $locations .= '<option value="' . $key . '" ' . ($block == $key ? 'selected="selected"' : '') . '>' . $name . '</option>';
}
//Filtres
MenuAdminService::add_filter_fieldset($menu, $tpl);
 function fetch_feeds()
 {
     if (isset($_GET['get_feeds']) && $_GET['get_feeds'] == '1') {
         get_feeds();
         die;
     }
 }
Beispiel #5
0
     }
 }
 // 404 error
 if ($_GET['page_name'] == '404') {
     // no content
     // we set up the meta tags and parse the request string on the partial page
 }
 // single article
 if ($_GET['page_name'] == 'article') {
     $article = get_article($_GET['article_id']);
 }
 // multiple articles - either a search or listings request
 if ($_GET['page_name'] == 'listing') {
     if (isset($_GET['feed_listing'])) {
         // for a list of all available feeds we'll borrow the listing page
         $feeds = get_feeds($config['admin']['show_all_feeds']);
         $articles = format_feeds_list($feeds);
     } elseif (!empty($_GET['search'])) {
         // run a search
         $articles = search_articles($_GET['search'], $config['layout']);
     } else {
         // standard article listing
         $articles = get_articles($config['layout']);
     }
 }
 // allowed pages array - redirect to 404 if any other page name is attempted
 $allowed_pages = array('feed', 'front', '404', 'article', 'listing');
 $_GET['page_name'] = in_array($_GET['page_name'], $allowed_pages) ? $_GET['page_name'] : '404';
 // get content partial - checking for theme versions as well
 $theme_content_folder = WW_ROOT . '/ww_view/themes' . $config['site']['theme'] . '/_content';
 $content_partial = file_exists($theme_content_folder . '/_' . $_GET['page_name'] . '.php') ? $theme_content_folder . '/_' . $_GET['page_name'] . '.php' : WW_ROOT . '/ww_view/_content/_' . $_GET['page_name'] . '.php';
Beispiel #6
0
<?php

/*	Copyright (c) 2014 Freeder
 *	Released under a MIT License.
 *	See the file LICENSE at the root of this repo for copying permission.
 */
// TODO: Modularize me!
require_once 'inc/init.php';
require_once 'inc/feeds.php';
require_once 'inc/entries.php';
require_auth();
$feeds = get_feeds();
$tpl->assign('config', $config, RainTPL::RAINTPL_HTML_SANITIZE);
$tpl->assign('templates', list_templates(), RainTPL::RAINTPL_HTML_SANITIZE);
$tpl->assign('feeds', $feeds, RainTPL::RAINTPL_XSS_SANITIZE);
// Handle posted info for settings
if (!empty($_POST['synchronization_type']) && !empty($_POST['template']) && !empty($_POST['timezone']) && isset($_POST['import_tags_from_feeds']) && isset($_POST['anonymous_access']) && isset($_POST['entries_to_keep']) && !empty($_POST['display_entries']) && isset($_POST['entries_per_page']) && isset($_POST['share_input_shaarli']) && isset($_POST['share_input_diaspora']) && !empty($_POST['token']) && check_token(600, 'settings_form')) {
    if ($config->synchronization_type != $_POST['synchronization_type']) {
        $config->synchronization_type = $_POST['synchronization_type'];
        require_once INC_DIR . 'cron.php';
        if ($config->synchronization_type == 'cron') {
            register_crontask('0 * * * * cd ' . dirname(__FILE__) . '../ && php refresh.php > logs/cron.log 2>&1  # FREEDER AUTOADDED CRONTASK');
        } else {
            unregister_crontask('# FREEDER AUTOADDED CRONTASK');
        }
    }
    // Template
    if (is_dir(TPL_DIR . $_POST['template'])) {
        $config->template = $_POST['template'];
        if (!endswith($config->template, '/')) {
            $config->template = $config->template . '/';
Beispiel #7
0
<opml version="1.1">
	<head>
		<title><?php 
echo get_option('sitename');
?>
</title>
		<dateModified><?php 
/** This is unclean */
echo date('D, j M Y G:i:s O');
?>
</dateModified>
	</head>
	<body>
<?php 
if (has_feeds()) {
    foreach (get_feeds() as $feed) {
        $feed = array_map('htmlspecialchars', $feed);
        ?>
		<outline text="<?php 
        echo $feed['name'];
        ?>
" title="<?php 
        echo $feed['name'];
        ?>
" type="rss" xmlUrl="<?php 
        echo $feed['feed'];
        ?>
" htmlUrl="<?php 
        echo $feed['url'];
        ?>
" />
Beispiel #8
0
/**
 *
 */
function list_feeds($args = '')
{
    $defaults = array('format' => '<a href="%1$s">%3$s</a> [<a href="%4$s">' . _r('Feed') . '</a>]', 'title_length' => 0);
    $args = lilina_parse_args($args, $defaults);
    /** Make sure we don't overwrite any current variables */
    extract($args, EXTR_SKIP);
    if (has_feeds()) {
        $feeds = get_feeds();
        usort($feeds, '_sort_feeds');
        foreach ($feeds as $feed) {
            $icon = $feed['icon'];
            if (!$icon) {
                $icon = get_option('baseurl') . 'lilina-favicon.php?i=default';
            }
            $title = $title_length > 0 ? shorten($feed['name'], $title_length) : $feed['name'];
            printf($format, $feed['url'], $icon, $title, $feed['feed']);
        }
    }
}
Beispiel #9
0
<?php

/*	Copyright (c) 2014 Freeder
 *	Released under a MIT License.
 *	See the file LICENSE at the root of this repo for copying permission.
 */
require_once 'inc/init.php';
require_once 'inc/entries.php';
require_once 'inc/feeds.php';
$view = isset($_GET['view']) ? $_GET['view'] : '_home';
$page = isset($_GET['p']) ? (int) $_GET['p'] : 0;
$tpl->assign('view', $view);
$tpl->assign('entries', get_entries($view, $page), RainTPL::RAINTPL_XSS_SANITIZE);
$nb_entries = get_entries_count($view, $page);
$tpl->assign('nb_entries', intval($nb_entries));
$tpl->assign('nb_pages', intval($nb_entries / $config->entries_per_page) + 1, RainTPL::RAINTPL_XSS_SANITIZE);
$tpl->assign('feeds', get_feeds(), RainTPL::RAINTPL_XSS_SANITIZE);
$tpl->draw('index');
Beispiel #10
0
/**
 *
 */
function list_feeds($args = '')
{
    $defaults = array('format' => '<a href="%1$s">%3$s</a> [<a href="%4$s">' . _r('Feed') . '</a>]', 'title_length' => 0);
    $args = lilina_parse_args($args, $defaults);
    /** Make sure we don't overwrite any current variables */
    extract($args, EXTR_SKIP);
    if (has_feeds()) {
        foreach (get_feeds() as $feed) {
            $title = $title_length > 0 ? shorten($feed['name'], $title_length) : $feed['name'];
            printf($format, $feed['url'], Templates::path_to_url(Templates::get_file('feed.png')), $title, $feed['feed']);
        }
    }
}
/**
 * format_feeds_list
 * 
 * 
 * 
 * 
 * 
 * 
 */
function format_feeds_list($feeds = '')
{
    $feeds_list = !empty($feeds) ? $feeds : get_feeds();
    $listing = array();
    foreach ($feeds_list as $section => $details) {
        $feeds = $details['feeds'];
        $intro = '<ul>';
        foreach ($feeds as $feed) {
            $intro .= '
				<li><a href="' . $feed['url'] . '" title="rss feed for ' . $feed['title'] . '">' . $feed['title'] . '</a></li>';
        }
        $intro .= '</ul>';
        $listing[] = array('title' => $details['section'], 'summary' => $details['description'], 'listing' => $intro);
    }
    return $listing;
}