태터툴즈는 검색 기능이 단일 검색입니다.
즉 "겨울,오뎅"라고 치면 "겨울,오뎅"라는 글만 검색되죠.
근데 사실 이렇게 글을 입력하는 경우에는 "겨울"과 "오뎅"이 같이 들어간 글을 찾는 경우가 대부분입니다.
그래서 이 부분을 수정해보겠습니다.
태터툴즈가 설치된 폴더의 search 라는 폴더에서 index.php 파일을 에디터로 엽니다.
참고로 저는 태터툴즈 1.06 버전입니다.
콤마로 단어를 구분해서 SQL 문장을 만들기 위해서는 아래의 문장이 필요합니다.
$temp = explode($separator, $search);
$SQL='';
foreach ($temp as $key => $search) {
$SQL=$SQL."and (comment like '%".$temp[$key]."%') ";
}
이것을 반복적으로 사용하면 됩니다.
function getCommentList($owner,$search){ 라는 함수를 찾습니다.
if($result=mysql_query("~~~~~ 를 찾아서 아래와 같이 수정을 합니다.
$temp = explode($separator, $search);
$SQL='';
foreach ($temp as $key => $search) {
$SQL=$SQL."and (comment like '%".$temp[$key]."%') ";
}
// echo $SQL;
$SQL="select id, entry, parent, name, comment, written from {$database['prefix']}Comments where entry > 0 AND owner = $owner $authorized $SQL";
// echo $SQL;
// if($result=mysql_query("select id, entry, parent, name, comment, written from {$database['prefix']}Comments where entry > 0 AND owner = $owner $authorized and comment like '%$search%'")){
if($result=mysql_query($SQL)){
다음은 function getEntryListBySearch($owner,$search){ 를 찾습니다.
// $cond=empty($search)?'':"AND (title LIKE '%$search%' OR content LIKE '%$search%')";여기를 찾아서 아래와 같이 수정을 합니다.
$temp = explode($separator, $search);
$SQL='';
foreach ($temp as $key => $search) {
$SQL=$SQL." AND (title LIKE '%".$temp[$key]."%' OR content LIKE '%".$temp[$key]."%') ";
}// $cond=empty($search)?'':"AND (title LIKE '%$search%' OR content LIKE '%$search%')";
$cond=empty($search)?'': $SQL;
다음은 function getEntriesWithPagingBySearch($owner,$search,$page,$count){ 를 찾습니다.
$cond=empty($search)?'':"AND (e.title LIKE '%$search%' OR e.content LIKE '%$search%')"; 를 찾아서 아래와 같이 수정을 합니다.
$temp = explode($separator, $search);
$SQL='';
foreach ($temp as $key => $search) {
$SQL=$SQL." AND (e.title LIKE '%".$temp[$key]."%' OR e.content LIKE '%".$temp[$key]."%') ";
}
// $cond=empty($search)?'':"AND (e.title LIKE '%$search%' OR e.content LIKE '%$search%')";
$cond=empty($search)?'': $SQL;
이렇게 3군데 정도 수정을 하면 되는걸로 기억이 되네요,.. ^^?
이렇게 하신 후에 검색에서 콤마로 구분된 복수 검색어를 입력해보세요.
"슬픈,사랑,이야기" "겨울,오뎅,떡뽁이," "아빠,엄마"등요.
잘 나오면 성공.. 안되면.. 어디가 문제인지는 저도 몰라용...