BP Profile Search
[Updated February 14, 2011]
When I had a chance to look into BuddyPress, the ‘social networking in a box’ for WordPress, I noticed that a plugin to search, or filter, the members directory was still missing.
So I released BP Profile Search. BP Profile Search adds a configurable search form to the Members directory page, so visitors can find site members searching their extended profiles.
This page contains the updated documentation for BP Profile Search 2.4.
Features
BP Profile Search shows your visitors a form to search or filter your Members directory. In the plugin admin page you can access the following options:
* Specify the text for the form header and welcome message (HTML enabled).
* Enable the show/hide form feature.
* Select the profile fields to include in the search form (currently the datebox profile fields are not supported).
* If your extended profiles include a birth date field, enable the age range search, so your visitors can specify the minimum and maximum age for their search.
* Select the search mode for text fields, between:
– partial match, where a search for John matches field values of John, Johnson, Long John Silver, and so on;
– exact match, where a search for John matches the field value John only.
In both modes the wildcard characters % (percent sign), matching zero or more characters, and _ (underscore), matching exactly one character, are available to your visitors to better specify their search.
* Select the members list to filter, if your Members Directory page contains more than one.
Installation
After the standard manual or automatic plugin installation procedure, you’ll be able to access the plugin admin page BuddyPress -> Profile Search.
Before you can use the plugin, you have to add the profile search form to your BuddyPress Members page.
If you are using the BuddyPress default theme, open index.php in the buddypress/bp-themes/bp-default/members folder, locate this line (around line 14):
</div><!-- #members-dir-search -->
and, right after that, insert the BP Profile Search form:
<?php do_action ('bp_profile_search_form'); ?>
If you are not using the BuddyPress default theme, you have to insert the BP Profile Search form somewhere in your theme Members page.
Troubleshooting
- If your search always returns the full members list, try changing the Filtered Members List value in the Advanced Options tab.
Conclusions
I hope you find this plugin useful and help me improve it, with your suggestions, bug reports, and patches. BP Profile Search is available for download in the WordPress Plugin Directory and in the BuddyPress Plugin Directory.
Hello!
I just wanted to say your plug in is great! I did have to rename the folder as suggested but everything else seemingly works so far. Thank you very much for such a great addition to BuddyPress/WordPress! The only suggestion/request/feedback I have so far is that searches don’t find words within the fields. As in the search only returns results that are exact matches. So if I have a multi-line field with a bunch of information unless everything is copied in word for word into the search it doesn’t find it (versus putting in one word or two words that happen to appear in the field). Thank you again!
@Online RPG Profiles
Thank you for your kind words! The feature you suggest is coming with the next plugin version (end of July?)
Update: the choice between partial match and exact match for text searches is available in BP Profile Search 2.3.
Hi there!
I installed everything and the form shows up fine but I can’t seem to get it to work. Any thoughts on what I might be doing wrong? (The website is not yet complete.)
http://cineclat.com/members/
Thanks and best wishes,
Kristen
Hi Kristen,
the search form on your site is working fine for me, perhaps you solved the problem already?
Hi Andrea-
Never mind – I’m an idiot. lol (I didn’t think I had filled out the information on the admin profile but apparently I did.)
It’s brilliant – thank you so much!
@andrea I can’t wait! I’ll be signing up for wordpress.org shortly to give your add on a 5/5! Thanks for the response!
Hello once again! One more quick question: In the next release, will multi-select drop down and check box field be supported as well? Thank you!
@Online RPG Profiles
Yes, I hope so!
Update: support for multiselectbox and checkbox profile fields is available in BP Profile Search 2.0.
@andrea You are amazing! Can’t wait to see how it works out. Thanks again!
Well done on this plugin… it is the deciding vote so far on switching from e107 to wordpress, i look forward to new updates etc
Ooops! My comments unfortunately have been lost. So, let’s start again. The problem is as it written below: i use BP Columns 1.2 theme and the results of search appear not below the search form, but in “users” widget in the left sidebar (see http://www.intimati.ru/members/). How can i improve this? Thanks.
@teteryonok
The plugin operates by filtering the members list in the page, and it filters the first list it finds. So if you disable the sidebar widget, it will filter the main members list.
@andrea
Thanks a lot
Quick question – can I use this on the homepage? How can I make it re-direct upon submit to the proper search results?
I want to have this as a home php widget .. Works fine if I have it in members; possible to make work under home directory?
@WordPress Consultant
Currently BP Profile Search works by filtering the member directory entries, and it has to stay on the members page in order to be effective. But if you display the member directory and the search form on the home page, the directory will be filtered to show the search form results.
Absolutely superb work – I’ve mentioned the need for this a number of times on the Buddypress forums, as have other people, and what you’ve done here opens up Buddypress for a massive range of extra websites.
Thank you very, very much indeed…:-)
Thank you Aran for your kind words!
Have tried inserting it in several places but can’t get it to show up. I’m using the buddypress template pack so tried it there as well is in the main theme. Can’t find which place the members functions are loading from. Thanks.
Hi Dave,
the BuddyPress Template Pack adds a few files to your theme’s folder. So you can open members/index.php in your theme’s folder, then follow the above instruction to add the search form to the Members Directory page.
Hi, plugin works but shows no fields to search in:
Profile Search
You can find site members searching their public profiles. Search by any or all of the fields below: (and there is nothing below except Search and Clear Form).
Thanks for any advice.
Hi Tony,
Probably you need to customize the search form in the plugin admin page: BuddyPress -> Profile Search.
I love bp profile search, but one thing I want, is the option to search in an area, like from age of 20 to the age of 30. how can I go about to do this?
Hi Kalle,
I’m putting the final touches on that feature, and I hope to release it with the next plugin version. Thank you for your interest!
Update: the age range search option is available in BP Profile Search 2.2.
Thank you for creating what appears to be a simple solution, allowing powerful features for us to share with our users. Unfortunately, I’m not able to get this implemented using my current theme. If you go to http://vetworkingla.org, you’ll see that we’re using the free CosmicBuddy theme (so I think the Members page is members-loop.php), but I can’t find the line of code you referenced above to even paste the search form into.
Would love to have our Veteran users find each other by searching Branch of Service, Location, or Industry Interests.
Thanks in advance for the help.
-Travis
Hi Travis,
to add the search form to the Cosmic Buddy theme, open index.php in the cosmicbuddy/members folder, locate this line (around line 11):
<h2 class="widgettitle"><?php _e( 'Members Directory', 'buddypress' ) ?></h2>and, right after that, insert the BP Profile Search form:
<?php do_action ('bp_profile_search_form'); ?>That’s all! Remember to customize the search form in the plugin admin page: BuddyPress -> Profile Search.
Hi
I recently uploaded the plugin upgrade for BP Profile Search. After uploading, the form on my Buddypress members page has dissappeared. I tried going onto the Dashboard and clicking Profile Search to adjust or reset the fields but it just throws me out. Can this have anything to do with me changing the original Profile Search from BuddyPress Profile Search to just Profile Search?
Andy
Hi Andrew,
yes, you have to rename your plugin folder name from bp-profile-search to profile-search and then reactivate the plugin. I think that’s a WordPress bug, I’ll investigate further as soon as I can.
Hi! I love your plugin! I was wondering if there is a way to have a profile search on the home page. If so, do you know how to put it there? I am using BP columns theme. Thanks!
Hi Mary,
this plugin operates by filtering the members list, so it can be added on a page which already displays a members list. If you display a members list on your home page, you can add the profile search on that page as well, following the installation instructions.
Hi Andrea,
Thank you very much for this super usefull plugin.
I use it on a network site that I am building up for arists, basically to help them finding each other.
I have a field “Skills”. and I have have made a profile for my self writing: bass, cello, keyboard….
Unfortunatly, it seems like your plugin, does not know how to search when there is more than one word in a field. Am I correct ? Could this somehow be fixed, or can you give a hint about where to start, if i wanna try fix it.
Thanks!
Hi August,
currently to search for a word in a larger text you have to use the wildcard characters, see the readme file. E.g. in your case you have to search for %cello%, and that will match the word cello in any larger text.
I understand that’s not convenient for a casual user, so in the next plugin version I’m going to add an option in the admin panel to specify the default searching method. If you are interested, I can send you a beta version for your testing.
Hi Andrea,
Thank you very much for a fast reply, Yes i would like to beta test it. The network is not so big yet, since it’s just launched, but will hoepfully grow, and then we will need the best search features possible, since thats the main idea for the site.
unfortunately, I am not a php programmer, I can only do “homemade hacks”, so i am reliable on people like you who make this nice plugins:-)
Maybe you can use some of this info: ?
http://www.joedolson.com/boolean-query-in-mysql.php
Andrea, I would love to run the beta as well!
August, Candace,
I’ve just sent you the beta version. I’m looking forward to your feedback!
Hi! I had upgraded to the latest version of your profile search plug in, however, now it will not work for searches. When you enter which gender you would like to search, it pulls up all of the members instead of filtering them by gender. Any suggestions? Thanks!
Hi Mary,
it’s difficult to tell without more information. If you wish I can debug this issue, and I’ll need admin and FTP access on your test site.
Update:
The problem explanation is simpler than I thought. Since this plugin filters the member list in the page, and it filters the first list it finds, it was filtering the results in the left sidebar widget, that is the search results were shown in the left sidebar.
If you remove that widget, the plugin will correctly filter the main members list. In a future plugin version I’ll try to remove this limitation.
Once again, thank you very much for the plugin update for the BP search profile. It works great!
Do you know if there is a way that I can build a separate search page that by default open the “show search form”.
+ Do you know if there any way that I can make a search string url, that filter members the same way as your plugin?
As an example an url that output search in the fields COUNTRY=denmark, SKILSS=bass ?
http://www.globalunits.net
Hello August,
I’m glad the new version works for you! I’m going to release it soon.
You can have a separate search page if you write a new page template, containing the profile search form (do_action…) and then a display of the members list, so that list will be filtered by the plugin. You can modify the show/hide form option from the admin panel, but that option will be effective for all the plugin instances in your site.
Currently it’s not possible to use a search URL, but that’s a good suggestion for a future release!
@andrea
OH MY GOSH! I was having this same issue and was pulling my hair out! Thank you so much for posting this update!
Hi Candace,
This looks like a common issue, so I’m going to mention it in the main post. Thank you for your feedback!
Hi Andrea,
Thank you for the reply concerning search page and search URL.
I don’t understand how you can think of it as an update, wouldn’t it be Buddypress itself that will have to be updated then? OR do you mean that your could make in extension to the plugin, that could grab the url you type into the browser, and the use it to automatically fill in the fields in the search form.
like: http://www.globalunits.net/home/members//?s=bass&#field=skills – or whatever…..(I don’t know how to write this kind of commands, just an example of an idea..
@August
Yes, I was thinking of an extension to the plugin, that could use the URL to fill up the search form and activate the search.
Greetings,
I like this plugin, thanks for the hard work on it.
It was working just fine on my site until I made the recent upgrade… now when conducting a search, it returns all members no matter what is searched. Can I just downgrade back to the old version or is there something I can do to fix this one?
Thanks!
@ifanatics
If you have a members widget in the Members page, try removing it. If that doesn’t work, I may need to look at your site. Please let me know!
I have the latest WordPress and BuddyPress. I installed this Plugin and when I try to activate it I get the following. I get the same if I try to delete it. Adding the line to index.php does not help anything. Has anyone seen this before? Any way I can delete the plugin and try again?
Method Not Implemented
GET to /fortcollins/wp-admin/plugins.php not supported.
Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
Hi Steve,
To delete a plugin you can delete its folder from your FTP file manager. Please let me know if the problem doesn’t go away.
Hi Andrea, Your plugin works great! This is just a feature request
Are you working on a location search field? That is, if I want to do a search of members whereby they could enter their City or Zip Code in a field and then be able to sort the database by Distance? In addition, I happen to live in Germany, so something that would not be confined to “State” as in the USA, because over here they have other terminology.
I currently solve for this by having a “City” field, but this doesn’t let me solve for Distance, and it’s a problem in languages/countries that have multiple spellings for cities.
Something with Google Map API would be pretty handy.
There was an earlier plugin that was discontinued that had some of these features, and I still see people asking for it: http://wordpress.org/extend/plugins/buddypress-geo/
In any case, THANK YOU!
Done, thank you. I will try to install again.
@Bryan
Hi Bryan,
The location search is an interesting feature, I’ll add it to my to-do list. Thank you for your suggestion!
Andrea, have you seen the error I described above? I tried to reinstall and same error.