//Redirect per problema indicizzazione google
$url = $_SERVER["SCRIPT_URL"];
if(preg_match("/artist/i",$url))
{
$url = str_replace('Artist','artist',$url);
if(preg_match("/[A-Z \+]/",$url) || preg_match("/nokia/i",$url) )
{
$url = strtolower($url);
$url = str_replace('artist','Artist',$url);
$url = str_replace('nokia/','',$url);
$url = str_replace('mono/','',$url);
$url = str_replace(' ','_',$url);
$url = str_replace('+','_',$url);
$url = str_replace('/_','/',$url);
$url = str_replace('_/','/',$url);
//echo "";
header("HTTP/1.1 301 Moved Permanently");
header("Location: http://".$_SERVER["HTTP_HOST"]."$url");
header("Connection: close");
exit;
}
}
unset($url);
//Cerca 'es' (con gli apici) per customizzare il motore es
$keyword_from = array('n.e.r.d','n.e.r.d.','o.c.','the oc','the o.c.','r.e.m.','get right','m@d', 'm.i.a', 'oh oh');
$keyword_to = array('nerd', 'nerd', 'oc', 'oc' ,'oc', 'rem', 'getright', 'The concert','Sunshowers','ohoh');
//$keyword_from = array('n.e.r.d','n.e.r.d.','N.E.R.D','N.E.R.D.');
//$keyword_to = array('nerd' ,'nerd' ,'nerd' ,'nerd' );
$limitserv = 5;
$limitservlogo = 12;
$limitservwall = 10;
$cols_max = 6;
$cols_max_wall = 5;
$max = 60;
$limit_top = 48;
$visualizzatop = array(
'nokia',
'siemens',
'ericsson',
'sonyericsson',
'sony ericsson',
'alcatel',
'motorola',
'panasonic',
);
require_once "/mnt/gfsPartition/data/parts-mt2/lib/MT2_lib.php";
myCookie();
include "/mnt/gfsPartition/data/parts-mt2/lib/connect.php";
$artisti_str = array('artista','speciale','artist','special','especial','kuenstler');
$_opt = myurl();
//print_r($_opt);
if($_opt[0] != '')
{
$k=str_replace('_',' ',urldecode($_opt[0]));
if($_opt[1] != '')
{
$m=$_opt[1];
if($_opt[2] != '')
{
$t = $_opt[2];
}
}
}
require_once "/mnt/gfsPartition/data/parts-mt2/lib/localize.$_domain.php";
$mtBottomId = '407924';
//Patch per ricerche di 'suonerie','loghi','picture SMS' ecc...
if(!strcasecmp($k,'suonerie') || !strcasecmp($k,'loghi') || !strcasecmp($k,'suonerie polifoniche'))
{
header("Location: http://www.mrtones.it/".strtolower(str_replace(' ','_',$k))."_".strtolower(str_replace(' ','',$m))."/");
exit;
}
elseif(!strcasecmp($k,'picture sms'))
{
header("Location: http://www.mrtones.it/pictures_sms_nokia/");
exit;
}
?>
$ktemp = $k;
$k = ucwords($k);
switch($_domain)
{
case 'it':
echo "Suonerie ".stripslashes($k).", Loghi ".stripslashes($k).", Polifoniche ".stripslashes($k).", Picture SMS ".stripslashes($k)." - Mr.Tones";
break;
case 'com':
case 'uk':
echo stripslashes($k)." Ringtones, ".stripslashes($k)." Logos, ".stripslashes($k)." Polyphonic Ringtones, ".stripslashes($k)." Picture Messages - Mr.Tones";
break;
case 'es':
echo "Melodías ".stripslashes($k).", Logos ".stripslashes($k).", Melodías Polifónicas ".stripslashes($k).", Imágenes ".stripslashes($k)." - Mr.Tones";
case 'de':
echo "Klingeltöne ".stripslashes($k).", Logos ".stripslashes($k).", Polyphone Klingeltöne ".stripslashes($k).", Farbige Logos ".stripslashes($k)." - Mr.Tones";
break;
}
?>
$bannerstring = "general";
if ($_domain=="com" || $_domain=="uk")
include $parts."/integrazione/kimedia_".$_domain.".html";
?>
include $parts.'/integrazione/wunderloop.html'; ?>
$k = $ktemp;
include $parts.'/integrazione/top_'.$_domain.'.htm';
$k = strtolower($k);
//include $parts.'/integrazione/banner_search_'.$_domain.'.htm';
mrtPageBanner($_domain, 'top');
//Trasformazione keyword ingestibili (array $keyword_from $keyword_to)
$k = str_replace($keyword_from,$keyword_to,$k);
$k = ucwords($k);
$_type='search';
$_tmptype = $_type;
$_type = 'abb';
include $parts."/integrazione/menu_".$_domain.".htm";
$_type = $_tmptype;
$dbh=getAdmDbConnection();
?>
| |
 |
