caching = true; if (!$tplRss->is_cached("rss_feed.tpl",getParam("cat",""))) { addToHistory(17,"","",""); if ($set_rss_generate) { $lCat=getParamInt("cat",""); $lType=getParam("type",""); if ($lType=="best_rated") { $lCat=""; $lOrder=" order by ad_totalscore desc"; } else if ($lType=="most_viewed") { $lCat=""; $lOrder=" order by ad_views desc"; } else if ($lCat) { $lCat=" AND $cat_tbl.cat_id =$lCat"; $lOrder=" order by ad_date desc, ad_id desc"; } else { $lCat=""; $lOrder=" order by ad_date desc, ad_id desc"; } $tplRss->assign("lastbuild",date("D, j M Y H:i:s",time())); $tplRss->assign("language",$set_language); $tplRss->assign("url",$set_url); $tplRss->assign("sitename",$set_sitename); $lCatName=""; if ($set_multilang_cat) $lColCat = "lang_" . $set_language; if (!$lCatName) $lColCat = "cat_name"; if ($set_validation==1) // If ad validation is on, only show ad_is_valid=1 ads $val_string = " AND ad_is_validated = 1"; $val_string .= " AND (ad_pp_expire>=NOW() OR user_up_expire>=NOW()) "; $val_string .= " AND (ad_start_date='0000-00-00' or CURDATE()>=ad_start_date) "; $sql_links = "select ad_id,ad_title,ad_description,ad_date,$lColCat as cat_name,$cat_tbl.cat_id from $usr_tbl,$ads_tbl inner join $cat_tbl on $ads_tbl.ad_cat_id = $cat_tbl.cat_id where ad_owner=user_id $val_string $lCat $lOrder limit $set_rss_limit"; $result = q($sql_links); $i=0; while($row=mysql_fetch_array($result)) { $lPub="EST"; $sitetitle = ""; $ad_id = $row["ad_id"]; $ad_title=$row["ad_title"]; $ad_description=$row["ad_description"]; $datestamp = date("D, j M Y H:i:s",$row["ad_date"]); $catname = $row["cat_name"]; $link="http://$set_url/" . linkDetail($ad_id); $lArray[$i]["title"]=$ad_title; $lArray[$i]["descr"]=$ad_description; $lArray[$i]["date"]=$datestamp; $lArray[$i]["catname"]=$catname; $lArray[$i]["link"]=$link; $i++; } $tplRss->assign("rss_list",$lArray); } } $tplRss->caching = 2; $tplRss->cache_lifetime = 3600; $tplRss->display("rss_feed.tpl",getParamInt("cat",""));?>