Example #1
0
/**
* 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 
}
Example #2
0
 hours. Try <a href="index.php?hours=-1" id="viewallitems">viewing all items.</a></div>
	<div style="border:1px solid #e7dc2b;background: #fff888;margin:15px;padding:10px;display:none;">Now loading all available items - If they don't load within 20 seconds, click <a href="index.php?hours=-1">here</a><br /><img src="<?php 
    template_directory();
    ?>
/loading.gif" alt="<?php 
    _e('Loading...');
    ?>
" /></div>
<?php 
}
?>
	</div>
</div>

<?php 
if (has_feeds()) {
    ?>
<div id="sources">
	<h3><?php 
    _e('Sources');
    ?>
</h3>
	<ul><?php 
    list_feeds('format=<li><a href="%1$s">%3$s</a> <a href="%4$s" class="feed-link">(' . _r('Feed') . ")</a></li>\n");
    ?>
	</ul>
	<div class="clearer">&nbsp;</div>
</div>
<?php 
} else {
    //Already handled above; if there are no feeds, then there should be no items...
Example #3
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']);
        }
    }
}
Example #4
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']);
        }
    }
}
Example #5
0
else {
?>
			<div style="border:1px solid #e7dc2b;background: #fff888;margin:15px;padding:10px;">No items available from in the last <?php echo get_offset(true); ?> hour(s). Try <a href="index.php?hours=-1" id="viewallitems">viewing all items</a></div>
			<div style="background: url('<?php template_directory(); ?>/spinner-back.png');margin:15px;padding:10px;display:none;">Now loading all available items - If they don't load within 20 seconds, click <a href="index.php?hours=-1">here</a><br /><img src="<?php template_directory(); ?>/spinner.gif" alt="Loading..." /></div>
<?php
}
?>
			</ul>
		</div>
	</div>
</div>


<div id="sidebar">
	<ul>
		<?php if( has_feeds() ): ?>
		<li id="sources"><h3>Sources</h3>
			<ul>
				<?php list_feeds('title_length=35&format=<li><a href="%1$s"><img class="icon" src="%2$s" /><span class="title">%3$s</span></a></li>'); ?>
			</ul>
		</li>
		<?php endif; ?>
		<li>Powered by <a href="http://getlilina.org/">Lilina News Aggregator</a></li>
	</ul>
</div>

<?php template_footer(); ?>
<!-- Generated in: <?php global $timer_start; echo lilina_timer_end($timer_start); ?> -->

<script src="<?php echo get_option('baseurl') ?>inc/js/jquery.js"></script>
<script src="<?php template_directory(); ?>/greader.js"></script>