if(in_array(strtolower($m), $artisti_str))
{
$m='Nokia';
$artista=1;
}
elseif(in_array(strtolower($t),$artisti_str))
{
unset($t);
$artista=1;
}
else $artista=0;
if ($t=='')
{?>
 |
if(in_array(strtolower($k),$visualizzatop))
echo "$_hit ".strtoupper($m)." | ";
else
echo "$k | ";
?>
 |
|
}
//Tolgo spazi iniziali e finali
$key_search = trim($k);
//Controllo lunghezza singole parole
//$preg=0;
//$parole_singole = preg_split("/[\W ]+/",$key_search);
//$match_like = '';
//foreach($parole_singole as $parola)
//{
//if(strlen($parola) > 2)
//{
//$key_match.=' +'.addslashes($parola);
//$preg=1;
//}
//}
if(in_array(strtolower($key_search),$visualizzatop)) //Caso in cui estraggo la classifica
{
$match = '';
$limit_query_top = " LIMIT $limit_top";
}
elseif($artista) //Caso in cui cerco la frase esattamente com'č scritta
{
//Questa cerca esattamente la frase inserita
$key_artista = '"'.addslashes($key_search).'"';
$match = "AND MATCH(title,author,keyword) AGAINST ('$key_artista' IN BOOLEAN MODE)";
//$key_regex = preg_quote(str_replace('.','',$key_search));
//$key_regex = addslashes($key_regex);
//$match = "AND CONCAT(' ',title,' ',author,' ',keyword,' ') LIKE '% $key_regex %'";
}
//elseif(!$preg) //Caso di parole inferiori a 2 lettere
// {
// //Questo caso non serve piů
// $parole = addslashes($key_search);
// $match_like.="AND CONCAT(' ',title,' ',author,' ',keyword,' ') LIKE '% $parole %'";
// $match = $match_like;
// }
else { //Caso di ricerca dell'utente
$key_search2 = addslashes($key_search);
$match = "AND MATCH(title,author,keyword) AGAINST ('$key_search2') ";
}
if($t != '')
{
$limitserv = $max;
$limitservlogo = $max;
$limitservwall = $max;
$type_where = "AND type='$t'";
if($match =='')
$order = ",parclick DESC";
else
$order = ",title";
}
else
{
$order = ",parclick DESC";
$limit_query_top = '';
}
$restrict = '';
if ($m == 'Panasonic')
$restrict = "AND type='mono'";
elseif (strtolower($m) != 'nokia')
$restrict = "AND type!='pict'";
//ESCLUSIONE WALLPAPER IT
$exclude_wall = '';
//if(!($_domain == 'com' || $_domain == 'es' || $_domain == 'uk'))
// $exclude_wall = "type!='wall' AND";
//FINE ESCLUSIONE
//$query = "SELECT id,code,title,author,primary_cat,type FROM Content WHERE $exclude_wall state='on' AND primary_cat!=0 AND domain='$_domain' $type_where $restrict $match ORDER BY type$order $limit_query_top";
// MODIFICA GIO PER VISUALIZZAZIONE!
$query = "SELECT id,code,title,author,primary_cat,type FROM Content WHERE $exclude_wall state='on' AND primary_cat!=0 AND domain='$_domain' $type_where $restrict $match ";
if($_domain == 'uk') {
$query .= "
ORDER BY
CASE
WHEN type = 'poli' THEN 1
WHEN type = 'wall' THEN 2
WHEN type = 'mono' THEN 3
WHEN type = 'logo' THEN 4
WHEN type = 'pict' THEN 5
END$order $limit_query_top";
} else {
$query .= "
ORDER BY
CASE
WHEN type = 'mono' THEN 1
WHEN type = 'poli' THEN 2
WHEN type = 'wall' THEN 3
WHEN type = 'logo' THEN 4
WHEN type = 'pict' THEN 5
END$order $limit_query_top";
}
//echo "";
$res = mysql_query($query, $dbh) or die("Errore in SQL: $query ".mysql_error());
$lasttype='';
$lt=0;
$num_cont = mysql_num_rows($res);
if($num_cont == 0)
{
echo '| ';
include "/mnt/gfsPartition/data/parts-mt2/notfound_".$_domain.".html";
echo ' | ';
echo ' | |  | ';
echo '';
include 'colonna.php';
echo ' |
';
include $parts."/integrazione/footer_spacer_search.htm";
include $parts."/integrazione/footer_copyright_".$_domain.".htm";
echo ' ';
if(!$artista)
{
if ($m == 'Nokia')
$found = 'no';
else
$found = 'yesno';
//echo "";
$query = "INSERT INTO Searchnewkey SET keyword='" . addslashes($k) . "',found='$found',domain='$_domain'";
mysql_query($query, $dbh) or die("Errore in SQL: $query
".mysql_error());
}
mysql_close($dbh);
exit;
}
elseif ($t=='')
if($match == '')
echo "| $_found8 |
";
else
echo "| $_found7 |
";
while ($result = mysql_fetch_array($res))
{
$lt++;
$type = $result[type];
$logopic = 0;
if($type=='logo' || $type=='pict' || $type=='wall')
$logopic = 1;
$author = str_replace('#','',$result[author]);
if($lasttype != $type)
{
if ($lasttype=='logo' || $lasttype=='pict' || $lasttype=='wall')
{
$str_result .= "$str_under
";
$str_result .= " |
";
$str_under = '';
$limit = $limitservlogo;
}
else $limit = $limitserv;
////////////// Fine sezione precedente
if ($lt > $max)
$lt = $max;
if ($lasttype != '' && $lt > $limit + 1 && $t == '')
{
$str_result .= " |
\n";
$str_result .= "| \n";
$str_result .= "$_found6 ";
//if ($_domain == 'com')
if ($match != '' && ($_domain == 'com' || $_domain == 'uk' || $_domain == 'de'))
$str_result .= " $k ";
$str_result .= "$_services[$lasttype] $m";
if ($match != '' && ($_domain != 'com' || $_domain == 'uk' || $_domain == 'de' ))
$str_result .= " $k ";
$str_result .= " |
\n";
}
//Didascalia
if ($t == '')
$color = "#FFcc33";
else
$color = "#FF9900";
$str_result .= "\n";
$str_result .= " | \n";
if($match != '')
{
if ($_domain == 'com' || $_domain == 'uk' || $_domain == 'de')
$frase_print = "$k $m ".$_caturl[0][$type];
elseif($_domain == 'it')
$frase_print = $_caturl[0][$type]." $k $m";
elseif($_domain == 'es')
$frase_print = $_caturl[0][$type]." $k $m";
$str_result .= "" .strtoupper($frase_print);
}
else
$str_result .= " | $_hit " .strtoupper($_caturl[0][$type]." $m");
if ($t != '')
$str_result .= " | ";
//Fine didascalia
$str_result .= " |
|
 |
\n";
//Trovate n xxxxxxxx ....
if ($lasttype != '')
{
//$str_result .= " |
\n";
$tot_result .= " \n";
$tot_result .= "| | \n";
if ($lasttype == 'logo' || $lasttype == 'pict' || $lasttype == 'wall')
$tot_result .= "$_found5 ";
else
$tot_result .= "$_found4 ";
$lt--;
if($match == '' && $lt > $limit_top)
$lt = $limit_top;
if($_domain == 'com' || $_domain == 'uk' || $_domain == 'de')
$tot_result .= $lt.' '.$k.' '."$_services[$lasttype] $m";
else
$tot_result .= $lt.' '."$_services[$lasttype] $k $m";
$lt=1;
$tot_result .= " |
|
";
$tot_result .= " |
\n";
}
$tot_result .= $str_result;
$str_result = '';
if ($logopic)
{
$n_loghi = 0;
$n_pict = 0;
$n_wall = 0;
$str_result .= "";
$str_result .= "  | ";
}
$lasttype=$type;
$nserv=1;
}
if(($nserv > $limitserv && !$logopic) ||
(($type=='logo'|| $type == 'pict') && $nserv > $limitservlogo) ||
($type == 'wall' && $nserv >$limitservwall))
continue;
$m_l = strtolower($m);
$url_content=array
(
'it' => array
(
'mono' => "/suoneria_".str_replace(' ','',$m_l)."/suoneria_".urlentone($result[title])."/$result[id]/$result[primary_cat]/",
'poli' => "/suoneria_polifonica/suoneria_polifonica_".urlentone($result[title])."/$result[id]/$result[primary_cat]/",
'logo' => "/logo_".str_replace(' ','',$m_l)."/logo_".urlentone($result[title])."/$result[id]/$result[primary_cat]/",
'pict' => "/picture_sms_nokia/picture_sms_".urlentone($result[title])."/$result[id]/$result[primary_cat]/",
'wall' => "/sfondo_cellulare/sfondo_".urlentone($result[title])."_cellulare/$result[id]/$result[primary_cat]/",
),
'com' => array
(
'mono' => "/".str_replace(' ','',$m_l)."_ringtone/".urlentone($result[title])."_ringtone/$result[id]/$result[primary_cat]/",
'poli' => "/polyphonic_ringtone/".urlentone($result[title])."_polyphonic_ringtone/$result[id]/$result[primary_cat]/",
'logo' => "/".str_replace(' ','',$m_l)."_logo/".urlentone($result[title])."_logo/$result[id]/$result[primary_cat]/",
'pict' => "/picture_message_nokia/".urlentone($result[title])."_picture_message/$result[id]/$result[primary_cat]/",
'wall' => "/wallpaper/".urlentone($result[title])."_wallpaper/$result[id]/$result[primary_cat]/",
),
'es' => array
(
'mono' => "/melodia_".str_replace(' ','',$m_l)."/melodia_".urlentone($result[title])."/$result[id]/$result[primary_cat]/",
'poli' => "/melodia_polifonica/melodia_polifonica_".urlentone($result[title])."/$result[id]/$result[primary_cat]/",
'logo' => "/logo_".str_replace(' ','',$m_l)."/logo_".urlentone($result[title])."/$result[id]/$result[primary_cat]/",
'pict' => "/imagen_nokia/imagen_".urlentone($result[title])."/$result[id]/$result[primary_cat]/",
'wall' => "/fondo/fondo_".urlentone($result[title])."/$result[id]/$result[primary_cat]/",
),
'uk' => array
(
'mono' => "/".str_replace(' ','',$m_l)."_ringtone/".urlentone($result[title])."_ringtone/$result[id]/$result[primary_cat]/",
'poli' => "/polyphonic_ringtone/".urlentone($result[title])."_polyphonic_ringtone/$result[id]/$result[primary_cat]/",
'logo' => "/".str_replace(' ','',$m_l)."_logo/".urlentone($result[title])."_logo/$result[id]/$result[primary_cat]/",
'pict' => "/picture_message_nokia/".urlentone($result[title])."_picture_message/$result[id]/$result[primary_cat]/",
'wall' => "/wallpaper/".urlentone($result[title])."_wallpaper/$result[id]/$result[primary_cat]/",
),
'de' => array
(
'mono' => "/".str_replace(' ','',$m_l)."_klingelton/".urlentone($result[title])."_klingelton/$result[id]/$result[primary_cat]/",
'poli' => "/polyphonen_klingelton/".urlentone($result[title])."_polyphonen_klingelton/$result[id]/$result[primary_cat]/",
'logo' => "/".str_replace(' ','',$m_l)."_logo/".urlentone($result[title])."_logo/$result[id]/$result[primary_cat]/",
'pict' => "/bildmitteilung/".urlentone($result[title])."_bildmitteilung/$result[id]/$result[primary_cat]/",
'wall' => "/farbige_logo/".urlentone($result[title])."_farbige_logo/$result[id]/$result[primary_cat]/",
)
);
switch($type)
{
case 'mono':
$str_result .= " ";
$str_result .= "| $result[title] | ";
//$str_result .= "$author | ";
$str_result .= "$author | ";
$str_result .= "";
//$ringlisten = $_ringlisten.': '.$_ringmono_pre.addslashes($result['title']).' '.$_ringmono_post;
//$ringlisten .= ' - '.$_ringmonos_pre.addslashes($author).' '.$_ringmonos_post;
//$str_result .= "onmouseover=\"self.status='".$ringlisten."';return true;\" ";
//$str_result .= "onmouseout=\"self.status='';return true;\" href=\"#\">";
$str_result .= " | ";
$str_result .= "
| ";
if($lt != $limitserv)
$str_result .= " | ";
break;
case 'poli':
$file = "/contents/$type/".substr($result[code],-1).'/'.substr($result[code],-2,1)."/$result[code].mp3";
$str_result .= " ";
$str_result .= "| $result[title] | ";
//$str_result .= "$author | ";
$str_result .= "$author | ";
$str_result .= "";
//$ringlisten = $_ringlisten.': '.$_ringpoli_pre.addslashes($result['title']).' '.$_ringpoli_post;
//$ringlisten .= ' - '.$_ringpolis_pre.addslashes($author).' '.$_ringpolis_post;
//$str_result .= "onmouseover=\"self.status='".$ringlisten."';return true;\" ";
//$str_result .= "onmouseout=\"self.status='';return true;\">";
$str_result .= " | ";
$str_result .= "
| ";
if($lt != $limitserv)
$str_result .= " | ";
break;
case 'logo':
$n_loghi++;
$file = "/contents/$type/" . substr($result[code],-1) ."/$result[code].gif";
$link = $url_content[$_domain][$type];
if($n_loghi >= ($cols_max + 1 ))
{
$n_loghi = 1;
$str_result .= "$str_under ";
$str_under = '';
if ($linea_visu_logo != 1 || $t != '')
{
$str_result .= " |
| ";
$str_result .= "
 |
\n";
$str_result .= " | ";
}
$str_result .= "";
$linea_visu_logo=1;
}
$str_result .= "\n";
$logoalt = $_logo_pre.$result[title].' '.$m.' '.$_logo_post;
$str_result .= " | \n";
$str_result .= " | ";
$str_under .= "\n";
$str_under .= "$result[title] | \n";
$str_under .= " | \n";
break;
case 'pict':
$n_pict++;
$file = "/contents/$type/" . substr($result[code],-1) ."/$result[code].gif";
$link = $url_content[$_domain][$type];
if($n_pict >= ($cols_max + 1 ))
{
$n_pict = 1;
$str_result .= " $str_under ";
$str_under = '';
if ($linea_visu_pict != 1 || $t != '')
{
$str_result .= " |
| ";
$str_result .= " |
\n";
$str_result .= " | ";
}
$str_result .= "";
$linea_visu_pict=1;
}
$str_result .= "\n";
$pictalt = $_pict_pre.$result[title].$_pict_post;
$str_result .= " | \n";
$str_result .= " | ";
$str_under .= "\n";
$str_under .= "$result[title] | \n";
$str_under .= " | \n";
break;
case 'wall':
$n_wall++;
$file = "/contents/$type/".substr($result[code],-1)."/$result[code].jpg";
$link = $url_content[$_domain][$type];
if($n_wall >= ($cols_max_wall + 1 ))
{
$n_wall=1;
$str_result .= " $str_under ";
$str_under = '';
if ($linea_visu_wall != 1 || $t != '')
{
$str_result .= " |
| ";
$str_result .= " |
\n";
$str_result .= " | ";
}
$str_result .= "";
$linea_visu_wall = 1;
}
$str_result .= "";
$str_result .= "  | ";
$str_result .= " | ";
$str_under .= "$result[title] | \n";
$str_under .= " | ";
//comm
break;
}
$nserv++;
}
//echo " $num_cont ";
if ($num_cont > 0)
{
if ($lasttype=='logo' || $lasttype=='pict' || $lasttype=='wall')
{
$str_result .= " $str_under ";
$str_result .= " |  |
";
$limit = $limitservlogo;
}
else $limit = $limitserv;
if ($lasttype != '' && $lt > $limit && $t == '')
{
$str_result .= " |
\n";
$str_result .= "| \n";
$str_result .= "$_found6 ";
if ($match != '' && ($_domain == 'com' || $_domain == 'uk' || $_domain == 'de'))
$str_result .= " $k ";
$str_result .= "$_services[$lasttype] $m";
if ($match != '' && ($_domain != 'com' || $_domain == 'uk' || $_domain == 'de'))
$str_result .= " $k\n";
$str_result .= " |
\n";
}
//Trovate n xxxxxxxx ....
if ($lasttype != '')
{
$tot_result .= " \n";
$tot_result .= "| | \n";
if ($lasttype == 'logo' || $lasttype == 'pict' || $lasttype == 'wall')
$tot_result .= "$_found5 ";
else
$tot_result .= "$_found4 ";
if($match == '' && $lt > $limit_top)
$lt = $limit_top;
if($_domain == 'com' || $_domain == 'uk' || $_domain == 'de')
$tot_result .= $lt.' '. $k . ' ' ."$_services[$lasttype] $m";
else
$tot_result .= $lt.' '."$_services[$lasttype] $k $m";
$tot_result .= " |
|
";
$tot_result .= " |
\n";
}
$tot_result .= $str_result;
$str_result = '';
}
echo "$tot_result";
if(!$artista)
{
//echo "";
$query = "INSERT INTO Searchnewkey SET keyword='" . addslashes($k) . "',found='yes',domain='$_domain'";
mysql_query($query, $dbh) or die("Errore in SQL: $query
".mysql_error());
}
//mysql_close($dbh);
?>
|
 |
include '/mnt/gfsPartition/html-mt2/colonna.php'; ?>
|
include $parts."/integrazione/footer_spacer_search.htm"; ?>
include $parts."/integrazione/footer_copyright_".$_domain."_1.htm"; ?>
mrtPageBanner($_domain, 'bottom'); ?>
include $parts."/integrazione/footer_copyright_".$_domain."_2.htm"; ?>
//include $parts."/integrazione/footer_copyright_$_domain.htm"; ?>
include $parts."/integrazione/redsheriff.html"; ?>
mrtPageBanner($_domain, 'dynamic'); ?>