Saludos...
Estoy configurando mi RSS para que este pueda ser accesible a los anuncios dinámicos de facebook. Estos me estan pidiendo unos campos obligatorios, como por ejemplo: Precio.
Cuando voy a mi pagina de feed: http://.../index.php?page=search&sFeed=rss
- NO SE VE en la página
- PERO SI APARECE el codigo fuente.
este es el rssFEED.php
oc-includes/osclass/classes/RSSFeed.php
<?php if ( ! defined('ABS_PATH')) exit('ABS_PATH is not loaded. Direct access is not allowed.');
class RSSFeed {
private $title;
private $link;
private $description;
private $items;
public function setPrice($osc_item_formated_price) {
$this->price = $osc_item_formated_price;
}
public function __construct() {
$this->items = array();
}
public function setTitle($title) {
$this->title = $title;
}
public function setLink($link) {
$this->link = $link;
}
public function setDescription($description) {
$this->description = $description;
}
public function addItem($item) {
$this->items[] = $item;
}
public function dumpXML() {
echo '<?xml version="1.0" encoding="UTF-8"?>', PHP_EOL;
echo '<rss version="2.0">', PHP_EOL;
echo '<channel>', PHP_EOL;
echo '<title>', $this->title, '</title>', PHP_EOL;
echo '<price>', $this->price, '</price>', PHP_EOL;
echo '<link>', $this->link, '</link>', PHP_EOL;
echo '<description>', $this->description, '</description>', PHP_EOL;
foreach ($this->items as $item) {
echo '<item>', PHP_EOL;
echo '<title><![CDATA[', $item['title'], ']]></title>', PHP_EOL;
echo '<link>', $item['link'], '</link>', PHP_EOL;
echo '<guid>', $item['link'], '</guid>', PHP_EOL;
echo '<description><![CDATA[';
if(@$item['image']) {
echo '<a href="'.$item['image']['link'].'" title="'.$item['image']['title'].'" rel="nofollow">';
echo '<img style="float:left;border:0px;" src="'.$item['image']['url'].'" alt="'.$item['image']['title'].'"/> </a>';
}
echo $item['description'], ']]>';
echo '</description>', PHP_EOL;
echo '<pubDate>', date('r',strtotime($item['dt_pub_date'])) , '</pubDate>', PHP_EOL;
echo '<price>', $item['price'], '</price>', PHP_EOL;
echo '</item>', PHP_EOL;
}
echo '</channel>', PHP_EOL;
echo '</rss>', PHP_EOL;
}
}
?>
Y este es mi search.php oc-includes/osclass/controller/search.php
(más o menos por la linea 525)
$feed = new RSSFeed;
$feed->setTitle(__('Latest listings added') . ' - ' . osc_page_title());
$feed->setLink(osc_base_url());
$feed->setDescription(__('Latest listings added in') . ' ' . osc_page_title());
if(osc_count_items()>0) {
while(osc_has_items()) {
if(osc_count_item_resources() > 0){
osc_has_item_resources();
$feed->addItem(array(
'title' => osc_item_title(),
'link' => htmlentities( osc_item_url(), ENT_COMPAT, "UTF-8" ),
'description' => osc_item_description(),
'country' => osc_item_country(),
'price' => osc_item_formated_price(),
'region' => osc_item_region(),
'city' => osc_item_city(),
'city_area' => osc_item_city_area(),
'category' => osc_item_category(),
'dt_pub_date' => osc_item_pub_date(),
'image' => array( 'url' => htmlentities(osc_resource_thumbnail_url(), ENT_COMPAT, "UTF-8"),
'title' => osc_item_title(),
'link' => htmlentities( osc_item_url() , ENT_COMPAT, "UTF-8") )
));
} else {
$feed->addItem(array(
'title' => osc_item_title(),
'link' => htmlentities( osc_item_url() , ENT_COMPAT, "UTF-8"),
'description' => osc_item_description(),
'country' => osc_item_country(),
'price' => osc_item_formated_price(),
'region' => osc_item_region(),
'city' => osc_item_city(),
'city_area' => osc_item_city_area(),
'category' => osc_item_category(),
'dt_pub_date' => osc_item_pub_date()
));
}
}
}
Gracias!