format_rss_channel

Хочешь помочь с переводом? Это очень просто и быстро. Лишь зарегистрируйся, и можешь тут же начать переводить.

includes/common.inc, строка 981

Версии
5
format_rss_channel($title, $link, $description, $items, $language = 'en', $args = array())
6
format_rss_channel($title, $link, $description, $items, $langcode = NULL, $args = array())

Formats an RSS channel.

Arbitrary elements may be added using the $args associative array.

Связанные темы

▾ 2 функции вызывают format_rss_channel()

aggregator_page_rss in modules/aggregator/aggregator.module
Коллбэк меню. Генерирует фид из материалов аггергатора или категорий в формате RSS 0.92.
node_feed in modules/node/node.module
A generic function for generating RSS feeds from a set of nodes.

Код

<?php
function format_rss_channel($title, $link, $description, $items, $language = 'en', $args = array()) {
  // arbitrary elements may be added using the $args associative array

  $output = "<channel>\n";
  $output .= ' <title>'. check_plain($title) ."</title>\n";
  $output .= ' <link>'. check_url($link) ."</link>\n";

  // The RSS 2.0 "spec" doesn't indicate HTML can be used in the description.
  // We strip all HTML tags, but need to prevent double encoding from properly
  // escaped source data (such as &amp becoming &amp;amp;).
  $output .= ' <description>'. check_plain(decode_entities(strip_tags($description))) ."</description>\n";
  $output .= ' <language>'. check_plain($language) ."</language>\n";
  $output .= format_xml_elements($args);
  $output .= $items;
  $output .= "</channel>\n";

  return $output;
}
?>
Войдите или зарегистрируйтесь, чтобы получить возможность отправлять комментарии

Вход в систему