1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89
|
<?php
require_once('../includes/functions.php');
if (file_exists(SITE_ROOT.'/themes/'.THEME.'/feed-rss.php')){//feed-rss from the theme!
require_once(SITE_ROOT.'/themes/'.THEME.'/feed-rss.php');
}
else{//not found in theme
header("Content-type: text/xml; charset=utf-8");
?>
<rss version="2.0" xmlns:g="http://base.google.com/ns/1.0">
<channel>
<title>RSS - <?php echo $html_title;?></title>
<description>RSS - <?php echo $html_description." ".$currentCategory;?></description>
<link><?php echo SITE_URL;?>/</link>
<pubDate><?php echo date(DATE_RFC822);?></pubDate>
<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" href="<?php echo SITE_URL;?>/rss/" type="application/rss+xml" />
<?php
if ($resultRSS){
foreach ( $resultRSS as $row ){
$idPost=$row['idPost'];
$postType=$row['type'];
$postTypeName=getTypeName($postType);
$postTitle=html_entity_decode($row['title'],ENT_COMPAT,CHARSET);
$postPrice=$row['price'];
/*$postPlace=$row['place'];*/
$postPhone=$row['phone'];
$postPlace= str_replace (" "," ",strip_tags(html_entity_decode($row['place'],ENT_COMPAT,CHARSET)));
if (LOCATION) $postLocation = getLocationName($row['idLocation']);
else $postLocation='';
$postDesc= $row['description'];
/*$postDesc= str_replace (" "," ",strip_tags(html_entity_decode($row['description'],ENT_COMPAT,CHARSET)));*/
$category=$row['category'];//real category name
$fcategory=$row['friendlyName'];//frienfly name category
$idCategoryParent=$row['idCategoryParent'];
$fCategoryParent=$row['parent'];
$insertDate=date(DATE_RFC822,strtotime($row['insertDate']));
if ($row["hasImages"]==1){
$postImage=getPostImages($idPost,setdate($row['insertDate']),true,true);
$expire_date = date('Y-m-d', strtotime("+30 days"));
$postImage= str_replace ("thumb_","",$postImage);
}
else $postImage="";//there's no image
$categoryUrl=$fcategory;
$postUrl=itemURL($idPost,$fcategory,$postTypeName,$postTitle,$fCategoryParent,$postPrice);
?>
<?php if ($postPrice > 0){?>
<item>
<title><![CDATA[<?php echo $postTitle;?><?php if ($postLocation!='' && LOCATION) echo ' - '.$postLocation;?>]]></title>
<link><?php echo SITE_URL.$postUrl;?></link>
<description><![CDATA[
<?php echo $postDesc;?>
<br /><br />
<hr> ]]>
</description>
<g:image_link><?php if ($postImage!="" && RSS_IMAGES) echo "$postImage"; else echo "".SITE_URL."/images/no_pic.png"; ?></g:image_link>
<g:google_product_category>Maison et jardin</g:google_product_category>
<g:condition>occasion</g:condition>
<g:shipping>
<g:country>FR</g:country>
<g:service>Standard</g:service>
<g:price>0</g:price>
</g:shipping>
<g:brand><?php echo $html_title;?></g:brand>
<g:mpn><?php echo $fcategory;?>-<?php echo $idPost;?></g:mpn>
<g:id><?php echo $idPost;?></g:id>
<g:availability>en stock</g:availability>
<g:price><?php if ($postPrice!=0) echo getPrice($postPrice);?>
<?php /*
$pourcent = 20;
$number = ($row['price'] *= (1 + $pourcent / 100));
$prix = number_format((float)$number, 2, '.', '');
echo $prix;
*/ ?>
</g:price>
<g:phone><?php echo $postPhone;?></g:phone>
<g:product_type>Maison et jardin</g:product_type>
</item>
<?php }?>
<?php
}
}
$ocdb->closeDB();
?>
</channel>
</rss>
<?php
}//if else
?> |
Partager