", "", $te); return htmlspecialchars($te); } function pid2nickname($pid) { // pid 받아서 별명 반환 $dbcs = new mysqli('localhost', 'hyeri0418', 'Music0418', 'hyeri0418'); //mysql 열기 성공 체크 if(mysqli_connect_errno()) { echo 'DBERROR'; mysqli_close($dbcs); exit; } $query = "select * from ob_userdb where `poid` = '".$pid."'"; $resultk = $dbcs->query($query); $rowcid = $resultk->fetch_assoc(); return $rowcid['nickname']; } function getprofileimg($pid) { // pid 받아서 별명 반환 $dbcs = new mysqli('localhost', 'hyeri0418', 'Music0418', 'hyeri0418'); //mysql 열기 성공 체크 if(mysqli_connect_errno()) { echo 'DBERROR'; mysqli_close($dbcs); exit; } $query = "select * from ob_userdb where `poid` = '".$pid."'"; $resultk = $dbcs->query($query); $rowcid = $resultk->fetch_assoc(); return $rowcid['profileimg']; } $kakao = new KAKAO_LOGIN(array( "CLIENT_ID" => "7fe1ec9a83c2dd4636c4e798fae77dee", // (*필수)클라이언트 ID "RETURN_URL" => "http://mtg-kr.com/ob/index.php", // (*필수)콜백 URL "AUTO_CLOSE" => true, // 인증 완료후 팝업 자동으로 닫힘 여부 설정 (추가 정보 기재등 추가행동 필요시 false 설정 후 추가) "SHOW_LOGOUT" => false // 인증 후에 로그아웃 버튼 표시/ 또는 표시안함 ) ); if(strpos($_SERVER['HTTP_HOST'],"mtg-kr.com") === false) $kakao->RETURN_URL = $_SERVER['HTTP_HOST']."/index.php"; $userinfo = $kakao->getUserProfile(); $nowuser = ""; // 현재 로그인한 사람의 정보를 불러옵니다. if($kakao->getConnectState()) { // 유저 정보 가져오기 $_COOKIE['ob_id'] = $userinfo['id']; $query = "select * from ob_userdb where `poid` = '".$_COOKIE['ob_id']."'"; $resultk = $dbcs->query($query); if($resultk->num_rows != 0) { $nowuser = $resultk->fetch_assoc(); $query = "update ob_userdb set `lastaccdate` = '".$today."' where `poid` = '".$_COOKIE['ob_id']."'"; $resultk = $dbcs->query($query); } else { $query = "insert into `ob_userdb` (`poid`, `nickname`, `joindate`, `lastaccdate`, `service`, `email`) values ('".$userinfo['id']."', '".$userinfo['properties']['nickname'].substr($userinfo['id'], -6)."', '".date("YmdHis")."', '".date("YmdHis")."', 'a', '".$userinfo['kakao_account']['email']."')"; $resultt = $dbcs->query($query); //$rowtext = $resultt->fetch_assoc(); echo ""; // 로긴은 했는데, DB에 없다. -> 신규임 -> 로그인 정보 저장 후 다시 열시 // 가입은 오픈바인더에서.. //echo ""; exit(); } } if($_GET['mode'] == "logout") { $kakao->logout(); //echo ""; exit(); } if($_COOKIE['ex_url'] == "") { } else { // 이전 url이 있다면 이 값을 임시로 옮기고, 쿠키 삭제하고, 리다이렉트 /* $exurl = $_COOKIE['ex_url']; setcookie('ex_url', "", time() - 3600,"/"); // 접속할때마자 연장 if($exurl != "" and $exurl != "https://mtg-kr.com/ob/ob.php?mode=logout") echo ""; else echo ""; exit(); */ } /* if($_COOKIE['ob_id'] != '') { // 현재 ob_id가 정상인가? // 카카오한테 현재 세션에 대한 ob_id를 다시 받고 // 그걸로 강제 업데이트 $data = array(); $data['Authorization'] = 'Bearer '.$_SESSION['kakao_access_token']; $scurl = curl_init(); curl_setopt($scurl, CURLOPT_URL, 'http://kapi.kakao.com/v2/user/me'); curl_setopt($scurl, CURLOPT_POST, 1); curl_setopt($scurl, CURLOPT_POSTFIELDS, $data); curl_setopt($scurl, CURLOPT_HTTPHEADER, array( 'Authorization: '.$data['Authorization'] )); //echo $_SESSION['kakao_access_token']; curl_setopt($scurl, CURLOPT_RETURNTRANSFER,true); $retVar = curl_exec($scurl); curl_close($scurl); $_retAr = json_decode($retVar); $_retAr = json_decode(json_encode($_retAr),true); if($_retAr['id'] == "" or !is_numeric($_retAr['id'])) { setcookie('ob_id', $_retAr['id'], time()+86400,'/'); // 접속할때마자 연장 echo ""; exit(); } if($_retAr['id'] != $_COOKIE['ob_id']) { echo ""; exit(); } setcookie('ob_id', $_retAr['id'], time()+86400,'/'); // 접속할때마자 연장 $profileimageurl = $_retAr['properties']['profile_image']; //echo $_retAr['id']; //setcookie('ob_basket', $_COOKIE['ob_basket'], time()+86400); // 접속할때마자 연장 } */ // 기본 html $html = ""; $rowseller = ""; if($_COOKIE['ob_id'] != "") { $query = "select * from ob_userdb where `poid` = '".mysql_real_escape_string($_COOKIE['ob_id'])."'"; $resultk = $dbcs->query($query); $rowseller = $resultk->fetch_assoc(); } $profileimageurl = $rowseller['profileimg']; echo ' '; if($_COOKIE['ob_id'] == "") echo '오픈 바인더 포털 :: 매글입니다.'; else echo '오픈 바인더 포털 :: '.$rowseller['nickname'].' 님 환영합니다.'; echo ' '; //echo ''; echo ''; echo ''; echo ''; //echo ''; echo ' '; echo ' '; $set = mysql_real_escape_string($_GET['set']); $_GET['set'] = mysql_real_escape_string($_GET['set']); $rarity = mysql_real_escape_string($_GET['rarity']); $ln = mysql_real_escape_string($_GET['ln']); if($ln == '') $ln = 20; $stype = mysql_real_escape_string($_GET['stype']); $ctype = mysql_real_escape_string($_GET['ctype']); $color = mysql_real_escape_string($_GET['color']); $page = mysql_real_escape_string($_GET['page']); $sort = mysql_real_escape_string($_GET['sort']); if($sort == "") $sort = "asc"; if($page == "") $page = 1; // ob_popupdb - pid, content // 대문 전용 $query = " select * from ob_popupdb where pid = '".$_GET['pid']."' or pid = 'admin'"; $result = $dbcs->query($query); $mobile_agent = '/(iPod|iPhone|Android|BlackBerry|SymbianOS|SCH-M\d+|Opera Mini|Windows CE|Nokia|SonyEricsson|webOS|PalmOS)/'; $ismob = preg_match($mobile_agent, $_SERVER['HTTP_USER_AGENT']); $show_width_height = true; for ($i=0; $i < $result->num_rows; $i++) { $row = $result->fetch_assoc(); if($row['content'] != "") { if ($ismob) { // 모바일에서 $popup_x = 0; $popup_y = 110+$i*50; } else { // 데스크탑에서 if ($show_width_height) { $popup_wh = ";width:500px"; // ;height:{$nw['nw_height']}px } else { $popup_wh = ""; } $popup_x = '200'; $popup_y = '100'; } $color_no = 'c'.($i%5+1); $layer_id = 'hd_pops_'.$row['id']; // 이미 체크 되었다면 Continue if($_COOKIE['hd_pops_'.$row['id']] == "") { echo '
'.$row['content'].'
'; echo '
'; } } } $navhtml = ""; // 대문 echo '
'; // 위로 올라가기 버튼 echo '
home

vertical_align_top
'; echo '
'; echo '"; echo '"; // end of sidebar echo ''; //if(!$_COOKIE['ob_id']) echo $kakao->login(); echo '
'; // 헤더 끝 if($_GET['page'] == '') $_GET['page'] = 1; if($_GET['set'] != "" and $_GET['mode'] == "iconic") { //set 읽기 $query = "select * from `xe_mtga_cards` where `code` = '".$_GET['set']."' and (`side` = 'a' or `side` is null) and `number` not like '%AA%'"; $_GET['color'] = strtoupper($_GET['color']); if($_GET['color'] != "" and $_GET['color'] != "C" ) { $query = $query." and ("; for($i=0;$iquery($query); echo '
'; echo '
'; for($i=0;$i<$resultq->num_rows;$i++) { $temp = $resultq->fetch_assoc(); echo '
'; echo '
'; // 크롭디자인, 카드이름, 코드번호 echo '
'; echo '

'.$temp['code'].'-'.$temp['number'].'

'.$temp['fullname'].'

'.$temp['fullname_k'].' 

'; echo '
'; // echo '
'; //col } echo '
'; //row echo '
'; //container } if($_GET['set'] != "" and $_GET['mode'] == "list") { $_GET['arg'] = 'ko'; echo '
'; // leftbox // 왼쪽 메뉴 echo "
"; // 스타일에 맞는 CSS 적용 echo '조건 필터 열기'; // 검색용 드롭다운 박스들 출력 //echo "
검색용 필터
"; /*echo '조건 필터 열기'; */ echo "
"; // set echo "
"; $query = "select * from xe_mtga_card_sets where `is_online_only` = 'N' order by release_date DESC"; $resultset = $dbcs->query($query); echo ""; echo ""; echo "
"; // rarity echo "
"; echo ""; echo ""; echo "
"; // color echo "
"; echo ""; echo ""; echo "
"; // ctype echo "
"; echo ""; echo ""; echo "
"; // porder echo "
"; echo ""; echo ""; echo "
"; // ln echo "
"; echo ""; echo ""; echo "
"; // 보기 형태 echo '필터 초기화'; echo "
"; echo "
"; // end of leftbox // midbox echo "
"; // 세트 리스트 출력 모드 $query = "select * from xe_mtga_cards where xe_mtga_cards.`code` = '".strtoupper($_GET['set'])."' and xe_mtga_cards.`number` not like 'AA%' and (xe_mtga_cards.`side` = 'a' or xe_mtga_cards.`side` is null) "; //필터옵션 - 기본 필터 가져오기 if($rarity != '') $query = $query." and xe_mtga_cards.`rarity` = '".$rarity."'"; if($color != "") { if($color == "C") $query = $query." and xe_mtga_cards.`colors` = '[]' or xe_mtga_cards.`colors` is null "; else $query = $query." and xe_mtga_cards.`colors` like '%".$color."%' "; } if($ctype != "") $query = $query." and xe_mtga_cards.`types` like '%".$ctype."%' "; //정렬옵션 통합 - 가격(높은, 낮은), 번호(오름, 내림) switch($sort) { case 'high' : $query = $query." order by xe_mtga_cards.`norm` DESC "; break; case 'low' : $query = $query." order by xe_mtga_cards.`norm` ASC "; break; case 'fhigh' : $query = $query." order by xe_mtga_cards.`form` DESC "; break; case 'flow' : $query = $query." order by xe_mtga_cards.`form` ASC "; break; case 'asc' : $query = $query." order by xe_mtga_cards.`number`*1 ASC"; break; case 'desc' : $query = $query." order by xe_mtga_cards.`number`*1 DESC"; break; default : echo $sort; break; } $resultlist = $dbcs->query($query); //echo $query; //exit(); $totalpage = ceil($resultlist->num_rows / $ln); // 페이지뷰 $query = $query." LIMIT ".(($_GET['page']-1) * $ln).", ".$ln; $resultlist = $dbcs->query($query); echo '
'; if($page != "1") echo '이전'; else echo '이전'; // 페이지 네이션 echo ""; if($page < $totalpage) echo '다음'; else echo '다음'; echo "
"; echo "
"; for($zx=0;$zx<$resultlist->num_rows;$zx++) { // 각 카드에 대해서 $templist = $resultlist->fetch_assoc(); $_GET['code'] = $templist['number']; // 데이터 값 획득 $query = "select *, xe_mtga_cards.name as name, xe_mtga_cards.code as code, xe_mtga_cards.type as type, xe_mtga_card_sets.name as setname, xe_mtga_card_sets.code as setcode, xe_mtga_card_sets.type as settype from xe_mtga_cards inner join xe_mtga_card_sets on xe_mtga_cards.`code` = xe_mtga_card_sets.`code` and xe_mtga_cards.`code` = '".$_GET['set']."' and xe_mtga_cards.`number` = '".$_GET['code']."'"; //if($_GET['set'] == "CMB1" and $_GET['code'] == "100") echo $query; // 정렬시 참조용 // SELECT * FROM `xe_mtga_cards` WHERE `code` = 'ISD' ORDER BY length(`xe_mtga_cards`.`number`) ASC, `xe_mtga_cards`.`number` ASC $result = $dbcs->query($query); if($result->num_rows == 1) { // 카드 검색 내용 출력 $row = $result->fetch_assoc(); /*if($row['layout'] == "meld") { // 멜드카드 처리 // 3개 한번에 내보냅니다. } else */ { echo "
"; echo "
"; echo '
'; // 사이즈 이펙트 처리 다르게 if($_GET['arg'] == "ko" and $row['name_k'] != "") echo ''; else if($_GET['arg'] == "ko" and $row['name_k'] == "") echo ''; else if($_GET['arg'] == "en") echo ''; else if($_GET['arg'] != "ko" and $_GET['arg'] != "en" and $row['name_k'] != "") echo ''; else echo ''; echo "
"; echo "
"; echo '
'; // 가격 관련 echo '
'; //세트로고, 세트명(약어), #카드번호, 희귀도 echo '
'.$row["setname"].'
#'.$row['number'].' - '; switch($row['rarity']) { case "mythic" : echo 'Mythic Rare'; break; case "rare" : echo 'Rare'; break; case "uncommon" : echo 'Uncommon'; break; case "common" : echo 'Common'; break; default : } echo '
'; echo '
'; // end of cardmoreinfo echo '
'; echo ''; $ckn = ckprice($dbcs, $_GET['set'], $_GET['code'], 'normal'); //if($ckn) $ckn = ckprice($dbcs, $_GET['set'], $_GET['code'], 'foil'); if($ckn != "") { echo ''; for($i=0;$i < count($ckn);$i++) { if($ckn[$i]->ava == "OoS") echo ''; else echo ''; } } echo ""; $ckn = ckprice($dbcs, $_GET['set'], $_GET['code'], 'foil'); //$ckn = ckprice($dbcs, $_GET['set'], $_GET['code'], 'foil'); if($ckn != "") { echo ''; for($i=0;$i < count($ckn);$i++) { if($ckn[$i]->ava == "OoS") echo ''; else echo ''; } } echo ""; echo '
분류NMEXVGG
일반'.$ckn[$i]->price.''.$ckn[$i]->price.'
포일'.$ckn[$i]->price.''.$ckn[$i]->price.'
'; echo '
'; // end of cardprice $query = "select *, xe_mtga_cards.name as name, xe_mtga_cards.code as code, xe_mtga_cards.type as type, xe_mtga_card_sets.name as setname, xe_mtga_card_sets.code as setcode, xe_mtga_card_sets.type as settype from xe_mtga_cards inner join xe_mtga_card_sets on xe_mtga_cards.`code` = xe_mtga_card_sets.`code` and xe_mtga_cards.`name` = '".addslashes($row['name'])."' order by xe_mtga_card_sets.release_date DESC"; $resultx = $dbcs->query($query); echo '
'; echo ''; if($resultx->num_rows < 6) { for($i=0;$i<$resultx->num_rows;$i++) { $rowset = $resultx->fetch_assoc(); //$ckn = ckprice($dbcs, $rowset['code'], $rowset['number'], 'normal'); echo ''; } } else { for($i=0;$i<6;$i++) { $rowset = $resultx->fetch_assoc(); //$ckn = ckprice($dbcs, $rowset['code'], $rowset['number'], 'normal'); echo ''; } echo ''; echo ''; } echo '
'; echo ''; if($rowset['name'] != "Plains" and $rowset['name'] != "Island" and $rowset['name'] != "Swamp" and $rowset['name'] != "Mountain" and $rowset['name'] != "Forest") { echo '
 (등록수 : '; $query = "select count(*) as count from ob_pddb where `set` = '".$rowset['code']."' and `code` = '".$rowset['number']."'"; $resultcount = $dbcs->query($query); $rowcount = $resultcount->fetch_assoc(); echo $rowcount['count']; echo ')
