Arama butonu
Bu konudaki kullanıcılar: 1 misafir, 1 mobil kullanıcı
1
Cevap
453
Tıklama
0
Öne Çıkarma
Rss acil yardım
H
15 yıl
Onbaşı
Konu Sahibi

MERHABA ARKADAŞLAR WEB SİTEMİN RSS KAREKTER SORUNU YAŞIYORUM BU KONUDA BANA YARDIM EDEBİLECEK BİR BÜYÜĞÜM VARMI DOSYA AŞAĞIDAKİ GİBİDİR






<?php

require 'includes/fonctions.php';
require 'includes/config.php';

$cat=is_numeric($_GET["cat"])?$_GET["cat"]:0;
$cat=($_GET["cat"]=="mvv")?$_GET["cat"]:$cat;
$cat=($_GET["cat"]=="mra")?$_GET["cat"]:$cat;
$cat=($_GET["cat"]=="mrp")?$_GET["cat"]:$cat;

$city=$_GET["city"];

$evt=$cat==EVTCAT?"1":0;
define(MAX_RSS_ARTICLES,'20');

$topCatName=is_numeric($_GET["cat"])?getCategoryName($cat):"";
$topCatName=($_GET["cat"]=="mvv")?"Most viewed video":$topCatName;
$topCatName=($_GET["cat"]=="mra")?"Most recent ads":$topCatName;
$topCatName=($_GET["cat"]=="mrp")?"Most recent photos":$topCatName;

$description = META_DESCR;
$email_address = SITE_CONTACT;//STORE_OWNER_EMAIL_ADDRESS;

// Encoding to UTF-8
$store_name = utf8_encode (SITE_NAME);
$rss_title = utf8_encode (SITE_NAME." - $topCatName" );
$weblink = utf8_encode (SITE_URL);
$description = utf8_encode ($description);
$email_address = utf8_encode (SITE_CONTACT);
$limit=MAX_RSS_ARTICLES;

// Begin sending of the data
Header('Content-Type: application/xml');
echo '<?xml version="1.0" encoding="UTF-8" ?>' . "\n";
echo '<?xml-stylesheet href="http://www.w3.org/2000/08/w3c-synd/style.css" type="text/css"?>' . "\n";
echo '<!-- RSS for ' . SITE_NAME . ', generated on ' . date(r) . ' -->' . "\n";
$description = str_replace('&','&',$description);
$description = str_replace('<','<',$description);
$description = str_replace('>','>',$description);
?>

<rss xmlns:dt="http://xsltsl.org/date-time" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:media="http://search.yahoo.com/mrss/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" xmlns:photo="http://www.pheed.com/pheed/" xmlns:syn="http://purl.org/rss/1.0/modules/syndication/" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:im="http://purl.org/rss/1.0/item-images/" version="2.0" >

<channel>
<title><?php echo $rss_title; ?>
</title>
<link><?php echo $weblink;?>
</link>
<description><?php echo $description; ?>
</description>
<webMaster><?=SITE_CONTACT?>
</webMaster>
<language>en-us</language>
<lastBuildDate><?php echo date(r); ?>
</lastBuildDate>
<docs>http://blogs.law.harvard.edu/tech/rss
</docs>
<?php
if ($city!="")
$cityfilter=" AND ac.id_city=".$city;
else
$cityfilter="";

