= $cacheInt){$cacheUpdate=1;} //if((!$link && file_exists($cachedContent)) || $cacheUpdate==0) if((!$link || !$db_selected || $highServerLoad==1) && file_exists($cachedContent)) { if($link){mysqli_close($link);} echo file_get_contents($cachedContent); exit; }} mysqli_set_charset($link,"utf8"); $letter=mysqli_real_escape_string($link, $letter); $urlencodedband=urlencode($band); if(preg_match("# \((feat\.|ft\.|feat|ft|featuring|duet with) #is",$song)) { $songwithoutfeats=preg_replace("# \((feat\.|ft\.|feat|ft|featuring|duet with).*#is","",$song); preg_match("# \((feat\.|ft\.|feat|ft|featuring|duet with)(.*)#is",$song,$featpart); $onlyfeatpart="(".$featpart[1]."".$featpart[2].""; }else{ $songwithoutfeats=$song; $onlyfeatpart=""; } /*preg_match("/-lyrics-(.*)\.html/",$url_array[3],$fontsize); $fsize=$fontsize[1]; //echo "

$fsize"; if($fsize==18){$addmeta="\n"; $redir="/read/$letter/$url_array[2]/".str_replace("-18.html",".html",$url_array[3])."";}else{$fsize=16; $redir="/read/$letter/$url_array[2]/".str_replace(".html","",$url_array[3])."-18.html";}*/ //if(!$song){include("/home/fce/www/inc/404.php");exit;} $fsize=16; /* if($url_array[4] || preg_match("/\/\/| |'|-lyrics-lyrics|%[2-7][a-fA-F0-6]|\/[A-Z]|-[A-Z]|--/",$requri) || !preg_match("/\.html$/",$requri) || !preg_match("/-lyrics$/",$url_array[2])){$q=urlencode($song);$s=2;include("/home/fce/www/inc/404.php");exit;} */ $bandlink=preg_replace("/ |%20|-/","_",strtolower($band)); ####################################################################################### ####################################################################################### $band4sql=str_replace("'","\'",$band);//\x00|\n|\r|\|'|"|\x1a $song4sql=str_replace("'","\'",$song);//\x00|\n|\r|\|'|"|\x1a $md5=md5("$band4sql $song4sql"); $sonuc=@mysqli_query($link, "SELECT * FROM elyrics WHERE md5val = '".$md5."' AND band = '".$band4sql."' AND song = '".$song4sql."' AND letter = '$letter'"); $varmi=@mysqli_num_rows($sonuc); if($varmi==0){$warn="(error code: r1)";mysqli_close($link);include("/home/fce/www/inc/404.php");exit;} $row=mysqli_fetch_array($sonuc); $rtot=$row['count']; $rrate=$row['rating']; $views=$row['views']; $submitter=$row['submitter']; $corrector=$row['corrector']; $corrdate=$row['correction_date']; if($corrdate){$cordate=date("F j, Y",$corrdate);$cord=" on $cordate";} $album_id=$row['album_id']; $song_duration=$row['song_duration']; $ytid=$row['ytid']; $newviews=$views+1; // check usa top 100 chart $usa100_pos=@mysqli_result(@mysqli_query($link, "select `pos` from `usatop40` where `band` ='$band4sql' AND `song` = '$song4sql'"),0); if($usa100_pos>0){$chartMsg="
$songwithoutfeats is currently #$usa100_pos in the USA chart";} // /* $cookieName=substr($md5,0,15); if(!isset($_COOKIE[$cookieName]) && $isBot=="no") { $setCookie=setcookie($cookieName,'read',strtotime('+12 hours'),'/'); if($setCookie) { $newviews=$views+1; if($rtot>0){$avgrating=$rrate/$rtot;}else{$avgrating=0;} //to prevent division by zero error $newscore=number_format(($avgrating*0.900)+($newviews*0.0028)+($rtot*0.072),2); if($isBot=="no" && $mysql_write_operations=="enabled"){mysqli_query($link, "UPDATE `elyrics` SET views = '$newviews', score = '$newscore' WHERE md5val = '$md5'"); mysqli_query($link, "UPDATE `elyrics2` SET views = '$newviews', score = '$newscore' WHERE md5val = '$md5'"); } } } */ /*if($fsize==18) # getvid.php - vote.php - print.php - submit_lyrics.php { $newviews=$views+1; if($rtot>0){$avgrating=$rrate/$rtot;}else{$avgrating=0;} //to prevent division by zero error $newscore=number_format(($avgrating*0.900)+($newviews*0.0028)+($rtot*0.072),2); if($isBot=="no" && $mysql_write_operations=="enabled"){mysqli_query($link, "UPDATE `elyrics` SET views = '$newviews', score = '$newscore' WHERE md5val = '$md5'"); mysqli_query($link, "UPDATE `elyrics2` SET views = '$newviews', score = '$newscore' WHERE md5val = '$md5'");} }*/ mysqli_free_result($sonuc); # get picurl and artist info $xdat=mysqli_query($link, "select * from artist_news where artist = '$band4sql'"); $arf=mysqli_fetch_array($xdat); $qq=stripslashes(strtolower(trim(stripslashes($band)))); $imgname="".substr(md5("$qq-cigdemim1980"),0,16).""; if($arf['images']!="") { $bols=explode("|",$arf['images']); $kac=@count($bols)-1; if($kac>0){$artist_image="//$cdn_domain/artist_img/$imgname-".$bols[0].".jpg";} } else { $artist_image=""; } $picurl=$artist_image; $sizeInf=" width=\"64\" height=\"64\""; if($arf['twitter']){$twitterx=" $band twitter";} if($arf['official']){$officialx=" Official page";} if($arf['wikipedia']){$wikix=" $band wiki";} if($arf['facebook']){$facex=" $band facebook";} mysqli_free_result($xdat); # get songfact if there is any $sfact=@mysqli_query($link, "select * from blog where songfact_id = '$md5'"); if(@mysqli_num_rows($sfact)==1){ $sfd=mysqli_fetch_array($sfact); $songfactx=" $song Meaning"; } @mysqli_free_result($sfact); # Get album info from database if($album_id>0) { $alb=mysqli_query($link, "select * from albums_itunes where id = '$album_id'"); $albex=mysqli_num_rows($alb); if($albex>0) { $albinf=mysqli_fetch_array($alb); $first_release_year=substr($albinf['first_release_date'],0,4); if($first_release_year>3){$album_release_date=preg_replace("/\|[0-9]$/","",$albinf['first_release_date']);}else{$album_release_date=$albinf['release_date'];} $album_name=trim(preg_replace("/\(.*\)/","",$albinf['album_name'])); if(preg_match("# - single$#i",$album_name) && $song_duration>2 && $isBot=="no" && $mysql_write_operations=="enabled"){ //album isminde single varsa, bu sarkiyi orjinal albumde gostermek icin, cronjobs.php de tekrar album bilgisi almaya yolluyor $surre=file_get_contents("/home/fce/www/inc/ref/song_dur.txt"); //ya 0 ya da 1 olacak mysqli_query($link, "UPDATE `elyrics` SET song_duration = '$surre' WHERE md5val = '$md5'"); mysqli_query($link, "UPDATE `elyrics2` SET song_duration = '$surre' WHERE md5val = '$md5'"); } $album_image="//$cdn_domain/album_img/".$albinf['cover_url'].".jpg"; $album_tracks_num=$albinf['trackcount']; $albumnote="Album: $album_name / Original Release Date: $album_release_dateGenre: ".$albinf['genre']; if($song_duration>2){$song_duration=floor($song_duration/1000);$seconds=$song_duration%60;$song_duration=floor($song_duration/60);$minutes=$song_duration%60;if($seconds<10){$seconds="0$seconds";} $albumnote.="Song Duration: $minutes min $seconds sec";} if($albinf['cover_url']!="no image"){$picurl=$album_image;$altinfo="$band - ".$albinf['album_name'];$sizeInf=" width=\"100\" height=\"100\"";} else{$altinfo="$simpleband $simplesong lyrics";} $ayrac1=" / "; $labels="Record Label(s): ".$albinf['label'].""; //$itunes_link=""; } else { $albumnote=""; $altinfo="$simpleband $simplesong lyrics"; $ayrac1=""; } mysqli_free_result($alb); }else{$albumnote="";$class1="navcnt2";$class2="navimg2";$altinfo="$simpleband $simplesong lyrics";$ayrac1="";} # Get album info from database # Top artist lyrics $pregm=@mysqli_query($link, "SELECT song FROM `elyrics` WHERE band = '$band4sql' order by views desc limit 0,11"); if(mysqli_num_rows($pregm)>1){ $ncss=0; while($rrw=mysqli_fetch_row($pregm)) { if($song != $rrw[0]) { $ncss++; $rrwNew=trim(preg_replace("/\(.*?\)/","",$rrw[0])); $rrwNew=trim(preg_replace("/\[.*?\]/","",$rrwNew)); if(preg_match("/ feat\. | ft\. | feat | ft | featuring /",$rrwNew)){ preg_match("/(.*?)( feat\. | ft\. | feat | ft | featuring ).*?/",$rrwNew,$rrwPuresong); $rrwNew=trim($rrwPuresong[1]);} $contenido2.=" $rrwNew"; } if($ncss==10){break;} }} @mysqli_free_result($pregm); # Top artist lyrics # Choose Lyrics to Display on the Page //$Bak=@mysqli_query($link, "select * from `lyrics_official` where md5val = '$md5'"); //$Bakrow=mysqli_fetch_array($Bak); //$tipo='mxm'; //$lyrics=$Bakrow[lyrics]; //if(strlen($lyrics)>200) //{ //$to_day = date("m.d.Y"); //$cvcx=@mysqli_result(@mysqli_query($link, "select count(*) from `1_mxm_views` where day = '$to_day'"),0); //if($DeviceType!="desktop"){$rndx=mt_rand(1,100);}else{$rndx=99;} //if($isBot=="yes" || $ref=='yes'){$rndx=10;$mco="yep";} //if($rndx > 50) /* if($DeviceType!="desktop"){$rndx=mt_rand(1,4);}else{$rndx=1;} if($isBot=="yes" || $ref=='yes'){$rndx=4;$mco="yep";} if($rndx!=4) */ //{ // if(!$mco){ // if($cvcx==0){mysqli_query($link, "insert into `1_mxm_views` (day,counted,not_counted) values ('$to_day','1','0')");} // else{mysqli_query($link, "update `1_mxm_views` set counted = counted+1 where day = '$to_day'");} // } // $trackScript=""; //if($DeviceType!="desktop"){$musixmatch_ad="
// //
";} //}else{ // if(!$mco){ // if($cvcx==0){mysqli_query($link, "insert into `1_mxm_views` (day,counted,not_counted) values ('$to_day','0','1')");} // else{mysqli_query($link, "update `1_mxm_views` set not_counted = not_counted+1 where day = '$to_day'");} // } //} /*if($Bakrow[info]!="") { $ayirs=explode("Copyright:",$Bakrow[info]); $writer="".str_replace("Writer(s): ","Songwriter(s): ",trim($ayirs[0])).""; if($writer=="