'; } echo '
'.$rowset['code'].'-'.$rowset['number'].'
'; echo '
'; echo ''; //if($rowset['name'] != "Plains" and $rowset['name'] != "Island" and $rowset['name'] != "Swamp" and $rowset['name'] != "Mountain" and $rowset['name'] != "Forest") { echo '
 (등록수 : '; $query = "select count(*) as count from ob_pddb where `set` = '".$rowset['code']."' and `code` = '".$rowset['number']."'"; $resultcount = $dbcs->query($query); $rowcount = $resultcount->fetch_assoc(); echo $rowcount['count']; echo ')
'; } echo '
'.$rowset['code'].'-'.$rowset['number'].'
'; echo '
'; if($resultx->num_rows > 6) echo '

▷ 다른 세트 더 보기

'; echo '
'; echo ''; // end of othersets echo '
'; echo '
'; // end of cardsets echo '
'; echo '
'; // 샵 수와 샵들 가격 나열 echo '

제품 취급 온라인샵

'; echo '
'; // d 등급 이상의 관리자만 띄우기 $query = "select * from ob_pddb inner join ob_userdb on ob_pddb.`pid` = ob_userdb.`poid` and ob_pddb.`set` = '".$_GET['set']."' and ob_pddb.`code` = '".$_GET['code']."' and ob_userdb.`service` > 'd' and ob_pddb.`del` = 'n' order by ob_pddb.`lastdate`"; $resultus = $dbcs->query($query); if($resultus->num_rows == 0) { echo '
'; echo '

- 취급 온라인샵이 없습니다. -

'; echo '
'; } echo ''; for($i=0;$i<$resultus->num_rows;$i++) { $temp = $resultus->fetch_assoc(); if($temp['count'] != 0) { echo ''; echo ''; echo ''; echo ''; echo ''; //end of each list } } echo '
'; echo ''.pid2nickname($temp['pid']).""; echo ''.lang2flag($temp['language']).stat2icon($temp['stat']); if($temp['type'] == 'foil') echo ""; echo ''; echo price2html($dbcs, $temp['ck'], $temp['type'],$temp['stat'],$temp['price'])."원 (보유 ".$temp['count']."장)
"; if($_COOKIE['ob_id'] != $temp['pid'] and $temp['count'] != 0) { switch($temp['pid']) { case '1441741308' : echo '홈페이지에서 구매'; break; default : echo '장바구니 '; break; } } echo '
'; echo '
'; // end of list echo '
'; // end of cardshop echo '
'; // end of cardsellerinfo echo '
'; // end of cardinfoetc echo '
'; echo '
'; if($_GET['arg'] == "ko" and $row['type_k'] != "") { echo $row['name_k']; echo " ".mtgsymbols($row['mana_cost']); echo " English";} else if($_GET['arg'] == "ko" and $row['type_k'] == "") { echo $row['name']; echo " ".mtgsymbols($row['mana_cost']);} else if($_GET['arg'] == "en" and $row['type_k'] != "") {echo $row['name']; echo " ".mtgsymbols($row['mana_cost']); echo " 한국어판";} else if($_GET['arg'] == "en" and $row['type_k'] == "") { echo $row['name']; echo " ".mtgsymbols($row['mana_cost']);} else if($_GET['arg'] != "ko" and $_GET['arg'] != "en" and $row['type_k'] != "") {echo $row['name_k']; echo " ".mtgsymbols($row['mana_cost']); echo " English";} else {echo $row['name']; echo " ".mtgsymbols($row['mana_cost']); } echo '
'; echo '
'; if($_GET['arg'] == "ko" and $row['type_k'] != "") { echo $row['type_k']; } else if($_GET['arg'] == "ko" and $row['type_k'] == "") { echo $row['type']; } else if($_GET['arg'] == "en" and $row['type_k'] != "") {echo $row['type']; } else if($_GET['arg'] == "en" and $row['type_k'] == "") { echo $row['type']; } else if($_GET['arg'] != "ko" and $_GET['arg'] != "en" and $row['type_k'] != "") {echo $row['type_k'];} else {echo $row['type'];} echo '
'; echo '
'; $row['text_k'] = mtgsymbols(nl2br($row['text_k'])); $row['text'] = mtgsymbols(nl2br($row['text'])); if($_GET['arg'] == "ko" and $row['text_k'] != "") { echo $row['text_k'];} else if($_GET['arg'] == "ko" and $row['text_k'] == "") { echo $row['text']; } else if($_GET['arg'] == "en" and $row['text_k'] != "") {echo $row['text']; } else if($_GET['arg'] == "en" and $row['text_k'] == "") { echo $row['text']; } else if($_GET['arg'] != "ko" and $_GET['arg'] != "en" and $row['text_k'] != "") {echo $row['text_k']; } else {echo $row['text']; } echo '
'; echo '
'; echo ''; $row['flavor_text_k'] = nl2br($row['flavor_text_k']); $row['flavor_text'] = nl2br($row['flavor_text']); if($_GET['arg'] == "ko" and $row['flavor_text_k'] != "") { echo $row['flavor_text_k'];} else if($_GET['arg'] == "ko" and $row['flavor_text_k'] == "") { echo $row['flavor_text']; } else if($_GET['arg'] == "en" and $row['flavor_text_k'] != "") {echo $row['flavor_text']; } else if($_GET['arg'] == "en" and $row['flavor_text_k'] == "") { echo $row['flavor_text']; } else if($_GET['arg'] != "ko" and $_GET['arg'] != "en" and $row['flavor_text_k'] != "") {echo $row['flavor_text_k']; } else {echo $row['flavor_text']; } echo ''; echo '
'; echo '
'; if($row['power'] != "" and $row['toughness'] != "") echo $row['power']."/".$row['toughness']; else if($row['loyalty'] != "")echo "충성도 : ".$row['loyalty']; echo '
'; echo '
'; echo 'Illustrated by '.$row['artist']; echo '
'; echo '
'; //echo $row['legalities']; echo ''; //{"brawl":"Legal","commander":"Legal","duel":"Legal","future":"Legal","historic":"Legal","legacy":"Legal","modern":"Legal","pioneer":"Legal","standard":"Legal","vintage":"Legal"} echo ''; $leg = json_decode($row['legalities'], true); $pos = 1; // 스탠, 파이오니어, 모던, 레거시, 빈티지, 커맨더 까지는 하고, 나머지는 foreach에 맞김 if($leg['standard'] == "Banned") echo ''; else if($leg['standard'] == "") echo ''; else echo ''; echo ''; if($pos % 2 == 0) { echo ''; echo ''; } $pos++; unset($leg['standard']); if($leg['pioneer'] == "Banned") echo ''; else if($leg['pioneer'] == "") echo ''; else echo ''; echo ''; if($pos % 2 == 0) { echo ''; echo ''; } $pos++; unset($leg['pioneer']); if($leg['modern'] == "Banned") echo ''; else if($leg['modern'] == "") echo ''; else echo ''; echo ''; if($pos % 2 == 0) { echo ''; echo ''; } $pos++; unset($leg['modern']); if($leg['legacy'] == "Banned") echo ''; else if($leg['legacy'] == "") echo ''; else echo ''; echo ''; if($pos % 2 == 0) { echo ''; echo ''; } $pos++; unset($leg['legacy']); if($leg['vintage'] == "Banned") echo ''; else if($leg['vintage'] == "") echo ''; else echo ''; echo ''; if($pos % 2 == 0) { echo ''; echo ''; } $pos++; unset($leg['vintage']); if($leg['commander'] == "Banned") echo ''; else if($leg['commander'] == "") echo ''; else echo ''; echo ''; if($pos % 2 == 0) { echo ''; echo ''; } $pos++; unset($leg['commander']); foreach($leg as $key => $value) { if($value == "Banned") echo ''; else echo ''; echo ''; if($pos % 2 == 0) { echo ''; echo ''; } $pos++; } echo ''; echo '

'.$leg['standard'].'

Illegal

'.$leg['standard'].'

Standard

'.$leg['pioneer'].'

Illegal

'.$leg['pioneer'].'

Pioneer

'.$leg['modern'].'

Illegal

'.$leg['modern'].'

Modern

'.$leg['legacy'].'

Illegal

'.$leg['legacy'].'

Legacy

'.$leg['vintage'].'

Illegal

'.$leg['vintage'].'

Vintage

'.$leg['commander'].'

Illegal

'.$leg['commander'].'

Commander

'.$value.'

'.$value.'

'.ucfirst($key).'

'; echo '
'; echo '
'; // end of carddatainfo echo "
"; // cardgrid echo "
"; // cardcontainer }// end of meld } // end of if 자료 갯수 1개 else if($result->num_rows > 1) // 양면, 스플릿, 어드벤처 { // 자료를 a, b 별도로 받고 구성합니다. // $row에 뒷면인지 앞면인지 옆면인지 모를 카드 이름을 받았습니다. // 메인 쿼리 자체는 a를 가리켜야 하고, 서브 쿼리가 b를 가리켜야 합니다. // 카드 이미지는 layout 값에 따라 다른 방식으로 보여줍니다. // layout - adventure, aftermath, flip, meld, normal, split, transform $row = $result->fetch_assoc(); // 일단 한개 빼고 $rowb = array(); if($row['layout'] == 'adventure' or $row['layout'] == 'aftermath' or $row['layout'] == 'flip' or $row['layout'] == 'split' or $row['layout'] == 'transform' or $row['layout'] == 'modal_dfc') { $query = "select *, xe_mtga_cards.name as name, xe_mtga_cards.code as code, xe_mtga_cards.type as type, xe_mtga_card_sets.name as setname, xe_mtga_card_sets.code as setcode, xe_mtga_card_sets.type as settype from xe_mtga_cards inner join xe_mtga_card_sets on xe_mtga_cards.`code` = xe_mtga_card_sets.`code` and xe_mtga_cards.`code` = '".$_GET['set']."' and xe_mtga_cards.`number` = '".$_GET['code']."' and xe_mtga_cards.`side` = 'a'"; $result = $dbcs->query($query); $row = $result->fetch_assoc(); $query = "select *, xe_mtga_cards.name as name, xe_mtga_cards.code as code, xe_mtga_cards.type as type, xe_mtga_card_sets.name as setname, xe_mtga_card_sets.code as setcode, xe_mtga_card_sets.type as settype from xe_mtga_cards inner join xe_mtga_card_sets on xe_mtga_cards.`code` = xe_mtga_card_sets.`code` and xe_mtga_cards.`code` = '".$_GET['set']."' and xe_mtga_cards.`number` = '".$_GET['code']."' and xe_mtga_cards.`side` = 'b'"; $result = $dbcs->query($query); $rowb = $result->fetch_assoc(); } //print_r($query); //echo "
"; echo "
"; echo "
"; echo '
'; // 사이즈 이펙트 처리 다르게 if($_GET['arg'] == "ko" and $row['name_k'] != "") echo ''; else if($_GET['arg'] == "ko" and $row['name_k'] == "") echo ''; else if($_GET['arg'] == "en") echo ''; else if($_GET['arg'] != "ko" and $_GET['arg'] != "en" and $row['name_k'] != "") echo ''; else echo ''; if($row['layout'] == 'transform' or $row['layout'] == 'modal_dfc') { echo '

다른 면 보기

'; } echo "
"; // end of cardboxinfo echo "
"; echo '
'; // 가격 관련 echo '
'; //세트로고, 세트명(약어), #카드번호, 희귀도 echo '
'.$row["setname"].'
#'.$row['number'].' - '; switch($row['rarity']) { case "mythic" : echo 'Mythic Rare'; break; case "rare" : echo 'Rare'; break; case "uncommon" : echo 'Uncommon'; break; case "common" : echo 'Common'; break; default : } echo '
'; echo '
'; // end of cardmoreinfo echo '
'; echo ''; $ckn = ckprice($dbcs, $_GET['set'], $_GET['code'], 'normal'); if($ckn != "") { echo ''; for($i=0;$i < count($ckn);$i++) { if($ckn[$i]->ava == "OoS") echo ''; else echo ''; } } echo ""; $ckn = ckprice($dbcs, $_GET['set'], $_GET['code'], 'foil'); if($ckn != "") { echo ''; for($i=0;$i < count($ckn);$i++) { if($ckn[$i]->ava == "OoS") echo ''; else echo ''; } } echo ""; echo '
분류NMEXVGG
일반'.$ckn[$i]->price.''.$ckn[$i]->price.'
포일'.$ckn[$i]->price.''.$ckn[$i]->price.'
'; echo '
'; // end of cardprice $query = "select *, xe_mtga_cards.name as name, xe_mtga_cards.code as code, xe_mtga_cards.type as type, xe_mtga_card_sets.name as setname, xe_mtga_card_sets.code as setcode, xe_mtga_card_sets.type as settype from xe_mtga_cards inner join xe_mtga_card_sets on xe_mtga_cards.`code` = xe_mtga_card_sets.`code` and xe_mtga_cards.`name` = '".addslashes($row['name'])."' order by xe_mtga_card_sets.release_date DESC"; $resultx = $dbcs->query($query); echo '
'; echo ''; if($resultx->num_rows < 6) { for($i=0;$i<$resultx->num_rows;$i++) { $rowset = $resultx->fetch_assoc(); //$ckn = ckprice($dbcs, $rowset['code'], $rowset['number'], 'normal'); echo ''; } } else { for($i=0;$i<6;$i++) { $rowset = $resultx->fetch_assoc(); //$ckn = ckprice($dbcs, $rowset['code'], $rowset['number'], 'normal'); echo ''; } echo ''; echo ''; } echo '
'; echo ''; if($rowset['name'] != "Plains" and $rowset['name'] != "Island" and $rowset['name'] != "Swamp" and $rowset['name'] != "Mountain" and $rowset['name'] != "Forest") { echo '
 (등록수 : '; $query = "select count(*) as count from ob_pddb where `set` = '".$rowset['code']."' and `code` = '".$rowset['number']."'"; $resultcount = $dbcs->query($query); $rowcount = $resultcount->fetch_assoc(); echo $rowcount['count']; echo ')
'; } echo '
'.$rowset['code'].'-'.$rowset['number'].'
'; echo '
'; echo ''; if($rowset['name'] != "Plains" and $rowset['name'] != "Island" and $rowset['name'] != "Swamp" and $rowset['name'] != "Mountain" and $rowset['name'] != "Forest") { echo '
 (등록수 : '; $query = "select count(*) as count from ob_pddb where `set` = '".$rowset['code']."' and `code` = '".$rowset['number']."'"; $resultcount = $dbcs->query($query); $rowcount = $resultcount->fetch_assoc(); echo $rowcount['count']; echo ')
