alert('검색어가 없습니다.');history.go(-1);";exit; } if(eregi('%',$S_word) || eregi(',',$S_word) || eregi('\.',$S_word)) { echo(""); exit; }else if(mb_strlen($S_word, "euc-kr") < 2){ echo(""); exit; } //현재 접속자수 체크 include "$DOCUMENT_ROOT/seyul_counter/now_count.php"; $dist_text=$S_text; //밑에 인클루드 땜시. 여기서 선언... ################################################################################ //검색시 검색어 실시간 저장 if($S_gu =='통합' && $S_word){ $S_text=$S_word; if($keyworx){//쿠키가 있을때.. if($keyworx == $S_text){ setcookie(keyworx, $S_text, "0","/"); }else{ setcookie(keyworx, $S_text, "0","/"); include "$DOCUMENT_ROOT/search_word/N_search_array_save.php"; } }else {//쿠키가 없을때.. setcookie(keyworx, $S_text, "0","/"); include "$DOCUMENT_ROOT/search_word/N_search_array_save.php"; } } //검색어 실시간 접속 끝!! ###############나의 검색어 쿠키 굽기....############################################ if($category || $S_word){ //검색결과가 10개 넘을경우 다음페이지를 볼때 제외... if(!$start_p){ $My_S_Word[6]=$category."|".$city."|".$S_gu."|".$S_word; for($i=1;$i <= 5;$i++){ if($My_S_Word[$i]){ }else{ setcookie("My_S_Word[".$i."]", $My_S_Word[6], time()+3600, '/'); $My_S_Word[$i]=$My_S_Word[6]; $i=$i+5; } } //첫번째 for문.. //다섯개 다있으면 로테이션.... if($My_S_Word[5]){ $My_S_Word[5]=$My_S_Word[6]; for($i=1;$i <= 5;$i++){ setcookie("My_S_Word[".$i."]", $My_S_Word[$i+1], time()+3600, '/'); } // setcookie("My_S_Word[5]", $My_S_Word[6], time()+3600, '/'); } }//검색결과가 ~ 끝!! for($i=1;$My_S_Word[$i];$i++){ $My_X_Word=explode("|",$My_S_Word[$i]); if(!$My_X_Word[3]){ $My_Word=$My_X_Word[4]; }else{ $My_Word=$My_X_Word[3]; } $My_V_Word[$i] = "".$My_Word.""; } } //나의 검색어 쿠키 굽기 끝!! ################################################################################ ####################불러올동안 보여주기~~~~################################ /* echo " "; ob_start(); // 출력 버퍼를 켬 */ ############################################################################## //search폼 echo "".$S_word." - 도우미114!!"; echo "
"; include "../include/top_new.htm"; echo"
"; include "search.html"; echo "
"; //echo $catecory."/".$city."/".$S_gu."/".$S_word; ##### 데이터베이스 연결 $conn = @mysql_connect(localhost, doumy, ehdnal114) or die('디비 접속 오류!!'); ##### 데이터베이스 선택 $db = mysql_select_db(doumy) or die('디비 선택 오류!!'); ########## 조건에 따른 질의부분..########### if($category=='aa') {$category='서울';} if($category=='bb') {$category='대전';} if($category=='cc') {$category='대구';} if($category=='dd') {$category='부산';} if($category=='ee') {$category='인천';} if($category=='ff') {$category='광주';} if($category=='gg') {$category='울산';} if($category=='hh') {$category='경기';} if($category=='ii') {$category='강원';} if($category=='jj') {$category='충북';} if($category=='kk') {$category='충남';} if($category=='ll') {$category='경북';} if($category=='mm') {$category='경남';} if($category=='nn') {$category='전북';} if($category=='oo') {$category='전남';} if($category=='pp') {$category='제주';} if($category=='지역선택') {$category='';} if($city=='세부선택') {$city='';} ########한글자르기.... function kstrcut($str, $len) //뒤자르기 { if ($len >= strlen($str)) return $str; $klen = $len - 1; while(ord($str[$klen]) & 0x80) $klen--; return substr($str, 0, $len - (($len + $klen + 1) % 2)); } function kstrcut1($str) //앞자르기 { $str = substr($str,1); $klen = strlen($str); $i=0; while(ord($str[$i]) & 0x80) $i++; return $str; } ##### 쿼리 만들기.... if($S_word != '주변맛집' && $S_word != '주변숙박'){ if($category != "지역선택" && $category){ $Q_txt="(jiyuk = 'all' or jiyuk like '%$category%')"; } if($city != "세부선택" && $city){ $Q_txt=$Q_txt." and (jiyuk = 'all' or addr like '%$city%') "; } }else{ if($category != "지역선택" && $category){ $Q_txt="(jiyuk like '%$category%')"; } if($city != "세부선택" && $city){ $Q_txt=$Q_txt." and (addr like '%$city%') "; } } if($S_word){ if($Q_txt){$Q_txt = $Q_txt." and ";} if($S_gu == '통합'){ if($S_word == '주변맛집'){ //주변맛집 검색시... $Q_txt=$Q_txt."(upjong like '%식당%' or upjong like '%음식점%' or upjong like '%맛집%')"; }else if($S_word == '주변숙박'){//주변숙박 검색시.. $Q_txt=$Q_txt."(upjong like '%민박%' or upjong like '%모텔%' or upjong like '%호텔%' or upjong like '%펜션%')"; }else{ if(strlen($S_word) >=8){ $S_word_gu = substr($S_word,0,4); $S_word_gu_1 = substr($S_word,4); $S_word_gu1 = substr($S_word,0,6); $S_word_gu1_1 = substr($S_word,6); //검색어가 홀수일때 글자깨짐현상으로 한글자르기..... 함수 kstrcut, kstrcut1 if(strlen($S_word) % 2 != '0'){ $S_word_gu = kstrcut($S_word,4); // $S_word_gu_1 = kstrcut1($S_word_gu_1); $S_word_gu1 = kstrcut($S_word,6); $S_word_gu1_1 = kstrcut1($S_word_gu1_1); } $Q_city1=" or (addr like '%$S_word_gu%' and (title like '%$S_word_gu_1%' or upjong like '%$S_word_gu_1%')) or tel1 like '%$S_word%' or tel2 like '%$S_word%'"; if(strlen($S_word_gu1_1) >=4){ $Q_city2=" or (addr like '%$S_word_gu1%' and (title like '%$S_word_gu1_1%' or upjong like '%$S_word_gu1_1%')) or tel1 like '%$S_word%' or tel2 like '%$S_word%'"; } } // $Q_txt=$Q_txt."(title like '%$S_word%' or upjong like '%$S_word%')"; $Q_txt=$Q_txt."(title like '%$S_word%' or upjong like '%$S_word%')".$Q_city1.$Q_city2; } }else if($S_gu == '상호'){ $Q_txt=$Q_txt."(title like '%$S_word%')"; }else if($S_gu == '업종'){ $Q_txt=$Q_txt."(upjong like '%$S_word%')"; }else if($S_gu == '주소'){ $Q_txt=$Q_txt."(addr like '%$S_word%')"; }else if($S_gu == '품목'){ $Q_txt=$Q_txt."(comment1 like '%$S_word%')"; }else if($S_gu == '전화'){ $Q_txt=$Q_txt."(tel1 like '%$S_word%' or tel2 like '%$S_word%' or no_tel like '%$S_word%')"; }else if($S_gu == '여행'){ $Q_txt=$Q_txt."(thema = '$S_word' or title like '%$S_word%' or comment like '%$S_word%')"; } } if($L_chk == 'T_L'){ echo ""; } //카테고리에서 검색 되어왔을때.... if($Cate_No){ $Q_txt="category = '$Cate_No'"; } ##### 검색!! $limit_time1=date("Ymd H시 i분", mktime(date("H"),date("i"),0,date("m")-3,date("d"),date("Y")-2)); //관리자가 아닐때... 네이버등록광고는 검색안됨!! if(!($doumy_super_admin == 'best' || $doumy_super_admin =='good')){ $Q_admin = "and d_day like '%D'"; }else{ $Q_admin = ""; } if($S_gu == '여행'){ $query="select count(no) from tour where $Q_txt "; }else{ // $query="select count(no) from doumy_data where ($Q_txt) and view = 'yes' and in_day >= '$limit_time1' and (ad_no not like 'Z%' and ad_no not like 'z%')"; // $query="select count(no) from doumy_data where ($Q_txt) and view = 'yes' and in_day >= '$limit_time1' $Q_admin"; // 전부검색되게(기간만료건까지) $query="select count(no) from doumy_data where ($Q_txt)"; } $res = mysql_query($query); if(!$res){ echo $query; } $tot=mysql_fetch_row($res); $P_su=10; $paging=$tot[0] / $P_su; if(!$S_no){ $S_no=0; } if($S_gu == '여행'){ $result1 = mysql_query("select * from tour where $Q_txt order by no desc limit $S_no, $P_su"); }else{ // $result1 = mysql_query("select ad_no, title, upjong, jiyuk, addr, homepage, map, back_no, id from doumy_data where ($Q_txt) and view = 'yes' and in_day >= '$limit_time1' and (ad_no not like 'Z%' and ad_no not like 'z%') $Q_admin order by in_day desc, title asc, upjong asc limit $S_no, $P_su"); // 전부검색되게(기간만료건까지) $result1 = mysql_query("select ad_no, title, upjong, jiyuk, addr, homepage, map, back_no, id, in_day, d_day from doumy_data where ($Q_txt) order by in_day desc, title asc, upjong asc limit $S_no, $P_su"); } //스타일시트 echo" "; //새창띄우기 echo""; echo "
"; echo "
"; ######추천광고!! if($S_gu != '여행'){//여행지 검색이 아닐때만 추천광고 나타내기..... $S_word_ok=trim($S_word); $limit_time=date("Y-m-d"); $reco=mysql_query("select * from doumy_reco where AD_Posi = 'Sear' && limit_date >= '$limit_time' && upjong like '%$S_word_ok%' "); if($S_word){ $res_reco=mysql_num_rows($reco); }else{ $res_reco=0; } //추천업체등록하기 링크정의 if($res_reco < 4){ $rec_link="+ 추천업체 등록신청 +"; }else{ $rec_link="+ 추천업체 등록신청 +"; } echo ""; echo ""; if($res_reco>0){ $ti=1; while($res2row=mysql_fetch_array($reco)){ if($ti%2=='1'){ echo ""; } else { echo ""; } $ti++; }//while닫기. }else {///$res_reco 제어닫기 //echo ""; } echo "
추천업체".$rec_link."    
"; } else{ echo ""; } $res2row[title]=strip_tags($res2row[title]); // $res2row[upjong]=strip_tags($res2row[upjong]); $res2row[upjong]=$res2row[upjong]; if($res2row[jiyuk]=='all')$res2row[jiyuk]="전국"; if($res2row[direct_link] =='y' && $res2row[homepage]){ $add_link=$res2row[homepage]; }else{ $add_link="../ad_page/?id=$res2row[id]"; } echo "
- $res2row[title]
- $res2row[upjong]
- $res2row[tel]  [$res2row[jiyuk]]
"; if($ti%2=='1'){ echo "
→ 검색어 '".$S_word."'에 대한 추천광고가 없습니다.
"; echo "
"; ######플러스광고 & 카테고리 /* echo "

  플러스광고

