Search Profile Fields mod

Allgemeiner Support zum phpBB 2 Board und phpBB 2 Modifikationen
Forumsregeln
Auch wenn hier der Support für phpBB 2 weiterhin aufrecht erhalten bleibt, weisen wir darauf hin, dass das phpBB 2 nicht mehr offiziell unterstützt und weiterentwickelt wird!
Antworten
Benutzeravatar
fahraeus
Beiträge: 9
Registriert: Do 01.Dez, 2005 16:57

Search Profile Fields mod

Beitrag von fahraeus »

Your phpBB Version: Vanilla phpBB 2.0.18
MODs: No
Your knowledge: Intermediate
Boardlink: [url]http://[/url]

PHP Version:
MySQL Version:


What have you done before the problem was there?
none


What have you already tryed to solve the problem?
I have tried str_replace('å', '',... and str_replace('Å', '',...



Description and Message

Can you help me get the Search Profile Fields mod work with Swedish characters å ä ö and Å Ä Ö, everything else is working, but I really need this to be working also...

When a profile field has the character Å you cant find it if you use the small character å when searching... but a finds A, b finds B and so on...

So problem is, if you use Å in search field it will find Å but not å... and if you use å it will find å but not Å.
Zuletzt geändert von fahraeus am Di 27.Dez, 2005 23:38, insgesamt 2-mal geändert.
Benutzeravatar
oxpus
Administrator
Beiträge: 28735
Registriert: Mo 27.Jan, 2003 22:13
Wohnort: Bad Wildungen
Kontaktdaten:

Beitrag von oxpus »

Does the "normal" search still works?
Karsten Ude
-={ Das Mädchen für alles }=-
Kein Support per Messenger, Email oder PN! Unaufgeforderte Nachrichten werden ignoriert!
No support per Messenger, Email or PM. Each unasked message will be ignored!
Benutzeravatar
fahraeus
Beiträge: 9
Registriert: Do 01.Dez, 2005 16:57

Beitrag von fahraeus »

[quote="oxpus - Wed 28.Dec, 2005 00:54";p="51081"]Does the "normal" search still works?[/quote]

Hi again Oxpus!

I have checked and You are correct, the normal search seems to be the root of the problem NOT your mod.

Example: When I search on your board for the word "ähnlich" (lowercase ä) or "Ähnlich" (UPPERCASE Ä) it results in the same amount of hits (176 hits). It does not matter if I use UPPERCASE Ä or lowercase ä. This is the way I need it.

On my board i created one topic with the word "Ähnlich" (UPPERCASE) and another topic with the word "ähnlich" (lowercase). When I search for "ähnlich" (lowercase) it returns only the topic with lowercase.

I have searched internet for over 6 hours :eek: but cannot find the solution anywhere not even on phpbb.com ^d

Oxpus, have you got an idea on how to solve the problem? And again, thank you for being so kind helping me out.
Benutzeravatar
oxpus
Administrator
Beiträge: 28735
Registriert: Mo 27.Jan, 2003 22:13
Wohnort: Bad Wildungen
Kontaktdaten:

Beitrag von oxpus »

Hm, the search will not differ between upper and lower case words...
Try this:

Code: Alles auswählen

#
#-----[ OPEN ]-----
#
search.php

#
#-----[ FIND ]-----
#
				if (preg_match('#^[\*%]+$#', trim($split_search[$i])) || preg_match('#^[^\*]{1,2}$#', str_replace(array('*', '%'), '', trim($split_search[$i]))))

#
#-----[ REPLACE WITH ]-----
#
				if (preg_match('#^[\*%]+$#i', trim($split_search[$i])) || preg_match('#^[^\*]{1,2}$#i', str_replace(array('*', '%'), '', trim($split_search[$i]))))

#
#-----[ FIND ]-----
#
			if (preg_match('#^[\*%]+$#', trim($search_author)) || preg_match('#^[^\*]{1,2}$#', str_replace(array('*', '%'), '', trim($search_author))))

#
#-----[ REPLACE WITH ]-----
#
			if (preg_match('#^[\*%]+$#i', trim($search_author)) || preg_match('#^[^\*]{1,2}$#i', str_replace(array('*', '%'), '', trim($search_author))))

#
#-----[ FIND ]-----
#
			if ( @eregi($search_word, $search_profile_string[$i]) )

#
#-----[ REPLACE WITH ]-----
#
			if ( @ereg($search_word, $search_profile_string[$i]) )


#
#-----[ SAVE/CLOSE ALL FILES ]-----
#
# EoM
This will ever differ between lower and upper cases!
Karsten Ude
-={ Das Mädchen für alles }=-
Kein Support per Messenger, Email oder PN! Unaufgeforderte Nachrichten werden ignoriert!
No support per Messenger, Email or PM. Each unasked message will be ignored!
Benutzeravatar
fahraeus
Beiträge: 9
Registriert: Do 01.Dez, 2005 16:57

Beitrag von fahraeus »

Hi, and thanks... I have not yet tried the above solution because...
Hm, the search will not differ between upper and lower case words...
Try this:
The search does differ between lower and upper cases. With english characters there is no problem at all. Problem is only with characters outside A-Z, like ä Ä and ö Ö

Should I still try to apply above solution or is there something else that needs to be done (since a - z already works fine).

Did you do something special to make search differ between ä and Ä on your board? Since a native vanilla board does not...
Zuletzt geändert von fahraeus am Mi 28.Dez, 2005 19:38, insgesamt 1-mal geändert.
Benutzeravatar
oxpus
Administrator
Beiträge: 28735
Registriert: Mo 27.Jan, 2003 22:13
Wohnort: Bad Wildungen
Kontaktdaten:

Beitrag von oxpus »

My latest snippet will was written to differ between EACH lower and upper case!
Karsten Ude
-={ Das Mädchen für alles }=-
Kein Support per Messenger, Email oder PN! Unaufgeforderte Nachrichten werden ignoriert!
No support per Messenger, Email or PM. Each unasked message will be ignored!
Antworten