'; } echo '
'.$rowset['code'].'-'.$rowset['number'].'
'; echo '
'; if($resultx->num_rows > 6) echo '

▷ 다른 세트 더 보기

'; echo '
'; echo ''; // end of othersets echo '
'; echo '
'; // end of cardsets echo '
'; echo '
'; // 샵 수와 샵들 가격 나열 echo '

제품 취급 온라인샵

'; echo '
'; // d 등급 이상의 관리자만 띄우기 $query = "select * from ob_pddb inner join ob_userdb on ob_pddb.`pid` = ob_userdb.`poid` and ob_pddb.`set` = '".$_GET['set']."' and ob_pddb.`code` = '".$_GET['code']."' and ob_userdb.`service` > 'd' and ob_pddb.`del` = 'n' order by ob_pddb.`lastdate`"; $resultus = $dbcs->query($query); if($resultus->num_rows == 0) { echo '
'; echo '

- 취급 온라인샵이 없습니다. -

'; echo '
'; } echo ''; for($i=0;$i<$resultus->num_rows;$i++) { $temp = $resultus->fetch_assoc(); if($temp['count'] != 0) { echo ''; echo ''; echo ''; echo ''; echo ''; //end of each list } } echo '
'; echo ''.pid2nickname($temp['pid']).""; echo ''.lang2flag($temp['language']).stat2icon($temp['stat']); if($temp['type'] == 'foil') echo ""; echo ''; echo price2html($dbcs,$temp['ck'], $temp['type'],$temp['stat'],$temp['price'])."원 (보유 ".$temp['count']."장)
"; if($_COOKIE['ob_id'] != $temp['pid']) { switch($temp['pid']) { case '1441741308' : echo '홈페이지에서 구매'; break; default : echo '장바구니 '; break; } //echo '장바구니 '; } echo '
'; echo '
'; // end of list echo '
'; // end of cardshop echo '
'; // end of cardsellerinfo echo '
'; // end of cardinfoetc echo '
'; echo '
'; if($_GET['arg'] == "ko" and $row['type_k'] != "") { echo $row['name_k'].' // '.$rowb['name_k']; echo "
 ".mtgsymbols($row['mana_cost'])." // ".mtgsymbols($rowb['mana_cost']); echo " English";} else if($_GET['arg'] == "ko" and $row['type_k'] == "") { echo $row['name'].' // '.$rowb['name']; echo "
 ".mtgsymbols($row['mana_cost'])." // ".mtgsymbols($rowb['mana_cost']);} else if($_GET['arg'] == "en" and $row['type_k'] != "") {echo $row['name'].' // '.$rowb['name']; echo "
 ".mtgsymbols($row['mana_cost'])." // ".mtgsymbols($rowb['mana_cost']); echo " 한국어판";} else if($_GET['arg'] == "en" and $row['type_k'] == "") { echo $row['name'].' // '.$rowb['name']; echo "
 ".mtgsymbols($row['mana_cost'])." // ".mtgsymbols($rowb['mana_cost']);} else if($_GET['arg'] != "ko" and $_GET['arg'] != "en" and $row['type_k'] != "") {echo $row['name_k'].' // '.$rowb['name_k']; echo "
 ".mtgsymbols($row['mana_cost'])." // ".mtgsymbols($rowb['mana_cost']); echo " English";} else {echo $row['name'].' // '.$rowb['name']; echo "
 ".mtgsymbols($row['mana_cost'])." // ".mtgsymbols($rowb['mana_cost']); } echo '
'; echo '
전면 :
'; if($_GET['arg'] == "ko" and $row['type_k'] != "") { echo $row['type_k']; } else if($_GET['arg'] == "ko" and $row['type_k'] == "") { echo $row['type']; } else if($_GET['arg'] == "en" and $row['type_k'] != "") {echo $row['type']; } else if($_GET['arg'] == "en" and $row['type_k'] == "") { echo $row['type']; } else if($_GET['arg'] != "ko" and $_GET['arg'] != "en" and $row['type_k'] != "") {echo $row['type_k'];} else {echo $row['type'];} echo '
'; echo '
'; $row['text_k'] = mtgsymbols(nl2br($row['text_k'])); $row['text'] = mtgsymbols(nl2br($row['text'])); if($_GET['arg'] == "ko" and $row['text_k'] != "") { echo $row['text_k'];} else if($_GET['arg'] == "ko" and $row['text_k'] == "") { echo $row['text']; } else if($_GET['arg'] == "en" and $row['text_k'] != "") {echo $row['text']; } else if($_GET['arg'] == "en" and $row['text_k'] == "") { echo $row['text']; } else if($_GET['arg'] != "ko" and $_GET['arg'] != "en" and $row['text_k'] != "") {echo $row['text_k']; } else {echo $row['text']; } echo '
'; echo '
'; echo ''; $row['flavor_text_k'] = nl2br($row['flavor_text_k']); $row['flavor_text'] = nl2br($row['flavor_text']); if($_GET['arg'] == "ko" and $row['flavor_text_k'] != "") { echo $row['flavor_text_k'];} else if($_GET['arg'] == "ko" and $row['flavor_text_k'] == "") { echo $row['flavor_text']; } else if($_GET['arg'] == "en" and $row['flavor_text_k'] != "") {echo $row['flavor_text']; } else if($_GET['arg'] == "en" and $row['flavor_text_k'] == "") { echo $row['flavor_text']; } else if($_GET['arg'] != "ko" and $_GET['arg'] != "en" and $row['flavor_text_k'] != "") {echo $row['flavor_text_k']; } else {echo $row['flavor_text']; } echo ''; echo '
'; echo '
'; if($row['power'] != "" and $row['toughness'] != "") echo $row['power']."/".$row['toughness']; else if($row['loyalty'] != "")echo "충성도 : ".$row['loyalty']; echo '
'; echo '
후면 :
'; if($_GET['arg'] == "ko" and $rowb['type_k'] != "") { echo $rowb['type_k']; } else if($_GET['arg'] == "ko" and $rowb['type_k'] == "") { echo $rowb['type']; } else if($_GET['arg'] == "en" and $rowb['type_k'] != "") {echo $rowb['type']; } else if($_GET['arg'] == "en" and $rowb['type_k'] == "") { echo $rowb['type']; } else if($_GET['arg'] != "ko" and $_GET['arg'] != "en" and $rowb['type_k'] != "") {echo $rowb['type_k'];} else {echo $rowb['type'];} echo '
'; echo '
'; $rowb['text_k'] = mtgsymbols(nl2br($rowb['text_k'])); $rowb['text'] = mtgsymbols(nl2br($rowb['text'])); if($_GET['arg'] == "ko" and $rowb['text_k'] != "") { echo $rowb['text_k'];} else if($_GET['arg'] == "ko" and $rowb['text_k'] == "") { echo $rowb['text']; } else if($_GET['arg'] == "en" and $rowb['text_k'] != "") {echo $rowb['text']; } else if($_GET['arg'] == "en" and $rowb['text_k'] == "") { echo $rowb['text']; } else if($_GET['arg'] != "ko" and $_GET['arg'] != "en" and $rowb['text_k'] != "") {echo $rowb['text_k']; } else {echo $rowb['text']; } echo '
'; echo '
'; echo ''; $rowb['flavor_text_k'] = nl2br($rowb['flavor_text_k']); $rowb['flavor_text'] = nl2br($rowb['flavor_text']); if($_GET['arg'] == "ko" and $rowb['flavor_text_k'] != "") { echo $rowb['flavor_text_k'];} else if($_GET['arg'] == "ko" and $rowb['flavor_text_k'] == "") { echo $rowb['flavor_text']; } else if($_GET['arg'] == "en" and $rowb['flavor_text_k'] != "") {echo $rowb['flavor_text']; } else if($_GET['arg'] == "en" and $rowb['flavor_text_k'] == "") { echo $rowb['flavor_text']; } else if($_GET['arg'] != "ko" and $_GET['arg'] != "en" and $rowb['flavor_text_k'] != "") {echo $rowb['flavor_text_k']; } else {echo $rowb['flavor_text']; } echo ''; echo '
'; echo '
'; if($rowb['power'] != "" and $rowb['toughness'] != "") echo $rowb['power']."/".$rowb['toughness']; else if($rowb['loyalty'] != "")echo "충성도 : ".$rowb['loyalty']; echo '
'; echo '
'; echo 'Illustrated by '.$row['artist']; echo '
'; echo '
'; //echo $row['legalities']; echo ''; //{"brawl":"Legal","commander":"Legal","duel":"Legal","future":"Legal","historic":"Legal","legacy":"Legal","modern":"Legal","pioneer":"Legal","standard":"Legal","vintage":"Legal"} echo ''; $leg = json_decode($row['legalities'], true); $pos = 1; // 스탠, 파이오니어, 모던, 레거시, 빈티지, 커맨더 까지는 하고, 나머지는 foreach에 맞김 if($leg['standard'] == "Banned") echo ''; else if($leg['standard'] == "") echo ''; else echo ''; echo ''; if($pos % 2 == 0) { echo ''; echo ''; } $pos++; unset($leg['standard']); if($leg['pioneer'] == "Banned") echo ''; else if($leg['pioneer'] == "") echo ''; else echo ''; echo ''; if($pos % 2 == 0) { echo ''; echo ''; } $pos++; unset($leg['pioneer']); if($leg['modern'] == "Banned") echo ''; else if($leg['modern'] == "") echo ''; else echo ''; echo ''; if($pos % 2 == 0) { echo ''; echo ''; } $pos++; unset($leg['modern']); if($leg['legacy'] == "Banned") echo ''; else if($leg['legacy'] == "") echo ''; else echo ''; echo ''; if($pos % 2 == 0) { echo ''; echo ''; } $pos++; unset($leg['legacy']); if($leg['vintage'] == "Banned") echo ''; else if($leg['vintage'] == "") echo ''; else echo ''; echo ''; if($pos % 2 == 0) { echo ''; echo ''; } $pos++; unset($leg['vintage']); if($leg['commander'] == "Banned") echo ''; else if($leg['commander'] == "") echo ''; else echo ''; echo ''; if($pos % 2 == 0) { echo ''; echo ''; } $pos++; unset($leg['commander']); foreach($leg as $key => $value) { if($value == "Banned") echo ''; else echo ''; echo ''; if($pos % 2 == 0) { echo ''; echo ''; } $pos++; } echo ''; echo '

'.$leg['standard'].'

Illegal

'.$leg['standard'].'

Standard

'.$leg['pioneer'].'

Illegal

'.$leg['pioneer'].'

Pioneer

'.$leg['modern'].'

Illegal

'.$leg['modern'].'

Modern

'.$leg['legacy'].'

Illegal

'.$leg['legacy'].'

Legacy

'.$leg['vintage'].'

Illegal

'.$leg['vintage'].'

Vintage

'.$leg['commander'].'

Illegal

'.$leg['commander'].'

Commander

'.$value.'

'.$value.'

'.ucfirst($key).'

'; echo '
'; echo '
'; // end of carddatainfo //echo "
"; // cardcontainer echo "
"; // cardgrid } // end of if 자료 갯수 2개 } // end of for // 여기에 무한 넘기기 표시 /* echo ' '; */ if($page != "1") echo '이전'; else echo '이전'; // 페이지 네이션 echo ""; if($page < $totalpage) echo '다음'; else echo '다음'; echo "
"; // end of midbox echo '
'; // end of row }// end of list 출력 else if($_GET['set'] == "" and $_GET['code'] == "" and $_GET['search'] == "" and $_GET['mode'] == "") { echo "
"; echo ''; // end of searchbox /* echo '

매장 아이콘을 누르면 매장별 참가등록 사이트로 이동합니다.

누구나 물어 볼 것 같은 FAQ

'; */ /* $query = "select * from ob_bcate where proj = 'ob' order by star DESC, id ASC"; $resultb = $dbcs->query($query); echo '
'; for($i=0;$i<$resultb->num_rows;$i++) { $temp = $resultb->fetch_assoc(); // 카테고리의 최신글 가져오기 date(Ymd) $tof = date('Y').'-'.date('m').'-'.date('d').' 00:00'; $tot = date('Y').'-'.date('m').'-'.date('d').' 23:59'; $query = "select * from ob_bcont where `catid` = ".$temp['id']." and `del` != 'y' and `date` >= '".$tof."' and `date` <= '".$tot."' order by id DESC"; $resultc = $dbcs->query($query); echo '
'; echo '
'; echo '
'; echo ''.replmtg($temp['name']); // 제목 if($resultc->num_rows>0) echo ''.$resultc->num_rows.''; echo ''; echo '
'; // end of card-content echo '
'; // 최신글 5개까지 표시 $query = "select * from ob_bcont where `catid` = ".$temp['id']." and `del` != 'y' order by id DESC limit 0, 3"; $resultc = $dbcs->query($query); echo '
'; for($j=0;$j<$resultc->num_rows;$j++) { $tempc = $resultc->fetch_assoc(); $query = "select count(id) from ob_breply where cid = ".$tempc['id']." and del != 'y'"; $resultre = $dbcs->query($query); $tempre = $resultre->fetch_assoc(); echo '* '.$tempc['head'].''; $profileimageurlthis = getprofileimg($tempc['pid']); if($profileimageurlthis == "") $profileimageurlthis = "http://mtg-kr.com/favicon.png"; echo ' ('.$tempc['date'].') ['.$tempre['count(id)'].'] '.pid2nickname($tempc['pid']).''; } echo '
'; // end of collection echo '
'; // end of card-action echo '
'; // end of card echo '
'; // end of col } */ // 지금 스탠다드에는.... /* $panel = array('
query($query); // 왼쪽 전년도 세트, 오른쪽 당년도 세트, release_date 검사 (데탑 기준 2개씩, 모바일은 한개씩) // 세트이름 한글(영문) - 세트로고 - 발매일 // $temp = $result->fetch_assoc(); $start = substr($temp['release_date'], 0, 4); echo "
"; echo "

지금 스탠다드에서는..."; $query = "select * from `ob_extrasetdata` where `set` = 'lastupdate'"; $resd = $dbcs->query($query); $rest = $resd->fetch_assoc(); echo '
('.$rest['release_date'].' 갱신됨)'; echo "

"; // $i=0은 먼저 처리 echo "
"; echo "
".substr($temp['release_date'], 0, 4).". 4Q ~ ".(substr($temp['release_date'], 0, 4)+1).". 3Q
"; echo "
.
"; //echo "
"; echo $panel[0]." style='width:49%;float:left;margin-right:3px;'>"; echo '
'; echo '

'; echo ' '.$temp['setname_k']; echo '
('.$temp['name'].')'; echo '
'.substr($temp['release_date'], 0, 4)."년 ".substr($temp['release_date'], 4, 2)."월 ".substr($temp['release_date'], 6, 2)."일 발매"; echo '

'; echo '
'; // panel-heading echo "
"; // panel for($i=1;$i<$result->num_rows or $i<8;$i++) { //4의 배수에서 div 닫고 새로 //2의 배수에서 div 닫고 새로 //mod로 panel div 적용 if($temp = $result->fetch_assoc()) { if($i%4 ==0) { echo "
"; echo "
".substr($temp['release_date'], 0, 4).". 4Q ~ ".(substr($temp['release_date'], 0, 4)+1).". 3Q
"; echo "
.
"; $start = substr($temp['release_date'], 0, 4); } echo $panel[$i%4]." style='width:49%;float:left;margin-right:3px;'>"; echo '
'; echo '

