[RC] Search Custom Profile Field

A place for MOD Authors to post and receive feedback on MODs still in development. No MODs within this forum should be used within a live environment!
Scam Warning
User avatar
4_seven
I've Been Banned!
Posts: 5155
Joined: Wed Apr 30, 2008 1:41 am

Re: [BETA] Search Custom Profile Field

Post by 4_seven »

i believe it. in the version named in this post this and other things are fixed: so may wait a bit or may manic2 fix it meanwhile..
Current Mods | Mod Base | php(BB) programming | No help via PM
manic2
Registered User
Posts: 435
Joined: Thu Jun 12, 2008 9:16 pm

Re: [BETA] Search Custom Profile Field

Post by manic2 »

Cubguy501 wrote:

Code: Select all

$sql_where .= ($family_name) ? ' AND fd.pf_family_name ' . $db->sql_like_expression(str_replace('*', $db->any_char, $family_name)) . ' ' : '';
... now im having a similair problem as someone else i think i read on this thread, is the search is Case-Sensitive!
Can you try making that line in this format (adjusting family_name to name if that's your CPF)

Code: Select all

$sql_where .= strtolower($family_name) ? ' AND LOWER(fd.pf_family_name) ' . $db->sql_like_expression(str_replace('*', $db->any_char, strtolower($family_name))) . ' ' : '';
manic
manic2
Registered User
Posts: 435
Joined: Thu Jun 12, 2008 9:16 pm

Re: [BETA] Search Custom Profile Field

Post by manic2 »

Mod updated to version 0.0.2 to be case insensitive, download link on first page.
manic
Cubguy501
Registered User
Posts: 141
Joined: Mon Feb 07, 2011 8:39 pm

Re: [BETA] Search Custom Profile Field

Post by Cubguy501 »

YEP! that seems to work perfect! i tried all combinations and it always got the same results!
mattconley2011
Registered User
Posts: 114
Joined: Sat Jan 16, 2010 6:49 am

Re: [BETA] Search Custom Profile Field

Post by mattconley2011 »

Possibilty to make it so you don't have to put the * if you are searching part of the name only?
manic2
Registered User
Posts: 435
Joined: Thu Jun 12, 2008 9:16 pm

Re: [BETA] Search Custom Profile Field

Post by manic2 »

mattconley2011 wrote:Possibilty to make it so you don't have to put the * if you are searching part of the name only?
I'd rather leave it the way that the rest of the memberlist search works:-
To match partial data use * as a wildcard.
but if you really want to do it:-

Open memberlist.php
Find:-

Code: Select all

$family_name		= request_var('family_name', '');
Add after:-

Code: Select all

$family_name = $family_name  . '*';
manic
pld32
Registered User
Posts: 5
Joined: Wed Mar 23, 2011 5:14 pm

Re: [BETA] Search Custom Profile Field

Post by pld32 »

I'm installing and getting this error. I'm running as the administrator and I'm the one who setup the forum.

The file ./../memberlist.php could not be copied into place.

Any idea's please.
manic2
Registered User
Posts: 435
Joined: Thu Jun 12, 2008 9:16 pm

Re: [BETA] Search Custom Profile Field

Post by manic2 »

pld32 wrote:I'm installing and getting this error. I'm running as the administrator and I'm the one who setup the forum.

The file ./../memberlist.php could not be copied into place.

Any idea's please.
It's not a problem with the actual mod.

How are you doing the edits? It's best to use an ftp programme like filezilla to download any files, make the edits with a file editor such as notepad++ then re-upload them with filezilla.

Alternatively if you are using Automod to install this then you need to ask over in the Automod section.
manic
manic2
Registered User
Posts: 435
Joined: Thu Jun 12, 2008 9:16 pm

Re: [BETA] Search Custom Profile Field

Post by manic2 »

See discussion here for when using with Field type of 'Dropdown box':-
http://www.phpbb.com/community/viewtopi ... &t=2133967
manic
cutefan
Registered User
Posts: 17
Joined: Fri Jul 08, 2011 9:08 am

Re: [BETA] Search Custom Profile Field

Post by cutefan »

Hi,

I have a problem with accents.
For example I have a CPF 'name'. Let's say that the name is "Stéphane", in that case, the user search won't work.
When a user search the name "Stéphane" it will not find any result, but "St*" works well.
My char-set is in UTF8.

I tried :

Code: Select all

$name        =  utf8_encode(request_var('name', '') . '*');
 

Code: Select all

$name        =  utf8_decode(request_var('name', '') . '*');
  
Echo ($name) gives "st??phane"

Any ideas?
Thanks,
User avatar
4_seven
I've Been Banned!
Posts: 5155
Joined: Wed Apr 30, 2008 1:41 am

Re: [BETA] Search Custom Profile Field

Post by 4_seven »

read from here
http://www.phpbb.com/community/viewtopi ... #p13008321
may it is the reason.

utf8_decode + utf8_encode is no solution
Current Mods | Mod Base | php(BB) programming | No help via PM
User avatar
4_seven
I've Been Banned!
Posts: 5155
Joined: Wed Apr 30, 2008 1:41 am

Re: [BETA] Search Custom Profile Field

Post by 4_seven »

i forget...

try

Code: Select all

$name        =  request_var('name', '', true) . '*'); 
for multibyte support ;)
Current Mods | Mod Base | php(BB) programming | No help via PM
cutefan
Registered User
Posts: 17
Joined: Fri Jul 08, 2011 9:08 am

Re: [BETA] Search Custom Profile Field

Post by cutefan »

Worked like a charm, thx :D
cutefan
Registered User
Posts: 17
Joined: Fri Jul 08, 2011 9:08 am

Re: [BETA] Search Custom Profile Field

Post by cutefan »

Hey,

I am facing another problem, the CPF values are reset when the page reloads.

I noticed that this URL works: http://test.net/forum/memberlist.php?us ... r&name=cat (name is my CPF)

So I did the following change to memberlist.php, and I managed to add the CPF to the URL:

Code: Select all

 $check_params = array(
 'name'            => array('name', '', true),
 
However, even if the CPF value is in the URL I couldn't get it to show the value in the input area.
I tried value="{NAME}" without sucess.

Any ideas?
Thanks,
manic2
Registered User
Posts: 435
Joined: Thu Jun 12, 2008 9:16 pm

Re: [BETA] Search Custom Profile Field

Post by manic2 »

In your HTML file which is something close to this:-

Code: Select all

<dd><input type="text" name="name" id="name" value="" class="inputbox" /></dd>
In line find:-

Code: Select all

value=""

Replace with:-

Code: Select all

value="{NAME}" 
Then in your memberlist.php file
Find:-

Code: Select all

'ICQ'		=> $icq,
Add after:-

Code: Select all

'NAME'	=> $name,
This is from memory so come back here if it doesn't work.
manic

Return to “[3.0.x] MODs in Development”