theme_aggregator_page_opml

Definition

theme_aggregator_page_opml($feeds)
modules/aggregator/aggregator.pages.inc, line 432

Description

Theme the OPML feed output.

Parameters

$feeds An array of the feeds to theme.

Related topics

Namesort iconDescription
Default theme implementationsFunctions and templates that present output to the user, and can be implemented by themes.

Code

<?php
function theme_aggregator_page_opml($feeds) {
  drupal_set_header('Content-Type: text/xml; charset=utf-8');

  $output  = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n";
  $output .= "<opml version=\"1.1\">\n";
  $output .= "<head>\n";
  $output .= '<title>' . check_plain(variable_get('site_name', 'Drupal')) . "</title>\n";
  $output .= '<dateModified>' . gmdate('r') . "</dateModified>\n";
  $output .= "</head>\n";
  $output .= "<body>\n";
  foreach ($feeds as $feed) {
    $output .= '<outline text="' . check_plain($feed->title) . '" xmlUrl="' . check_url($feed->url) . "\" />\n";
  }
  $output .= "</body>\n";
  $output .= "</opml>\n";

  print $output;
}
?>
 
 

All source code and documentation on this site is released under the terms of the GNU General Public License, version 2 and later. Drupal is a registered trademark of Dries Buytaert.