'; echo ' '.$temp['setname_k']; echo '
('.$temp['name'].')'; echo '
'.substr($temp['release_date'], 0, 4)."년 ".substr($temp['release_date'], 4, 2)."월 ".substr($temp['release_date'], 6, 2)."일 발매"; echo '

'; echo '

'; echo '
'; // panel-heading echo "
"; // panel } else { if($i%4 ==0) echo "
"; //if($i%2 ==0) echo "
"; echo $panel[$i%4]." style='width:49%;float:left;margin-right:3px;'>"; echo '
'; echo '

'; echo ' 제품명 미정
'; echo $year.'년 '.($i-4).'번째 확장팩 발매 예정
.'; echo '

'; echo '
'; // panel-heading echo "
"; // panel } //if($i%2 ==1) echo "
"; // col-sm-6 if($i%4 ==3) { $priceng = $dbcs->query("select date from ob_ckadddb order by `date` DESC limit 0, 1"); $temp = $priceng->fetch_assoc(); echo '
.
'; echo "
".($start+2)."년 3분기까지 사용가능
"; echo "
"; // col-sm-12 } } if($i%2 != 1) echo "
"; if($i%4 != 3) { //echo "
".($start+2)."년 3분기까지 유효
"; echo "
"; } echo "
"; // row echo "
"; // row */ echo '
'; // end of row } else if($_GET['set'] != "" and $_GET['code'] != "") { // 데이터 값 획득 $query = "select *, xe_mtga_cards.name as name, xe_mtga_cards.code as code, xe_mtga_cards.type as type, xe_mtga_card_sets.name as setname, xe_mtga_card_sets.code as setcode, xe_mtga_card_sets.type as settype from xe_mtga_cards inner join xe_mtga_card_sets on xe_mtga_cards.`code` = xe_mtga_card_sets.`code` and xe_mtga_cards.`code` = '".$_GET['set']."' and xe_mtga_cards.`number` = '".$_GET['code']."' order by xe_mtga_cards.`type_k` DESC"; //if($_GET['set'] == "CMB1" and $_GET['code'] == "100") echo $query; // 정렬시 참조용 // SELECT * FROM `xe_mtga_cards` WHERE `code` = 'ISD' ORDER BY length(`xe_mtga_cards`.`number`) ASC, `xe_mtga_cards`.`number` ASC $result = $dbcs->query($query); if($result->num_rows == 1) { // 카드 검색 내용 출력 $row = $result->fetch_assoc(); /*if($row['layout'] == "meld") { // 멜드카드 처리 // 3개 한번에 내보냅니다. } else */ { echo "
"; echo "
"; echo "
"; echo '
'; // 사이즈 이펙트 처리 다르게 if($_GET['arg'] == "ko" and $row['name_k'] != "") echo ''; else if($_GET['arg'] == "ko" and $row['name_k'] == "") echo ''; else if($_GET['arg'] == "en") echo ''; else if($_GET['arg'] != "ko" and $_GET['arg'] != "en" and $row['name_k'] != "") echo ''; else echo ''; echo "
"; echo "
"; echo '
'; // 가격 관련 echo '
'; //세트로고, 세트명(약어), #카드번호, 희귀도 echo '
'.$row["setname"].'
#'.$row['number'].' - '; switch($row['rarity']) { case "mythic" : echo 'Mythic Rare'; break; case "rare" : echo 'Rare'; break; case "uncommon" : echo 'Uncommon'; break; case "common" : echo 'Common'; break; default : } echo '
'; echo '
'; // end of cardmoreinfo echo '
'; echo ''; $ckn = ckprice($dbcs, $_GET['set'], $_GET['code'], 'normal'); //$ckn = ckprice($dbcs, $_GET['set'], $_GET['code'], 'normal'); if($ckn != "") { echo ''; for($i=0;$i < count($ckn);$i++) { if($ckn[$i]->ava == "OoS") echo ''; else echo ''; } } echo ""; $ckn = ckprice($dbcs, $_GET['set'], $_GET['code'], 'foil'); //$ckn = ckprice($dbcs, $_GET['set'], $_GET['code'], 'foil'); if($ckn != "") { echo ''; for($i=0;$i < count($ckn);$i++) { if($ckn[$i]->ava == "OoS") echo ''; else echo ''; } } echo ""; echo '
분류NMEXVGG
일반'.$ckn[$i]->price.''.$ckn[$i]->price.'
포일'.$ckn[$i]->price.''.$ckn[$i]->price.'
'; echo '
'; // end of cardprice $query = "select *, xe_mtga_cards.name as name, xe_mtga_cards.code as code, xe_mtga_cards.type as type, xe_mtga_card_sets.name as setname, xe_mtga_card_sets.code as setcode, xe_mtga_card_sets.type as settype from xe_mtga_cards inner join xe_mtga_card_sets on xe_mtga_cards.`code` = xe_mtga_card_sets.`code` and xe_mtga_cards.`name` = '".addslashes($row['name'])."' order by xe_mtga_card_sets.release_date DESC"; $resultx = $dbcs->query($query); echo '
'; echo ''; if($resultx->num_rows < 6) { for($i=0;$i<$resultx->num_rows;$i++) { $rowset = $resultx->fetch_assoc(); //$ckn = ckprice($dbcs, $rowset['code'], $rowset['number'], 'normal'); echo ''; } } else { for($i=0;$i<6;$i++) { $rowset = $resultx->fetch_assoc(); //$ckn = ckprice($dbcs, $rowset['code'], $rowset['number'], 'normal'); echo ''; } echo ''; echo ''; } echo '
'; echo ''; if($rowset['name'] != "Plains" and $rowset['name'] != "Island" and $rowset['name'] != "Swamp" and $rowset['name'] != "Mountain" and $rowset['name'] != "Forest") { echo '
 (등록수 : '; $query = "select count(*) as count from ob_pddb where `set` = '".$rowset['code']."' and `code` = '".$rowset['number']."'"; $resultcount = $dbcs->query($query); $rowcount = $resultcount->fetch_assoc(); echo $rowcount['count']; echo ')
'; } echo '
'.$rowset['code'].'-'.$rowset['number'].'
'; echo '
'; echo ''; //if($rowset['name'] != "Plains" and $rowset['name'] != "Island" and $rowset['name'] != "Swamp" and $rowset['name'] != "Mountain" and $rowset['name'] != "Forest") { echo '
 (등록수 : '; $query = "select count(*) as count from ob_pddb where `set` = '".$rowset['code']."' and `code` = '".$rowset['number']."'"; $resultcount = $dbcs->query($query); $rowcount = $resultcount->fetch_assoc(); echo $rowcount['count']; echo ')
'; } echo '
'.$rowset['code'].'-'.$rowset['number'].'
'; echo '
'; if($resultx->num_rows > 6) echo '

▷ 다른 세트 더 보기

'; echo '
'; echo ''; // end of othersets echo '
'; echo '
'; // end of cardsets echo '
'; echo '
'; // 샵 수와 샵들 가격 나열 echo '

제품 취급 온라인샵

'; echo '
'; // d 등급 이상의 관리자만 띄우기 $query = "select * from ob_pddb inner join ob_userdb on ob_pddb.`pid` = ob_userdb.`poid` and ob_pddb.`set` = '".$_GET['set']."' and ob_pddb.`code` = '".$_GET['code']."' and ob_userdb.`service` > 'd' and ob_pddb.`del` = 'n' order by ob_pddb.`lastdate`"; $resultus = $dbcs->query($query); if($resultus->num_rows == 0) { echo '
'; echo '

- 취급 온라인샵이 없습니다. -

'; echo '
'; } echo ''; for($i=0;$i<$resultus->num_rows;$i++) { $temp = $resultus->fetch_assoc(); if($temp['count'] != 0) { echo ''; echo ''; echo ''; echo ''; echo ''; //end of each list } } echo '
'; echo ''.pid2nickname($temp['pid']).""; echo ''.lang2flag($temp['language']).stat2icon($temp['stat']); if($temp['type'] == 'foil') echo ""; echo ''; echo price2html($dbcs, $temp['ck'], $temp['type'],$temp['stat'],$temp['price'])."원 (보유 ".$temp['count']."장)
"; if($_COOKIE['ob_id'] != $temp['pid'] and $temp['count'] != 0) { switch($temp['pid']) { case '1441741308' : echo '홈페이지에서 구매'; break; default : echo '장바구니 '; break; } //echo '장바구니 '; } echo '
'; echo '
'; // end of list echo '
'; // end of cardshop /* echo '
'; // echo '

오픈 바인더 유저 보유 내역 열기/닫기

'; echo ''; echo '
'; */ echo '
'; // end of cardsellerinfo echo '
'; // end of cardinfoetc echo '
'; echo '
'; if($_GET['arg'] == "ko" and $row['type_k'] != "") { echo $row['name_k']; echo " ".mtgsymbols($row['mana_cost']); echo " English";} else if($_GET['arg'] == "ko" and $row['type_k'] == "") { echo $row['name']; echo " ".mtgsymbols($row['mana_cost']);} else if($_GET['arg'] == "en" and $row['type_k'] != "") {echo $row['name']; echo " ".mtgsymbols($row['mana_cost']); echo " 한국어판";} else if($_GET['arg'] == "en" and $row['type_k'] == "") { echo $row['name']; echo " ".mtgsymbols($row['mana_cost']);} else if($_GET['arg'] != "ko" and $_GET['arg'] != "en" and $row['type_k'] != "") {echo $row['name_k']; echo " ".mtgsymbols($row['mana_cost']); echo " English";} else {echo $row['name']; echo " ".mtgsymbols($row['mana_cost']); } echo '
'; echo '
'; if($_GET['arg'] == "ko" and $row['type_k'] != "") { echo $row['type_k']; } else if($_GET['arg'] == "ko" and $row['type_k'] == "") { echo $row['type']; } else if($_GET['arg'] == "en" and $row['type_k'] != "") {echo $row['type']; } else if($_GET['arg'] == "en" and $row['type_k'] == "") { echo $row['type']; } else if($_GET['arg'] != "ko" and $_GET['arg'] != "en" and $row['type_k'] != "") {echo $row['type_k'];} else {echo $row['type'];} echo '
'; echo '
'; $row['text_k'] = mtgsymbols(nl2br($row['text_k'])); $row['text'] = mtgsymbols(nl2br($row['text'])); if($_GET['arg'] == "ko" and $row['text_k'] != "") { echo $row['text_k'];} else if($_GET['arg'] == "ko" and $row['text_k'] == "") { echo $row['text']; } else if($_GET['arg'] == "en" and $row['text_k'] != "") {echo $row['text']; } else if($_GET['arg'] == "en" and $row['text_k'] == "") { echo $row['text']; } else if($_GET['arg'] != "ko" and $_GET['arg'] != "en" and $row['text_k'] != "") {echo $row['text_k']; } else {echo $row['text']; } echo '
'; echo '
'; echo ''; $row['flavor_text_k'] = nl2br($row['flavor_text_k']); $row['flavor_text'] = nl2br($row['flavor_text']); if($_GET['arg'] == "ko" and $row['flavor_text_k'] != "") { echo $row['flavor_text_k'];} else if($_GET['arg'] == "ko" and $row['flavor_text_k'] == "") { echo $row['flavor_text']; } else if($_GET['arg'] == "en" and $row['flavor_text_k'] != "") {echo $row['flavor_text']; } else if($_GET['arg'] == "en" and $row['flavor_text_k'] == "") { echo $row['flavor_text']; } else if($_GET['arg'] != "ko" and $_GET['arg'] != "en" and $row['flavor_text_k'] != "") {echo $row['flavor_text_k']; } else {echo $row['flavor_text']; } echo ''; echo '
'; echo '
'; if($row['power'] != "" and $row['toughness'] != "") echo $row['power']."/".$row['toughness']; else if($row['loyalty'] != "")echo "충성도 : ".$row['loyalty']; echo '
'; echo '
'; echo 'Illustrated by '.$row['artist']; echo '
'; echo '
'; //echo $row['legalities']; echo ''; //{"brawl":"Legal","commander":"Legal","duel":"Legal","future":"Legal","historic":"Legal","legacy":"Legal","modern":"Legal","pioneer":"Legal","standard":"Legal","vintage":"Legal"} echo ''; $leg = json_decode($row['legalities'], true); $pos = 1; // 스탠, 파이오니어, 모던, 레거시, 빈티지, 커맨더 까지는 하고, 나머지는 foreach에 맞김 if($leg['standard'] == "Banned") echo ''; else if($leg['standard'] == "") echo ''; else echo ''; echo ''; if($pos % 2 == 0) { echo ''; echo ''; } $pos++; unset($leg['standard']); if($leg['pioneer'] == "Banned") echo ''; else if($leg['pioneer'] == "") echo ''; else echo ''; echo ''; if($pos % 2 == 0) { echo ''; echo ''; } $pos++; unset($leg['pioneer']); if($leg['modern'] == "Banned") echo ''; else if($leg['modern'] == "") echo ''; else echo ''; echo ''; if($pos % 2 == 0) { echo ''; echo ''; } $pos++; unset($leg['modern']); if($leg['legacy'] == "Banned") echo ''; else if($leg['legacy'] == "") echo ''; else echo ''; echo ''; if($pos % 2 == 0) { echo ''; echo ''; } $pos++; unset($leg['legacy']); if($leg['vintage'] == "Banned") echo ''; else if($leg['vintage'] == "") echo ''; else echo ''; echo ''; if($pos % 2 == 0) { echo ''; echo ''; } $pos++; unset($leg['vintage']); if($leg['commander'] == "Banned") echo ''; else if($leg['commander'] == "") echo ''; else echo ''; echo ''; if($pos % 2 == 0) { echo ''; echo ''; } $pos++; unset($leg['commander']); foreach($leg as $key => $value) { if($value == "Banned") echo ''; else echo ''; echo ''; if($pos % 2 == 0) { echo ''; echo ''; } $pos++; } echo ''; echo '

'.$leg['standard'].'

Illegal

'.$leg['standard'].'

Standard

'.$leg['pioneer'].'

Illegal

'.$leg['pioneer'].'

Pioneer

'.$leg['modern'].'

Illegal

'.$leg['modern'].'

Modern

'.$leg['legacy'].'

Illegal

'.$leg['legacy'].'

Legacy

'.$leg['vintage'].'

Illegal

'.$leg['vintage'].'

Vintage

'.$leg['commander'].'

Illegal

'.$leg['commander'].'

Commander

'.$value.'

'.$value.'

'.ucfirst($key).'

