//======================================== // dehead(config/function/lib) Include //======================================== include $_SERVER['DOCUMENT_ROOT']."/front/include/dehead.php"; require PATH_LIB."naverLogin.php"; //======================================== // Meta Tag //======================================== $metaAdd = ($sc) ? "self_list_".$sc : "self_list"; $metaTitle = $metaInfo[$metaAdd]['title']; $metaDescription = $metaInfo[$metaAdd]['description']; $metaKeyword = $metaInfo[$metaAdd]['keyword']; $metaImage = $metaInfo[$metaAdd]['image']; //======================================== // Naver Auth //======================================== $naver = new Naver(array( "CLIENT_ID" => NAVER_LOGIN_ID, // (*필수)클라이언트 ID "CLIENT_SECRET" => NAVER_LOGIN_SECRET, // (*필수)클라이언트 시크릿 "RETURN_URL" => NAVER_LOGIN_REDIRECT_URL, // (*필수)콜백 URL "AUTO_CLOSE" => true, // 인증 완료후 팝업 자동으로 닫힘 여부 설정 (추가 정보 기재등 추가행동 필요시 false 설정 후 추가) "SHOW_LOGOUT" => false // 인증 후에 네이버 로그아웃 버튼 표시/ 또는 표시안함 ) ); //======================================== // Class Connect //======================================== $Db = new Db(); // 데이터 베이스 클래스 //======================================== // Data Process //======================================== $rowCount = $pageInfo['epilogueA']['rowCount']; // 한 페이지에 보여질 게시물 수 $startNum = ($page - 1) * $rowCount; // limit 시작 위치 $param = array('no' => PARAMETER_NO, 'show' => PARAMETER_Y, 'del' => PARAMETER_N, 'sort' => "A"); //======================================== // Search Query //======================================== if($sc){ $param['category1'] = $sc; $param['category2'] = $Db->likeify($categoryArr[$sc]); $searchINS .= " AND (category = :category1 OR tag LIKE :category2)"; } if($sk){ if($sf){ $param['keyword'] = $Db->likeify($sk); } else { $param = array_merge($param, array( 'keyword_title' => $Db->likeify($sk), 'keyword_content' => $Db->likeify($sk) )); } $searchINS .= ($sf) ? " AND $sf LIKE :keyword" : " AND (title LIKE :keyword_title AND content LIKE :keyword_content)"; } if($st){ $param['tag'] = $Db->likeify($st); $searchINS .= " AND tag LIKE :tag"; } if($sb){ $param['best'] = $sb; $searchINS .= " AND best = :best"; } //20170530 임의묶음용 sct변수 추가 if($sct){ if($sct == 1){ $searchINS .= ' AND (no = 2417 OR no = 2431 OR no = 2369 OR no = 2424)'; }else if($sct == 2){ $searchINS .= ' AND (no = 2451 OR no = 1694 OR no = 1489)'; }else if($sct == 3){ $searchINS .= ' AND (no = 875 OR no = 2260 OR no = 2342)'; } } $orderINS .= ($sd) ? "$sd DESC" : "insert_date DESC"; $addPath = "&sc=$sc&sd=$sd&st=$st&sf=$sf&sk=$sk&sb=$sb"; //======================================== // Data Load //======================================== //20170530 sct적용시 베스트 없애기위해 조건추가 if(!$sct){ if($sb == "" || $sb == "N"){ $bestParam = array_merge($param, array('best' => PARAMETER_Y)); $best = $Db->query("SELECT no, store, insert_date, name, title, content, hit FROM $TABLE_EPILOGUE WHERE no > :no AND d_show = :show AND del = :del AND sort = :sort AND best = :best $searchINS ORDER BY insert_date DESC LIMIT 5", $bestParam); foreach ($best as $key => $val){ $strTmp .= $val['no'].","; } $noStr = ($best) ? "AND no NOT IN (".substr($strTmp, 0, -1).")" : ""; } else { $noStr = ""; } }else{ $best = array(); } $totalCount = $Db->single("SELECT COUNT(*) FROM $TABLE_EPILOGUE WHERE no > :no AND d_show = :show AND del = :del AND sort = :sort $noStr $searchINS", $param); $totalPages = ceil($totalCount / $rowCount); $param = array_merge($param, array('startNum' => $startNum, 'rowCount' => $rowCount)); $list = $Db->query("SELECT no, best, store, insert_date, name, title, content, hit FROM $TABLE_EPILOGUE WHERE no > :no AND d_show = :show AND del = :del AND sort = :sort $noStr $searchINS ORDER BY $orderINS LIMIT :startNum, :rowCount", $param); $keyword = explode("|", $Db->single("SELECT keyword FROM $TABLE_KEYWORD WHERE code = :code", array('code' => "B"))); $Db->CloseConnection; for($i=0; $i<4; $i++){ $countCut[$i] = mb_substr(sprintf("%04d", $totalCount), $i, 1); } //======================================== // header Include //======================================== include PATH_INCLUDE."header.php"; ?> if(bip == 'Y'){ ?> }?>