include "../db/db_conn.php";
include "../counter/count.php";
include "../db/band_album_admin_idx.php";
header("Vary: User-Agent, Accept");
$is_echo_preview_lib = 0;
$is_echo_coll_wish_lib = 0;
$is_echo_rclike_lib = 0;
$idx = $_GET["idx"];
$lyrics = mysqli_fetch_array(mysqli_query($connect, "select * from lyrics where idx='".$idx."'"));
$albumInfo = mysqli_fetch_array(mysqli_query($connect, "select * from Album where idx='".$lyrics["aidx"]."'"));
$band_info = mysqli_fetch_array(mysqli_query($connect, "select * from Band where idx='".$albumInfo['band_idx']."'"));
if (!$lyrics[0]) {
$tmp7 = preg_replace("/^\/lyrics-song\/([^\/]+)-([0-9]+)\/?$/","$1",$_SERVER["REQUEST_URI"]);
$new_lyrics = mysqli_fetch_array(mysqli_query($connect, "select idx,ab_str from lyrics where ab_str='".$tmp7."' order by idx desc limit 0,1"));
if ($new_lyrics["idx"]) {
header("HTTP/1.1 301 Moved Permanently");
header("Location: ".$protocol_site_domain.echo_lyrics_song_url($new_lyrics["idx"],$new_lyrics["ab_str"]));
exit;
}
else {
header("HTTP/1.1 404 Not Found"); header("Location: ".$url_404); exit;
}
}
if (!$albumInfo[0]) {
header("HTTP/1.1 404 Not Found"); header("Location: ".$url_404); exit;
}
$lyrics_song_url = echo_lyrics_song_url($lyrics["idx"],$lyrics["ab_str"]);
$album_url = echo_album_url($lyrics["aidx"],$albumInfo['ab_str']);
$band_url = echo_band_url($albumInfo['band_idx'],$band_info['ab_str']);
if (preg_match("/\/lyrics_song\//",$_SERVER['REQUEST_URI']) || preg_match("/\/lyrics\/song\//",$_SERVER['REQUEST_URI'])) {
header("HTTP/1.1 301 Moved Permanently");
header("Location: ".$protocol_site_domain.$lyrics_song_url);
exit;
}
$band_idx = $albumInfo['band_idx'];
## brutal, grind 장르 앨범은 광고출력 안하고 검색엔진 색인 중단
/*
if (stripos($albumInfo["style"],"brutal")!==false || stripos($albumInfo["style"],"grind")!==false) {
$is_view_ad = 0;
$no_robots = 1;
}
*/
## 광고 차단 Band인지 확인
/*
$chk_band_idx = $band_idx;
$chk_band_name = $band_info["band"];
$chk_band_genre = $band_info["style"];
include "../etc/no_ads_band_check.php";
*/
## 광고 차단 Album인지 확인
/*
$chk_album_idx = $albumInfo["idx"];
$chk_album_genre = $albumInfo["style"];
include "../etc/no_ads_album_check.php";
*/
## 광고 차단 Page인지 확인
include "../etc/no_ads_page_check.php";
if (!$albumInfo["no_collabo"] && ($albumInfo["band_idx_2"] || $albumInfo["band_idx_3"] || $albumInfo["band_idx_4"] || $albumInfo["band_idx_5"] || $albumInfo["band_idx_6"])) {
$band_name_str = $band_info["band"];
for ($i=2 ; $i<7 ; $i++) {
if ($albumInfo["band_idx_".$i]) {
$tmp = mysqli_fetch_array(mysqli_query($connect, "select band,ab_str from Band where idx='".$albumInfo["band_idx_".$i]."'"));
if ($tmp[0]) {
$is_collabo = 1;
$band_name_str .= " / ".$tmp["band"];
${"band_idx_".$i} = $albumInfo["band_idx_".$i];
${"band_name_".$i} = $tmp["band"];
${"band_ab_str_".$i} = $tmp["ab_str"];
}
}
}
if ($albumInfo["a_type"]!="split") {
$collaboration = " [collaboration]";
}
}
else {
$band_name_str = $albumInfo["band"];
}
$mTitle = $band_name_str." - ".$lyrics["track"]." Lyrics";
//$m_title_tmp = " Lyrics";
$description = $band_name_str." - ".$lyrics["track"]." Lyrics : ";
$description .= trim(str_replace(" "," ",str_replace("\r\n"," ",strip_tags($lyrics["lyrics"]))));
$description = cutStr($description,250);
if (strlen($description)<80) $description = "";
$mTitle = str_replace("<","<",$mTitle);
$mTitle = str_replace(">",">",$mTitle);
$description = str_replace("<","<",$description);
$description = str_replace(">",">",$description);
$meta_description = $description;
if ($albumInfo["big_cover"]=="y") $og_image = "/album-cover-artwork/".$albumInfo["image"];
else $og_image = "/album/cover/".$albumInfo["image"];
$head_string = "
";
if ($description) {
$head_string .=
"
";
}
$fb_data_href = $protocol_site_domain.$lyrics_song_url;
$tmp = 0;
if ($albumInfo["member"]) $tmp += 5;
if ($albumInfo["guest_session"]) $tmp += 5;
if ($albumInfo["other_staff"]) $tmp += 5;
$tmp += $band_info["lyrics_num"];
if ($isMobile) {
$no_top_ad = 1;
if ($tmp>=17 || strlen($lyrics["lyrics"])>=200) $echo_matched_content = 1;
$head_include_file = "
";
$top_include_file = "../mobile_top.php";
$main_include_file = "include/mobile_lyrics_view.php";
include "../mobile_site_layout.php";
}
else {
$a_year_album = substr($albumInfo["release_date"],0,4);
//$top_big_ad_file = "../etc/mk_lyrics_top_auto_1.php";
$top_big_ad_file = "";
$head_include_file = "
";
$top_include_file = "../top_new.php";
$main_include_file = "include/lyrics_view.php";
$side_include_file_1 = "../side/side_group_lyrics.php";
if ($tmp>=17 || strlen($lyrics["lyrics"])>=200) $side_include_file_2 = "../side/matched_content.php";
include "../site_layout_new.php";
}
include "../hidden2.php";
?>