채택완료
특정게시판만 제목과 내용검색안되게 할려고하는데..ㅜㅜ
search.php 파일에서 특정 게시판만 제목과 내용이 검색 안되게 할려고 합니다.
아래 소스에 무었을 해야 하는지 알려주시면 정말 감사 하겠습니다.
case 'wr_subject' :
case 'wr_content' :
if (preg_match("/[a-zA-Z]/", $search_str))
$str .= "INSTR(LOWER({$field[$k]}), LOWER('{$search_str}'))";
else
$str .= "INSTR({$field[$k]}, '{$search_str}')";
break;
|
답변 4개
채택된 답변
+20 포인트
그냥 해당 스킨의 list.skin.php파일이보시면
Copy
<!-- 게시판 검색 시작 { --> <fieldset id="bo_sch"> <legend>게시물 검색</legend> <form name="fsearch" method="get"> <input type="hidden" name="bo_table" value="<?php echo $bo_table ?>"> <input type="hidden" name="sca" value="<?php echo $sca ?>"> <input type="hidden" name="sop" value="and"> <label for="sfl" class="sound_only">검색대상</label> <select name="sfl" id="sfl" > <option value="wr_subject"<?php echo get_selected($sfl, 'wr_subject', true); ?>>제목</option> <option value="wr_content"<?php echo get_selected($sfl, 'wr_content'); ?>>내용</option> <option value="wr_subject||wr_content"<?php echo get_selected($sfl, 'wr_subject||wr_content'); ?>>제목+내용</option> <option value="mb_id,1"<?php echo get_selected($sfl, 'mb_id,1'); ?>>회원아이디</option> <option value="mb_id,0"<?php echo get_selected($sfl, 'mb_id,0'); ?>>회원아이디(코)</option> <option value="wr_name,1"<?php echo get_selected($sfl, 'wr_name,1'); ?>>글쓴이</option> <option value="wr_name,0"<?php echo get_selected($sfl, 'wr_name,0'); ?>>글쓴이(코)</option> </select> <label for="stx" class="sound_only">검색어<strong class="sound_only"> 필수</strong></label> <input type="text" name="stx" value="<?php echo stripslashes($stx) ?>" required id="stx" class="frm_input required" size="26" maxlength="20"> <input type="submit" value="검색" class="btn_submit"> </form> </fieldset> <script type="text/javascript"> $('#sfl').fancySelect(); </script> <!-- } 게시판 검색 끝 -->
검색 폼이있는데
여기중간에
Copy
<option value="wr_subject"<?php echo get_selected($sfl, 'wr_subject', true); ?>>제목</option> <option value="wr_content"<?php echo get_selected($sfl, 'wr_content'); ?>>내용</option> <option value="wr_subject||wr_content"<?php echo get_selected($sfl, 'wr_subject||wr_content'); ?>>제목+내용</option>
여기부분을 특정 게시판일때에 없애면 되는거 아닌가요?
저부분을 없애면 제목,내용등으로 검색을 못하니깐 동일한 말씀같습니다.
search.php의 코어쪽을 건들여서 수정하는것보다
skin에서 수정하시는게 더 안전하기도 하지요
Copy
<?if($bo_table != '게시판명')?><option value="wr_subject"<?php echo get_selected($sfl, 'wr_subject', true); ?>>제목</option> <option value="wr_content"<?php echo get_selected($sfl, 'wr_content'); ?>>내용</option> <option value="wr_subject||wr_content"<?php echo get_selected($sfl, 'wr_subject||wr_content'); ?>>제목+내용</option><?}?>
이렇게하면 특정 게시판 에는 select option이 안보일껍니다.
답변을 작성하려면 로그인이 필요합니다.