"){$writer="";} $copyr="
Copyright: ".trim($ayirs[1])."
"; }*/ // $footer="
Official lyrics by "; //} $footer="
Official lyrics by "; //if($Bakrow[writers]!=""){ if($row['writers']!=""){ $tWriters=trim(preg_replace("# {2,}#"," ",preg_replace("#[^a-zA-Z0-9 \"@,.'-]#","",$row['writers']))); foreach(explode(",",$tWriters) as $pBand){ $pBand=trim($pBand); $varmiki=@mysqli_query($link, "select * from artist_news where artist = '".mysqli_real_escape_string($link, bandCorrect($pBand))."'"); if(mysqli_num_rows($varmiki)>0){$nWriters.="$pBand, ";}else{$nWriters.="$pBand, ";} } $writer="Songwriter(s): ".rtrim($nWriters,', ')."
"; // utf8 degil cunku } //if($Bakrow[publishers]!=""){$copyr="Publisher(s): ".trim(preg_replace("# {2,}#"," ",str_replace(",",", ",preg_replace("#[^a-zA-Z0-9 \"@,.'-]#","",$Bakrow[publishers]))))."
";} // utf8 degil cunku //@mysqli_free_result($Bak); // id=995589 dan sonra 'ALTER TABLE `lyrics` modify `lyrics` TEXT CHARACTER SET `utf8mb4` COLLATE `utf8mb4_unicode_ci`' komut kullanilarak utf8 e cevirildi //ALTER TABLE tablename CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; //ALTER TABLE `lyrics_utf8` modify `lyrics` TEXT CHARACTER SET `utf8mb4` COLLATE `utf8mb4_unicode_ci` //UPDATE albums_itunes SET all_tracks = CONVERT(CAST(CONVERT(all_tracks USING latin1) AS BINARY) USING utf8mb4); //https://stackoverflow.com/questions/11436594/how-to-fix-double-encoded-utf8-characters-in-an-utf-8-table //if($_GET[bobo]==1){ // mysqli_set_charset($link,"utf8"); // $sonucx=mysqli_query($link, "SELECT lyrics FROM lyrics_utf8 WHERE md5val = '".$md5."'"); //}else{ //$sonucx=@mysqli_query($link, "SELECT lyrics FROM lyrics_utf8 WHERE md5val = '".$md5."' AND not_complete = '0'"); //if(@mysqli_num_rows($sonucx)==0){ $sonucx=mysqli_query($link, "SELECT lyrics FROM lyrics WHERE md5val = '".$md5."'"); //} //} $rowx=mysqli_fetch_row($sonucx); $lyrics=str_replace("|||","",$rowx[0]); mysqli_free_result($sonucx); $lyrics=trim(preg_replace("/Songwriters(.*)<\/small>/","",$lyrics)); $tipo='db'; $copyrx=@mysqli_fetch_row(@mysqli_query($link, "select count(*) from copyright_url where url = '/read".str_replace("lyrics-18.html","lyrics.html",strtolower(mysqli_real_escape_string($link, $thepath)))."' OR url = '/song/".strtolower($letter)."/".UrlCorrection($band)."-lyrics.html'")); if($copyrx[0]==1){ $lyrics="We are sorry but we are not allowed to post $song lyrics by $band either for privacy issues or copyright restrictions!

