similar topics mod - Stopwörter ?
Verfasst: 06.06.2005 13:45
Larsneo empfahl das unten (er nannte es allerdings noch quick and dirty)
für die viewtopic.php.
Funktioniert ohne Fehlermeldung. Nun habe ich noch search_stopwords.txt auf /language/lang_german/ gelegt, aber mir scheint diese Textdatei der nicht zu wertenden Topic-Wörter wird ignoriert ?
Ich bekomme trotzdem x Themen mit Wörtern, die in meinem Forum häufig vorkommen. Funktioniert es bei jemand, ich weiß nur, daß Lars Neo es hinbekommen hat.
// Similar Topics
// check against stopwords and synonyms start
include($phpbb_root_path . 'includes/functions_search.'.$phpEx);
$stopword_array = @file($phpbb_root_path . 'language/lang_' . $board_config['default_lang'] . '/search_stopwords.txt');
$synonym_array = @file($phpbb_root_path . 'language/lang_' . $board_config['default_lang'] . '/search_synonyms.txt');
$title_search = "";
$title_search_array = array();
$title_search_array = ( !strstr($multibyte_charset, $lang['ENCODING']) ) ? split_words(clean_words('similar', stripslashes($topic_title), $stopword_array, $synonym_array), 'search') : split(' ', $topic_title);
for($i = 0; $i < count($title_search_array); $i++)
{
$title_search .= $title_search_array[$i]. ' ';
}
// check against stopwords and synonyms end
$sql = "SELECT topic_id
FROM ". TOPICS_TABLE ."
WHERE topic_id != $topic_id
AND forum_id NOT IN (4,9,16)
AND MATCH (topic_title) AGAINST ('". addslashes($title_search) ."')
ORDER BY topic_time DESC LIMIT 0,10";[/b]
für die viewtopic.php.
Funktioniert ohne Fehlermeldung. Nun habe ich noch search_stopwords.txt auf /language/lang_german/ gelegt, aber mir scheint diese Textdatei der nicht zu wertenden Topic-Wörter wird ignoriert ?
Ich bekomme trotzdem x Themen mit Wörtern, die in meinem Forum häufig vorkommen. Funktioniert es bei jemand, ich weiß nur, daß Lars Neo es hinbekommen hat.
// Similar Topics
// check against stopwords and synonyms start
include($phpbb_root_path . 'includes/functions_search.'.$phpEx);
$stopword_array = @file($phpbb_root_path . 'language/lang_' . $board_config['default_lang'] . '/search_stopwords.txt');
$synonym_array = @file($phpbb_root_path . 'language/lang_' . $board_config['default_lang'] . '/search_synonyms.txt');
$title_search = "";
$title_search_array = array();
$title_search_array = ( !strstr($multibyte_charset, $lang['ENCODING']) ) ? split_words(clean_words('similar', stripslashes($topic_title), $stopword_array, $synonym_array), 'search') : split(' ', $topic_title);
for($i = 0; $i < count($title_search_array); $i++)
{
$title_search .= $title_search_array[$i]. ' ';
}
// check against stopwords and synonyms end
$sql = "SELECT topic_id
FROM ". TOPICS_TABLE ."
WHERE topic_id != $topic_id
AND forum_id NOT IN (4,9,16)
AND MATCH (topic_title) AGAINST ('". addslashes($title_search) ."')
ORDER BY topic_time DESC LIMIT 0,10";[/b]