'; echo '
'; echo '
'; // end of carddatainfo echo "
"; // cardgrid echo "
"; // cardcontainer echo "
"; // 룰링 출력 echo "
"; // 룰링 출력 echo "개더러 규칙 부연 설명 (영어만 지원됩니다.)"; echo '열기/닫기'; echo "
"; echo "'; } echo "
"; echo "
"; // cardcontainer2 }// end of meld } // end of if 자료 갯수 1개 else if($result->num_rows > 1) // 양면, 스플릿, 어드벤처 { // 자료를 a, b 별도로 받고 구성합니다. // $row에 뒷면인지 앞면인지 옆면인지 모를 카드 이름을 받았습니다. // 메인 쿼리 자체는 a를 가리켜야 하고, 서브 쿼리가 b를 가리켜야 합니다. // 카드 이미지는 layout 값에 따라 다른 방식으로 보여줍니다. // layout - adventure, aftermath, flip, meld, normal, split, transform $row = $result->fetch_assoc(); // 일단 한개 빼고 $rowb = array(); if($row['layout'] == 'adventure' or $row['layout'] == 'aftermath' or $row['layout'] == 'flip' or $row['layout'] == 'split' or $row['layout'] == 'transform' or $row['layout'] == 'modal_dfc') { $query = "select *, xe_mtga_cards.name as name, xe_mtga_cards.code as code, xe_mtga_cards.type as type, xe_mtga_card_sets.name as setname, xe_mtga_card_sets.code as setcode, xe_mtga_card_sets.type as settype from xe_mtga_cards inner join xe_mtga_card_sets on xe_mtga_cards.`code` = xe_mtga_card_sets.`code` and xe_mtga_cards.`code` = '".$_GET['set']."' and xe_mtga_cards.`number` = '".$_GET['code']."' and xe_mtga_cards.`side` = 'a' order by xe_mtga_cards.`type_k` DESC"; $result = $dbcs->query($query); $row = $result->fetch_assoc(); $query = "select *, xe_mtga_cards.name as name, xe_mtga_cards.code as code, xe_mtga_cards.type as type, xe_mtga_card_sets.name as setname, xe_mtga_card_sets.code as setcode, xe_mtga_card_sets.type as settype from xe_mtga_cards inner join xe_mtga_card_sets on xe_mtga_cards.`code` = xe_mtga_card_sets.`code` and xe_mtga_cards.`code` = '".$_GET['set']."' and xe_mtga_cards.`number` = '".$_GET['code']."' and xe_mtga_cards.`side` = 'b' order by xe_mtga_cards.`type_k` DESC"; $result = $dbcs->query($query); $rowb = $result->fetch_assoc(); } //print_r($query); echo "
"; echo "
"; echo "
"; echo '
'; // 사이즈 이펙트 처리 다르게 if($_GET['arg'] == "ko" and $row['name_k'] != "") echo ''; else if($_GET['arg'] == "ko" and $row['name_k'] == "") echo ''; else if($_GET['arg'] == "en") echo ''; else if($_GET['arg'] != "ko" and $_GET['arg'] != "en" and $row['name_k'] != "") echo ''; else echo ''; if($row['layout'] == 'transform' or $row['layout'] == 'modal_dfc') { echo '

다른 면 보기

'; } echo "
"; // end of cardboxinfo echo "
"; echo '
'; // 가격 관련 echo '
'; //세트로고, 세트명(약어), #카드번호, 희귀도 echo '
'.$row["setname"].'
#'.$row['number'].' - '; switch($row['rarity']) { case "mythic" : echo 'Mythic Rare'; break; case "rare" : echo 'Rare'; break; case "uncommon" : echo 'Uncommon'; break; case "common" : echo 'Common'; break; default : } echo '
'; echo '
'; // end of cardmoreinfo echo '
'; echo ''; $ckn = ckprice($dbcs, $_GET['set'], $_GET['code'], 'normal'); if($ckn != "") { echo ''; for($i=0;$i < count($ckn);$i++) { if($ckn[$i]->ava == "OoS") echo ''; else echo ''; } } echo ""; $ckn = ckprice($dbcs, $_GET['set'], $_GET['code'], 'foil'); if($ckn != "") { echo ''; for($i=0;$i < count($ckn);$i++) { if($ckn[$i]->ava == "OoS") echo ''; else echo ''; } } echo ""; echo '
분류NMEXVGG
일반'.$ckn[$i]->price.''.$ckn[$i]->price.'
포일'.$ckn[$i]->price.''.$ckn[$i]->price.'
'; echo '
'; // end of cardprice $query = "select *, xe_mtga_cards.name as name, xe_mtga_cards.code as code, xe_mtga_cards.type as type, xe_mtga_card_sets.name as setname, xe_mtga_card_sets.code as setcode, xe_mtga_card_sets.type as settype from xe_mtga_cards inner join xe_mtga_card_sets on xe_mtga_cards.`code` = xe_mtga_card_sets.`code` and xe_mtga_cards.`name` = '".addslashes($row['name'])."' order by xe_mtga_card_sets.release_date DESC"; $resultx = $dbcs->query($query); echo '
'; echo ''; if($resultx->num_rows < 6) { for($i=0;$i<$resultx->num_rows;$i++) { $rowset = $resultx->fetch_assoc(); //$ckn = ckprice($dbcs, $rowset['code'], $rowset['number'], 'normal'); echo ''; } } else { for($i=0;$i<6;$i++) { $rowset = $resultx->fetch_assoc(); //$ckn = ckprice($dbcs, $rowset['code'], $rowset['number'], 'normal'); echo ''; } echo ''; echo ''; } echo '
'; echo ''; if($rowset['name'] != "Plains" and $rowset['name'] != "Island" and $rowset['name'] != "Swamp" and $rowset['name'] != "Mountain" and $rowset['name'] != "Forest") { echo '
 (등록수 : '; $query = "select count(*) as count from ob_pddb where `set` = '".$rowset['code']."' and `code` = '".$rowset['number']."'"; $resultcount = $dbcs->query($query); $rowcount = $resultcount->fetch_assoc(); echo $rowcount['count']; echo ')
'; } echo '
'.$rowset['code'].'-'.$rowset['number'].'
'; echo '
'; echo ''; if($rowset['name'] != "Plains" and $rowset['name'] != "Island" and $rowset['name'] != "Swamp" and $rowset['name'] != "Mountain" and $rowset['name'] != "Forest") { echo '
 (등록수 : '; $query = "select count(*) as count from ob_pddb where `set` = '".$rowset['code']."' and `code` = '".$rowset['number']."'"; $resultcount = $dbcs->query($query); $rowcount = $resultcount->fetch_assoc(); echo $rowcount['count']; echo ')
'; } echo '
'.$rowset['code'].'-'.$rowset['number'].'
'; echo '
'; if($resultx->num_rows > 6) echo '

▷ 다른 세트 더 보기

'; echo '
'; echo ''; // end of othersets echo '
'; echo '
'; // end of cardsets echo '
'; echo '
'; // 샵 수와 샵들 가격 나열 echo '

제품 취급 온라인샵

'; echo '
'; // d 등급 이상의 관리자만 띄우기 $query = "select * from ob_pddb inner join ob_userdb on ob_pddb.`pid` = ob_userdb.`poid` and ob_pddb.`set` = '".$_GET['set']."' and ob_pddb.`code` = '".$_GET['code']."' and ob_userdb.`service` > 'd' and ob_pddb.`del` = 'n' order by ob_pddb.`lastdate`"; $resultus = $dbcs->query($query); if($resultus->num_rows == 0) { echo '
'; echo '

- 취급 온라인샵이 없습니다. -

'; echo '
'; } echo ''; for($i=0;$i<$resultus->num_rows;$i++) { $temp = $resultus->fetch_assoc(); if($temp['count'] != 0) { echo ''; echo ''; echo ''; echo ''; echo ''; //end of each list } } echo '
'; echo ''.pid2nickname($temp['pid']).""; echo ''.lang2flag($temp['language']).stat2icon($temp['stat']); if($temp['type'] == 'foil') echo ""; echo ''; echo price2html($dbcs,$temp['ck'], $temp['type'],$temp['stat'],$temp['price'])."원 (보유 ".$temp['count']."장)
"; if($_COOKIE['ob_id'] != $temp['pid']) { switch($temp['pid']) { case '1441741308' : echo '홈페이지에서 구매'; break; default : echo '장바구니 '; break; } //echo '장바구니 '; } echo '
'; echo '
'; // end of list echo '
'; // end of cardshop /* echo '
'; // echo '

오픈 바인더 유저 보유 내역 열기/닫기

'; echo ''; echo '
'; */ echo '
'; // end of cardsellerinfo echo '
'; // end of cardinfoetc echo '
'; echo '
'; if($_GET['arg'] == "ko" and $row['type_k'] != "") { echo $row['name_k'].' // '.$rowb['name_k']; echo "
 ".mtgsymbols($row['mana_cost'])." // ".mtgsymbols($rowb['mana_cost']); echo " English";} else if($_GET['arg'] == "ko" and $row['type_k'] == "") { echo $row['name'].' // '.$rowb['name']; echo "
 ".mtgsymbols($row['mana_cost'])." // ".mtgsymbols($rowb['mana_cost']);} else if($_GET['arg'] == "en" and $row['type_k'] != "") {echo $row['name'].' // '.$rowb['name']; echo "
 ".mtgsymbols($row['mana_cost'])." // ".mtgsymbols($rowb['mana_cost']); echo " 한국어판";} else if($_GET['arg'] == "en" and $row['type_k'] == "") { echo $row['name'].' // '.$rowb['name']; echo "
 ".mtgsymbols($row['mana_cost'])." // ".mtgsymbols($rowb['mana_cost']);} else if($_GET['arg'] != "ko" and $_GET['arg'] != "en" and $row['type_k'] != "") {echo $row['name_k'].' // '.$rowb['name_k']; echo "
 ".mtgsymbols($row['mana_cost'])." // ".mtgsymbols($rowb['mana_cost']); echo " English";} else {echo $row['name'].' // '.$rowb['name']; echo "
 ".mtgsymbols($row['mana_cost'])." // ".mtgsymbols($rowb['mana_cost']); } echo '
'; echo '
전면 :
'; if($_GET['arg'] == "ko" and $row['type_k'] != "") { echo $row['type_k']; } else if($_GET['arg'] == "ko" and $row['type_k'] == "") { echo $row['type']; } else if($_GET['arg'] == "en" and $row['type_k'] != "") {echo $row['type']; } else if($_GET['arg'] == "en" and $row['type_k'] == "") { echo $row['type']; } else if($_GET['arg'] != "ko" and $_GET['arg'] != "en" and $row['type_k'] != "") {echo $row['type_k'];} else {echo $row['type'];} echo '
'; echo '
'; $row['text_k'] = mtgsymbols(nl2br($row['text_k'])); $row['text'] = mtgsymbols(nl2br($row['text'])); if($_GET['arg'] == "ko" and $row['text_k'] != "") { echo $row['text_k'];} else if($_GET['arg'] == "ko" and $row['text_k'] == "") { echo $row['text']; } else if($_GET['arg'] == "en" and $row['text_k'] != "") {echo $row['text']; } else if($_GET['arg'] == "en" and $row['text_k'] == "") { echo $row['text']; } else if($_GET['arg'] != "ko" and $_GET['arg'] != "en" and $row['text_k'] != "") {echo $row['text_k']; } else {echo $row['text']; } echo '
'; echo '
'; echo ''; $row['flavor_text_k'] = nl2br($row['flavor_text_k']); $row['flavor_text'] = nl2br($row['flavor_text']); if($_GET['arg'] == "ko" and $row['flavor_text_k'] != "") { echo $row['flavor_text_k'];} else if($_GET['arg'] == "ko" and $row['flavor_text_k'] == "") { echo $row['flavor_text']; } else if($_GET['arg'] == "en" and $row['flavor_text_k'] != "") {echo $row['flavor_text']; } else if($_GET['arg'] == "en" and $row['flavor_text_k'] == "") { echo $row['flavor_text']; } else if($_GET['arg'] != "ko" and $_GET['arg'] != "en" and $row['flavor_text_k'] != "") {echo $row['flavor_text_k']; } else {echo $row['flavor_text']; } echo ''; echo '
'; echo '
'; if($row['power'] != "" and $row['toughness'] != "") echo $row['power']."/".$row['toughness']; else if($row['loyalty'] != "")echo "충성도 : ".$row['loyalty']; echo '
'; echo '
후면 :
'; if($_GET['arg'] == "ko" and $rowb['type_k'] != "") { echo $rowb['type_k']; } else if($_GET['arg'] == "ko" and $rowb['type_k'] == "") { echo $rowb['type']; } else if($_GET['arg'] == "en" and $rowb['type_k'] != "") {echo $rowb['type']; } else if($_GET['arg'] == "en" and $rowb['type_k'] == "") { echo $rowb['type']; } else if($_GET['arg'] != "ko" and $_GET['arg'] != "en" and $rowb['type_k'] != "") {echo $rowb['type_k'];} else {echo $rowb['type'];} echo '
'; echo '
'; $rowb['text_k'] = mtgsymbols(nl2br($rowb['text_k'])); $rowb['text'] = mtgsymbols(nl2br($rowb['text'])); if($_GET['arg'] == "ko" and $rowb['text_k'] != "") { echo $rowb['text_k'];} else if($_GET['arg'] == "ko" and $rowb['text_k'] == "") { echo $rowb['text']; } else if($_GET['arg'] == "en" and $rowb['text_k'] != "") {echo $rowb['text']; } else if($_GET['arg'] == "en" and $rowb['text_k'] == "") { echo $rowb['text']; } else if($_GET['arg'] != "ko" and $_GET['arg'] != "en" and $rowb['text_k'] != "") {echo $rowb['text_k']; } else {echo $rowb['text']; } echo '
'; echo '
'; echo ''; $rowb['flavor_text_k'] = nl2br($rowb['flavor_text_k']); $rowb['flavor_text'] = nl2br($rowb['flavor_text']); if($_GET['arg'] == "ko" and $rowb['flavor_text_k'] != "") { echo $rowb['flavor_text_k'];} else if($_GET['arg'] == "ko" and $rowb['flavor_text_k'] == "") { echo $rowb['flavor_text']; } else if($_GET['arg'] == "en" and $rowb['flavor_text_k'] != "") {echo $rowb['flavor_text']; } else if($_GET['arg'] == "en" and $rowb['flavor_text_k'] == "") { echo $rowb['flavor_text']; } else if($_GET['arg'] != "ko" and $_GET['arg'] != "en" and $rowb['flavor_text_k'] != "") {echo $rowb['flavor_text_k']; } else {echo $rowb['flavor_text']; } echo ''; echo '
'; echo '
'; if($rowb['power'] != "" and $rowb['toughness'] != "") echo $rowb['power']."/".$rowb['toughness']; else if($rowb['loyalty'] != "")echo "충성도 : ".$rowb['loyalty']; echo '
'; echo '
'; echo 'Illustrated by '.$row['artist']; echo '
'; echo '
'; //echo $row['legalities']; echo ''; //{"brawl":"Legal","commander":"Legal","duel":"Legal","future":"Legal","historic":"Legal","legacy":"Legal","modern":"Legal","pioneer":"Legal","standard":"Legal","vintage":"Legal"} echo ''; $leg = json_decode($row['legalities'], true); $pos = 1; // 스탠, 파이오니어, 모던, 레거시, 빈티지, 커맨더 까지는 하고, 나머지는 foreach에 맞김 if($leg['standard'] == "Banned") echo ''; else if($leg['standard'] == "") echo ''; else echo ''; echo ''; if($pos % 2 == 0) { echo ''; echo ''; } $pos++; unset($leg['standard']); if($leg['pioneer'] == "Banned") echo ''; else if($leg['pioneer'] == "") echo ''; else echo ''; echo ''; if($pos % 2 == 0) { echo ''; echo ''; } $pos++; unset($leg['pioneer']); if($leg['modern'] == "Banned") echo ''; else if($leg['modern'] == "") echo ''; else echo ''; echo ''; if($pos % 2 == 0) { echo ''; echo ''; } $pos++; unset($leg['modern']); if($leg['legacy'] == "Banned") echo ''; else if($leg['legacy'] == "") echo ''; else echo ''; echo ''; if($pos % 2 == 0) { echo ''; echo ''; } $pos++; unset($leg['legacy']); if($leg['vintage'] == "Banned") echo ''; else if($leg['vintage'] == "") echo ''; else echo ''; echo ''; if($pos % 2 == 0) { echo ''; echo ''; } $pos++; unset($leg['vintage']); if($leg['commander'] == "Banned") echo ''; else if($leg['commander'] == "") echo ''; else echo ''; echo ''; if($pos % 2 == 0) { echo ''; echo ''; } $pos++; unset($leg['commander']); foreach($leg as $key => $value) { if($value == "Banned") echo ''; else echo ''; echo ''; if($pos % 2 == 0) { echo ''; echo ''; } $pos++; } echo ''; echo '