"; $submitter=""; $corrector=""; } # Choose Lyrics to Display on the Page # check youtube id if($ytid){$youtubex=" $song video"; if($DeviceType!="phone"){ $marquee="

$band - $song
"; $marquee="
\"play
".substr($songwithoutfeats,0,30)."
".substr($band,0,30)."
"; } /* if($mobile_layout=="ok") { $tube_img=""; }else{$tube_img="
Watch $band $song video
";} */ $ytbimg="//i.ytimg.com/vi/$ytid/mqdefault.jpg"; $tube_img="$vdoAiMobile
Watch $simpleband $simplesong video
"; } # check youtube id /* # get popslide content $ret=mysqli_query($link, "select * from usatop40 where exist = '1' order by rand() limit 0,10"); while($thr=mysqli_fetch_array($ret)) { $vidID=""; $band4sql=str_replace("'","\'",$thr[band]); $song4sql=str_replace("'","\'",$thr[song]); $letx=get_Letter($band4sql); $md5x=md5("$band4sql $song4sql"); if($md5==$md5x){continue;} $vidID=@mysqli_result(@mysqli_query($link, "select youtube_id from youtube_ids where md5val = '$md5x'"),0); if(!empty($vidID)) { $nc++; $vidname="$thr[band] - $thr[song]"; if(strlen($vidname)>30){$vidname="".substr("$thr[band] - $thr[song]",0,30)."...";} //if($nc<5){$border="border-right:1px solid #C4CCC4;";}else{$border="";} $popslideC.=""; if($nc==5){break;} } } # get popslide content */ mysqli_close($link); $correctionx="
Correct lyrics"; ####################################################################################### ####################################################################################### ####################################################################################### if($rtot>1){$decir="votes";}else{$decir="vote";} if($rtot==0) { $nav="
"; $song_with_rating="

