} if (!isset($context['webmaster_address']) || !$context['webmaster_address']) { $context['webmaster_address'] = $context['site_email']; } // the preamble $text = '<?xml version="1.0" encoding="' . $context['charset'] . '"?>' . "\n" . '<rdf:RDF' . "\n" . ' xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"' . "\n" . ' xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#"' . "\n" . ' xmlns="http://purl.org/rss/1.0/"' . "\n" . ">\n" . '<channel rdf:about="' . $context['url_to_home'] . '/">' . "\n" . ' <title>' . encode_field(strip_tags($context['channel_title'])) . '</title>' . "\n" . ' <link>' . $context['url_to_home'] . '/</link>' . "\n" . ' <description>' . encode_field($context['channel_description']) . '</description>' . "\n"; // the geographical position, if any if (isset($context['site_position']) && $context['site_position']) { list($latitude, $longitude) = preg_split('/[ ,\\t]+/', $context['site_position']); $text .= ' <geo:Point>' . "\n" . ' <geo:lat>' . encode_field($latitude) . '</geo:lat>' . "\n" . ' <geo:long>' . encode_field($longitude) . '</geo:long>' . "\n" . ' </geo:Point>' . "\n"; } // the list of items $text .= ' <items>' . "\n" . ' <rdf:Seq>' . "\n"; // get local news include_once 'feeds.php'; $rows = Feeds::get_local_news(); // process rows, if any if (is_array($rows)) { // limit to ten items @array_splice($rows, 10); // build the list $items = ''; // for each item foreach ($rows as $url => $attributes) { list($time, $title, $author, $section, $image, $description) = $attributes; // encode links $url = str_replace('&', '&', $url); // the index of resources $text .= ' <rdf:li rdf:resource="' . $url . '" />' . "\n"; // output of one story $items .= "\n" . '<item rdf:about="' . $url . '">' . "\n" . ' <title>' . encode_field(strip_tags($title)) . "</title>\n" . "\t<link>" . $url . "</link>\n" . ' <description>' . encode_field(strip_tags($description)) . ' (' . gmdate('D, d M Y H:i:s', intval($time)) . " GMT)</description>\n";
if (!isset($context['webmaster_address']) || !$context['webmaster_address']) { $context['webmaster_address'] = $context['site_email']; } // set channel information $values = array(); $values['channel'] = array(); $values['channel']['title'] = $context['channel_title']; $values['channel']['link'] = $context['url_to_home'] . '/'; $values['channel']['description'] = $context['channel_description']; // the image for this channel if (isset($context['powered_by_image']) && $context['powered_by_image']) { $values['channel']['image'] = $context['powered_by_image']; } // get local news include_once '../feeds/feeds.php'; $values['items'] = Feeds::get_local_news(20, 'contents'); // make a text include_once '../services/codec.php'; include_once '../services/rss_codec.php'; $result = rss_Codec::encode($values); $text = @$result[1]; // put in cache Safe::file_put_contents($cache_id, $text); } // // transfer to the user agent // // handle the output correctly render_raw('text/xml; charset=' . $context['charset']); // suggest a name on download if (!headers_sent()) {
*/ include_once '../../shared/global.php'; // ensure we only provide public content through newsfeeds $context['users_without_teasers'] = 'Y'; Safe::load('parameters/feeds.flash.include.php'); // load a skin engine load_skin('articles'); // ensure we see only articles visible at the home page $context['skin_variant'] = 'home'; // sanity check if (is_callable('ming_useswfversion')) { ming_useswfversion(4); } // list fresh news include_once '../feeds.php'; if (!($items = Feeds::get_local_news(20, 'compact'))) { return; } // keep only titles and ISO8859-1 labels $titles = array(); $links = array(); $count = 0; foreach ($items as $url => $label) { // we are not interested into all attributes if (is_array($label)) { $label = $label[1]; } // strip codes include_once '../../codes/codes.php'; $label = Codes::strip($label); // remove every html tag
$context['channel_description'] = $context['site_description']; } if (!isset($context['webmaster_address']) || !$context['webmaster_address']) { $context['webmaster_address'] = $context['site_email']; } // set channel information $values['channel']['title'] = $context['channel_title']; $values['channel']['link'] = $context['url_to_home'] . '/'; $values['channel']['description'] = $context['channel_description']; // the image for this channel if (isset($context['powered_by_image']) && $context['powered_by_image']) { $values['channel']['image'] = $context['powered_by_image']; } // get local news include_once 'feeds.php'; $values['items'] = Feeds::get_local_news(); // make a text include_once '../services/codec.php'; include_once '../services/rss_codec.php'; $result = rss_Codec::encode($values); $text = @$result[1]; // put in cache Safe::file_put_contents($cache_id, $text); } // // transfer to the user agent // // handle the output correctly render_raw('text/xml; charset=' . $context['charset']); // suggest a name on download if (!headers_sent()) {