'.$leg['standard'].'

Illegal

'.$leg['standard'].'

Standard

'.$leg['pioneer'].'

Illegal

'.$leg['pioneer'].'

Pioneer

'.$leg['modern'].'

Illegal

'.$leg['modern'].'

Modern

'.$leg['legacy'].'

Illegal

'.$leg['legacy'].'

Legacy

'.$leg['vintage'].'

Illegal

'.$leg['vintage'].'

Vintage

'.$leg['commander'].'

Illegal

'.$leg['commander'].'

Commander

'.$value.'

'.$value.'

'.ucfirst($key).'

'; echo '
'; echo '
'; // end of carddatainfo echo "
"; // cardcontainer echo "
"; // cardgrid } // end of if 자료 갯수 2개 else { // 휴스턴 문제가 발생했다. echo "
"; // 무엇인가 잘못된 것 같습니다. 메인으로 돌아가서 다시 시도해주세요. echo '
'; echo '

무엇인가 잘못된 것 같습니다. 메인으로 돌아가서 다시 시도해주세요.

'; echo '

메인으로 돌아가기

'; echo '
'; } // 공통 페이지 - 룰 텍스트 등 } else if($_GET['search'] != "") { // 카드 이미지 나열 if(strlen($_GET['search']) < 3) { echo ""; exit(); } $inname = addslashes(mysql_real_escape_string($inname)); //한글이든 영어든 정확한 이름이 있으면 던진다. $query = "select * from xe_mtga_cards where fullname = '".$inname."' or fullname_k = '".$inname."' and is_online_only != 'Y' order by multiverse_id DESC"; //$query = "select * from xe_mtga_cards where name = '".$inname."' or name_k = '".$inname."' and (side is null or side = 'a' or (`layout` = 'meld' and `side` = 'b')) and is_online_only != 'Y' order by multiverse_id DESC"; $resultkname = $dbcs->query($query); $rowtruename = $resultkname->fetch_assoc(); //if($resultkname->num_rows == 1) $inname = addslashes($rowtruename['name']); // 검색해야할 검색어를 확보했으면, 이번엔 이름 중 탑 목록만 확보 //$query = "select * from (select * from xe_mtga_cards inner join xe_mtga_card_sets on xe_mtga_cards.`code` = xe_mtga_card_sets.`code`) as a group by a.name where (name like '%".$inname."%' or name_k like '%".$inname."%') and is_online_only != 'Y' order by multiverse_id DESC" ; //$query = "select * from (select xe_mtga_cards.name, xe_mtga_cards.code, xe_mtga_cards.number from xe_mtga_cards inner join xe_mtga_card_sets on xe_mtga_cards.`code` = xe_mtga_card_sets.`code` and (xe_mtga_cards.name like '%".$inname."%' or xe_mtga_cards.name_k like '%".$inname."%') and xe_mtga_cards.is_online_only != 'Y') as a group by name"; $query = "select * from (select * from xe_mtga_cards where (fullname like '%".$inname."%' or fullname_k like '%".$inname."%') and is_online_only != 'Y' and (side is null or side = 'a' or (layout = 'meld' and side = 'b')) order by xe_mtga_cards.`lang` DESC ) as a group by a.fullname "; //select * from (select * from xe_mtga_cards inner join xe_mtga_card_sets on xe_mtga_cards.`code` = xe_mtga_card_sets.`code` and (xe_mtga_cards.name like '%llanowar%' or xe_mtga_cards.name_k like '%llanowar%') and xe_mtga_cards.is_online_only != 'Y' order by field(xe_mtga_card_sets.type, 'expansion', 'core', 'masters')) as a group by a.name //$query = "select * from (select * from xe_mtga_cards where (name like '%".$inname."%' or name_k like '%".$inname."%') and (side is null or side = 'a' or (`layout` = 'meld' and `side` = 'b')) and is_online_only != 'Y' order by multiverse_id DESC) as a group by a.name"; $resultk = $dbcs->query($query); if($_GET['page'] == '') $page = 1; else $page = $_GET['page']; // 카드 리스팅하고 클릭 하게 셋업 //echo $resultk->num_rows; if($resultk->num_rows == 1) { $query = "select * from xe_mtga_cards where (fullname like '%".$inname."%' or fullname_k like '%".$inname."%') and is_online_only != 'Y' and (side is null or side = 'a' or (layout = 'meld' and side = 'b')) order by xe_mtga_cards.`lang` DESC"; $resultk = $dbcs->query($query); $rowcid = $resultk->fetch_assoc(); /* $query = "select * from xe_mtga_cards inner join ob_pddb on xe_mtga_cards.code = ob_pddb.set and xe_mtga_cards.number = ob_pddb.code and xe_mtga_cards.name = '".$rowcid['name']."' and ob_pddb.pid = '1216027144'"; $resultx = $dbcs->query($query); $rowx = $resultx->fetch_assoc(); */ //if($resultx->num_rows == 0) //{ echo ""; /*} else { echo ""; } */ exit(); } else if($resultk->num_rows > 1) { $ln = 12; $totalpage = ceil($resultk->num_rows / $ln); $totalcards = $resultk->num_rows; $query = $query." LIMIT ".(($page-1) * $ln).", ".$ln; $resultk = $dbcs->query($query); echo "
"; echo '
'; echo '

검색어 "'.$_GET['search'].'"에 대한 검색 결과는 '.$totalcards.' 종 입니다.

(전체 '.$totalpage.'페이지 중 '.$page.'페이지)