switch($cat){
case "mvv":
$q="SELECT id,title,video FRoM $tab_annonces WHERE $tab_annonces.publi=1 order by viewed desc limit 1";
break;
case "mra":
// $q="SELECT $tab_rub.category,$tab_annonces.* FRoM $tab_annonces,$tab_rub WHERE $tab_annonces.publi=1 and $tab_rub.id_cat=$tab_annonces.id_cat order by date desc limit $limit";
$q="SELECT r.category,a.* FRoM $tab_annonces a ,$tab_rub r,ann_ad_city ac WHERE a.publi=1 and r.id_cat=a.id_cat $cityfilter GROUP BY a.id order by date desc limit $limit";

/*
$q="SELECT c.category,a.* FROM ann_annonces a ";
$q.="INNER JOIN ann_ad_city ac ON ac.id_ann=a.id ";
$q.="INNER JOIN ann_categories c ON c.id_cat=a.id_cat ";
$q.="WHERE a.publi=1".$cityfilter;
$q.=" order by date desc limit $limit";
*/
break;
case "mrp":
// $q="SELECT c.category,a.id,a.title,a.price,p.url FRoM $tab_rub c,$tab_photos p left join $tab_annonces a on a.id=p.id_ann WHERE a.publi=1 and a.id_cat=c.id_cat order by p.date desc limit $limit";
$q="SELECT c.category,a.*,p.url FRoM $tab_rub c,ann_ad_city ac,$tab_photos p left join $tab_annonces a on a.id=p.id_ann WHERE a.publi=1 and a.id_cat=c.id_cat $cityfilter GROUP BY a.id order by p.date desc limit $limit";

/*
$q="SELECT c.category,a.*,p.* FROM ann_annonces a ";
$q.="INNER JOIN ann_photos p ON p.id_ann=a.id ";
$q.="INNER JOIN ann_categories c ON c.id_cat=a.id_cat ";
$q.="INNER JOIN ann_ad_city ac ON ac.id_ann=a.id ";
$q.="WHERE a.publi=1".$cityfilter;
$q.=" ORDER by p.date desc limit $limit";
*/
break;
default:
$q="SELECT $tab_rub.category,$tab_annonces.* FRoM $tab_annonces,$tab_rub WHERE ($tab_annonces.id_cat=$cat or $tab_annonces.id_cat in (select id_cat from $tab_rub where parent=$cat)) and $tab_annonces.type='1' and $tab_annonces.publi=1 and $tab_annonces.evt=$evt and $tab_rub.id_cat=$tab_annonces.id_cat order by $tab_annonces.date desc limit 0,50";
} // switch

//echo "$q";
$res=DBquery($q,0);
//print_r($res);
if(is_array($res)){

foreach($res as $ad)
{
$catId=$ad["id_cat"];
$catName=$ad["category"];
$adUrl=urlize($ad["title"]);
$adTitle=$ad["title"];
$id=$ad["id"];
$date=date("r",strtotime($ad["date"]));
$price=$ad["price"];
$photo=$ad["photo"]?"<img width=\"65px\" id=\"thumbImg\" src=\"{$ad['photo']}\" title=\"$adTitle\" alt=\"$adTitle\"/>":"";
$video=$ad["video"]?"<img border=0 id=\"vdoIcon\" src=\"images/video.gif\" title=\"Video $adTitle\" alt=\"Video $adTitle\"/>":"";
$descr=strip_tags($ad["descr"]);


//http://www.w3.org/TR/REC-xml/#dt-chardata
// The ampersand character (&) and the left angle bracket (<) MUST NOT appear in their literal form
$name = str_replace('&','&',$adTitle);
$desc = str_replace('&','&',$descr);
$link = str_replace('&','&',SITE_URL."/a,$id,$adUrl.htm");
$catName = str_replace('&','&',$catName);

$name = str_replace('<','<',$adTitle);
$desc = str_replace('<','<',$descr);
$link = str_replace('<','<',$link);
$catName = str_replace('<','<',$catName);

$name = str_replace('>','>',$name);
$desc = str_replace('>','>',$desc);
$link = str_replace('>','>',$link);
$catName = str_replace('>','>',$catName);

// Writing the output
echo '<item>' . "\n";
echo "<category>$catName</category>\n";
echo ' <title><![CDATA[' . $name . ']]></title>' . "\n";
echo ' <link>' . $link . '</link>' . "\n";
echo ' <description>' . "\n";
echo '<![CDATA['.$photo.'';
echo ''.$video.'';
echo " $desc";
echo ' ]]></description>' . "\n";
echo ' <guid>' . $link . '</guid>' . "\n";
echo ' <pubDate>' . $date . '</pubDate>' . "\n";
echo '</item>' . "\n";
}
}
?>
</channel>
</rss>

DH forumlarında vakit geçirmekten keyif alıyor gibisin ancak giriş yapmadığını görüyoruz.

Üye olduğunda özel mesaj gönderebilir, beğendiğin konuları favorilerine ekleyip takibe alabilir ve daha önce gezdiğin konulara hızlıca erişebilirsin.

Üye Ol Şimdi Değil





< Bu mesaj bu kişi tarafından değiştirildi herme -- 10 Ocak 2011; 9:34:35 >

H
15 yıl
Onbaşı
Konu Sahibi

yardım edecek kimse yokmu



DH Mobil uygulaması ile devam edin. Mobil tarayıcınız ile mümkün olanların yanı sıra, birçok yeni ve faydalı özelliğe erişin. Gizle ve güncelleme çıkana kadar tekrar gösterme.