".print_songname($songwithoutfeats,1)."

$onlyfeatpart"; $ratinginfo=""; } else { $the_rating=$rrate/$rtot; if(is_float($the_rating)){$the_rating=number_format(($rrate/$rtot),2);} //$nav="
"; //$song_with_rating="

".str_replace(" Lyrics","",print_songname($song,1))." Lyrics

"; //$ratinginfo="$ayrac1Rating:
//$the_rating/10 [$rtot $decir]
"; $nav="
"; $song_with_rating="

".print_songname($songwithoutfeats,1)."

$onlyfeatpart"; $ratinginfo="$ayrac1Rating: $the_rating/10 [$rtot $decir]"; $aggrating=',"aggregateRating":{"@type":"AggregateRating","bestRating":"10","ratingCount":"'.$rtot.'","ratingValue":"'.$the_rating.'"}'; if($the_rating>=9.5){$starId="star5";}elseif($the_rating>=8.5){$starId="star4half";}elseif($the_rating>=7.5){$starId="star4";} elseif($the_rating>=6.5){$starId="star3half";}elseif($the_rating>=5.5){$starId="star3";}elseif($the_rating>=4.5){$starId="star2half";} elseif($the_rating>=3.5){$starId="star2";}elseif($the_rating>=2.5){$starId="star1half";}elseif($the_rating>=1.5){$starId="star1";}else{$starId="starhalf";} $starIdJs=""; } if(!$the_rating){$the_rating="N/A";} // /*