Forum Replies Created
-
Noizeburger, I’ve been testing your solution for a few days now and it’s working great. I’ve also found a way to improve it slightly, and I’m pretty sure a good PHP developer could improve it even more. Let me explain:
With your solution, the search is made on the term “band” for instance. But if people who have another type of profile have the word “band” in ANY field of their profile, the search will find them anyways. So I thought it is possible to write a script that hides the unwanted results. I used Javascript but I’m pretty sure it would be better in PHP.
In order to do that, I added a PHP line that includes the profile type field in the search result. Then with Javascript, I parse that line and, depending on the URL of the page, I give different classes to search results. For instance, if I was on the “band” page, I give all the “bar” profiles a CSS class that hides them. Works perfectly.
There is a problem though: since the unwanted profiles are just hidden but still exist in the HTML code, the loop counts them anyway and so the search results count does not match the number of profiles that are displayed.
Yes, you’re right, that’s what I want to do, to have two different memberlists that can be displayed separately on two different pages.
Your solution seems to work just fine on your website. I would prefer it if there was a way to filter the members directly in the members loop for instance, but your way is pretty interesting too.
Does the ?s=xxx thing work by default on Buddypress or do I have to code it myself ? I’m kind of a beginner with Buddypress and I’m not really good in PHP, so the easier the better