채택완료

FAQ 게시판에서 검색 기능...

2024-05-11 (토) 22:15:58 7,172

안녕하세요

FAQ에서 검색을 하면 그건 관리자모드 인기검색어관리에 반영이 안되더라고요...

FAQ에서 검색된 내용도 기록에 남기고 싶은데

반영시킬수 있는 방법 있을까요?~!

ㅠㅠ 감사합니다.

|

답변 1개 / 댓글 2개

채택된 답변
+20 포인트

/bbs/faq.php 파일에 아래 부분을 추가해주세요.

insert_popular('fa_subject', $stx);

Copy
if($stx) {

       $sql_search = " and ( INSTR(fa_subject, '$stx') > 0 or INSTR(fa_content, '$stx') > 0 ) ";

       insert_popular('fa_subject', $stx);

    }

답변에 대한 댓글 2개

감사합니다.
반영은 잘 되지만, 에러메시지가 살짝 뜹니다.


Warning: in_array() expects parameter 2 to be array, string given in /home/~~/www/lib/common.lib.php on line 3066

3066번째줄을 찾아가보면 이렇게 되어 있네요...
한번 더 부탁드립니다.!

감사합니다.ㅠ



// 인기검색어 입력
function insert_popular($field, $str)
{
global $g5;

if(!in_array('mb_id', $field)) {
$sql = " insert into {$g5['popular_table']} set pp_word = '{$str}', pp_date = '".G5_TIME_YMD."', pp_ip = '{$_SERVER['REMOTE_ADDR']}' ";
sql_query($sql, FALSE);
}
}
[code]
if($stx) {
$sql_search = " and ( INSTR(fa_subject, '$stx') > 0 or INSTR(fa_content, '$stx') > 0 ) ";
$field = array('fa_subject');
insert_popular($field, $stx);
}
[/code]

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