atom_feed

Versions
6
atom_feed()

Produces an atom 1.0 feed for the front page content.

Code

contributions/atom/atom.module, line 112

<?php
function atom_feed() {
  if (strpos(arg(2), 'atom') === 0 || strpos(arg(2), 'feed') === 0) {
    die(drupal_not_found());
  }
  global $base_url;
  $nodes = db_query_range("SELECT n.nid FROM {node} n WHERE n.promote = '1' AND n.status = '1' ORDER BY n.created DESC", 0, variable_get('atom_feed_entries', 15));

  $feed_info = array();
  $feed_info['title']    = strip_tags(variable_get('site_name', 'Drupal'));
  $feed_info['subtitle'] = strip_tags(variable_get('site_slogan', ''));
  $feed_info['html_url'] = $base_url;
  $feed_info['atom_url'] = url('atom/feed', array('absolute' => TRUE));
  _atom_print_feed($nodes, $feed_info);
}
?>

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.
  • You may post code using <code>...</code> (generic) or <?php ... ?> (highlighted PHP) tags.
  • Web page addresses and e-mail addresses turn into links automatically.

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
Image CAPTCHA
Enter the characters shown in the image.