include "../db/db_conn.php";
include "../counter/count.php";
header("Vary: User-Agent, Accept");
$is_echo_preview_lib = 0;
$is_echo_coll_wish_lib = 0;
$is_echo_rclike_lib = 0;
$start = $_GET["start"];
$start = (int)$start;
$id = $_GET["id"];
$idx = $_GET["idx"];
$smd = $_GET["smd"];
$smm = $_GET["smm"];
$scm = $_GET["scm"];
$scv = $_GET["scv"];
if ($id=="Freeboard") $id = "Free_Board";
else if ($id=="Mania") $id = "Metal_Board";
else if ($id=="Information") $id = "News";
else if ($id=="Free_Review") $id = "Free_Reviews";
if ($id=="Free_Reviews" || $id=="Reviews") {
if ($memberLevel<21 && isset($_COOKIE["logged_idx"])) {
if ($_COOKIE["logged_idx"]!="1" && $_COOKIE["logged_idx"]!="21751") {
header("Location: ".$protocol_site_domain."/board/Free_Board");
exit;
}
}
}
$rz = @mysqli_fetch_array(mysqli_query($connect, "select * from ".$id." where idx='".$idx."'"));
if (!$rz[0]) {
header("HTTP/1.1 404 Not Found");
header("Location: ".$url_404);
exit;
}
$post_url = echo_board_url($rz["idx"],$rz["url_str"],$id);
if (preg_match("/idx=/",$_SERVER['REQUEST_URI'])) {
header("HTTP/1.1 301 Moved Permanently");
header("Location: ".$protocol_site_domain.$post_url);
exit;
}
/*
$tmp = explode("?", $_SERVER["REQUEST_URI"]);
if (preg_replace("/^\/board\/".$id."\/(.*)-([0-9]+)\/?$/", "$1", $tmp[0]) != $rz["url_str"]) {
header("HTTP/1.1 301 Moved Permanently");
header("Location: ".$protocol_site_domain.$post_url);
exit;
}
*/
//조회수
if ($_COOKIE["mk_board_".$id."_".$idx]!="mk_board") {
@SetCookie("mk_board_".$id."_".$idx,"mk_board",time()+120,"/"); //2분
mysqli_query($connect, "update ".$id." set b_read=b_read+1 where idx='".$idx."'");
}
include "member_admin_check.php";
//background-image, bgcolor, header, footer 는 비출력
$row_admin = @mysqli_fetch_array( mysqli_query($connect, "select * from board_admin where name='".$id."'"));
if ($memberLevel>$row_admin["pm_read"] && $board_admin!="hell_admin") {
header("Location: ".$protocol_site_domain."/board/".$id);
exit;
}
if ($smm || $smd || $scm || $scv) {
$no_robots = 1; //noindex
}
if ($id=="Free_Board") $board_name = "Free Board";
else if ($id=="Metal_Board") $board_name = "Metal Board";
else if ($id=="News") $board_name = "News";
else if ($id=="Playlist_of_the_Day") $board_name = "Playlist of the Day";
else if ($id=="Free_Reviews") $board_name = "Free Reviews";
else if ($id=="Market") $board_name = "Market";
else if ($id=="Favorite_Albums") $board_name = "Favorite Albums";
else if ($id=="Music_Videos") $board_name = "Music Videos";
else if ($id=="Notice") $board_name = "Notice";
else if ($id=="Reviews") $board_name = "Reviews";
else {
header("Location: ".$protocol_site_domain."/board/Free_Board");
exit;
}
## 광고 차단 Page인지 확인
include "../etc/no_ads_page_check.php";
$h1c = $rz["b_subject"]." | ".$board_name;
$mTitle = $h1c;
$description = strip_tags($rz["b_content"]);
$description = str_replace("\r\n"," ",$description);
$description = str_replace(" "," ",$description);
$description = cutStr($description,170);
$description = trim($description);
if (strlen($description)<60) $description = "";
if ($id=="Free_Reviews" || $id=="Reviews" || $id=="News" || $id=="Favorite_Albums") $description = "";
$meta_description = $description;
$og_file = mysqli_fetch_array(mysqli_query($connect, "select name,TYPE from ".$id."_file where idx='".$idx."' order by fidx asc limit 0,1"));
if ($og_file["TYPE"]=="image/pjpeg" || $og_file["TYPE"]=="image/jpeg" || $og_file["TYPE"]=="image/jpg" || $og_file["TYPE"]=="image/gif" || $og_file["TYPE"]=="image/x-png" || $og_file["TYPE"]=="image/png") {
$og_image_str = "
";
}
$post_write_url = ($memberLevel==21) ? "/member/login_form.php?return_url=".urlencode("/board/write.php?id=".$id) : "/board/write.php?id=".$id;
$post_button = "";
if ($id=="Free_Reviews" || $id=="Reviews") {
if ($_COOKIE["logged_idx"]=="1" || $_COOKIE["logged_idx"]=="21751") {
$post_button = "
";
}
}
else if ($id!="Notice" || $memberLevel==0) {
$post_button = "
";
}
$head_string = "
".$og_image_str."
";
if ($description) {
$head_string .=
"
";
}
$fb_data_href = $protocol_site_domain.$post_url;
$event = mysqli_fetch_array(mysqli_query($connect, "select * from events where board_id='".$id."' and post_idx='".$idx."'"));
if ($event[0]) {
$tmp = str_replace("[공연 정보] ","",$rz["b_subject"]);
$tmp2 = explode(" (",$tmp,2);
$event_title = $tmp2[0];
$tmp3 = explode(") [",$tmp2[1],2);
$event_date = $tmp3[0];
$tmp4 = explode("]",$tmp3[1],2);
$event_venue = $tmp4[0];
$event_start_date = substr($event_date,0,10);
$event_start_time = strtotime($event_start_date);
$event_start_week = (strlen($event_date)==10) ? " (".strtoupper(date("D",$event_start_time)).")" : "";
$today_time = strtotime(date("Ymd"));
$today_ymd = date("Ymd");
if ($today_ymd<=$event["event_date"]) {
$d_days = (strtotime($event["event_date"]) - $today_time)/86400;
if ($d_days==0) $d_days_str = "Today"; else if ($d_days>0) $d_days_str = "D-".$d_days."";
}
else if ($event["event_date_2"] && $today_ymd<=$event["event_date_2"]) {
$d_days = (strtotime($event["event_date_2"]) - $today_time)/86400;
if ($d_days==0) $d_days_str = "Today"; else if ($d_days>0) $d_days_str = "D-".$d_days."";
}
else if ($event["event_date_3"] && $today_ymd<=$event["event_date_3"]) {
$d_days = (strtotime($event["event_date_3"]) - $today_time)/86400;
if ($d_days==0) $d_days_str = "Today"; else if ($d_days>0) $d_days_str = "D-".$d_days."";
}
else if ($event["event_date_4"] && $today_ymd<=$event["event_date_4"]) {
$d_days = (strtotime($event["event_date_4"]) - $today_time)/86400;
if ($d_days==0) $d_days_str = "Today"; else if ($d_days>0) $d_days_str = "D-".$d_days."";
}
else if ($event["event_date_5"] && $today_ymd<=$event["event_date_5"]) {
$d_days = (strtotime($event["event_date_5"]) - $today_time)/86400;
if ($d_days==0) $d_days_str = "Today"; else if ($d_days>0) $d_days_str = "D-".$d_days."";
}
else if ($event["event_date_6"] && $today_ymd<=$event["event_date_6"]) {
$d_days = (strtotime($event["event_date_6"]) - $today_time)/86400;
if ($d_days==0) $d_days_str = "Today"; else if ($d_days>0) $d_days_str = "D-".$d_days."";
}
}
if ($isMobile) {
$no_top_ad = 1;
$echo_matched_content = 1;
$top_include_file = "../mobile_top.php";
$main_include_file = "include/mobile_content.php";
include "../mobile_site_layout.php";
}
else {
$top_include_file = "../top_new.php";
$side_include_file_1 = "../side/kingdom_new.php";
$side_include_file_2 = "../side/ad_300_600_board.php";
$side_include_file_3 = "../side/community_new.php";
$side_include_file_4 = "../side/info_new.php";
$side_include_file_5 = "../memo_box/index_new.php";
$side_include_file_6 = "../side/matched_content.php";
//$side_include_file_7 = "../side/album_of_the_year_2023_html.php";
$main_include_file = "include/content.php";
include "../site_layout_new.php";
}
include "../hidden2.php";
?>