PDA

View Full Version : Search members by custom profile fields


Admin
02-24-2002, 10:00 PM
Here's another quick hack, allows your users (you can already do this in the Admin CP) to find other members using custom profile fields.
This hack will use all the fields you have set up, except those that are marked as "Hidden".

For a demo, I attached a screen shot of this in post #2.

Have fun! :)

Admin
02-25-2002, 06:28 AM
Demo...
(What do you say about my drawing skills, eh? :D)

TECK
02-25-2002, 06:52 AM
lol.. anyway, sheila will be happy right? another happy user :D

Reeve of shinra
02-25-2002, 12:08 PM
Out of idle curiousity, if you happen to have alot of custom fields, will this add any lag time?

Admin
02-25-2002, 12:23 PM
No.

neal
02-25-2002, 03:10 PM
lookng great, another good one chen!

incursio
02-25-2002, 07:46 PM
If the search produces more than 1 page of results, the hack doesn't work for subsequent pages - FYI.

incursio
02-25-2002, 08:08 PM
An easy fix (adds another query, but I don't care):

in memberslist.php, find


$pagenav = getpagenav($totalusers,"memberlist.php?s=$session[sessionhash]&action=$action&what=$what&ltr=$ltr&perpage=$perpage&orde
rby=$orderby&ausername=$ausername&ahomepage=$ahomepage&aicq=$aicq&aaim=$aaim&ayahoo=$ayahoo&joindateafter=$joindateafter&joindatebef
ore=$joindatebefore&lastpostafter=$lastpostafter&lastpostbefore=$lastpostbefore&postslower=$postslower&postsupper=$postsupper&direct
ion=$direction$extra_stuff");


First, add the "$extra_stuff" to the end. Then right above this line, add:


$bgcounter=0;
$tmprc=$DB_site->query("SELECT profilefieldid FROM profilefield WHERE hidden=0");

while ($profilefield=$DB_site->fetch_array($tmprc) and ++$bgcounter) {
$fldname = "fields[" . $bgcounter . "]";
$realfld = "$fields[$bgcounter]";
$extra_stuff .= "&" . $fldname . "=" . urlencode($realfld);
}
if($tmprc) $DB_site->free_result($tmprc);


Seems to work for me.

rx7forums.com
02-26-2002, 08:14 PM
Just installed and nothing happens when I search via a locaton. What could be wrong take a look here. http://www.rx7forums.com/forums/memberlist.php?action=search

KuraFire
05-06-2002, 07:30 PM
Thanks man, this hack is great, and seems to work just fine :):up:

Takara
05-07-2002, 11:27 AM
I modified this just a bit so that it only searches one extra profile feild, and it works great.

Thanks ^_^ :bunny:

roxics
07-02-2002, 09:22 AM
Hey this is great. Thanks

Just curious though. How could I integrate some of these search fields into a table on the front page of my website?

Admin
07-02-2002, 01:48 PM
I'm not sure what you mean, roxics.

roxics
07-02-2002, 04:47 PM
Well lets say I go into Advanced members search on the board. But I want to take a few of these seach fields and stick them on the front page of the site. So that when people arrive at the site they see some fields on the left in a table called "Seach members by location"

Just a way of making the seach fields more accessable.

Admin
07-02-2002, 06:03 PM
Copy the form you see in the search page, and remove the fields you don't need.

roxics
07-02-2002, 06:49 PM
Wow that was super easy. Thanks. I don't know why I thought it would be more complicated then that. :)

Keith
09-10-2002, 07:42 PM
Hi Chen,

A long time ago I requested a hack similar to this. The actual request was for admin level only, to be able to search and find members based on a custom profile field, and generate a mail list for it.

It was based on identifying members with boats under 24 feet for instance so we could send a custom email. But I think it may have been posted before VBulletin.Org started. May have posted the request on VBulleting.com.

Anyways, how can I edit this code to simply allow the admin only to do the search on custom fields to generate an email list?

cobradude
09-11-2002, 05:14 AM
Works like a charm on 2.2.7

Thanks FireFly!

aadvani
10-01-2002, 02:40 AM
For which vB version is this hack?
I have vB 2.2.7 and the memberlist.php file does NOT contain any code such as what is mentioned in your [FireFly] attached file "search_mlist_2.0.txt".
AA

aadvani
10-10-2002, 12:06 PM
Figured it out, finally!
GREAT hack, FireFly - thanks!
AA

telc
10-29-2002, 03:30 AM
will this be part of v3

USODJA
12-17-2002, 04:13 PM
Is there a working version for 2.2.9 .... some parts of the code are different

zimmerm
01-09-2003, 04:59 AM
is there anyway to modify this so that you can access a new search page that will allow you to only search one of the custom fields?

Gutspiller
01-18-2003, 10:57 PM
I have an older board and I got all the way through the instructions, but the last step:

In the "memberlistsearch" template, add $customfields right *above* this:

<tr>
<td bgcolor="{tableheadbgcolor}" colspan="2"><normalfont color="{tableheadtextcolor}"><b>Options</b></normalfont></td>
</tr>

I don't have a "memberlistsearch" template. Can anybody help me on where I might add this last step on an older board?

Please Help. :(

lemarsu
04-06-2003, 06:57 PM
It is a bit unrelated to this thread... but in another way it is very much so related.....

Is there a way to add the custom profile fields in the search of Email Users in the admin section ?

Thanks
LeMarsu

floridaideal
04-08-2003, 07:43 AM
Hi all

I have set this great hack up but would like the users to be able to search just one profile field, can anyone tell me what I need to change to do this.

Thank you

Stuart

themonarch
08-24-2003, 08:25 PM
Got a parse error on vBulletin 2.3.2.

gmarik
11-04-2003, 06:46 PM
Oh, I would love to have it working on 2.3 as well. Chen?!

Robert Basil
11-13-2003, 02:03 PM
Oh, I would love to have it working on 2.3 as well. Chen?!

(In my best AOL voice)..... Me too! ;)

Tilmanitou
01-12-2004, 10:48 PM
(In my best AOL voice)..... Me too! ;)

Me too! seems it is not working on v2.3.? Please let us know Chen! :nervous:

ricker
01-27-2004, 07:12 PM
GOOD STUFF
*installs*

Tilmanitou
01-29-2004, 06:45 PM
GOOD STUFF
*installs*

did you get it to run on vb 2.3.3 ?
please let us know!

Emmy2
03-14-2004, 01:32 AM
I just installed this on vb2.3.4 and it works perfectly.

John Diver
03-05-2007, 12:15 PM
Sorry to bring up such an old thread, is this available for vb3?