Exemplo n.º 1
0
</h3>
	<ul>
<?php 
/**
 * 
 * @global array
 */
function get_feed_list()
{
    global $data;
    if (isset($data['feeds'])) {
        return $data['feeds'];
    }
    return false;
}
$feed_list = get_feed_list();
if (is_array($feed_list)) {
    foreach ($feed_list as $this_feed) {
        if (isset($this_feed['name']) && !empty($this_feed['name'])) {
            echo '
	<li><a href="' . $this_feed['feed'] . '">' . stripslashes($this_feed['name']) . '</a></li>';
        } else {
            echo '
	<li><a href="' . $this_feed['feed'] . '">' . _r('(No title specified)') . '</a></li>';
        }
    }
} else {
    echo '<li>' . _r('No feeds installed yet.') . '</li>';
}
?>
	</ul>
Exemplo n.º 2
0
<ul id="favs">
<?php 
function get_feed_list($feed_url)
{
    $feed = simplexml_load_file($feed_url);
    $html = '';
    if (!$feed) {
        return FALSE;
    }
    foreach ($feed->xpath('//item') as $item) {
        $html .= '<li><a target="_blank" title="' . htmlspecialchars($item->description) . '" href="' . htmlspecialchars($item->link) . '">&#9679;</a></li>' . PHP_EOL;
    }
    return $html;
}
echo get_feed_list('http://feeds.delicious.com/v2/rss/pup/framit?count=15');
?>
</ul>