1:1문의에 제목, 내용, 글쓴이, 회원아이디 선택후 검색이 가능하도록 수정 (북마크스님,210812)
This commit is contained in:
@ -58,11 +58,29 @@ if(is_file($skin_file)) {
|
|||||||
|
|
||||||
$stx = trim($stx);
|
$stx = trim($stx);
|
||||||
if($stx) {
|
if($stx) {
|
||||||
if (preg_match("/[a-zA-Z]/", $stx))
|
$sfl = trim($sfl);
|
||||||
$sql_search .= " and ( INSTR(LOWER(qa_subject), LOWER('$stx')) > 0 or INSTR(LOWER(qa_content), LOWER('$stx')) > 0 )";
|
if ($sfl) {
|
||||||
else
|
switch ($sfl) {
|
||||||
$sql_search .= " and ( INSTR(qa_subject, '$stx') > 0 or INSTR(qa_content, '$stx') > 0 ) ";
|
case "qa_subject" :
|
||||||
|
case "qa_content" :
|
||||||
|
case "qa_name" :
|
||||||
|
case "mb_id" :
|
||||||
|
break;
|
||||||
|
default :
|
||||||
|
$sfl = "qa_subject";
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$sfl = "qa_subject";
|
||||||
|
}
|
||||||
|
$sql_search .= " and (`{$sfl}` like '%{$stx}%') ";
|
||||||
}
|
}
|
||||||
|
// $stx = trim($stx);
|
||||||
|
// if($stx) {
|
||||||
|
// if (preg_match("/[a-zA-Z]/", $stx))
|
||||||
|
// $sql_search .= " and ( INSTR(LOWER(qa_subject), LOWER('$stx')) > 0 or INSTR(LOWER(qa_content), LOWER('$stx')) > 0 )";
|
||||||
|
// else
|
||||||
|
// $sql_search .= " and ( INSTR(qa_subject, '$stx') > 0 or INSTR(qa_content, '$stx') > 0 ) ";
|
||||||
|
// }
|
||||||
|
|
||||||
$sql_order = " order by qa_num ";
|
$sql_order = " order by qa_num ";
|
||||||
|
|
||||||
|
|||||||
@ -457,6 +457,20 @@ function get_board_sfl_select_options($sfl){
|
|||||||
return run_replace('get_board_sfl_select_options', $str, $sfl);
|
return run_replace('get_board_sfl_select_options', $str, $sfl);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function get_qa_sfl_select_options($sfl) {
|
||||||
|
|
||||||
|
global $is_admin;
|
||||||
|
|
||||||
|
$str = '';
|
||||||
|
$str .= '<option value="qa_subject" '.get_selected($sfl, 'qa_subject', true).'>제목</option>';
|
||||||
|
$str .= '<option value="qa_content" '.get_selected($sfl, 'qa_content').'>내용</option>';
|
||||||
|
$str .= '<option value="qa_name" '.get_selected($sfl, 'qa_name').'>글쓴이</option>';
|
||||||
|
if ($is_admin)
|
||||||
|
$str .= '<option value="mb_id" '.get_selected($sfl, 'mb_id').'>회원아이디</option>';
|
||||||
|
|
||||||
|
return run_replace('get_qa_sfl_select_options', $str, $sfl);
|
||||||
|
}
|
||||||
|
|
||||||
// 읽지 않은 메모 갯수 반환
|
// 읽지 않은 메모 갯수 반환
|
||||||
function get_memo_not_read($mb_id, $add_where='')
|
function get_memo_not_read($mb_id, $add_where='')
|
||||||
{
|
{
|
||||||
|
|||||||
@ -118,7 +118,7 @@ add_stylesheet('<link rel="stylesheet" href="'.$qa_skin_url.'/style.css">', 0);
|
|||||||
<input type="hidden" name="sop" value="and">
|
<input type="hidden" name="sop" value="and">
|
||||||
<label for="sfl" class="sound_only">검색대상</label>
|
<label for="sfl" class="sound_only">검색대상</label>
|
||||||
<select name="sfl" id="sfl">
|
<select name="sfl" id="sfl">
|
||||||
<?php echo get_board_sfl_select_options($sfl); ?>
|
<?php echo get_qa_sfl_select_options($sfl); ?>
|
||||||
</select>
|
</select>
|
||||||
<label for="stx" class="sound_only">검색어<strong class="sound_only"> 필수</strong></label>
|
<label for="stx" class="sound_only">검색어<strong class="sound_only"> 필수</strong></label>
|
||||||
<input type="text" name="stx" value="<?php echo stripslashes($stx) ?>" required placeholder="검색어를 입력하세요" id="stx" class="sch_input" size="15" maxlength="15">
|
<input type="text" name="stx" value="<?php echo stripslashes($stx) ?>" required placeholder="검색어를 입력하세요" id="stx" class="sch_input" size="15" maxlength="15">
|
||||||
|
|||||||
@ -44,7 +44,7 @@ add_stylesheet('<link rel="stylesheet" href="'.$qa_skin_url.'/style.css">', 0);
|
|||||||
<input type="hidden" name="sop" value="and">
|
<input type="hidden" name="sop" value="and">
|
||||||
<label for="sfl" class="sound_only">검색대상</label>
|
<label for="sfl" class="sound_only">검색대상</label>
|
||||||
<select name="sfl" id="sfl">
|
<select name="sfl" id="sfl">
|
||||||
<?php echo get_board_sfl_select_options($sfl); ?>
|
<?php echo get_qa_sfl_select_options($sfl); ?>
|
||||||
</select>
|
</select>
|
||||||
<label for="stx" class="sound_only">검색어<strong class="sound_only"> 필수</strong></label>
|
<label for="stx" class="sound_only">검색어<strong class="sound_only"> 필수</strong></label>
|
||||||
<div class="sch_bar">
|
<div class="sch_bar">
|
||||||
|
|||||||
@ -118,7 +118,7 @@ add_stylesheet('<link rel="stylesheet" href="'.$qa_skin_url.'/style.css">', 0);
|
|||||||
<input type="hidden" name="sop" value="and">
|
<input type="hidden" name="sop" value="and">
|
||||||
<label for="sfl" class="sound_only">검색대상</label>
|
<label for="sfl" class="sound_only">검색대상</label>
|
||||||
<select name="sfl" id="sfl">
|
<select name="sfl" id="sfl">
|
||||||
<?php echo get_board_sfl_select_options($sfl); ?>
|
<?php echo get_qa_sfl_select_options($sfl); ?>
|
||||||
</select>
|
</select>
|
||||||
<label for="stx" class="sound_only">검색어<strong class="sound_only"> 필수</strong></label>
|
<label for="stx" class="sound_only">검색어<strong class="sound_only"> 필수</strong></label>
|
||||||
<input type="text" name="stx" value="<?php echo stripslashes($stx) ?>" required placeholder="검색어를 입력하세요" id="stx" class="sch_input" size="15" maxlength="15">
|
<input type="text" name="stx" value="<?php echo stripslashes($stx) ?>" required placeholder="검색어를 입력하세요" id="stx" class="sch_input" size="15" maxlength="15">
|
||||||
|
|||||||
@ -44,7 +44,7 @@ add_stylesheet('<link rel="stylesheet" href="'.$qa_skin_url.'/style.css">', 0);
|
|||||||
<input type="hidden" name="sop" value="and">
|
<input type="hidden" name="sop" value="and">
|
||||||
<label for="sfl" class="sound_only">검색대상</label>
|
<label for="sfl" class="sound_only">검색대상</label>
|
||||||
<select name="sfl" id="sfl">
|
<select name="sfl" id="sfl">
|
||||||
<?php echo get_board_sfl_select_options($sfl); ?>
|
<?php echo get_qa_sfl_select_options($sfl); ?>
|
||||||
</select>
|
</select>
|
||||||
<label for="stx" class="sound_only">검색어<strong class="sound_only"> 필수</strong></label>
|
<label for="stx" class="sound_only">검색어<strong class="sound_only"> 필수</strong></label>
|
||||||
<div class="sch_bar">
|
<div class="sch_bar">
|
||||||
|
|||||||
Reference in New Issue
Block a user