Advertisement
Guest User

Untitled

a guest
Aug 17th, 2011
210
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.90 KB | None | 0 0
  1. <?php
  2. include_once('http://www.rantsports.com/php/simplepie.inc');               // include the required file
  3. $feed = new SimplePie();
  4. $feed->set_feed_url('http://www.tmz.com/category/TMZsports/rss.xml');
  5. $feed->set_cache_duration(1800);
  6. $feed->init();
  7. $limit = $feed->get_item_quantity(3); // specify number of items
  8. $items = $feed->get_items(0, $limit); // create an array of items
  9.  ?>
  10. <div class="partners-area">
  11. <a href="http://www.tmz.com" target="_blank"><img src="http://www.rantsports.com/wp-content/themes/rantsports/images/TMZ_Partner_Logo.jpg" width="135" /></a>
  12. <?php
  13. if ($limit == 0) echo '<div>The feed is either empty or unavailable.</div>';
  14. else foreach ($items as $item) : ?>
  15.  
  16.     <li><a href="<?php echo $item->get_permalink(); ?>"
  17.       title="<?php echo $item->get_date('j F Y @ g:i a'); ?>" target="_blank">
  18.         <?php echo $item->get_title(); ?>
  19.     </a></li>
  20.  
  21.  
  22. <?php endforeach; ?>
  23. </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement