format('Y-m-d'); function urls($in) { $text = " ".preg_replace('/(’|‘|“|”)/', "'", $in);//" ".str_replace("\n", " ", $in); $urlRegex = "/(https?\:\/\/|\s)[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,4})(\/+[a-z0-9_.\:\;-]*)*(\?[\&\%\|\+a-z0-9_=,\.\:\;-]*)?([\&\%\|\+&a-z0-9_=,\:\;\.-]*)([\!\#\/\&\%\|\+a-z0-9_=,\:\;\.-]*)*/i"; $emailRegex="/\w+@[a-zA-Z_]+?\.[a-zA-Z]{2,4}/"; $currentUrl = ""; return trim($text); } function getMini($field) { $img=$field; $arr=explode("/", $img); $arr[count($arr)-1]="mini_".$arr[count($arr)-1]; return implode("/", $arr); } function getGeneriLinks($str) { $generiLinks=""; $mod=$str; $generiLinks.=''.$str.', '; $generiLinks=substr($generiLinks, 0, strlen($generiLinks)-2); return $generiLinks; } function getIconsAnteprima($arr) { global $today; $totImg=0; $totVideo=0; if($arr['immagine']!="immagini/logo.jpg") { $totImg++; } if($arr['premium'] && (new DateTime($arr['premium_data_fine'])>=$today)) { $totImg+=intval($arr['tot_img_premium']); } elseif($arr['gold'] && (new DateTime($arr['gold_data_fine'])>=$today)) { $totImg+=intval($arr['tot_img_gold']); } if($arr['video']!="") { $totVideo++; } if($arr['premium'] && (new DateTime($arr['premium_data_fine'])>=$today)) { $totVideo+=intval($arr['tot_video_premium']); } elseif($arr['gold'] && (new DateTime($arr['gold_data_fine'])>=$today)) { $totVideo+=intval($arr['tot_video_gold']); } $html="
"; if(($arr['premium'] && (new DateTime($arr['premium_data_fine'])>=$today)) || ($arr['gold'] && (new DateTime($arr['gold_data_fine'])>=$today))) { if($arr['vis_telefono']) { $html.="
"; } } if($arr['immagine']!="immagini/logo.jpg") { $html.="
".$totImg."
"; } if($arr['video']!="") { $html.="
".$totVideo."
"; } if(($arr['premium'] && (new DateTime($arr['premium_data_fine'])>=$today)) || ($arr['gold'] && (new DateTime($arr['gold_data_fine'])>=$today))) { if($arr['tot_mp3_premium']) { $html.="
".$arr['tot_mp3_premium']."
"; } elseif($arr['tot_mp3_gold']) { $html.="
".$arr['tot_mp3_gold']."
"; } } $html.="
"; return $html; } function getFeedbackPreview($arr) { $html=""; if($arr['tot_feedback']) { for($i=0; $i<$arr['media_feedback']; $i++) { $html.=""; } for($i=0; $i<5-$arr['media_feedback']; $i++) { $html.=""; } $html.=" (".$arr['tot_feedback']." feedback)"; } return $html; } function getDeficits($res) { global $today; $classWithPremium=(intval($res['premium']) && (new DateTime($res['premium_data_fine'])>=$today))?" gruppoPremium":""; $classWithPremium.=intval($res['tot_feedback'])==0?" grNFe":""; $classWithPremium.=$res['immagine']=="immagini/logo.jpg"?" grNIm":""; $classWithPremium.=$res['video']==""?" grNVi":""; $classWithPremium.=(((intval($res['premium'])==1 && (new DateTime($res['premium_data_fine'])>=$today)) || (intval($res['gold'])==1 && (new DateTime($res['gold_data_fine'])>=$today))) && intval($res['vis_telefono'])==1)?"":" grNPh"; $classWithPremium.=(((intval($res['premium'])==1 && (new DateTime($res['premium_data_fine'])>=$today)) && intval($res['tot_mp3_premium'])>0) || ((intval($res['gold']==1) && (new DateTime($res['gold_data_fine'])>=$today)) && intval($res['tot_mp3_gold'])>0))?"":" grNMp"; return $classWithPremium; } function getEsclusioni() { $html="
"; $html.="Mostra gruppi con:  "; $html.="
telefono visibile  
"; $html.="
foto  
"; $html.="
video  
"; $html.="
mp3  
"; $html.="
feedback  
"; $html.="
"; return $html; } function getEsclusioniVicine() { $html="
"; $html.="Mostra gruppi con:  "; $html.="
telefono visibile  
"; $html.="
foto  
"; $html.="
video  
"; $html.="
mp3  
"; $html.="
feedback  
"; $html.="
"; return $html; } $provGP=preg_replace('/_/', '-', preg_replace('/-/', ' ', $_GET['prov'])); $genGP=preg_replace(array('/-/', '/\|/'), array(' ', '/'), $_GET['gen']); $data=new Mysql(); $link=$data->connect(); $ricerca_regione=false; $auth=$data->getAuth("select provincia from province where provincia='".mysqli_real_escape_string($link, $provGP)."'"); if(mysqli_num_rows($auth)==0) { $ricerca_regione=true; $auth=$data->getAuth("select regione from regioni where regione='".mysqli_real_escape_string($link, $provGP)."'"); if(mysqli_num_rows($auth)==0) { header("Location: http://www.musiqua.it"); } } $arr_gen_musica=array("Acustica", "Altro", "Ambient", "Classica", "Elettronica", "House / Techno", "Latin", "Popolare", "Sperimentale", "Strumentale", "World / Etno"); ?> . Musica per il matrimonio o altro evento
=date_format(current_date, '%Y-%m-%d')) desc, (gruppi.gold and date_format(gruppi.gold_data_fine, '%Y-%m-%d')>=date_format(current_date, '%Y-%m-%d')) desc, gruppi.valore desc"; } else { $sql1="select distinct gruppi.*, (select count(*) from immagini_premium where id_gruppo=gruppi.id) as tot_img_premium, (select count(*) from immagini_gold where id_gruppo=gruppi.id) as tot_img_gold, (select count(*) from video_premium where id_gruppo=gruppi.id) as tot_video_premium, (select count(*) from video_gold where id_gruppo=gruppi.id) as tot_video_gold, (select round(avg(voto)) from feedback where id_gruppo=gruppi.id and visibile=1 and cancellato=0 and abuso=0) as media_feedback, (select count(*) from feedback where id_gruppo=gruppi.id and visibile=1 and cancellato=0 and abuso=0) as tot_feedback, (select count(*) from mp3_premium where id_gruppo=gruppi.id) as tot_mp3_premium, (select count(*) from mp3_gold where id_gruppo=gruppi.id) as tot_mp3_gold, ".$sessione." as login from gruppi join generi_gruppi on generi_gruppi.id_gruppo=gruppi.id where gruppi.visibile=1 and gruppi.cancellato=0 and gruppi.bannato=0 and gruppi.regione='".mysqli_real_escape_string($link, $provGP)."' and generi_gruppi.genere='".mysqli_real_escape_string($link, $genGP)."' order by (gruppi.premium and date_format(gruppi.premium_data_fine, '%Y-%m-%d')>=date_format(current_date, '%Y-%m-%d')) desc, (gruppi.gold and date_format(gruppi.gold_data_fine, '%Y-%m-%d')>=date_format(current_date, '%Y-%m-%d')) desc, gruppi.valore desc"; } $auth=$data->getAuth($sql1); if(mysqli_num_rows($auth)) { $rowRegioneIns=mysqli_fetch_array($auth); $regioneIns=$rowRegioneIns['regione']; mysqli_data_seek($auth,0); echo ""; } ?>
1?"
Ordina per: cachet minimo cachet massimo nome gruppo
":""; $ordinamenti.=mysqli_num_rows($auth)>1?getEsclusioni():""; $html='
'.(preg_match("/^http:\/\/www.musiqua.it/", $referrer)?'
Indietro
':'
Nuova ricerca
').'

