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
| if ($_SERVER['HTTP_HOST'] == "www.domaine.be" || $_SERVER['HTTP_HOST'] == "domaine.be")
{
// Get results
$sql = "SELECT a.*, UNIX_TIMESTAMP(a.createdon) AS timestamp, ct.cityname,
COUNT(*) AS piccount, p.picfile,
scat.subcatname, cat.catid, cat.catname $xfieldsql
FROM $t_ads a
INNER JOIN $t_cities ct ON a.cityid = ct.cityid
INNER JOIN $t_subcats scat ON a.subcatid = scat.subcatid
INNER JOIN $t_cats cat ON scat.catid = cat.catid
LEFT OUTER JOIN $t_adxfields axf ON a.adid = axf.adid
LEFT OUTER JOIN $t_adpics p ON a.adid = p.adid AND p.isevent = '0'
LEFT OUTER JOIN $t_featured feat ON a.adid = feat.adid AND feat.adtype = 'A'
WHERE $where
AND $visibility_condn
AND cityid <97
AND (feat.adid IS NULL OR feat.featuredtill < NOW())
$loc_condn
GROUP BY a.adid
ORDER BY a.createdon DESC
LIMIT $offset, $ads_per_page";
$res = mysql_query($sql) or die($sql.mysql_error());
}
else
{
// Get results
$sql = "SELECT a.*, UNIX_TIMESTAMP(a.createdon) AS timestamp, ct.cityname,
COUNT(*) AS piccount, p.picfile,
scat.subcatname, cat.catid, cat.catname $xfieldsql
FROM $t_ads a
INNER JOIN $t_cities ct ON a.cityid = ct.cityid
INNER JOIN $t_subcats scat ON a.subcatid = scat.subcatid
INNER JOIN $t_cats cat ON scat.catid = cat.catid
LEFT OUTER JOIN $t_adxfields axf ON a.adid = axf.adid
LEFT OUTER JOIN $t_adpics p ON a.adid = p.adid AND p.isevent = '0'
LEFT OUTER JOIN $t_featured feat ON a.adid = feat.adid AND feat.adtype = 'A'
WHERE $where
AND $visibility_condn
AND cityid >97
AND (feat.adid IS NULL OR feat.featuredtill < NOW())
$loc_condn
GROUP BY a.adid
ORDER BY a.createdon DESC
LIMIT $offset, $ads_per_page";
$res = mysql_query($sql) or die($sql.mysql_error());
} |
Partager