/** * Return given RSS feed informations * * @param array $values : parameters values array(parameterName => parameterValue) in : * selected : the selected rss ID * @param multidimentionnal array $tags : xml2Array content of atm-function tag * ... {url} ... {label} ... {description} ... * @return string : the RSS feed informations * @access public */ function rss($values, $tags) { global $cms_language; if (!sensitiveIO::isPositiveInteger($values['selected'])) { $this->raiseError("Selected value parameter must be a valid RSS Feed ID : " . $values['selected']); return false; } $RSSDefinition = new CMS_poly_rss_definitions($values['selected']); if ($RSSDefinition->hasError()) { $this->raiseError("Selected value parameter must be a valid RSS Feed ID : " . $values['selected']); return false; } $linkParameters = ''; if (sizeof($values) > 1) { foreach ($values as $key => $value) { if ($key != 'selected') { $linkParameters .= '&' . $key . '=' . io::htmlspecialchars($value); } } } $replace = array('{url}' => PATH_REALROOT_WR . '/rss/rss' . (!STRIP_PHP_EXTENSION ? '.php' : '') . '?id=' . $RSSDefinition->getID() . $linkParameters, '{label}' => $RSSDefinition->getLabel($cms_language), '{description}' => $RSSDefinition->getDescription($cms_language)); $xml2Array = new CMS_xml2Array($tags); $return = $xml2Array->toXML($tags); $return = str_replace(array_keys($replace), $replace, $return); return $return; }
$namespaces = 'xmlns:media="http://search.yahoo.com/mrss/" xmlns:atom="http://www.w3.org/2005/Atom"'; $hash = md5(serialize($_REQUEST)); $cache = new CMS_cache($hash, 'polymod', 'auto', true); if ($cache->exist()) { //Get content from cache $content = $cache->load(); } else { $cache->start(); if (!isset($_REQUEST['id']) || !sensitiveIO::isPositiveInteger($_REQUEST['id'])) { $error = 1; } else { if (!CMS_poly_rss_definitions::exists($_REQUEST['id'])) { $error = 2; } else { $RSSDefinition = new CMS_poly_rss_definitions($_REQUEST['id']); if ($RSSDefinition->hasError()) { $error = 2; } //Create RSS Content ob_start(); eval(sensitiveIO::stripPHPTags($RSSDefinition->getValue('compiledDefinition'))); $data = ob_get_contents(); ob_end_clean(); if (!$data) { $error = 3; } $label = new CMS_object_i18nm($RSSDefinition->getValue("labelID")); $description = new CMS_object_i18nm($RSSDefinition->getValue("descriptionID")); $link = $RSSDefinition->getValue("link") ? $RSSDefinition->getValue("link") : CMS_websitesCatalog::getMainURL(); $categoriesTags = ''; if ($RSSDefinition->getValue("categories")) {