채택완료

게시판 검색에서 전체 검색 분류 추가

2023-07-21 (금) 13:20:24 2,659

게시판 검색에서 

<?php echo get_board_sfl_select_options($sfl); ?>

검색 옵션에 전체 검색도 추가하고 싶은데 방법이 있을까요?

검색옵션 : 

전체 

제목

내용

제목+내용

Copy
function get_board_sfl_select_options($sfl){

global $is_admin;

$str = '';

$str .= '<option value="wr_subject" '.get_selected($sfl, 'wr_subject', true).'>제목</option>';

$str .= '<option value="wr_content" '.get_selected($sfl, 'wr_content').'>내용</option>';

$str .= '<option value="wr_subject||wr_content" '.get_selected($sfl, 'wr_subject||wr_content').'>제목+내용</option>';

if ( $is_admin ){

$str .= '<option value="mb_id,1" '.get_selected($sfl, 'mb_id,1').'>회원아이디</option>';

$str .= '<option value="mb_id,0" '.get_selected($sfl, 'mb_id,0').'>회원아이디(코멘트)</option>';

}

$str .= '<option value="wr_name,1" '.get_selected($sfl, 'wr_name,1').'>글쓴이</option>';

$str .= '<option value="wr_name,0" '.get_selected($sfl, 'wr_name,0').'>글쓴이(코멘트)</option>';

 

return run_replace('get_board_sfl_select_options', $str, $sfl);

}
|

답변 2개 / 댓글 2개

채택된 답변
+20 포인트

 $str = ''; ==>  $str = "<option value=''>전체</option>";

답변에 대한 댓글 1개

wr_subject||wr_content
구분값 || 을 주면서 적용하면 되는군요! 감사합니다.
2023-07-21 (금) 17:27:07

저거 배열이 들어간게 아니라서 그냥 $str 필드를 넣어서 수정 하면될것같아요

답변에 대한 댓글 1개

감사합니다.!

답변을 작성하려면 로그인이 필요합니다.