- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
function m_location_count($cat, $featured = true) {
global $var;
$title = '';
if(is_array($cat)) {
$cat_arr = $cat;
$cat = "";
$first = true;
foreach($cat_arr as $v) {
if($first) {
$title .= $v;
$cat .= "'$v'";
$first = false;
} else {
$title .= " & $v";
$cat .= ",'$v'";
}
}
} else {
$title = $cat;
$cat = "'$cat'";
}
if($featured) {
$sql = "select jjl.loc_id, jjl.title, jjl.street, jjl.phone, jjl.loccat from `jos_jev_locations` jjl, jos_jev_customfields3 jjc where jjl.loc_id = jjc.target_id and jjc.value = 1 and jjl.published=1 order by jjl.title ";
}
else {
$sql = "select jjl.loc_id, jjl.title, jjl.street, jjl.phone, jjl.loccat from `jos_jev_locations` jjl, `jos_categories` jc where jjl.loccat = jc.id and jc.title in($cat) and jjl.published=1 order by jjl.title";
}
$data =mysql_query($sql);
return mysql_num_rows($data);
}
guest 01.04.2011 15:27 # 0
guest 01.04.2011 16:00 # +1
rO_ot 04.04.2011 20:49 # 0
bytes 06.04.2011 01:26 # 0
guest 06.04.2011 11:19 # 0