include "../db/db_conn.php";
include "../counter/count.php";
header("Vary: User-Agent, Accept");
//$is_echo_preview_lib = 0; //1
$is_echo_coll_wish_lib = 0;
$is_echo_rclike_lib = 0;
$idx = $_GET["idx"];
if ($_COOKIE["logged_idx"]) {
$chk_time = time()-3600;
$like_chk = mysqli_fetch_array(mysqli_query($connect, "select count(*) from Album_photo_like where mem_idx='".$_COOKIE["logged_idx"]."' and like_time>'".$chk_time."'"));
$com_chk = mysqli_fetch_array(mysqli_query($connect, "select count(*) from Album_photo_com where mem_idx='".$_COOKIE["logged_idx"]."' and rtime>'".$chk_time."'"));
if ($like_chk[0] || $com_chk[0]) {
header("Cache-Control: no-store, no-cache, must-revalidate, max-age=0");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
}
}
$row = mysqli_fetch_array(mysqli_query($connect, "select * from Album_photo where idx='".$idx."'"));
if (!$row[0]) {
header("HTTP/1.1 404 Not Found");
header("Location: ".$url_404);
exit;
}
else {
$album_info = mysqli_fetch_array(mysqli_query($connect, "select * from Album where idx='".$row["album_idx"]."'"));
$artist_info = mysqli_fetch_array(mysqli_query($connect, "select * from Band where idx='".$row["artist_idx"]."'"));
$mem_info = mysqli_fetch_array(mysqli_query($connect, "select * from member where idx='".$row["mem_idx"]."'"));
if (!$album_info["no_collabo"] && ($album_info["band_idx_2"] || $album_info["band_idx_3"] || $album_info["band_idx_4"] || $album_info["band_idx_5"] || $album_info["band_idx_6"])) {
$band_name_str = $artist_info["band"];
for ($i=2 ; $i<7 ; $i++) {
if ($album_info["band_idx_".$i]) {
$tmp = mysqli_fetch_array(mysqli_query($connect, "select band,ab_str from Band where idx='".$album_info["band_idx_".$i]."'"));
if ($tmp[0]) {
$is_collabo = 1;
$band_name_str .= " / ".$tmp["band"];
${"band_idx_".$i} = $album_info["band_idx_".$i];
${"band_name_".$i} = $tmp["band"];
${"band_ab_str_".$i} = $tmp["ab_str"];
}
}
}
if ($album_info["a_type"]!="split") {
$collaboration = " [collaboration]";
}
}
else {
$band_name_str = $album_info["band"];
}
$mTitle = $band_name_str." - ".$album_info["album"].(($row["format"])?" ".$row["format"]:"")." Photo";
}
$ap_url = echo_ap_url($idx,$album_info["ab_str"],$row["format"]);
$breadcrumb_5_name = $album_info["album"].(($row["format"])?" ".$row["format"]:"")." Photo";
if (!preg_match("/^\/album-photo\/([^\/]+)-([0-9]+)\/?$/",$_SERVER['REQUEST_URI'])) {
header("HTTP/1.1 301 Moved Permanently");
header("Location: ".$protocol_site_domain.$ap_url);
exit;
}
$a_year_album = substr($album_info["release_date"],0,4);
$cnt_rz = mysqli_fetch_array(mysqli_query($connect, "select count(*) from Album_photo where artist_idx='".$row["artist_idx"]."'"));
$name_str = ($mem_info["name"]) ? " by ".$mem_info["name"] : "";
if ($row["photo_txt"]) {
$des_photo_txt = htmlspecialchars_decode(str_replace("\r\n",". ",strip_tags($row["photo_txt"])));
$des_photo_txt = trim(str_replace(" "," ",$des_photo_txt));
}
$description = $band_name_str." - ".$album_info["album"]." (".$a_year_album.") Album Photo".$name_str.".";
$description .= ($row["format"]) ? " Format: ".$row["format"]."." : "";
$description .= ($row["likes"]>1) ? " ".$row["likes"]." likes." : "";
$description .= ($des_photo_txt) ? " ".$des_photo_txt."." : "";
$description .= ($cnt_rz[0]>1) ? " ".$cnt_rz[0]." ".$artist_info["band"]." Album Photos." : "";
$description = cutStr($description,300);
$meta_description = $description;
$head_string = "
";
if ($description) {
$head_string .=
"
";
}
if ($isMobile) {
$no_top_ad = 1;
$no_mc_ad = 1;
$top_include_file = "../mobile_top.php";
$main_include_file = "include/mobile_photo_detail.php";
$bottom_echo_string = "
";
include "../mobile_site_layout.php";
}
else {
$top_include_file = "../top_new.php";
$main_include_file = "include/photo_detail.php";
$side_include_file_1 = "../side/side_group_2.php";
$bottom_echo_string = "
";
include "../site_layout_new.php";
}
include "../hidden2.php";
?>