Seite 1 von 1

MOD: User suche

Verfasst: 14.06.2005 11:39
von Charger
nach einbau MOD: Search_In_User_Profiles
http://www.oxpus.de/load.php?id=234

wenn ich auf suchen klicke,
habe ich folgende fehlermeldung:
Parse error: parse error, unexpected T_ELSE in /kunden/99460_85748/location/phpBB2/search.php on line 265

hier die datei als .txt
http://www.garching-location.de/phpBB2/search2.txt

wer kann da helfen?

Verfasst: 14.06.2005 11:55
von Markus67
Hi ...

suche und lösche in der search.php

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']);
	}
}
suche:

Code: Alles auswählen

//
// Search forum
//
und davor das ganze wieder einfügen.

Markus

Verfasst: 14.06.2005 13:03
von Charger
hallo,

dann erscheint das hier:
[ externes Bild ]

da müssten auswahllfelder sein oder nicht?

Verfasst: 14.06.2005 13:10
von Markus67
Hi ...

nicht dass ich wüsste ... steht dann irgendwo in der Modbeschreibung was von Auswahlfelder?

Markus

Verfasst: 14.06.2005 13:18
von Charger
kann dort nur interessen/wohnort etc... eingeben
da müssten nehme ich mal an auswahlfelder sein,
woher soll der user sonst wissen wen/was er suche soll?

es wäre auch nicht schlecht gewesen auch nach dem geschlecht suchen zu
können, habe den gender-Mod
weist du wo ich das machen kann?