행

검색어에 지정된 배경색이 안보이는 건 버그인가요 ?

오류가 나는곳의 주소를 알려주시면 더 빠르고 정확하게 답변 받을 수 있습니다.

오류 주소 :

lib/common.lib.php 에 search_font 함수가 선언된 곳이 있습니다.

관리자모드에서 검색글색지정 배경지정을 해 놓으면 검색시에 글의색과 배경색이 보여집니다.

문제는 제목에만 보여진다는 것입니다.

아래 처럼 검색어에 태그가 붙습니다.

<span style='background-color:YELLOW; color:RED;'>검색어</span>

그러나, 어떤 이유에서인지는 모르나 글 내용에서는 붙지 않습니다.

글자자르기 때문일지도 몰라 테스트 해 보았으나 역시 마찬가지입니다.

내용검색을 해도 마찬가지로 <span style='background-color:YELLOW; color:RED;'>검색어</span> 가 찍히지 않습니다.

bbs/search.php 아래


// 비밀글은 검색 불가
if (strstr($row[wr_option].$row2[wr_option], "secret"))
$row[wr_content] = "[비밀글 입니다.]";

$subject = get_text($row[wr_subject]);
if (strstr($sfl, "wr_subject"))
$subject = search_font($stx, $subject);

if ($read_level[$idx] <= $member[mb_level])
{
$row[wr_content]= strip_tags($row[wr_content]); ////추가
//$content = cut_str(get_text($row[wr_content]),300,"…");
$content = cut_str(conv_content($row[wr_content],2),300,"…");//수정
if (strstr($sfl, "wr_content"))
$content = search_font($stx, $content);
}
else
$content = '';

skin/search/basic/search.skin.php 아래

echo strip_tags( $list[$idx][$i][content] );

//strip_tags 가 문제를 일으키는 것 같아 보입니다만.....

댓글 2개

$row[wr_content]= strip_tags($row[wr_content]); ////추가

이부분에 문제가 있거나

$content = cut_str(conv_content($row[wr_content],2),300,"…");//수정

문제가 있는걸로 보여집니다.
태그가 검색 후에 뿌려지는 문제가 있어서 어떤 분의 도움으로 태그가 노출 안되게 바꾸었습니다.
즉,

$content = cut_str(get_text($row[wr_content]),300,"…");
if (strstr($sfl, "wr_content"))
$content = search_font($stx, $content);

이렇게 변경

$row[wr_content]= strip_tags($row[wr_content]); ////추가
//$content = cut_str(get_text($row[wr_content]),300,"…");
$content = cut_str(conv_content($row[wr_content],2),300,"…");//수정
if (strstr($sfl, "wr_content"))
$content = search_font($stx, $content);

되었습니다.
댓글을 작성하시려면 로그인이 필요합니다.

그누보드4 관련 질문은 QA 로 이전됩니다. QA 그누보드4 바로가기 기존 게시물은 열람만 가능합니다.

+
제목 글쓴이 날짜 조회
09-03-08 조회 1,592
09-03-08 조회 925
09-03-08 조회 965
09-03-08 조회 1,023
09-03-08 조회 1,022
09-03-08 조회 1,597
09-03-08 조회 1,164
09-03-08 조회 1,026
09-03-08 조회 918
09-03-08 조회 1,424
09-03-07 조회 902
09-03-07 조회 1,339
09-03-07 조회 965
09-03-07 조회 1,095
09-03-07 조회 906
09-03-07 조회 1,071
09-03-07 조회 1,636
09-03-07 조회 1,934
09-03-07 조회 1,002
09-03-07 조회 1,608