"; if($S_word){ include "A_plus_search.php"; } echo "
"; */ /* 애드센스 지움 echo " "; echo "
"; */ /* echo "

플러스광고                        + 플러스광고 등록신청 +

"; if($S_word){ include "A_plus_search.php"; } echo "

카테고리 검색

"; if($S_word){ include "A_cate_search_N.php"; } echo "
"; echo "
"; */ }//플러스 및 카테고리 광고 끝!!! ######배달업체 광고 /* echo "

배달업체

"; if($S_word){ include "A_book_search.php"; } echo "
"; echo "
"; //배달업체광고 끝!!! */ //비즈광고 테이블나누기 //echo "
"; echo "
"; ######비즈광고(일반 광고) if($S_gu == '여행'){ $S_sub=''; }else{ $S_sub='일반업체'; } if($category && $S_gu == '여행' && !$S_word){ $S_word1 = $category; }else{ $S_word1 = $S_word; } /* echo "
"; */ echo "

"; echo "".$S_sub." "; echo "'".$S_word1."' 에 대한 ".$S_gu."검색결과입니다

"; // 에서 ".$tot[0]."건이 검색되었습니다.

"; if($tot[0] == '0'){ echo"

♣ 검색결과가 없을 경우
지역 + 업종 으로 검색하실 경우 
동이나 리 등은 넣지 마시고 검색바랍니다.

  예) 서울인테리어, 서울시인테리어, 강서구인테리어, 방화동인테리어, 방화인테리어
 
  +
