diff --git a/bbs/qalist.php b/bbs/qalist.php index 08fd0b175..63401e029 100644 --- a/bbs/qalist.php +++ b/bbs/qalist.php @@ -58,15 +58,33 @@ if(is_file($skin_file)) { $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 ) "; + $sfl = trim($sfl); + if ($sfl) { + switch ($sfl) { + 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 = " select count(*) as cnt + $sql = " select count(*) as cnt $sql_common $sql_search "; $row = sql_fetch($sql); diff --git a/lib/get_data.lib.php b/lib/get_data.lib.php index 9b92ebcd2..253f63962 100644 --- a/lib/get_data.lib.php +++ b/lib/get_data.lib.php @@ -457,6 +457,20 @@ function get_board_sfl_select_options($sfl){ return run_replace('get_board_sfl_select_options', $str, $sfl); } +function get_qa_sfl_select_options($sfl) { + + global $is_admin; + + $str = ''; + $str .= ''; + $str .= ''; + $str .= ''; + if ($is_admin) + $str .= ''; + + return run_replace('get_qa_sfl_select_options', $str, $sfl); +} + // 읽지 않은 메모 갯수 반환 function get_memo_not_read($mb_id, $add_where='') { diff --git a/mobile/skin/qa/basic/list.skin.php b/mobile/skin/qa/basic/list.skin.php index e9befda58..2f102f5e2 100644 --- a/mobile/skin/qa/basic/list.skin.php +++ b/mobile/skin/qa/basic/list.skin.php @@ -118,7 +118,7 @@ add_stylesheet('', 0); diff --git a/skin/qa/basic/list.skin.php b/skin/qa/basic/list.skin.php index e8af39051..47fdfb615 100644 --- a/skin/qa/basic/list.skin.php +++ b/skin/qa/basic/list.skin.php @@ -44,7 +44,7 @@ add_stylesheet('', 0);