Merge branch 'qa'
This commit is contained in:
@ -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);
|
||||
|
||||
@ -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 .= '<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='')
|
||||
{
|
||||
|
||||
@ -115,6 +115,11 @@ add_stylesheet('<link rel="stylesheet" href="'.$qa_skin_url.'/style.css">', 0);
|
||||
<legend>게시물 검색</legend>
|
||||
<form name="fsearch" method="get">
|
||||
<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">
|
||||
<?php echo get_qa_sfl_select_options($sfl); ?>
|
||||
</select>
|
||||
<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">
|
||||
<button type="submit" value="검색" class="sch_btn"><i class="fa fa-search" aria-hidden="true"></i> <span class="sound_only">검색</span></button>
|
||||
|
||||
@ -136,7 +136,8 @@
|
||||
#bo_sch {background:#fff;border:1px solid #d0d3db;position:relative;margin:10px}
|
||||
#bo_sch:after {display:block;visibility:hidden;clear:both;content:""}
|
||||
#bo_sch legend {position:absolute;margin:0;padding:0;font-size:0;line-height:0;text-indent:-9999em;overflow:hidden}
|
||||
#bo_sch .sch_input {float:left;width:100%;height:38px;border:0;padding:0;background-color:transparent;padding:0 0 0 10px}
|
||||
#bo_sch select {border:0;height:38px;border-right:1px solid #f8f8f8;float:left;width:30%}
|
||||
#bo_sch .sch_input {height:38px;border:0;padding:0;background-color:transparent;float:left;width:70%;padding:0 40px 0 10px}
|
||||
#bo_sch .sch_btn {height:38px;position:absolute;top:0;right:0;border:0;width:40px;background:none;font-size:15px}
|
||||
|
||||
|
||||
|
||||
@ -7,15 +7,18 @@ $query = $_SERVER['QUERY_STRING'];
|
||||
$vars = array();
|
||||
|
||||
foreach(explode('&', $query) as $pair) {
|
||||
list($key, $value) = explode('=', $pair);
|
||||
@list($key, $value) = explode('=', $pair);
|
||||
$key = urldecode($key);
|
||||
$value = preg_replace("/[^A-Za-z0-9\-_]/", "", urldecode($value));
|
||||
$vars[$key][] = $value;
|
||||
}
|
||||
|
||||
$itemIds = $vars['ITEM_ID'];
|
||||
if (isset($vars['ITEM_ID']))
|
||||
$itemIds = $vars['ITEM_ID'];
|
||||
else
|
||||
$itemIds = array();
|
||||
|
||||
if (count($itemIds) < 1) {
|
||||
if (is_null($itemIds) || count($itemIds) < 1) {
|
||||
exit('ITEM_ID 는 필수입니다.');
|
||||
}
|
||||
|
||||
|
||||
@ -41,6 +41,11 @@ add_stylesheet('<link rel="stylesheet" href="'.$qa_skin_url.'/style.css">', 0);
|
||||
<legend>게시물 검색</legend>
|
||||
<form name="fsearch" method="get">
|
||||
<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">
|
||||
<?php echo get_qa_sfl_select_options($sfl); ?>
|
||||
</select>
|
||||
<label for="stx" class="sound_only">검색어<strong class="sound_only"> 필수</strong></label>
|
||||
<div class="sch_bar">
|
||||
<input type="text" name="stx" value="<?php echo stripslashes($stx); ?>" id="stx" required class="sch_input" size="25" maxlength="15" placeholder=" 검색어를 입력해주세요">
|
||||
|
||||
@ -182,7 +182,7 @@ box-shadow:inset 0 2px 5px rgb(33, 135, 202)}
|
||||
.bo_sch select {border:0;width:100%;height:40px;border:1px solid #d0d3db;border-radius:2px;-webkit-box-shadow:inset 0 1px 1px rgba(0, 0, 0, .075);
|
||||
-moz-box-shadow:inset 0 1px 1px rgba(0, 0, 0, .075);
|
||||
box-shadow:inset 0 1px 1px rgba(0, 0, 0, .075)}
|
||||
.bo_sch .sch_bar {display:inline-block;width:100%;clear:both;border:1px solid #d0d3db;border-radius:2px;-webkit-box-shadow:inset 0 1px 1px rgba(0, 0, 0, .075);
|
||||
.bo_sch .sch_bar {display:inline-block;width:100%;clear:both;margin-top:15px;border:1px solid #d0d3db;border-radius:2px;-webkit-box-shadow:inset 0 1px 1px rgba(0, 0, 0, .075);
|
||||
-moz-box-shadow:inset 0 1px 1px rgba(0, 0, 0, .075);
|
||||
box-shadow:inset 0 1px 1px rgba(0, 0, 0, .075)}
|
||||
.bo_sch .sch_input {width:250px;height:38px;border:0;padding:0;background-color:transparent;float:left}
|
||||
|
||||
@ -115,6 +115,11 @@ add_stylesheet('<link rel="stylesheet" href="'.$qa_skin_url.'/style.css">', 0);
|
||||
<legend>게시물 검색</legend>
|
||||
<form name="fsearch" method="get">
|
||||
<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">
|
||||
<?php echo get_qa_sfl_select_options($sfl); ?>
|
||||
</select>
|
||||
<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">
|
||||
<button type="submit" value="검색" class="sch_btn"><i class="fa fa-search" aria-hidden="true"></i> <span class="sound_only">검색</span></button>
|
||||
|
||||
@ -136,7 +136,8 @@
|
||||
#bo_sch {background:#fff;border:1px solid #d0d3db;position:relative;margin:10px}
|
||||
#bo_sch:after {display:block;visibility:hidden;clear:both;content:""}
|
||||
#bo_sch legend {position:absolute;margin:0;padding:0;font-size:0;line-height:0;text-indent:-9999em;overflow:hidden}
|
||||
#bo_sch .sch_input {float:left;width:100%;height:38px;border:0;padding:0;background-color:transparent;padding:0 0 0 10px}
|
||||
#bo_sch select {border:0;height:38px;border-right:1px solid #f8f8f8;float:left;width:30%}
|
||||
#bo_sch .sch_input {height:38px;border:0;padding:0;background-color:transparent;float:left;width:70%;padding:0 40px 0 10px}
|
||||
#bo_sch .sch_btn {height:38px;position:absolute;top:0;right:0;border:0;width:40px;background:none;font-size:15px}
|
||||
|
||||
|
||||
|
||||
@ -41,6 +41,11 @@ add_stylesheet('<link rel="stylesheet" href="'.$qa_skin_url.'/style.css">', 0);
|
||||
<legend>게시물 검색</legend>
|
||||
<form name="fsearch" method="get">
|
||||
<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">
|
||||
<?php echo get_qa_sfl_select_options($sfl); ?>
|
||||
</select>
|
||||
<label for="stx" class="sound_only">검색어<strong class="sound_only"> 필수</strong></label>
|
||||
<div class="sch_bar">
|
||||
<input type="text" name="stx" value="<?php echo stripslashes($stx); ?>" id="stx" required class="sch_input" size="25" maxlength="15" placeholder=" 검색어를 입력해주세요">
|
||||
|
||||
@ -182,7 +182,7 @@ box-shadow:inset 0 2px 5px rgb(33, 135, 202)}
|
||||
.bo_sch select {border:0;width:100%;height:40px;border:1px solid #d0d3db;border-radius:2px;-webkit-box-shadow:inset 0 1px 1px rgba(0, 0, 0, .075);
|
||||
-moz-box-shadow:inset 0 1px 1px rgba(0, 0, 0, .075);
|
||||
box-shadow:inset 0 1px 1px rgba(0, 0, 0, .075)}
|
||||
.bo_sch .sch_bar {display:inline-block;width:100%;clear:both;border:1px solid #d0d3db;border-radius:2px;-webkit-box-shadow:inset 0 1px 1px rgba(0, 0, 0, .075);
|
||||
.bo_sch .sch_bar {display:inline-block;width:100%;clear:both;margin-top:15px;border:1px solid #d0d3db;border-radius:2px;-webkit-box-shadow:inset 0 1px 1px rgba(0, 0, 0, .075);
|
||||
-moz-box-shadow:inset 0 1px 1px rgba(0, 0, 0, .075);
|
||||
box-shadow:inset 0 1px 1px rgba(0, 0, 0, .075)}
|
||||
.bo_sch .sch_input {width:250px;height:38px;border:0;padding:0;background-color:transparent;float:left}
|
||||
|
||||
Reference in New Issue
Block a user