"; $is_robot = 1; } } //Here we include the anti-spam system to fight AI-bots since Sep 5, 2025 14:31... it is the same system we have on VSM... if (!$is_robot and !$is_human) { include_once $basedir.'/anti-spam/search_spam_check.php'; } #Connessione MySQL secure include_once $basedir_extrasecure.'/MySQL.inc'; #Moved here and loaded _once on 12/4/20, 12:18 PM... include_once $basedir.'/includes/database_tabs/shared_lists.inc'; include_once $basedir.'/includes/database_tabs/shared_functions.inc'; //This below fixed on 6/22/21, 9:50 AM! if (strpos($HTTP_HOST, $basesite) === false) { #fa il redirect 301 al dominio corretto $destinowww = $SSLprot."://".$basesite.$REQUEST_URI; header("HTTP/1.1 301 Moved Permanently"); header("Location: $destinowww"); exit; } /* if ($_SERVER['REMOTE_ADDR'] == '70.181.126.8') { print "destinowww5: $destinowww"; exit; } */ #print "/* ecco: $pirloso - $cleanSCRIPT */"; #Controlla se la pagina richiesta deve essere caricata sicura oppure non sicura... if ($sslwork) { if ($_SERVER['SERVER_PORT'] != 443) { $destino = "https://$basesite".$REQUEST_URI; #print "eccolo: $destino"; header("HTTP/1.1 301 Moved Permanently"); header("Location: $destino"); exit; } } else { if (!eregFF("/pj/",$cleanSCRIPT) and !eregFF("/scripts/",$cleanSCRIPT) and !eregFF("/testhttps/",$cleanSCRIPT) and !eregFF("/extras/",$cleanSCRIPT) and !eregFF("/uploads/",$cleanSCRIPT) and !eregFF("/includes/",$cleanSCRIPT) and strpos($cleanSCRIPT, "/login/news_jobs.rss") === false) { #Mettere qui le sezioni che sono indifferentemente caricate in https or http if ((eregFF("/login/",$cleanSCRIPT) or eregFF("/signup",$cleanSCRIPT) or eregFF("/confirmemail.php",$cleanSCRIPT) or eregFF("/cf.php",$cleanSCRIPT) or eregFF("/confirm.php",$cleanSCRIPT) or eregFF("/admin",$cleanSCRIPT) or eregFF("/cart/checkout.php",$cleanSCRIPT)) and $_SERVER['SERVER_PORT'] != 443) { $destino = "https://$basesite".$REQUEST_URI; #print "eccolo: $destino"; header("HTTP/1.1 301 Moved Permanently"); header("Location: $destino"); exit; } else if ($_SERVER['SERVER_PORT'] == 443 and !eregFF("/login/",$cleanSCRIPT) and !eregFF("/confirmemail.php",$cleanSCRIPT) and !eregFF("/signup",$cleanSCRIPT) and !eregFF("/cf.php",$cleanSCRIPT) and !eregFF("/confirm.php",$cleanSCRIPT) and !eregFF("/admin",$cleanSCRIPT) and !eregFF("/cart/checkout.php",$cleanSCRIPT) and !eregFF("js$",$cleanSCRIPT) and !eregFF("js$",$cleanSCRIPT) and !eregFF("css$",$cleanSCRIPT) and !eregFF("show_it.php",$cleanSCRIPT) and !eregFF("/extra_scripts/hoteditor/",$cleanSCRIPT)) { $destino = "http://$basesite".$REQUEST_URI; header("HTTP/1.1 301 Moved Permanently"); header("Location: $destino"); exit; } } } #Legge site status from control_panel table $queryRT = "SELECT status, nowrite FROM control_panel"; $resultRT = mysql_queryFF($queryRT); $SITESTATUS = mysql_resultFF($resultRT,0, 'status'); $SITENOWRITE = mysql_resultFF($resultRT,0, 'nowrite'); if ($SITESTATUS == 2) { #Se site status e' OFF... #Controlla che non sia io (devo avere controlpassword cookie...) if (!$controlpassword and !eregFF("/admin/",$cleanSCRIPT)) { #include "/home/webadmin/".$basesite."/EXTRA_SECURE/siteoff.inc"; include $basedir_extrasecure."/siteoff.inc"; exit; } } /* ###################################################################### #Controlla subito se c'e'' cookie visibilita', altrimenti visualizza pagina "Under Construction" -- da togliere quando si mette in production! $paginedisplayed = array('/curriculum', '/home', '/free-sheet-music', '/musicians-list', '/music-links', '/fabriphpadmin'); foreach ($paginedisplayed as $single) { if (eregFF($single, $cleanSCRIPT)) { $displaypage = 1; break; } } #Controlal subito se c'e'' cookie visibilita', altrimenti visualizza pagina "Under Construction" -- da togliere quando si mette in production! if (!$visibilita and !eregFF("set_flag.php",$REQUEST_URI) and !$displaypage) { include $basedir_extrasecure."/underconstruction.inc"; exit; } ###################################################################### */ #Memorizza session ID $s_id = $PHPSESSID; include $basedir_extrasecure.'/de-crypt_functions.inc'; #Attiva sessioni $bots = array( // Major Search Engines "Googlebot", "bingbot", "DuckDuckBot", "DuckDuckGo", "YandexBot", "YandexMobileBot", "Baiduspider", "Sogou", "Applebot", "Exabot", // Social Media "Twitterbot", "facebot", "LinkedInBot", "PinterestBot", // Regional/Specialized Search "Yeti", // Naver "Qwantify", // Qwant "DotBot", // Moz // Other Important Crawlers "CCBot", // Common Crawl "uptimebot", // Uptime monitoring "Crawler", // Generic crawler detection // Still Active Specialized Bots "psbot", // Picsearch "Raven", // SEO tools "SpiderBot", "SiteTech-Rover", "WebCopy", "WebFetcher", "SemrushBot", "SiteAuditBot", "SplitSignalBot" );//Current list of active bots as of 2024 $current_agent = $HTTP_USER_AGENT; #$current_agent = "BackRub/*.*"; foreach ($bots as $singlebot) { if (eregiFF($singlebot,$current_agent) and !(eregFF("Alexa Toolbar",$current_agent))) { #print "eccolo: $singlebot
"; $is_robot = 1; } } if (!$is_robot) { #Controlla che la pagina richiesta non sia un RSS oppure un contenuto dinamico per gli affiliati... if (!(eregFF("images/banners/dyn",$REQUEST_URI)) and !(eregFF("news.rdf",$REQUEST_URI)) and !(eregFF("news.rss",$REQUEST_URI))) { $expireTime = 60*60*24*100; // 100 days #Blocco di controllo per evitare errore del tipo: # "The session id contains invalid characters, valid characters are only a-z..." # Trovato su PHP site on 19-10-07 #Questo serve per permettere $sid passing senza cookies! ini_set('session.use_trans_sid', '1'); $sn=session_name(); if(isset($_GET[$sn])) if(strlen($_GET[$sn])!=32) unset($_GET[$sn]); if(isset($_POST[$sn])) if(strlen($_POST[$sn])!=32) unset($_POST[$sn]); if(isset($_COOKIE[$sn])) if(strlen($_COOKIE[$sn])!=32) unset($_COOKIE[$sn]); if(isset($PHPSESSID)) if(strlen($PHPSESSID)!=32) unset($PHPSESSID); ##### Fine Blocco COntrollo session_id if(!$s_id) { session_set_cookie_params($expireTime); session_start(); $s_id = session_id(); setcookie("s_id",$s_id,time()+95040000,'/'); } } } if ($fov) {#If it is coming from GoogleAd (2-21-2013)... #Scrive s_id dentro pre_overture table per verifiche (quando necessario)... $queryTdeleted = "INSERT INTO pre_overture (fov,session_id,tempo) VALUES ('$fov', '$s_id',$globaltempo)"; $result_Tdeleted = mysql_queryFF($queryTdeleted); if (!$fromov) { $fov = $fov."AAAAA".time(); setcookie("fromov",$fov,time()+31536000,'/'); #Scadenza un anno dopo } $destino_rfsh = $REQUEST_URI; $destino_rfsh = ereg_replaceFF("\?fov\=.+\&","?",$destino_rfsh); $destino_rfsh = ereg_replaceFF("\?fov\=.+$","",$destino_rfsh); $destino_rfsh = ereg_replaceFF("\&fov\=.+\&","\&",$destino_rfsh); $destino_rfsh = ereg_replaceFF("\&fov\=.+$","",$destino_rfsh); //header("HTTP/1.1 301 Moved Permanently"); header("Location: $destino_rfsh"); exit; } /* ###Prende shared libraries... if (!$sharedfunctionsflag) { include $basedir.'/includes/database_tabs/shared_lists.inc'; include $basedir.'/includes/database_tabs/shared_functions.inc'; } elseif (!$sharedlistsflag) { include $basedir.'/includes/database_tabs/shared_lists.inc'; } */ //Here we check for possible spam bots to stop Apr 7, 2025 13:29... if (!$is_robot) { //We look into the spam_bots_list table and we find the IP address or addresses that have the clumn "tempo" less than 15 minutes ago... $querySPAMBOTS = "SELECT partial_ip FROM spam_bots_list WHERE 1"; $resultSPAMBOTS = mysql_queryFF($querySPAMBOTS); $nitemsSPAMBOTS = mysql_num_rowsFF($resultSPAMBOTS); #print "querySPAMBOTS: $querySPAMBOTS - $nitemsSPAMBOTS"; #exit; if ($nitemsSPAMBOTS) { while ($rowSPAMBOTS = mysql_fetch_arrayFF($resultSPAMBOTS)) { $partialIP = $rowSPAMBOTS["partial_ip"]; #print "check this partialIP: $partialIP
"; if (strpos($useripaddress, $partialIP) !== false) { #print "stop this: $partialIP
"; include $basedir_extrasecure."/siteoff.inc"; exit; } } } } #exit; ###Controllo login... include 'setup_login.inc'; #Verifica se c'e' superuser on if ($HTTP_GET_VARS["superpassword"]) { $superpassword = $HTTP_GET_VARS["superpassword"]; } #Questo e' per evitare che chiunguque possa accedere come superuser senza conoscere la password if ($superuser and $superpassword != $superuserpw) { $superuser = 0; } #E questo invece attiva super user se presente password elseif ($superpassword == $superuserpw) { #Se c'e' password (cookie o in GET) $superuser = 1; } #Se e' logged, allora memorizza variabili utili condivise... if ($logged) { include $basedir.'/includes/login/takeloginvariables.inc'; #Prende Member variables... } ####Questo e' per banner redirect vecchie pagine e controllo hidden pages prima del lancio... #Include temporary include... //include "/home/webadmin/musicianspage.com/html/temporaryfirstinclude.inc"; #Enable gzip compression if browser accept it (SEO 10-14-2010)... if (!eregFF("/scripts/", $_SERVER['SCRIPT_FILENAME']) and !eregFF("/mc/flash/", $_SERVER['SCRIPT_FILENAME']) and !eregFF("/uploads/", $_SERVER['SCRIPT_FILENAME'])) { enablehtmlgzip(); } } ?> "; if ($catnarrow == "skill" and (!$skillADVF or $skillADVF == "---Any---")) { $skillADVF = $mainskillcomboarrayindex2[$keynarrow]+1; #print "eccolo: $skillADVF - $keynarrow
"; } elseif ($catnarrow == "instrument" and (!$skillADVF or $skillADVF == "---Any---")) { $skillADVF = $mainskillcomboarrayindex2[$keynarrow]; #print "eccolo: $skillADVF - $keynarrow
"; } elseif ($catnarrow == "genre" and (!$genreADVF or $genreADVF == "---Any---")) { $genreADVF = $genrearrayindex2[$keynarrow]+1; #print "eccolo: $genreADVF - $keynarrow
"; } elseif ($catnarrow == "ensemble" and (!$ensembledefine2ADVF or $ensembledefine2ADVF == "---Any---")) { $ensembledefine2ADVF = $keynarrow; #print "eccolo: $genreADVF - $keynarrow
"; } elseif ($catnarrow == "teaching" and (!$teachingADVF or $teachingADVF == "---Any---")) { $teachingADVF = $teachingfieldNO[$keynarrow]+1; #print "eccolo: $skillADVF - $keynarrow
"; } elseif ($catnarrow == "country" and (!$countryADVF or $countryADVF == "---Any---")) { $countryADVF = $countrylist2index[$keynarrow]; $countryADVF = strtoupper($countrylist1[$countryADVF]); #print "eccolo: $countryADVF - $keynarrow"; } elseif ($catnarrow == "state" and (!$stateADVF or $stateADVF == "---Any---")) { $stateADVF = $USAstateslist2index[$keynarrow]; $stateADVF = strtoupper($USAstateslist1[$stateADVF]); } #Qualche conversione... $$nomevarhere = str_replace("_"," ",$$nomevarhere); $$nomevarhereORIG = str_replace(" ","_",$$nomevarhereORIG); #Definisce query da aggiungere a tutti i links relativi sotto... $narrowURLs .= "&".$nomevarhere."=".$$nomevarhereORIG; } } #exit; #print "eccolo: ".$narrow[1]; #Controlla category e costruisce query... if ($categoryADVF == 1) { ##Single musician... $query .= "a.category = 1 "; #Controlla campi propri di questa categoria e li aggiunge se presenti... if ($aliasADVF) { $query .= " AND (a.alias LIKE '%$aliasADVF%' AND (a.aliaswitch = 1 or a.aliaswitch = 3)) "; } if ($firstnameADVF) { $query .= " AND (a.name LIKE '%$firstnameADVF%' AND (a.aliaswitch = 0 or a.aliaswitch = 2)) "; } if ($lastnameADVF) { $query .= " AND (a.lastname LIKE '%$lastnameADVF%' AND (a.aliaswitch = 0 or a.aliaswitch = 2)) "; } if ($genderADVF) { $genderSQL = $genderNO[$genderADVF]; $query .= " AND a.gender = $genderSQL "; } if ($skillADVF) { $skillMO = strtolower($mainskillcomboarrayindexREV[$skillADVF]); $skillMO = $skillnumericindex[$skillMO]; /* if ($FABRIZIO) { print "eccolo: $skillMO - $skillADVF - ".$mainskillcomboarrayindexREV[3]."

"; } */ $query .= " AND (a.skill = $skillMO or a.other_skills REGEXP '(^|[|])".$skillMO."($|[|])') "; $exnarrowsearch_skill = 1; $exnarrowsearch_instrument = 1; } $exnarrowsearch_ensemble = 1; #Narrow ensemble tolto quando single musician... } elseif ($categoryADVF == 2) { $query .= "a.category = 2 "; #Controlla campi propri di questa categoria e li aggiunge se presenti... if ($aliasADVF) { $query .= " AND (a.alias LIKE '%$aliasADVF%' AND (a.aliaswitch = 1 or a.aliaswitch = 3)) "; } if ($ensemblenameADVF) { $query .= " AND (a.lastname LIKE '%$ensemblenameADVF%' AND (a.aliaswitch = 0 or a.aliaswitch = 2)) "; } if ($ensembledefine1ADVF and $ensembledefine1ADVF != '---Any---') { if ($ensembledefine1otherADVF) { $query .= " AND a.ensembledefine1 = '$ensembledefine1ADVF'"; } else { $query .= " AND (a.ensembledefine1 = '$ensembledefine1ADVF' or a.ensembledefine1other LIKE '%$ensembledefine1ADVF%')"; } $exnarrowsearch_ensemble = 1; } if ($ensembledefine2ADVF and $ensembledefine2ADVF != '---Any---') { if ($ensembledefine2otherADVF) { $query .= " AND a.ensembledefine2 = '$ensembledefine2ADVF'"; } else { $query .= " AND (a.ensembledefine2 = '$ensembledefine2ADVF' or a.ensembledefine2other LIKE '%$ensembledefine2ADVF%')"; } $exnarrowsearch_ensemble = 1; } if ($ensembledefine1otherADVF) { $query .= " AND a.ensembledefine1other LIKE '%$ensembledefine1otherADVF%' "; $exnarrowsearch_ensemble = 1; } if ($ensembledefine2otherADVF) { $query .= " AND a.ensembledefine2other LIKE '%$ensembledefine2otherADVF%' "; $exnarrowsearch_ensemble = 1; } $exnarrowsearch_skill = 1; $exnarrowsearch_instrument = 1; } elseif ($categoryADVF == 3) { $query .= "a.category = 1 AND a.skill = ".$skillnumericindex['teacher']." "; #Controlla campi propri di questa categoria e li aggiunge se presenti... if ($aliasADVF) { $query .= " AND (a.alias LIKE '%$aliasADVF%' AND (a.aliaswitch = 1 or a.aliaswitch = 3)) "; } if ($firstnameADVF) { $query .= " AND (a.name LIKE '%$firstnameADVF%' AND (a.aliaswitch = 0 or a.aliaswitch = 2)) "; } if ($lastnameADVF) { $query .= " AND (a.lastname LIKE '%$lastnameADVF%' AND (a.aliaswitch = 0 or a.aliaswitch = 3)) "; } if ($teachingADVF and $teachingADVF != $skillnumericindex['other...']) { #Other, da escludere... $teachingADVFtemp = $teachingADVF-1; $query .= " AND a.teaching_field REGEXP '(^|[|])".$teachingADVFtemp."($|[|])' "; } if ($otherteachingADVF) { $query .= " AND a.teaching_field_other LIKE '%$otherteachingADVF%' "; } $exnarrowsearch_ensemble = 1; #Narrow ensemble tolto quando teacher... $browsing = "teacher"; $exnarrowsearch_skill = 1; } else { #Non funge! $userquery = ""; } $exnarrowsearch_category = 1; #Narrow escluso per category... ###Processa campi comuni a tutte le gaegorie... #Music genre... if ($genreADVF) { $genreADVFtemp = $genreADVF-1; $query .= " AND (a.genre = $genreADVFtemp or a.other_genres REGEXP '(^|[|])".$genreADVFtemp."($|[|])')"; $exnarrowsearch_genre = 1; } #Addition Date... $tempidefK = array(1 => 604800, 2 => 1209600, 3 => 1814400, 4 => 2592000, 5 => 5184000, 6 => 7776000, 7 => 15552000, 8 => 31104000); if ($additionADVF) { $tempostart = $globaltempo-$tempidefK[$additionADVF]; $query .= " AND (a.tempo > $tempostart)"; } #Updated Date... if ($updatedADVF) { $tempostart = $globaltempo-$tempidefK[$updatedADVF]; $query .= " AND (a.update_tempo > $tempostart)"; } #Country.... if ($countryADVF and $countryADVF != '---Any---') { $query .= " AND a.country = '$countryADVF'"; $exnarrowsearch_country = 1; } #Address... if ($addressADVF) { $query .= " AND a.address like '%$addressADVF%'"; } #City... if ($cityADVF) { $query .= " AND a.city LIKE '%$cityADVF%'"; } #ZIP... if ($ZIPADVF) { $query .= " AND a.ZIP = '$ZIPADVF'"; } #State.... if ($stateADVF and $stateADVF != '---Any---') { $query .= " AND a.state = '$stateADVF'"; $exnarrowsearch_states = 1; } ##Aggiugne filtro fisso... $query = add_MySQL_filter($query, 1); if ($locationflag and $orderby == "Distance") {//Adds this after WHERE... $query = str_replace(" where ", " where a.id = b.memb_id AND ", $query); ####Aggiunge order by secondo l' ordine richiesto... $query = orderby($query, 2, 1); } /* if ($FABRIZIO or $s_id == "n7p2t9hcu898162qipem9qpol2") { print "query finale external: $orderby - $query
"; exit; } */ $result = mysql_queryFF($query); $nitems = mysql_num_rowsFF($result); // if ($FABRIZIO) { // $zolo = mysql_fetch_arrayFF($result); // print_r($zolo); // exit; // } if ($nitems <= 5000 and $nitems) { #print "dentro"; $trovato = 1; $risultati = mysql_fetch_rowsarr($result); } #Se items sono maggiori di 5000, allora fa warning utente #di fare una ricerca piu' mirata. elseif ($nitems > 5000) { $toomanyresults = 1; } #exit; /* ####Test results... print "

"; if ($trovato) { $cc = 0; foreach ($risultati as $null) { print "ecco: $cc - ".$risultati[$cc]['id']." - ".$risultati[$cc]['name']." - ".$risultati[$cc]['lastname']."
"; $cc ++; } } else { print "No Results!"; } print "fine"; exit; */ if ($userquery) { #Se c'e' userquery... ############################################ ############################################ ############################################ // if ($FABRIZIO) { // print "risultati: ".print_r($risultati, true); // // } if ($trovato) { #Memorizza single arrays per ordinamento... foreach ($risultati as $key => $row) { // if ($FABRIZIO) { // // print "ecco: $key - ".$risultati[$key]['id']."
"; // } $chiavi = array_keys($risultati[$key]); foreach ($chiavi as $single) { $nomevar = "HERE".$single; ${$nomevar}[$key] = $row[$single]; // if ($FABRIZIO) { // #print "$".$nomevar.", "; // print "eccoci: $nomevar: ".${$nomevar}[$key]." - $key - ".$row[$single]."
"; // } } } include $basedir.'/search/basic_orderby.inc'; } #Fine if $trovato // if ($FABRIZIO) { // print "

end"; // exit; // } #Ora ordina ancora secondo il punteggio... #exit; #Per calcolo performance dello script... #$difftime = microtime()-$startime; #print "eccolo2: $difftime"; /* ####Test results... print "

"; if ($trovato) { $cc = 0; foreach ($risultati as $null) { print "ecco: $cc - ".$risultati[$cc]['id']." - ".$risultati[$cc]['name']." - ".$risultati[$cc]['lastname']."
"; $cc ++; } } else { print "No Results!"; } print "fine"; exit; */ ####Conteggio totale... if ($trovato) { $nitemsTOT = sizeof($risultati); } ####################################################### ####################################################### ####################################################### ###INSERIRE QUI NARROW BY PROCEDURE ####################################################### ####################################################### ####################################################### #Controlla quali narrow escludere memorizzando dentro $exnarrowsearch_xxxx #un flag per escludere i narrows... ####################################################### ####################################################### ####################################################### ####################################################### ####################################################### ####################################################### include $basedir.'/search/pagination.inc'; ##Definisce alcune variabili finali... } #Fine se c'e' $userquery! if ($nitemsTOT > 1 or $toomanyresults) { $displaynarrowby = 1; $narrowbyfromsearch = 1; #$browsing = ""; } #print "eccolo2222: ".$narrow[1]; #print "ecco primo: $browsing"; #exit; ########################################### ###############################START OUTPUT include $basedir.'/includes/doctype.inc'; include $basedir.'/search/BASE_html_musicians.inc'; ?>