'; echo '
'; echo "
"; echo "
"; // 나온 이름들을 다 붙여서 최신 Expansion, Core 정렬하고 for($i=0;$i<$resultk->num_rows;$i++) { $rowcid = $resultk->fetch_assoc(); /* $stime = get_mtime(); $query = "select xe_mtga_cards.code as `set`, xe_mtga_cards.number as number, xe_mtga_cards.name as name, xe_mtga_cards.name_k as name_k from xe_mtga_cards inner join ob_pddb on xe_mtga_cards.code = ob_pddb.set and xe_mtga_cards.number = ob_pddb.code and xe_mtga_cards.name = '".addslashes($rowcid['name'])."' and ob_pddb.pid = '1216027144'"; $resultx = $dbcs->query($query); $rowx = $resultx->fetch_assoc(); echo $i."번카드 사용시간 : ".(get_mtime() - $stime)."
"; */ if($resultx->num_rows != 0) { echo '"; } else { echo '"; } } } else { // 결과값이 없음 echo '
'; echo '
'; echo '"; echo '
'; // 헤더 끝 echo "
"; echo '
'; echo '

검색결과가 없습니다.

'; echo '

메인으로 돌아가기

'; echo "
"; //echo addslashes($inname)." ".strlen($inname)." ".$query; } echo '
'; // end of cardgrid echo "
"; // end of cardcontainer echo '
'; if($page != "1") echo ''; else echo "
 
"; if($page >= $totalpage) echo "
"; else echo ''; echo '
'; // end of page bar } else if($_GET['mode'] == 'board') { echo "
"; if($_GET['catid'] == "") { switch($_GET['id']) { case 'cate' : // 오픈바인더 proj의 카테고리를 출력 및 나열 $query = "select * from ob_bcate where proj = 'ob' order by star DESC, id ASC"; $resultb = $dbcs->query($query); for($i=0;$i<$resultb->num_rows;$i++) { $temp = $resultb->fetch_assoc(); // 카테고리의 최신글 가져오기 date(Ymd) $tof = date('Y').'-'.date('m').'-'.date('d').' 00:00'; $tot = date('Y').'-'.date('m').'-'.date('d').' 23:59'; $query = "select * from ob_bcont where `catid` = ".$temp['id']." and `del` != 'y' and `date` >= '".$tof."' and `date` <= '".$tot."'"; $resultc = $dbcs->query($query); echo '
'; echo '
'; echo '
'; echo '
'; echo ''.replmtg($temp['name']); // 제목 if($resultc->num_rows>0) echo ''.$resultc->num_rows.''; echo ''; echo replmtg($temp['detail']); echo '
'; // end of card-content echo '
'; // echo '

이동하기

'; echo '
'; // end of card-action echo '
'; // end of card echo '
'; // end of col echo '
'; // end of row } break; case 'edit' : // 글 수정하기 // 로그인 정보 확인 pid 비어 있으면 로그인 유도 // catid, cid, pid 검사 echo $_GET['catid']."의 ".$_GET['cid']; break; default : // 페이지 구성 if($_GET['page'] != '') $page = $_GET['page']; else $page = 1; // id가 숫자이고, 숫자 카테고리의 글 리스팅 $query = "select * from ob_bcate where id = ".$_GET['id']; $resultb = $dbcs->query($query); $cat = $resultb->fetch_assoc(); $query = "select id, type, catid, head, pid, date from ob_bcont where catid = ".$_GET['id']." and del != 'y' order by type DESC, id DESC"; $resultt = $dbcs->query($query); $totalpage = ceil($resultt->num_rows) / 20; $query = "select id, type, catid, head, pid, date from ob_bcont where catid = ".$_GET['id']." and del != 'y' order by type DESC, id DESC Limit ".(($page-1)*20).", 20"; $resultt = $dbcs->query($query); if($resultt->num_rows == 0) { // 글이 없습니다. echo '

게시판에 글이 없습니다.

'; echo '

게시판 목록으로 이동하기

'; echo '

첫 글 쓰기

'; } else { echo '
'; echo '
'; echo '
'; echo '
'; echo ''.$cat['name'].''; // 제목 echo '
'; // end of card-content echo '
'; for($i=0;$i<$resultt->num_rows;$i++) { $temp = $resultt->fetch_assoc(); //print_r($temp); echo ''; // div 쓰고 비율로 쪼개자. if($temp['type'] == 1) echo ""; else echo "
priority_high
"; echo ''; echo ''; echo'
".$temp['id']."'; $profileimageurlthis = getprofileimg($temp['pid']); if($profileimageurlthis == "") $profileimageurlthis = "http://mtg-kr.com/favicon.png"; // 리플 갯수 표시 $query = "select count(id) from ob_breply where cid = ".$temp['id']." and del != 'y'"; $resultre = $dbcs->query($query); $tempre = $resultre->fetch_assoc(); echo '  '.pid2nickname($temp['pid']).'('.$temp['date'].') [댓글 : '.$tempre['count(id)'].']
▷ '.replmtg($temp['head']).'
'; } } echo '
'; if($page != "1") echo " arrow_back이전"; else echo "arrow_back이전"; // 페이지 네이션 echo ""; echo ""; echo ""; if($page >= $totalpage) echo "arrow_forward다음"; else echo "arrow_forward다음"; echo "
"; // end of pagenation echo '
'; // end of card-action echo '
'; // end of card echo "view_list게시판 목록"; // 글쓰기 권한 여부 체크 if($cat['writers'] != "") { // 특정인에 해당하면 표시 if(strpos($cat['writers'], $_COOKIE['ob_id']) !== false) { echo "mode_edit새 글"; } } else if($cat['banned'] == "") { // 특정인과 관련 없고, 밴 목록도 없으면 버튼 띄우기 echo "mode_edit새 글"; } else { // 밴 명단에 있으면 못쓰고, 없으면 쓴다 if(strpos($cat['banned'], $_COOKIE['ob_id']) !== false) { //echo ""; exit(); } // catid, cid = 없음 //echo $_GET['catid']."의 ".$_GET['cid']; $query = "select * from ob_bcate where id = ".$_GET['catid']; $resultb = $dbcs->query($query); $cat = $resultb->fetch_assoc(); //echo '
'; if($_GET['cid'] == "") { // 새글 작성 // 작성 권한 검사 if($cat['writers'] != "") { // 특정인에 해당하면 표시 if(strpos($cat['writers'], $_COOKIE['ob_id']) !== false) { } else { echo ""; } } else if($cat['banned'] == "") { // 특정인과 관련 없고, 밴 목록도 없으면 버튼 띄우기 } else { // 밴 명단에 있으면 못쓰고, 없으면 쓴다 if(strpos($cat['banned'], $_COOKIE['ob_id']) !== false) { echo ""; } } echo '
'; echo '
'; echo '
'; echo '
'; echo '

'.$cat['name'].' 게시판에 글 쓰기

'; echo ' '; if($cat['owner'] == $_COOKIE['ob_id']) echo ''; echo '

'; echo '
'; // end of card-content echo '
'; // end of card echo '
'; // end of col echo '
'; // end of row } else { // 수정모드 $query = "select * from ob_bcont where id = ".$_GET['cid']; $resultc = $dbcs->query($query); $cont = $resultc->fetch_assoc(); // 작성 권한 검사 if($cat['writers'] != "") { // 특정인에 해당하면 표시 if(strpos($cat['writers'], $_COOKIE['ob_id']) !== false) { } else { echo ""; } } else if($cat['banned'] == "") { // 특정인과 관련 없고, 밴 목록도 없으면 버튼 띄우기 } else { // 밴 명단에 있으면 못쓰고, 없으면 쓴다 if(strpos($cat['banned'], $_COOKIE['ob_id']) !== false) { echo ""; } } // 니가 쓴 글이냐? if($cont['pid'] != $_COOKIE['ob_id']) { echo ""; } echo '
'; echo '
'; echo '
'; echo '
'; echo '

'.$cat['name'].' 게시판에 글 수정

'; echo '
'; if($cat['owner'] == $_COOKIE['ob_id']) { if($cont['type'] == 1) echo ''; else echo ''; } echo '

'; echo '
'; // end of card-content echo '
'; // end of card echo '
'; // end of col echo '
'; // end of row } break; default : // 그 외엔 다 본문 보기 // 본문 정보 가져오기 $query = "select * from ob_bcont where id = ".$_GET['cid']." and del != 'y'"; $resultb = $dbcs->query($query); $cont = $resultb->fetch_assoc(); // cid가 있으면 본문 페이지 뿌리는 페이지 // cid와 id로 db에서 글 찾아오기 // db 값이 없으면 글이 없습니다. <되돌아가기 버튼> $query = "select * from ob_bcate where id = ".$_GET['catid']; $resultcate = $dbcs->query($query); $cat = $resultcate->fetch_assoc(); /* echo '
'; echo '
'; echo '
'; echo '
'; echo ''.$cat['name'].''; // 제목 echo '
'; // end of card-content echo '
'; echo '
'; // end of card-action echo '
'; // end of card */ // 본문 출력하기 echo '
'; echo '
'; echo '
'; echo '
'; echo '
#'.$cat['name'].' - '.$cont['id'].'

'.replmtg($cont['head']).'

'; $profileimageurlthis = getprofileimg($cont['pid']); if($profileimageurlthis == "") $profileimageurlthis = "http://mtg-kr.com/favicon.png"; echo '  '.pid2nickname($cont['pid']).' ('.$cont['date'].')
'; echo '
'; echo '

'.replmtg($cont['contents']).'

'; echo '
'; // end of card-content // 기능 버튼 - 삭제, 목록으로 돌아가기 echo '
'; // end of card echo "view_list글목록"; if($cont['pid'] == $_COOKIE['ob_id']) echo "delete삭제"; if($cont['pid'] == $_COOKIE['ob_id']) echo "edit수정"; echo '
'; // end of col echo '
'; // end of row // 리플 출력 - 그냥 다 뿌려. // DB 읽기 $query = "select * from ob_breply where cid = ".$_GET['cid']." and del != 'y'"; $resultr = $dbcs->query($query); echo '
'; echo '
'; echo '
'; echo '
'; echo '

댓글 ( '.$resultr->num_rows.' 개 )

'; echo '
'; // end of card-content echo '
'; echo ""; for($i=0;$i<$resultr->num_rows;$i++) { // 글쓴이, 일자, 댓글내용, 삭제 버튼 $temp = $resultr->fetch_assoc(); echo ''; echo ''; if($temp['pid'] == $_COOKIE['ob_id']) { echo ""; } else { echo ""; } } echo '
'; $profileimageurlthis = getprofileimg($temp['pid']); if($profileimageurlthis == "") $profileimageurlthis = "http://mtg-kr.com/favicon.png"; echo '

   '.pid2nickname($temp['pid']).'

('.$temp['date'].')

'.replmtg($temp['contents']).'delete
'; echo '
'; // end of card-action echo '
'; // end of card echo '
'; // end of col echo '
'; // end of row // 리플 다는 바 -> 달고 나서 새로 고침 echo '
'; echo '
'; echo '
'; echo '
'; if($_COOKIE['ob_id']) { echo '
'; if($profileimageurl == "") $profileimageurl = "http://mtg-kr.com/favicon.png"; echo '

 '.pid2nickname($_COOKIE['ob_id']); echo ' '; echo '

'; } else { echo '

'; } echo '
'; // end of card-content echo '
'; // end of card echo '
'; // end of col echo '
'; // end of row // 조회수 갱신 - 관리자만 보임 $query = "update ob_bcont set `count` = `count` + 1 where id = ".$_GET['cid']; $resultb = $dbcs->query($query); break; } } echo '
'; // End of Container // 메인 링크 } else if($_GET['mode'] != 'list' and $_GET['mode'] != 'iconic') { echo "
"; // 무엇인가 잘못된 것 같습니다. 메인으로 돌아가서 다시 시도해주세요. echo '
'; echo '

무엇인가 잘못된 것 같습니다. 메인으로 돌아가서 다시 시도해주세요.

'; echo '

메인으로 돌아가기

'; echo '
'; // 메인 링크 } /* echo ' '; */ echo "
"; // end of Container cos echo '
'; echo ' '; echo ""; echo ""; ob_end_flush(); mysqli_close($dbcs); function lang2flag($con) { switch($con) { case 'Korean' : $html = $html.''; break; case 'Spanish' : $html = $html.''; break; case 'French' : $html = $html.''; break; case 'German' : $html = $html.''; break; case 'Italian' : $html = $html.''; break; case 'Portuguese (Brazil)' : $html = $html.''; break; case 'Japanese' : $html = $html.''; break; case 'Russian' : $html = $html.''; break; case 'Chinese Simplified' : $html = $html.''; break; case 'Chinese Traditional' : $html = $html.''; break; default : $html = $html.''; break; } return $html; } function stat2icon($con) { if($con == "") return ""; else return ""; // 아이콘을 만들어야겠다. } function price2html($db, $ck, $type, $stats, $price) { $ckn = ckprice($db, $_GET['set'], $_GET['code'], $type); $stat = 0; switch($tstats) { case 'EX' : $stat = 1; break; case 'VG' : $stat = 2; break; case 'G' : $stat = 3; break; } if($ck == "y") $pricef = ceil(($ckn[$stat]->price * $price)/10)*100; else $pricef = $price; if($pricef < 400 and $type == "normal") $pricef = 400; else if($pricef < 500 and $type == "foil") $pricef = 500; return "".number_format($pricef).""; } function replmtg($dcontent) { $dcontent = replacer_mtg("card", $dcontent); // $dcontent = replacer_mtg("dlist", $dcontent); $dcontent = replacer_mtg("tipc", $dcontent); return mtgsymbols($dcontent); } function replacer_mtg($dtag, $dcontent) { $stag = "[".$dtag."]"; $etag = "[/".$dtag."]"; while(1) // break 만날때까지 계속 { $sposition = strpos($dcontent, $stag); if($sposition) // 시작 태그 위치 찾아 넣고 false가 아니라면 { $eposition = strpos($dcontent, $etag); // 끝 태그를 찾습니다. if(!$eposition) return $dcontent; // 못 찾으면 while 탈출 $tagcontent = substr($dcontent, $sposition + strlen($stag), $eposition-$sposition-strlen($etag)+1); // 태그와 태그사이 내용물 찾기 switch($dtag) { case "dlist" : //$dcontent = str_replace($stag.$tagcontent.$etag,"", $dcontent); //$dcontent = $dcontent.deckviewer($tagcontent); $outdata = deckviewer($dtag, $tagcontent); $dcontent = str_replace($stag.$tagcontent.$etag, $outdata, $dcontent); break; case "card" : // $tagcontent의 가장 최근 값 찾기 // Load DB $dbcs = new mysqli('localhost', 'hyeri0418', 'Music0418', 'hyeri0418'); //mysql 열기 성공 체크 if(mysqli_connect_errno()) { echo 'DBERROR'; mysqli_close($dbcs); exit; } // 2. 이름으로 multiverseid 찾기 // 1) 한국어 데이터 유무를 먼저 검사 - 데이터 읽기 $query = "select * from xe_mtga_cards where name_k = '".addslashes($tagcontent)."' and (side is null or side = 'a') order by multiverse_id_k DESC"; if(!$result = $dbcs->query($query)) { echo "해당 이벤트 데이터베이스가 존재하지 않습니다.
관리자에게 문의하십시오."; mysqli_close($db); echo $query; exit(); } if($result->num_rows == 0)// 2) 만약에 $result->num_rows 가 0이면 영문으로 찾기 { $query = "select * from xe_mtga_cards where name = '".addslashes($tagcontent)."' and (side is null or side = 'a') order by multiverse_id DESC"; if(!$result = $dbcs->query($query)) { echo "해당 이벤트 데이터베이스가 존재하지 않습니다.
관리자에게 문의하십시오."; mysqli_close($db); echo $query; exit(); } if($result->num_rows <> 0) // 0이 아니라면 가장 최신 카드 multiverse_id 갖고오기 { $cardrow = $result->fetch_assoc(); $address = ciset($cardrow['code'], $cardrow['number'], "en"); } else { $multiverseid = "http://mtg-kr.com/noimage.png"; } } else { // 0이 아니라면 가장 최신 카드 multiverse_id 갖고 오기 아니라면 한글이니 multiverse_k $cardrow = $result->fetch_assoc(); $address = ciset($cardrow['code'], $cardrow['number'], "ko"); } $dcontent = str_replace($stag.$tagcontent.$etag,"", $dcontent); break; case "tipc" : $dcontent = str_replace($stag.$tagcontent.$etag,"".$tagcontent."", $dcontent); break; } } else { // 남은 태그가 없으면 return $dcontent; } } } function mtgsymbols($dcontent) { $cheatlist[0]=array('{W}',''); $cheatlist[1]=array('{U}',''); $cheatlist[2]=array('{B}',''); $cheatlist[3]=array('{R}',''); $cheatlist[4]=array('{G}',''); $cheatlist[5]=array('{C}',''); $cheatlist[6]=array('{P}',''); $cheatlist[7]=array('{S}',''); $cheatlist[8]=array('{X}',''); $cheatlist[9]=array('{Y}',''); $cheatlist[10]=array('{Z}',''); $cheatlist[11]=array('{0}',''); $cheatlist[12]=array('{1}',''); $cheatlist[13]=array('{2}',''); $cheatlist[14]=array('{3}',''); $cheatlist[15]=array('{4}',''); $cheatlist[16]=array('{5}',''); $cheatlist[17]=array('{6}',''); $cheatlist[18]=array('{7}',''); $cheatlist[19]=array('{8}',''); $cheatlist[20]=array('{9}',''); $cheatlist[21]=array('{10}',''); $cheatlist[22]=array('{11}',''); $cheatlist[23]=array('{12}',''); $cheatlist[24]=array('{13}',''); $cheatlist[25]=array('{14}',''); $cheatlist[26]=array('{15}',''); $cheatlist[27]=array('{16}',''); $cheatlist[28]=array('{17}',''); $cheatlist[29]=array('{18}',''); $cheatlist[30]=array('{19}',''); $cheatlist[31]=array('{20}',''); $cheatlist[32]=array('{E}',''); $cheatlist[33]=array('{T}',''); $cheatlist[34]=array('{Q}',''); $cheatlist[35]=array('{t}',''); $cheatlist[36]=array('{CHAOS}',''); $cheatlist[37]=array('{Artifact}',''); $cheatlist[38]=array('{Creature}',''); $cheatlist[39]=array('{Enchantment}',''); $cheatlist[40]=array('{Instant}',''); $cheatlist[41]=array('{Land}',''); $cheatlist[42]=array('{Planeswalker}',''); $cheatlist[43]=array('{Sorcery}',''); $cheatlist[44]=array('{Multiple}',''); $cheatlist[45]=array('{Flashback}',''); $cheatlist[46]=array('{Power}',''); $cheatlist[47]=array('{Toughness}',''); $cheatlist[48]=array('{Azorius}',''); $cheatlist[49]=array('{Boros}',''); $cheatlist[50]=array('{Dimir}',''); $cheatlist[51]=array('{Golgari}',''); $cheatlist[52]=array('{Gruul}',''); $cheatlist[53]=array('{Izzet}',''); $cheatlist[54]=array('{Orzhov}',''); $cheatlist[55]=array('{Rakdos}',''); $cheatlist[56]=array('{Selesnya}',''); $cheatlist[57]=array('{Simic}',''); $cheatlist[58]=array('{Abzan}',''); $cheatlist[59]=array('{Jeskai}',''); $cheatlist[60]=array('{Mardu}',''); $cheatlist[61]=array('{Sultai}',''); $cheatlist[62]=array('{Temur}',''); $cheatlist[63]=array('{Atarka}',''); $cheatlist[64]=array('{Dromoka}',''); $cheatlist[65]=array('{Kolaghan}',''); $cheatlist[66]=array('{Ojutai}',''); $cheatlist[67]=array('{Silumgar}',''); $cheatlist[68]=array('{Setessa}',''); $cheatlist[69]=array('{Akros}',''); $cheatlist[70]=array('{Meletis}',''); $cheatlist[71]=array('{W/U}',''); $cheatlist[72]=array('{W/B}',''); $cheatlist[73]=array('{U/B}',''); $cheatlist[74]=array('{U/R}',''); $cheatlist[75]=array('{B/R}',''); $cheatlist[76]=array('{B/G}',''); $cheatlist[77]=array('{R/G}',''); $cheatlist[78]=array('{R/W}',''); $cheatlist[79]=array('{G/W}',''); $cheatlist[80]=array('{G/U}',''); $cheatlist[81]=array('{2/W}',''); $cheatlist[82]=array('{2/U}',''); $cheatlist[83]=array('{2/B}',''); $cheatlist[84]=array('{2/R}',''); $cheatlist[85]=array('{2/G}',''); $cheatlist[86]=array('{W/P}',''); $cheatlist[87]=array('{U/P}',''); $cheatlist[88]=array('{B/P}',''); $cheatlist[89]=array('{R/P}',''); $cheatlist[90]=array('{G/P}',''); for($i=0;$i<91;$i++) { $dcontent = str_replace($cheatlist[$i][0],$cheatlist[$i][1],$dcontent); } return $dcontent; } function deckviewer($tag1,$id) { // 수정된 버전 2020년 8월 16일 // dlistmtga와 dlistmtgo 에 따라 작업 // initializing $db = new mysqli('localhost', 'hyeri0418', 'Music0418', 'hyeri0418'); //mysql 열기 성공 체크 if(mysqli_connect_errno()) { echo 'DBERROR'; mysqli_close($db); exit; } if($tag1 == 'dlist'){ $query = "select * from xe_mtga_decks where did = '".$id."'"; } // xe_mtga_decks의 did를 검사 // dataset_json if(!$result = $db->query($query)) { return "데이터베이스가 존재하지 않습니다.
관리자에게 문의하십시오.
"; mysqli_close($db); } if($result->num_rows == 0) { return "해당 덱 데이터 베이스가 없습니다.
관리자에 문의하십시오.
"; } $decklist = array(); $row = $result->fetch_assoc(); /* $info = $row['description']; // 덱리스트 정보 $temp = $row['dataset_json']; // 덱리스트 json $decklist = json_decode($temp,true); // 덱 배열 */ // 넘어온 덱리스트를 양식에 따라 파싱하여 데이터화 // main, side // no, code, number, image_url(6) // 현재 cid 받아서 주기 // 각 행별로main 카드 검색해서 카드타입 부여 (7) 및 카드 이름(5), multiverseid(4) 부여 // 검사 순서는 생물(creature), 대지(land), 나머지는 주문(spell) // multiverseid는 multiverse_id_k가 null 이면 multiverse_id 부여, 아니면 k 부여 // 카드이름은 multiverse_id_k가 null 이냐 아니냐로 한국어 이름 부여 구분 // 사이드는 (7)에 모두 side 넣기 $decklist = array(); // main 처리 $maincount = 0; $sidecount = 0; for($i=0;$iquery($queryc)) { echo "데이터베이스가 존재하지 않습니다.
관리자에게 문의하십시오."; mysqli_close($db); exit(); } if($resultc->num_rows == 0) { echo "해당 덱 데이터 베이스가 없습니다.
관리자에 문의하십시오."; exit(); } $rowc = $resultc->fetch_assoc(); // 카드 정보 추출 // 유형 넣기 if(strpos($rowc['type'],"Land")!==false) { $decklist['main'][$i]['type'] = "land"; } else { if(strpos($rowc['type'],"Creature")!==false) { $decklist['main'][$i]['type'] = "creature"; } else { $decklist['main'][$i]['type'] = "spell"; } } // 마나 넣기 $decklist['main'][$i]['mana'] = $rowc['mana_cost']; // 이름 넣기 if($rowc['multiverse_id_k']) // 한글판이 있는 카드면 { //return $rowc['multiverse_id_k']; // 한글 이름 넣기 // 혹시 side = a니? if($rowc['side'] == 'a') { $decklist['main'][$i]['name'] = $rowc['name_k']; // 일단 앞면 이름 넣고 $rowc = $resultc->fetch_assoc(); // 카드 정보 추출 $decklist['main'][$i]['name'] = $decklist['main'][$i]['name']." / ".$rowc['name_k']; // 다음 뒷면 이름 넣고 } else { $decklist['main'][$i]['name'] = $rowc['name_k']; } //multiverse_id_k 넣기 $decklist['main'][$i]['multiverse_id'] = $rowc['multiverse_id_k']; // 이미지 경로 없으면 임시 넣기 // $gathererpath = "http://gatherer.wizards.com/Handlers/Image.ashx?multiverseid=".$multiverseid."&type=card"; if(!$decklist['main'][$i]['image_url']) { $decklist['main'][$i]['image_url'] = "http://gatherer.wizards.com/handlers/Image.ashx?multiverseid=".$rowc['multiverse_id_k']."&type=card"; // 파일이 있는지 검사 "http://mtg-kr.com/files/attach/cards/".$rowㅊ['multiverse_id'].".png"; $filepath = '/hyeri0418/www/files/attach/cards/'.$decklist['main'][$i]['multiverse_id'].'.png'; if(is_file($filepath)) { $decklist['main'][$i]['image_url'] = 'http://mtg-kr.com/files/attach/cards/'.$rowc['multiverse_id_k'].'.png'; } } else { $filepath = '/hyeri0418/www/files/attach/cards/'.$decklist['main'][$i]['multiverse_id'].'.png'; if(is_file($filepath)) { $decklist['main'][$i]['image_url'] = 'http://mtg-kr.com/files/attach/cards/'.$rowc['multiverse_id_k'].'.png'; } else { $decklist['main'][$i]['image_url'] = "http://gatherer.wizards.com/handlers/Image.ashx?multiverseid=".$rowc['multiverse_id_k']."&type=card"; } } } else { // 영문 이름 넣기 // 혹시 side = a니? if($rowc['side'] == 'a') { $decklist['main'][$i]['name'] = $rowc['name']; // 일단 앞면 이름 넣고 $rowc = $resultc->fetch_assoc(); // 카드 정보 추출 $decklist['main'][$i]['name'] = $decklist['main'][$i]['name']." / ".$rowc['name']; // 다음 뒷면 이름 넣고 } else { $decklist['main'][$i]['name'] = $rowc['name']; } //multiverse_id 넣기 $decklist['main'][$i]['multiverse_id'] = $rowc['multiverse_id']; // 이미지 경로 없으면 임시 넣기 // $gathererpath = "http://gatherer.wizards.com/Handlers/Image.ashx?multiverseid=".$multiverseid."&type=card"; if(!$decklist['main'][$i]['image_url']) { $decklist['main'][$i]['image_url'] = "http://gatherer.wizards.com/handlers/Image.ashx?multiverseid=".$rowc['multiverse_id']."&type=card"; // 파일이 있는지 검사 "http://mtg-kr.com/files/attach/cards/".$rowㅊ['multiverse_id'].".png"; $filepath = '/hyeri0418/www/files/attach/cards/'.$decklist['main'][$i]['multiverse_id'].'.png'; if(is_file($filepath)) { $decklist['main'][$i]['image_url'] = 'http://mtg-kr.com/files/attach/cards/'.$rowc['multiverse_id'].'.png'; } } else { $filepath = '/hyeri0418/www/files/attach/cards/'.$decklist['main'][$i]['multiverse_id'].'.png'; if(is_file($filepath)) { $decklist['main'][$i]['image_url'] = 'http://mtg-kr.com/files/attach/cards/'.$rowc['multiverse_id'].'.png'; } else { $decklist['main'][$i]['image_url'] = "http://gatherer.wizards.com/handlers/Image.ashx?multiverseid=".$rowc['multiverse_id']."&type=card"; } } } $decklist['main'][$i]['cid'] = $rowc['cid']; $maincount = $maincount + $decklist['main'][$i]['no']; } // side 처리 for($i=0;$iquery($queryc)) { echo "데이터베이스가 존재하지 않습니다.
관리자에게 문의하십시오."; mysqli_close($db); exit(); } if($resultc->num_rows == 0) { echo "해당 덱 데이터 베이스가 없습니다.
관리자에 문의하십시오."; exit(); } $rowc = $resultc->fetch_assoc(); // 카드 정보 추출 // 유형 넣기 - 무조건 side $decklist['side'][$i]['type'] = "side"; // 마나 넣기 $decklist['side'][$i]['mana'] = $rowc['mana_cost']; // 이름 넣기 if($rowc['multiverse_id_k']) // 한글판이 있는 카드면 { // 한글 이름 넣기 // 혹시 side = a니? if($rowc['side'] == 'a') { $decklist['side'][$i]['name'] = $rowc['name_k']; // 일단 앞면 이름 넣고 $rowc = $resultc->fetch_assoc(); // 카드 정보 추출 $decklist['side'][$i]['name'] = $decklist['side'][$i]['name']." / ".$rowc['name_k']; // 다음 뒷면 이름 넣고 } else { $decklist['side'][$i]['name'] = $rowc['name_k']; } //multiverse_id_k 넣기 $decklist['side'][$i]['multiverse_id'] = $rowc['multiverse_id_k']; // 이미지 경로 없으면 임시 넣기 // $gathererpath = "http://gatherer.wizards.com/Handlers/Image.ashx?multiverseid=".$multiverseid."&type=card"; if(!$decklist['side'][$i]['image_url']) { $decklist['side'][$i]['image_url'] = "http://gatherer.wizards.com/handlers/Image.ashx?multiverseid=".$rowc['multiverse_id_k']."&type=card"; // 파일이 있는지 검사 "http://mtg-kr.com/files/attach/cards/".$rowㅊ['multiverse_id_k'].".png"; $filepath = '/hyeri0418/www/files/attach/cards/'.$decklist['side'][$i]['multiverse_id'].'.png'; if(is_file($filepath)) { $decklist['side'][$i]['image_url'] = 'http://mtg-kr.com/files/attach/cards/'.$rowc['multiverse_id_k'].'.png'; } } else { $filepath = '/hyeri0418/www/files/attach/cards/'.$decklist['side'][$i]['multiverse_id'].'.png'; if(is_file($filepath)) { $decklist['side'][$i]['image_url'] = 'http://mtg-kr.com/files/attach/cards/'.$rowc['multiverse_id_k'].'.png'; } else { $decklist['side'][$i]['image_url'] = "http://gatherer.wizards.com/handlers/Image.ashx?multiverseid=".$rowc['multiverse_id_k']."&type=card"; } } } else { // 영문 이름 넣기 // 혹시 side = a니? if($rowc['side'] == 'a') { $decklist['side'][$i]['name'] = $rowc['name']; // 일단 앞면 이름 넣고 $rowc = $resultc->fetch_assoc(); // 카드 정보 추출 $decklist['side'][$i]['name'] = $decklist['side'][$i]['name']." / ".$rowc['name']; // 다음 뒷면 이름 넣고 } else { $decklist['side'][$i]['name'] = $rowc['name']; } //multiverse_id 넣기 $decklist['side'][$i]['multiverse_id'] = $rowc['multiverse_id']; // 이미지 경로 없으면 임시 넣기 // $gathererpath = "http://gatherer.wizards.com/Handlers/Image.ashx?multiverseid=".$multiverseid."&type=card"; if(!$decklist['side'][$i]['image_url']) { $decklist['side'][$i]['image_url'] = "http://gatherer.wizards.com/handlers/Image.ashx?multiverseid=".$rowc['multiverse_id']."&type=card"; // 파일이 있는지 검사 "http://mtg-kr.com/files/attach/cards/".$rowㅊ['multiverse_id'].".png"; $filepath = '/hyeri0418/www/files/attach/cards/'.$decklist['side'][$i]['multiverse_id'].'.png'; if(is_file($filepath)) { $decklist['side'][$i]['image_url'] = 'http://mtg-kr.com/files/attach/cards/'.$rowc['multiverse_id'].'.png'; } } else { $filepath = '/hyeri0418/www/files/attach/cards/'.$decklist['side'][$i]['multiverse_id'].'.png'; if(is_file($filepath)) { $decklist['side'][$i]['image_url'] = 'http://mtg-kr.com/files/attach/cards/'.$rowc['multiverse_id'].'.png'; } else { $decklist['side'][$i]['image_url'] = "http://gatherer.wizards.com/handlers/Image.ashx?multiverseid=".$rowc['multiverse_id']."&type=card"; } } } $decklist['side'][$i]['cid'] = $rowc['cid']; $sidecount = $sidecount + $decklist['side'][$i]['no']; } // 코드 작성 $html = "
"; //--------------------------------------------------------------------------------------------------------- // Default // 대지, 생물 - 주문, 사이드 형태로 배치 // 링크 베이스 // http://mtg-kr.com/files/attach/cards/multiverid.png $html = $html.""; $html = $html.""; $html = $html.""; $html = $html.""; $html = $html.""; $html = $html.""; $html = $html.""; //$html = $html.""; $html = $html.""; $html = $html.""; $html = $html.""; $html = $html.""; $html = $html.""; $html = $html."
"; $html = $html."

".$row['title']."

"; $html = $html."

[card]".$decklist['main'][0]['name']."[/card]

"; $html = $html."

[card]".$decklist['main'][1]['name']."[/card]

"; $html = $html."
  메인 덱리스트 - 총 ".$maincount." 장
"; $html = $html."

"; //if($_REQUEST['ad'] != "off") { // Sponsor page. //$html = $html."

Sponsored by

"; //} //$copyclip = ""; //$html = $html."

"; //$html = $html.""; //$html = $html."

"; //$html = $html."
"; // 카드 장수 세기 $leftside = 0; $rightside = 0; $iflag = ""; for($i=0;$i $rightside + count($decklist['side'])) {$iflag = "right";} else {$iflag = "left";} // 카드 목록 출력 시작 // 1. 대지 $count = 0; $lco = 0; // 전체 목록을 대상으로 하나씩 검사 // if land //
// 장수 [tipc]이름[/tipc] mana //
// $count += 장수 $html = $html."
"; for($i=0;$i"; $html = $html." ".$decklist['main'][$i]['no']." "; if(!Mobile::isMobileCheckByAgent()) $html = $html."[tipc]".$decklist['main'][$i]['name']."[/tipc]"; else $html = $html."".$decklist['main'][$i]['name'].""; if(!Mobile::isMobileCheckByAgent()) $html = $html."".$decklist['main'][$i]['mana']." "; $html = $html."
"; $count = $count + $decklist['main'][$i]['no'];; $lco++; } } $html = $html."-----
대지 총 ".$count."
"; $html = $html.""; // 2. 생물 $count = 0; $cco = 0; // if creature // $cardname = 이름 // $cardlink = "".$cardname."".""; // $html = $html."".장수." ".$cardlink."
"; // $count += 장수 $html = $html."
"; for($i=0;$i"; $html = $html." ".$decklist['main'][$i]['no']." "; $html = $html."[tipc]".$decklist['main'][$i]['name']."[/tipc]"; $html = $html."".$decklist['main'][$i]['mana']." "; $html = $html."
"; $count = $count + $decklist['main'][$i]['no'];; $cco++; } } $html = $html."-----
생물 총 ".$count."
"; $html = $html.""; if($iflag == "left"){ $html = $html."
"; $html = $html."

덱리스트 출력

매직 온라인 & Arena

"; $html = $html.""; $html = $html.""; $html = $html.""; $html = $html.""; $html = $html.""; $html = $html.""; $html = $html."

"; $html = $html."
"; } $html = $html."
"; // 3. 주문 $count = 0; $sco = 0; $html = $html."
"; for($i=0;$i"; $html = $html." ".$decklist['main'][$i]['no']." "; $html = $html."[tipc]".$decklist['main'][$i]['name']."[/tipc]"; $html = $html."".$decklist['main'][$i]['mana']." "; $html = $html."
"; $count = $count + $decklist['main'][$i]['no'];; $sco++; } } $html = $html."-----
주문 총 ".$count."
"; $html = $html.""; // 4. 사이드보드 $count = 0; $sideco = 0; $html = $html."
"; $html = $html."
  사이드보드
"; for($i=0;$i"; $html = $html." ".$decklist['side'][$i]['no']." "; $html = $html."[tipc]".$decklist['side'][$i]['name']."[/tipc]"; $html = $html."".$decklist['side'][$i]['mana']." "; $html = $html."
"; $count = $count + $decklist['side'][$i]['no'];; $sideco++; } $html = $html."-----
사이드보드 총 ".$count."
"; $html = $html.""; if($iflag == "right"){ $html = $html."
"; $html = $html."

덱리스트 출력

매직 온라인 & Arena

"; $html = $html.""; $html = $html.""; $html = $html.""; $html = $html.""; $html = $html.""; $html = $html.""; $html = $html."

"; $html = $html."
"; } $html = $html."
.$info.
"; $html = $html.""; return $html; } function parsingdeck($htmlpage) { $db = new mysqli('localhost', 'hyeri0418', 'Music0418', 'hyeri0418'); //mysql 열기 성공 체크 if(mysqli_connect_errno()) { echo 'DBERROR'; mysqli_close($db); exit; } if(strpos($htmlpage, "(404)")) { echo "error reading pages"; return; } //1. MTGO Decklist 받아오기 $dcarr = trim($htmlpage); // 임시 $flist = array(); // 최종 데이터 배열 $flistcount = 0; // 카운터 //2. 각 라인별로 파싱하기 $parseline = explode("\n", $dcarr); // 줄별로 잘라서 배열 넣기 for($i=0;$i 아니면 에러메시지 보내고 종료 // if(!is_numeric($cnum)) { echo $i+1."행에 문제가 있습니다."; exit;} // multiverse_id_k가 존재하는 $canme을 조회 $cname 을 DB에서 조회 multiverse_id_k 내림차순 $query = "select * from xe_mtga_cards where CHAR_LENGTH(code) <= 3 and name = '".addslashes($cname)."' and multiverse_id_k > 0 and is_online_only = 'N' and (side = 'a' or side IS NULL) order by arenaid DESC"; if(!$resultd = $db->query($query)) { echo "DB error. fileload1"; mysqli_close($db); exit(); } // 있으면 가장 위에 있는 값 집어 넣고 // 없으면 multiverse_id 내림차순으로 조회하고 가장 위에 있는 값 넣기 if($resultd->num_rows > 0) { $rowe = $resultd->fetch_assoc(); // main, side -> no, code, number, oid, color, name, image_url // http://mtg-kr.com/files/attach/cards/465724.png $flist[$flistcount]['no'] = $cnum; $flist[$flistcount]['name'] = $rowe['name']; $flist[$flistcount]['cid'] = $rowe['cid']; $flist[$flistcount]['color'] = $rowe['colors']; $flist[$flistcount]['code'] = $rowe['code']; $flist[$flistcount]['cmc'] = $rowe['converted_mana_cost']; $flist[$flistcount]['number'] = $rowe['number']; $flist[$flistcount]['image_url'] = $rowe['image_url']; //"http://mtg-kr.com/files/attach/cards/".$rowe['multiverse_id_k'].".png"; $flistcount++; } else { // multiverse_id_k가 없으니까 // multiverse_id가 존재하는 $canme을 조회 $cname 을 DB에서 조회 multiverse_id 내림차순 $query = "select * from xe_mtga_cards where CHAR_LENGTH(code) <= 3 and name = '".addslashes($cname)."' and multiverse_id > 0 and is_online_only = 'N' and (side = 'a' or side IS NULL) order by multiverse_id DESC "; if(!$resultd = $db->query($query)) { echo "DB error. fileload"; mysqli_close($db); exit(); } // 있으면 가장 위에 있는 값 집어 넣고 if($resultd->num_rows > 0) { $rowe = $resultd->fetch_assoc(); $flist[$flistcount]['no'] = $cnum; $flist[$flistcount]['name'] = $rowe['name']; $flist[$flistcount]['cid'] = $rowe['cid']; $flist[$flistcount]['color'] = $rowe['colors']; $flist[$flistcount]['cmc'] = $rowe['converted_mana_cost']; $flist[$flistcount]['code'] = $rowe['code']; $flist[$flistcount]['number'] = $rowe['number']; $flist[$flistcount]['image_url'] = $rowe['image_url']; //"http://mtg-kr.com/files/attach/cards/".$rowe['multiverse_id'].".png"; $flistcount++; } } // 근데 그 마저도 없으면($flist[$i]['no'] == "") 에러 -> 에러메시지 송신 if($flist[$i]['no'] == "") { // 데이터를 못 받았다는 의미 echo ($i+1)."행에 문제가 있습니다.(b)"; //print_r($parseline); //이 자동 업데이트에 한해서는 페이지를 못 읽어 들이면 해당 부분 패스 return "0"; exit; } } // 빈줄 처리용 (사이드보드 경계) else { $flist[$flistcount]['no'] = ""; $flist[$flistcount]['name'] = ""; $flist[$flistcount]['code'] = ""; $flist[$flistcount]['number'] = ""; $flistcount++; } } return $flist; } ?>