El fichero de rss es este:
Código PHP:
<?php
define('IN_COPPERMINE', true);
define('INDEX_PHP', true);
require('include/init.inc.php');
//How many items you want to show in RSS feed
$thumb_per_page = 2;
$thumb_count = 2;
$lower_limit = 15;
if(isset($_GET['album'])){
$album = $_GET['album'];
}
//If it is a numeric album get the name and set variables
if ((is_numeric($album))){
$album_name_keyword = get_album_name($album);
$CURRENT_CAT_NAME = $album_name_keyword['title'];
$ALBUM_SET = "AND aid IN (".(int)$_GET['album'].")".$ALBUM_SET;
//Set the album to last uploaded
$album = 'lastup';
}
//If the album is not set set it to lastup - this is the default
if(!isset($album)){
$album = 'random';
}
if ((isset($_GET['cat']) && $_GET['cat'] < 0)){
$cat = - $_GET['cat'];
$album_name_keyword = get_album_name($cat);
$CURRENT_CAT_NAME = $album_name_keyword['title'];
$ALBUM_SET = "AND aid IN (".$cat.")".$ALBUM_SET;
}
//Changes these to point to your site if the following is not giving correct results.
$link_url = $CONFIG['ecards_more_pic_target']."displayimage.php?pos=-";
$image_url = $CONFIG['ecards_more_pic_target']."albums/";
$data = get_pic_data($album, $thumb_count, $album_name, $lower_limit, $thumb_per_page);
header ("content-type: text/xml");
//maybe you must change the encoding to iso-8859-1.
$rssHeader = <<<EOT
<?xml version="1.0" encoding="iso-8859-7"?>
<rss version="2.0"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:wfw="http://wellformedweb.org/CommentAPI/"
>
<channel>
<title>$CONFIG[gallery_name]</title>
<link>$CONFIG[ecards_more_pic_target]</link>
<description>$CONFIG[gallery_description] - $album_name</description>
<generator>http://www.oixalia.gr/gallery/rss.php</generator>
EOT;
echo $rssHeader;
foreach($data AS $picture) {
$thumb_url = "$image_url$picture[filepath]$CONFIG[thumb_pfx]$picture[filename]";
$keywords = explode(" ",trim($picture[keywords]));
$category_string = "";
foreach($keywords as $keyword){
// $category_string .= "<category>$keyword</category>";
}
$pubDate = gmdate("D, d M Y H:i:s", $picture[ctime]);
$description = '<center><a href="' . $link_url . $picture['pid'] . '"><img src="' . $thumb_url . '" border="1" hspace="2"> <align="center" ></a><br><br><br><br><br>'.bb_decode($picture[caption]).bb_decode($picture[caption_text]);
$description = htmlspecialchars($description);
$item = '<item>
<title>'.$picture[title].'</title>
<link>' . $link_url . $picture[pid] . '</link>
<pubDate>' .$pubDate.' EST</pubDate>
<description>'.$description.'</description>
</item>';
echo $item;
}
$rssFooter = <<<EOT
</channel>
</rss>
EOT;
echo $rssFooter;
?>
Código:
alguien puede echarme un cable??// ***********************************************
// Load Style Sheet
// ***********************************************
var rss_css:TextField.StyleSheet = new TextField.StyleSheet();
rss_css.onLoad = function(success:Boolean) {
if (success) {
trace ("css loaded...");
}
};
rss_css.load("mo_rss.css");
// ************************************************
// Load XML data
// ************************************************
loadDATA();
function loadDATA(){
var rss_xml:XML = new XML();
rss_xml.ignoreWhite = true;
rss_xml.onLoad = function(success:Boolean) {
if (success) {
processData(rss_xml);
} else {
trace("unable to load/parse cnet.xml");
}
};
rss_xml.load("http://lnx.titoworld.com/galeria/rs.php");
}
// ***********************************************
// Process Data
// ***********************************************
channel_title = "";
channel_desc = "";
channel_copyright = "";
channel_link = "";
channel_lang = "";
function processData(rm){
var rss = rm.firstChild.firstChild;
item_txt.text="";
item_txt.html = true;
item_txt.styleSheet = rss_css;
for (i=0;i<rss.childNodes.length;i++){
//trace(rss.childNodes[i].nodeName);
if (rss.childNodes[i].nodeName == "title"){
channel_title = rss.childNodes[i].firstChild.nodeValue;
}else if (rss.childNodes[i].nodeName == "description"){
channel_description = rss.childNodes[i].firstChild.nodeValue;
}else if (rss.childNodes[i].nodeName == "copyright"){
channel_copyright = rss.childNodes[i].firstChild.nodeValue;
}else if (rss.childNodes[i].nodeName == "link"){
channel_link = rss.childNodes[i].firstChild.nodeValue;
}else if (rss.childNodes[i].nodeName == "language"){
channel_lang = rss.childNodes[i].firstChild.nodeValue;
}else if (rss.childNodes[i].nodeName == "image"){
var sTitle;
var sLink; // link
var sURL; // logo url
txtLogo.html = true;
txtLogo.htmlText="";
for (j=0;j<rss.childNodes[i].childNodes.length;j++){
if (rss.childNodes[i].childNodes[j].nodeName == "title"){
sTitle = rss.childNodes[i].childNodes[j].firstChild.nodeValue;
}else if (rss.childNodes[i].childNodes[j].nodeName == "link"){
sLink = rss.childNodes[i].childNodes[j].firstChild.nodeValue;
}else if (rss.childNodes[i].childNodes[j].nodeName == "url"){
sURL = rss.childNodes[i].childNodes[j].firstChild.nodeValue;
}
}
}else if (rss.childNodes[i].nodeName == "item"){
var itemTitle;
var itemDesc;
var itemLink;
for (j=0;j<rss.childNodes[i].childNodes.length;j++){
if (rss.childNodes[i].childNodes[j].nodeName == "title"){
itemTitle = rss.childNodes[i].childNodes[j].firstChild.nodeValue;
}else if (rss.childNodes[i].childNodes[j].nodeName == "description"){
itemDesc = rss.childNodes[i].childNodes[j].firstChild.nodeValue;
}else if (rss.childNodes[i].childNodes[j].nodeName == "link"){
itemLink = rss.childNodes[i].childNodes[j].firstChild.nodeValue;
}
}
item_txt.htmlText += "<a href=\"" + itemLink + "\"><span class=\"headline\">" + "</span></a><br><span class=\"thread\">" + itemDesc + "</span>"
}
}
}
gracias! un saludo