'.$genGP." ".$provGP.'

'.mysqli_num_rows($auth).' risultati
'.(!$ricerca_regione?"Provincia":"Regione").': '.$provGP.'
Genere: '.getGeneriLinks(preg_replace('/, /', ",", $genGP)).'
'.$ordinamenti.'
'; $jsCode=""; //echo $html; } } } $html.=/*'
'.*/(preg_match("/^http:\/\/www.musiqua.it/", $referrer)?'
Indietro
':'
Nuova ricerca
'); //$jsCode.=""; echo $html; ?> getAuth("select regione from province where provincia='".mysqli_real_escape_string($link, $provGP)."'"); $rowVicine=mysqli_fetch_array($authVicine); $provGP=$rowVicine['regione']; } $authVicine=$data->getAuth("select regioni_ad from regioni where regione='".mysqli_real_escape_string($link, $provGP)."'"); $arrRegId=array(); if(mysqli_num_rows($authVicine)) { while($rowVicine=mysqli_fetch_array($authVicine)) { $arrRegId=array_merge($arrRegId, explode(",",$rowVicine['regioni_ad'])); } $arrRegId=array_unique($arrRegId); foreach($arrRegId as &$item) settype($item, 'integer'); $IDREG=implode(",",$arrRegId); $authVicine=$data->getAuth("select regione from regioni where id in (".$IDREG.")"); $defReg=array(); while($rowVicine=mysqli_fetch_array($authVicine)) { $defReg[]="'".mysqli_real_escape_string($link, $rowVicine['regione'])."'"; } $oldReg=array($provGP); $defReg=array_diff($defReg,$oldReg); $sqlVicine="select distinct gruppi.*, (select count(*) from immagini_premium where id_gruppo=gruppi.id) as tot_img_premium, (select count(*) from immagini_gold where id_gruppo=gruppi.id) as tot_img_gold, (select count(*) from video_premium where id_gruppo=gruppi.id) as tot_video_premium, (select count(*) from video_gold where id_gruppo=gruppi.id) as tot_video_gold, (select round(avg(voto)) from feedback where id_gruppo=gruppi.id and visibile=1 and cancellato=0 and abuso=0) as media_feedback, (select count(*) from feedback where id_gruppo=gruppi.id and visibile=1 and cancellato=0 and abuso=0) as tot_feedback, (select count(*) from mp3_premium where id_gruppo=gruppi.id) as tot_mp3_premium, (select count(*) from mp3_gold where id_gruppo=gruppi.id) as tot_mp3_gold, ".$sessione." as login from gruppi join generi_gruppi on generi_gruppi.id_gruppo=gruppi.id where gruppi.visibile=1 and gruppi.cancellato=0 and gruppi.bannato=0 and gruppi.regione in (".implode(",",$defReg).") and generi_gruppi.genere='".mysqli_real_escape_string($link, $genGP)."'"; if(!$ricerca_regione) { $sqlVicine.=" union "; $sqlVicine.="select distinct gruppi.*, (select count(*) from immagini_premium where id_gruppo=gruppi.id) as tot_img_premium, (select count(*) from immagini_gold where id_gruppo=gruppi.id) as tot_img_gold, (select count(*) from video_premium where id_gruppo=gruppi.id) as tot_video_premium, (select count(*) from video_gold where id_gruppo=gruppi.id) as tot_video_gold, (select round(avg(voto)) from feedback where id_gruppo=gruppi.id and visibile=1 and cancellato=0 and abuso=0) as media_feedback, (select count(*) from feedback where id_gruppo=gruppi.id and visibile=1 and cancellato=0 and abuso=0) as tot_feedback, (select count(*) from mp3_premium where id_gruppo=gruppi.id) as tot_mp3_premium, (select count(*) from mp3_gold where id_gruppo=gruppi.id) as tot_mp3_gold, ".$sessione." as login from gruppi join generi_gruppi on generi_gruppi.id_gruppo=gruppi.id where gruppi.visibile=1 and gruppi.cancellato=0 and gruppi.bannato=0 and gruppi.regione='".mysqli_real_escape_string($link, $provGP)."' and gruppi.provincia<>'".mysqli_real_escape_string($link, $old_prov)."' and generi_gruppi.genere='".mysqli_real_escape_string($link, $genGP)."' order by (premium and date_format(premium_data_fine, '%Y-%m-%d')>=date_format(current_date, '%Y-%m-%d')) desc, (gold and date_format(gold_data_fine, '%Y-%m-%d')>=date_format(current_date, '%Y-%m-%d')) desc, valore desc"; } else { $sqlVicine.=" order by (gruppi.premium and date_format(gruppi.premium_data_fine, '%Y-%m-%d')>=date_format(current_date, '%Y-%m-%d')) desc, (gruppi.gold and date_format(gruppi.gold_data_fine, '%Y-%m-%d')>=date_format(current_date, '%Y-%m-%d')) desc, gruppi.valore desc"; } $authVicine=$data->getAuth($sqlVicine); if(mysqli_num_rows($authVicine)) { //$jsCode.=""; echo $html; ?> '.(preg_match("/^http:\/\/www.musiqua.it/",$referrer)?'
Indietro
':'
Nuova ricerca
').'

'.$genGP." ".$provGP.'

Nessun risultato
Provincia: '.$provGP.'
Genere: '.getGeneriLinks(preg_replace('/, /', ",", $genGP)).'
'.$ordinamenti.'
'; //echo $html; } ?>
"; echo $jsCode."\n"; ?>