Blogroll based on aggregator feeds

This block displays a list of aggregator feeds. This can be considered a type of site-wide blogroll.

<?php
// Last update: May 7 2006
$result = db_query("SELECT a.title, a.url, a.fid, a.link
    FROM {aggregator_feed} a
    ORDER BY a.title"
);
$output = '<ul>';
while (
$feed = db_fetch_object($result)) {
   
$output .= '<li>' . l($feed->title, $feed->link) . '</li>';
}
$output .= '</ul>';
$output .= '<p><a href="/aggregator/sources">more</a></p>';
return
$output;
?>

Other suggestions:

  • Add a LIMIT command
  • Figure out the SQL to limit this to a particular aggregator category
  • Figure out the SQL to find the time of the last added feed item (sort by most recently updated)
 
 

Drupal is a registered trademark of Dries Buytaert.