Hi ...
search.php
suche:
Code: Alles auswählen
$match_word = str_replace('*', '%', $split_search[$i]);
$sql = "SELECT m.post_id
$search_msg_only .= ($only_bluecards) ? " AND p.post_bluecard>0 AND m.post_id=p.post_id " : "";
FROM " . SEARCH_WORD_TABLE . " w, " .
" . (($only_bluecards) ? ','.POSTS_TABLE . ' p ' : '') . " SEARCH_MATCH_TABLE . " m
WHERE w.word_text LIKE '$match_word'
AND m.word_id = w.word_id
AND w.word_common <> 1
$search_msg_only";
}
else
{
$match_word = addslashes('%' . str_replace('*', '', $split_search[$i]) . '%');
$search_msg_only = ( $search_fields ) ? "OR pt.post_subject LIKE '$match_word'" : '';
$search_msg_only .= ($only_bluecards) ? " AND p.post_bluecard>0 AND pt.post_id=p.post_id " : "";
$sql = "SELECT pt.post_id
FROM " . POSTS_TEXT_TABLE . "
pt " . (($only_bluecards) ? ','.POSTS_TABLE . ' p ' : '') . "
WHERE pt.post_text LIKE '$match_word'
$search_msg_only";
}
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not obtain matched posts list', '', __LINE__, __FILE__, $sql);
}
$row = array();
ersetze mit:
Code: Alles auswählen
$match_word = str_replace('*', '%', $split_search[$i]);
$search_msg_only .= ($only_bluecards) ? " AND p.post_bluecard>0 AND m.post_id=p.post_id " : "";
$sql = "SELECT m.post_id
FROM " . SEARCH_WORD_TABLE . " w, " . SEARCH_MATCH_TABLE . " m " . (($only_bluecards) ? ','.POSTS_TABLE . ' p ' : '') . "
WHERE w.word_text LIKE '$match_word'
AND m.word_id = w.word_id
AND w.word_common <> 1
$search_msg_only";
}
else
{
$match_word = addslashes('%' . str_replace('*', '', $split_search[$i]) . '%');
$search_msg_only = ( $search_fields ) ? "OR pt.post_subject LIKE '$match_word'" : '';
$search_msg_only .= ($only_bluecards) ? " AND p.post_bluecard>0 AND pt.post_id=p.post_id " : "";
$sql = "SELECT pt.post_id
FROM " . POSTS_TEXT_TABLE . "
pt " . (($only_bluecards) ? ','.POSTS_TABLE . ' p ' : '') . "
WHERE pt.post_text LIKE '$match_word'
$search_msg_only";
}
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not obtain matched posts list', '', __LINE__, __FILE__, $sql);
}
$row = array();
Markus