틀린검색어 ) 방화1동인테리어, 문화1동꽃집, 동막1리설비
  +
바른검색어 ) 방화인테리어,       문화꽃집,       동막설비

전화번호 로 검색하실 경우
'-' 를 꼭 사용하시기 바랍니다.

  +
틀린검색어 ) 023456789, 3456789
  +
바른검색어 ) 02-345-6789, 345-6789 

"; } //번호매기기 $start_p $start_no=$S_no+1; echo "

    "; for($i=0;$i<$P_su;$i++){ $row[$i]=mysql_fetch_array($result1); //url정확하게 구하기.. if($row[$i][back_no] >= 1 && $row[$i][back_no] <= 4) {$ad_url[$i]='';} else if($row[$i][back_no] >= 5 && $row[$i][back_no] <= 8) {$ad_url[$i]='new/';} else if($row[$i][back_no] == 9) {$ad_url[$i]='new1/';} else if($row[$i][back_no] == 10) {$ad_url[$i]='new2/';} else if($row[$i][back_no] == 11) {$ad_url[$i]='new3/';} else if($row[$i][back_no] == 12) {$ad_url[$i]='new4/';} else if($row[$i][back_no] == 13) {$ad_url[$i]='new5/';} else if($row[$i][back_no] == 14) {$ad_url[$i]='new6/';} else if($row[$i][back_no] == 15) {$ad_url[$i]='new7/';} else if($row[$i][back_no] == 16) {$ad_url[$i]='new8/';} ###########################광고기간 + 1개월 끝났으면 링크없애기############## $E_day = explode("|", $row[$i][d_day]); $E_year = $E_day[0]; $E_month1 = explode(".", $E_day[0]); if(!$E_month1[1]){ $E_month1[1] = 0; } $E_month = $E_month1[1] + 1; $in_day1=substr($row[$i][in_day],0,4)."년 ".substr($row[$i][in_day],4,2)."월 ".substr($row[$i][in_day],6,2)."일 "; $in_day2 = date("Y/m/d", mktime(0,0,0,substr($row[$i][in_day],4,2) + $E_month, substr($row[$i][in_day],6,2), substr($row[$i][in_day],0,4) + $E_year)); if(date("Y/m/d") > $in_day2){ $ad_link11[$i] = ' [만료]'; } if(!($doumy_super_admin || $doumy_card_super) && date("Y/m/d") > $in_day2){ $ad_link00[$i] = 'Y'; } #################################################################### if($S_gu == '여행'){ $ad_url[$i] = '/Tour/tour_view_new.php?code='.$row[$i][no]; $row[$i][id] = 'www'; $row[$i][jiyuk] = '추천여행지'; $row[$i][upjong] = $row[$i][addr]; $row[$i][homepage] = $row[$i][hompy]; $target='_parent'; }else{ $ad_url[$i] = ''; $target='_blank'; } if(eregi(""; $homelink[$i]="yes"; }else{ if($ad_link00[$i] == 'Y'){ $passurl[$i]=$ad_url[$i]; }else{ $passurl[$i]=""; } $homelink[$i]="no"; } //상호 테그 없애기.. $row[$i][title]=strip_tags($row[$i][title]); //검색단어 굵게 if($S_word){ $row[$i][upjong]= str_replace($S_word,"".$S_word."", $row[$i][upjong]); $row[$i][title]= str_replace($S_word,"".$S_word."", $row[$i][title]); } if($S_word_gu_1){ $row[$i][upjong]= str_replace($S_word_gu_1,"".$S_word_gu_1."", $row[$i][upjong]); // $row[$i][title]= str_replace($S_word_gu_1,"".$S_word_gu_1."", $row[$i][title]); } if(strlen($S_word_gu1_1) >=4){ $row[$i][upjong]= str_replace($S_word_gu1_1,"".$S_word_gu1_1."", $row[$i][upjong]); $row[$i][title]= str_replace($S_word_gu1_1,"".$S_word_gu1_1."", $row[$i][title]); } if($row[$i][title]){ echo "
  1. "; echo $passurl[$i]."".$row[$i][title].""; //약도체크 if($row[$i][map] && $ad_link00[$i] != 'Y'){ if($S_gu != '여행'){ if($row[$i][back_no] <= '15'){ echo"  [지도]"; }else{ echo"  [지도]"; } }else{ echo"  [지도]"; } } //즐겨찾기 if($ad_link00[$i] != 'Y'){ $row[$i][title]=strip_tags($row[$i][title]); if($row[$i][jiyuk] == 'all'){$row[$i][jiyuk] = '전국';} echo "  <".$row[$i][jiyuk].">  [즐겨찾기]"; } //경로 if(substr($row[$i][ad_no],0,1) == 'Z' || substr($row[$i][ad_no],0,1) == 'z'){$Z_addr[$i] = $row[$i][addr]."> ";} echo "
    ".$Z_addr[$i].$row[$i][upjong].""; //홈피체크 if($row[$i][homepage]){ echo "
    ".$row[$i][homepage].""; } //홈피바로링크시 웹광고 url은 지워요~~~ if($homelink[$i] == 'no' && $ad_link00[$i] != 'Y' ){ echo "
    http://".$row[$i][id].".doumy114.com".$ad_url[$i]."".$ad_link11[$i]."

    "; }else{ echo "

    "; } }else{ break; } }//루프종료 echo "
