####index.php
elseif($GET[show] == all){
allpics();
}
elseif($GET[zona] && $GET[category]){
$query = mysql_query("select * from $tablenamep WHERE zona LIKE '%$GET[zona]%' && category LIKE '%$_GET[category]%'ORDER BY ".get_setting(orderpic));
$num = mysql_num_rows($query);
if($num == 0){
echo('nessuna palestra corrisponde ai requisiti');
}else{
$i = 0;
$category = get_picture(category);
while($picture = mysql_fetch_array($query))
{
if($i > $num){} else {
$category = get_picture(category);
$id = $picture[id];
include(get_setting(absolutepath).'/templates/view.php');
$i++;
}
}include(get_setting(absolutepath).'/templates/view.php
view.php
<tr>
<td width="241" rowspan="7" valign="top" bgcolor="#CCCCCC"></td>
<td width="191" valign="top"> <p><strong>nome :</strong> </p></td>
<td width="21" valign="top">
<?=get_picture(title)?>
</td>
<td width="72" valign="top"><strong>categoria:</strong></td>
<td width="175" valign="top"><?echo the_category($GET[cat]); ?></td>
<td width="175" valign="top"> </td>
</tr>
<tr>
<td valign="top"><strong>zona :</strong> </td>
<td colspan="4"><?echo the_zone($GET[zone]);?></td>
</tr>
####
here what the function "the_category" do:
function the_category($cat){
global $tablenames, $id;
if($GET[cat]){ $cat = $GET[cat]; }
else{ $cat = get_picture(category); }
$query = mysql_query("SELECT name from $tablenames WHERE id='".$cat."'") or die(mysql_error());
$get = mysql_fetch_array($query);
echo $get[name];
}
can i have "flexible objects" in my template file ?
webmark