Parametro [citta] mancante.'); $citrow = db_selrow("SELECT * FROM citta WHERE cit_id='$cit'"); if ($citrow == false) die('ID Città non trovato.'); if ($citrow['cit_mobile'] != 1) die('ID Città non valido.'); // Controllo id $real_ids = array(); $ids = $_REQUEST['ids']; $list = explode(',', $ids); foreach ($list as $l) if (intval(trim($l)) > 0) $real_ids[] = intval(trim($l)); $descr_cond = (CURRENT_LANG == 'it') ? 'LENGTH(l.poi_descr) > 10' : 'LENGTH(l.poi_descr_'.CURRENT_LANG.') > 10'; // Opere $op = array(); $q = db_sel("SELECT l.poi_id, l.poi_nome, l.poi_nome_en, l.poi_padre FROM poi l JOIN quartiere q USING (qua_id) WHERE l.poi_padre > 0 && q.cit_id='".$cit."'"); // gian 09/05/2012 13:13:24 RIMOSSA CONDIZIONE SU DESCRIZIONE PER EVITARE POI NON REFERENZIATI AND $descr_cond"); while ($l = mysqli_fetch_assoc($q)) $op[$l['poi_padre']][] = $l; // Lista quartieri per questa città (per limitare la query select) //$qua_ids = array(); //$q = db_sel("SELECT * FROM quartiere WHERE cit_id='$cit'"); //while ($l = mysqli_fetch_assoc($q)) $qua_ids[] = $l['qua_id']; echo ''."\n"; $sql = "SELECT l.*, quartiere.*, citta.*, tipopoi.*, a.art_nome, a.art_cognome, a.art_alias, a.art_nome_en, a.art_cognome_en, a.art_alias_en, (SELECT CONCAT_WS('".SQL_JOIN_FIELDS."',foto_id,foto_nomefile) FROM foto_xref JOIN foto USING(foto_id) WHERE table_id=".TABLE_POI." AND item_id=l.poi_id AND foto_principale=1 LIMIT 1) as fotoprinc FROM poi l LEFT JOIN citta USING(cit_id) JOIN quartiere USING(qua_id) LEFT JOIN tipopoi USING(tipopoi_id) LEFT JOIN artista a USING (art_id) WHERE quartiere.cit_id='$cit' ORDER BY poi_id"; // and l.tipopoi_id<>13 // echo "" . xml_quote_text($sql) . ""; // gian 09/05/2012 13:12:24 rimossa condizione sulla descrizione altrimenti non lista vari POI che vengono citati negli itinerari, mandando in crash l'app // WHERE quartiere.cit_id='$cit' AND $descr_cond $q = db_sel($sql); while ($l = mysqli_fetch_assoc($q)) { $pid = $l['poi_id']; $tst = date_to_timestamp($l['poi_mod_date']); if (count($real_ids) > 0 && !in_array($pid, $real_ids)) continue; list ($foto_id, $foto_nomefile) = explode(SQL_JOIN_FIELDS, $l['fotoprinc']); $foto_small = CONF_MOBILE_IMAGE_SMALL; $foto_medium = CONF_MOBILE_IMAGE_MEDIUM; $foto_big = CONF_MOBILE_IMAGE_BIG; if (chk_pint($foto_id)) { $foto_small = image_url($foto_id, '138x138', $foto_nomefile); $foto_medium = image_url($foto_id, '457x457', $foto_nomefile); $foto_big = image_url($foto_id, '600x450', $foto_nomefile); $foto_small = preg_replace('!http://[^/]+/!','http://www.arte.it/', $foto_small); $foto_medium = preg_replace('!http://[^/]+/!','http://www.arte.it/', $foto_medium); $foto_big = preg_replace('!http://[^/]+/!','http://www.arte.it/', $foto_big); } echo "\t".''."\n"; echo "\t\t".''.xml_quote_text(xml_lg_db($l, 'poi_nome')).''."\n"; echo "\t\t".''.xml_quote_text($l['poi_padre']).''."\n"; echo "\t\t".''.$l['tipopoi_id'].''."\n"; // Variabile a seconda del tipo di poi $mp = $poi_map[$l['tipopoi_id']]; $tipo_table = $mp['tipo_table']; $tipo_table_id = $mp['tipo_table_id']; $table_prefix = $mp['tipo_table_prefix']; echo "\t\t".''.$l['poi_tipo'].''."\n"; // Artista if ($l['art_id'] > 0) { if (strlen($l['art_alias']) > 2) { echo "\t\t".''.xml_quote_text(lg_db($l, 'art_alias')).''."\n"; } else { echo "\t\t".''.xml_quote_text(lg_db($l, 'art_nome').' '.lg_db($l, 'art_cognome')).''."\n"; } } else { echo "\t\t".''."\n"; } if ($cit == 5179) { // caserta // se il nome e' lo stesso del comune, uso la provincia, forzando la notazione estesa $nome = trim(xml_lg_db($l, 'poi_ind_comune')); if ($nome == xml_lg_db($l, 'poi_nome')) { $prov = xml_lg_db($l, 'poi_ind_prov'); switch($prov) { case "BN": $nome = "Benevento"; break; case "CE": $nome = "Caserta"; break; } } if ($nome == "") { // prendo il nome del padre // error_log("EMPTY NAME"); // echo "POI_ID=$pid -- PADRE=" . $l['poi_padre']; if ($l['poi_padre'] > 0) { $sqlpadre = "SELECT poi_nome, poi_nome_en from poi where poi_id=" . $l['poi_padre']; // error_log($sqlpadre); $qpadre = db_sel($sqlpadre); // echo $sqlpadre; $padre = mysqli_fetch_assoc($qpadre); $nome = xml_lg_db($padre, 'poi_nome'); } } echo "\t\t".''.xml_quote_text($nome).''."\n"; } else echo "\t\t".''.xml_quote_text(xml_lg_db($l, 'qua_nome')).''."\n"; echo "\t\t".''.$l['poi_lat'].''."\n"; echo "\t\t".''.$l['poi_lng'].''."\n"; echo "\t\t".''.xml_quote_text($l['poi_ind']).''."\n"; echo "\t\t".''.xml_quote_text($l['poi_sito']).''."\n"; echo "\t\t".''.xml_quote_text($l['poi_eticket']).''."\n"; echo "\t\t".''.xml_quote_text($l['poi_email']).''."\n"; echo "\t\t".''.xml_quote_text($l['poi_email_pre']).''."\n"; echo "\t\t".''.xml_quote_text($l['poi_tel']).''."\n"; echo "\t\t".''.xml_quote_text($l['poi_tel_pre']).''."\n"; if ($cit == 5179) { // caserta if ($l['poi_descr_short'] != "") $descrizione = xml_lg_db($l, 'poi_descr_short'); else $descrizione = xml_lg_db($l, 'poi_descr'); echo "\t\t".''.xml_quote_html($descrizione).''."\n"; } else echo "\t\t".''.xml_quote_html(xml_lg_db($l, 'poi_descr')).''."\n"; echo "\t\t".''.xml_quote_html(xml_lg_db($l, 'poi_curiosita')).''."\n"; echo "\t\t".''.xml_quote_html(xml_lg_db($l, 'poi_trasporto')).''."\n"; echo "\t\t".''.xml_quote_html(xml_lg_db($l, 'poi_orario')).''."\n"; echo "\t\t".''.xml_quote_html(xml_lg_db($l, 'poi_prezzo')).''."\n"; echo "\t\t".''."\n"; echo "\t\t".''.xml_quote_text($l['poi_costo']).''."\n"; echo "\t\t".''."\n"; echo "\t\t".''.xml_quote_text($l['poi_segnalato_da']).''."\n"; echo "\t\t".''."\n"; echo "\t\t".''.xml_quote_text($l['poi_durata_visita'] != 0 ? $l['poi_durata_visita'] : '').''."\n"; echo "\t\t".''."\n"; echo "\t\t".''.xml_quote_text($l['poi_data_da'] != 0 ? $l['poi_data_da'] : '').''."\n"; echo "\t\t".''."\n"; echo "\t\t".''.xml_quote_text($l['poi_data_a'] != 0 ? $l['poi_data_a'] : '').''."\n"; echo "\t\t".''."\n"; echo "\t\t".''.xml_quote_text($l['poi_stelle'] != 0 ? $l['poi_stelle'] : '').''."\n"; echo "\t\t".''."\n"; echo "\t\t".''.xml_quote_text($l['poi_flag_gratis']).''."\n"; echo "\t\t".''."\n"; echo "\t\t".''.xml_quote_text($l['poi_flag_family']).''."\n"; echo "\t\t".''."\n"; echo "\t\t".''.xml_quote_text($l['poi_flag_disab']).''."\n"; echo "\t\t".''."\n"; echo "\t\t".''.xml_quote_text($l['poi_flag_risto']).''."\n"; echo "\t\t".''."\n"; echo "\t\t".''.xml_quote_text($l['poi_flag_book']).''."\n"; echo "\t\t".''."\n"; echo "\t\t".''.xml_quote_text($l['poi_flag_meteo']).''."\n"; echo "\t\t".''."\n"; echo "\t\t".''.xml_quote_text($l['poi_flag_code']).''."\n"; echo "\t\t".''."\n"; echo "\t\t".''.xml_quote_text($l['poi_flag_racc']).''."\n"; echo "\t\t".''."\n"; echo "\t\t".''.xml_quote_text($l['poi_flag_wifi']).''."\n"; echo "\t\t".''."\n"; echo "\t\t".''.xml_quote_text($l['poi_flag_business']).''."\n"; echo "\t\t".''."\n"; echo "\t\t".''.xml_quote_text($l['poi_flag_piscina']).''."\n"; echo "\t\t".''."\n"; echo "\t\t".''.xml_quote_text($l['poi_flag_giardino']).''."\n"; echo "\t\t".''."\n"; echo "\t\t".''.xml_quote_text($l['poi_flag_spa']).''."\n"; echo "\t\t".''."\n"; echo "\t\t".''.xml_quote_text($l['poi_flag_panorama']).''."\n"; echo "\t\t".''."\n"; echo "\t\t".''.xml_quote_text($l['poi_flag_bici']).''."\n"; echo "\t\t".''."\n"; echo "\t\t".''.xml_quote_text($l['poi_flag_percorsi']).''."\n"; echo "\t\t".''."\n"; echo "\t\t".''.xml_quote_text($l['poi_flag_lettura']).''."\n"; echo "\t\t".''.xml_quote_text($foto_small).''."\n"; //echo "\t\t".''.xml_quote_text($foto_medium).''."\n"; echo "\t\t".''.xml_quote_text($foto_big).''."\n"; echo "\t\t".''."\n"; if (isset($op[$pid])) foreach ($op[$pid] as $o) echo "\t\t\t".''.xml_quote_text(lg_db($o, 'poi_nome')).''."\n"; echo "\t\t".''."\n"; echo "\t".''."\n"; } echo ''; ?>