"; ?>
"; //지역 배너광고 파일 불러오기 include "banner_jiyuk.php"; */ //echo ""; echo ""; //배너광고 파일 불러오기 include "banner.php"; /* 애드센스 지움 echo "

"; */ echo "

"; echo "
"; $question="S_gu=$S_gu&S_word=$S_word&city=$city&category=$category&q=$q&Cate_No=$Cate_No"; //페이징한 숫자 보여주기... if(!$N_list){ $N_list=0; } if(!$P_list){ $P_list=0; } if($paging >10){ $T_page=10; if($P_list>0){ $PP=""; } if($N_list < ($tot[0]/100-1)){ $PN=""; } if($N_list == (int)($tot[0]/100)){ $T_page=(int)($tot[0]%100)/10; } }else{ $T_page=$paging; } $N_p="다음 10개"; $P_p="이전 10개"; echo"
"; //이전리스트 echo $PP.$P_p." "; echo ""; echo "

"; for($i=0;$i<$T_page;$i++){ $bbb=($i+1+($N_list*10)); if($S_no != (($i+1+($N_list*10))-1)*10){ echo " [".$bbb."] "; }else{ echo " ".$bbb." "; } } echo "

"; //다음 리스트 echo $PN.$N_p." "; echo "
"; //최상위 테이블 닫기 echo "
"; ?>
"; include "../include/bottom_new.htm"; echo"
"; ?> "; ob_end_flush(); // 버퍼의 내용을 출력한 후 현재 출력 버퍼를 종료 */ ?>