Suche und entferne:
Code: Alles auswählen
}
else if ( $search_profile != '' && $search_keywords == '' && $search_profile != '*' && $search_profile != '?' )
{
$search_keywords = str_replace('*', '', $search_profile);
$search_keywords = str_replace('?', '', $search_profile);
if ( $search_field_select == 0 )
{
$search_fields = $search_profile_fields_sql;
}
else
{
$search_fields = $search_profile_fields[$search_field_select];
}
$sql = "SELECT ".$search_fields.", user_id FROM ".USERS_TABLE."
WHERE user_active = 1
AND disallow_profile_search = 0";
if ( !$result = $db->sql_query($sql) )
{
message_die(GENERAL_ERROR, 'Could not read user profile data', '', __LINE__, __FILE__, $sql);
}
$search_profile_string = $userid = array();
while ( $row = $db->sql_fetchrow($result) )
{
if ( $search_field_select == 0 )
{
$i = 1;
$search_string = '';
foreach($search_profile_fields as $profile_field)
{
$search_string .= ( empty($search_string) ) ? $row[$profile_field] : ' '.$row[$profile_field];
}
$search_profile_string[] = $search_string;
}
else
{
$search_profile_string[] = $row[$search_profile_fields[$search_field_select]];
}
$userid[] = $row['user_id'];
}
$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');
$split_search = array();
$split_search = ( !strstr($multibyte_charset, $lang['ENCODING']) ) ? split_words(clean_words('search', stripslashes($search_keywords), $stopword_array, $synonym_array), 'search') : split(' ', $search_keywords);
$userids = '';
for ( $i = 0; $i < count($search_profile_string); $i++)
{
foreach($split_search as $search_word)
{
if ( @eregi($search_word, $search_profile_string[$i]) )
{
$userids .= ( empty($userids) ) ? $userid[$i] : ', '.$userid[$i];
}
}
}
if ( $userids != '' )
{
$page_title = $lang['Search_profile'];
include($phpbb_root_path . 'includes/page_header.'.$phpEx);
$template->set_filenames(array(
'body' => 'search_results_profiles.tpl')
);
$sql = "SELECT user_id, username FROM ".USERS_TABLE."
WHERE user_active = 1
AND user_id IN ($userids)
ORDER BY username $sort_dir";
if ( !$result = $db->sql_query($sql) )
{
message_die(GENERAL_ERROR, 'Could not read user profile data', '', __LINE__, __FILE__, $sql);
}
$result_user_list = '';
while ( $row = $db->sql_fetchrow($result) )
{
$user = '<a href="'.append_sid("profile.$phpEx?mode=viewprofile&".POST_USERS_URL."=".$row['user_id']).'" class="gen">'.$row['username'].'</a>';
$result_user_list .= ( $result_user_list == '' ) ? $user : '<b>,</b> '.$user;
}
$template->assign_vars(array(
'ROW_CLASS' => $theme['td_class1'],
'PROFILE_FIELDS' => implode(', ', $search_profile_fields_names),
'SEARCH_STRING' => $search_keywords,
'RESULT_USER_LIST' => $result_user_list,
'L_SEARCH_MATCHES' => $page_title,
'L_AUTHOR' => $lang['User'],
'L_SEARCH' => $lang['Search'],
'U_SEARCH' => append_sid("search.$phpEx"))
);
$template->pparse('body');
include($phpbb_root_path . 'includes/page_tail.'.$phpEx);
exit;
}
else
{
message_die(GENERAL_MESSAGE, $lang['No_search_match']);
}
}
}
Damit sollte die Suche wieder klappen... Nun hast du nen Mod eingebaut miz dem man die Profile durchsuchen kann... Weißt du noch welcher Mod das war? Denn da hast du einen Fehler gemacht beim einbauen. Es kommt nämlich 100pro nicht an die stelle.
Mein Tipp:
Suche:
Ersetze mit:
Code: Alles auswählen
}
else if ( $search_profile != '' && $search_keywords == '' && $search_profile != '*' && $search_profile != '?' )
{
$search_keywords = str_replace('*', '', $search_profile);
$search_keywords = str_replace('?', '', $search_profile);
if ( $search_field_select == 0 )
{
$search_fields = $search_profile_fields_sql;
}
else
{
$search_fields = $search_profile_fields[$search_field_select];
}
$sql = "SELECT ".$search_fields.", user_id FROM ".USERS_TABLE."
WHERE user_active = 1
AND disallow_profile_search = 0";
if ( !$result = $db->sql_query($sql) )
{
message_die(GENERAL_ERROR, 'Could not read user profile data', '', __LINE__, __FILE__, $sql);
}
$search_profile_string = $userid = array();
while ( $row = $db->sql_fetchrow($result) )
{
if ( $search_field_select == 0 )
{
$i = 1;
$search_string = '';
foreach($search_profile_fields as $profile_field)
{
$search_string .= ( empty($search_string) ) ? $row[$profile_field] : ' '.$row[$profile_field];
}
$search_profile_string[] = $search_string;
}
else
{
$search_profile_string[] = $row[$search_profile_fields[$search_field_select]];
}
$userid[] = $row['user_id'];
}
$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');
$split_search = array();
$split_search = ( !strstr($multibyte_charset, $lang['ENCODING']) ) ? split_words(clean_words('search', stripslashes($search_keywords), $stopword_array, $synonym_array), 'search') : split(' ', $search_keywords);
$userids = '';
for ( $i = 0; $i < count($search_profile_string); $i++)
{
foreach($split_search as $search_word)
{
if ( @eregi($search_word, $search_profile_string[$i]) )
{
$userids .= ( empty($userids) ) ? $userid[$i] : ', '.$userid[$i];
}
}
}
if ( $userids != '' )
{
$page_title = $lang['Search_profile'];
include($phpbb_root_path . 'includes/page_header.'.$phpEx);
$template->set_filenames(array(
'body' => 'search_results_profiles.tpl')
);
$sql = "SELECT user_id, username FROM ".USERS_TABLE."
WHERE user_active = 1
AND user_id IN ($userids)
ORDER BY username $sort_dir";
if ( !$result = $db->sql_query($sql) )
{
message_die(GENERAL_ERROR, 'Could not read user profile data', '', __LINE__, __FILE__, $sql);
}
$result_user_list = '';
while ( $row = $db->sql_fetchrow($result) )
{
$user = '<a href="'.append_sid("profile.$phpEx?mode=viewprofile&".POST_USERS_URL."=".$row['user_id']).'" class="gen">'.$row['username'].'</a>';
$result_user_list .= ( $result_user_list == '' ) ? $user : '<b>,</b> '.$user;
}
$template->assign_vars(array(
'ROW_CLASS' => $theme['td_class1'],
'PROFILE_FIELDS' => implode(', ', $search_profile_fields_names),
'SEARCH_STRING' => $search_keywords,
'RESULT_USER_LIST' => $result_user_list,
'L_SEARCH_MATCHES' => $page_title,
'L_AUTHOR' => $lang['User'],
'L_SEARCH' => $lang['Search'],
'U_SEARCH' => append_sid("search.$phpEx"))
);
$template->pparse('body');
include($phpbb_root_path . 'includes/page_tail.'.$phpEx);
exit;
}
else
{
message_die(GENERAL_MESSAGE, $lang['No_search_match']);
}
}
//
// Search forum
//