eriksson1337
Forum Replies Created
-
Forum: Plugins
In reply to: [BP Profile Search] Match one field with multiple othersThis seems to work. Is the order specified by the field name (for example field_1, field_2) or by the order i put them in the search form? And would it be possible to change the settings several times (for example the first 2 fields OR, then AND and the last two fields OR)?
Thank you
Forum: Plugins
In reply to: [BP Profile Search] Match one field with multiple othersHello,
so i tried it out like in your code, for example the first 2 fields try to match the same field and should be OR
add_filter ('bps_match_all', '__return_false'); add_filter ('bps_field_sql', 'change_query1', 10, 2); function change_query1 ($sql, $f) { if ($f->code == 'field_1') $sql['where']['field_id'] = 'field_id IN (1)'; return $sql; } add_filter ('bps_field_sql', 'change_query1', 10, 2); function change_query2 ($sql, $f) { if ($f->code == 'field_2') $sql['where']['field_id'] = 'field_id IN (1)'; return $sql; }
And the 3rd field and so on do match other fields and should be AND
add_filter ('bps_match_all', '__return_true'); add_filter ('bps_field_sql', 'change_query3', 10, 2); function change_query3 ($sql, $f) { if ($f->code == 'field_3') $sql['where']['field_id'] = 'field_id IN (3)'; return $sql; }
But somehow it only applies the filter that is toggled last, so it’s either OR or AND for the whole form. Id there any solution for that?
Thank you
Forum: Plugins
In reply to: [BP Profile Search] Match one field with multiple othersHow can i try to toggle add_filter (‘bps_match_all’, ‘__return_true’); after the third occurrence? Because it seems like you have to choose true or false for the whole form, depending on which filter is used last in the code.
Thank you
Forum: Plugins
In reply to: [BP Profile Search] Match one field with multiple othersIt works, thank’s a lot.
Forum: Plugins
In reply to: [BP Profile Search] Match one field with multiple othersThat could work, but the thing is that i need to have 3 search fields and if one of them matches a users (Text) field, it should match. The problem is, if one matches and the other 2 don’t, the user won’t be shown in the search results. So is it somehow possible to make a statement like:
IF Searchfield1 == UserTextfield OR IF Searchfield2 == UserTextfield OR IF Searchfield3 == UserTextfield THEN show User1 in the Search results?Thank you
Forum: Plugins
In reply to: [BP Profile Search] Match one field with multiple othersHi,
it’s a Text Box.
Forum: Plugins
In reply to: [BP Profile Search] Match one field with multiple othersThank you, it works. This way, it was also possible to match 3 search form fields with one field (for example: the search form has the fields color 1, color 2, color 3. The users have only one field: favorite color).
Is it possible to get the search results if one of the fields matches, even though the other fields have a different value?
For example: Search form fields: color 1 = blue, color 2 = red, color 3 = yellow.
The users field favorite color: red.
So normally, it wouldn’t show the user in the search results, because field 1 and field 3 didn’t match.
Is it possible to make like an OR statement for some fields?
It works, thank you.
Forum: Plugins
In reply to: [BP Profile Search] Match one field with multiple othersYes, for example user 1 and 2 have let’s say 3 fields for favourite colors. And i don’t know in what order they will provide them so if user 1 has blue in field 1 and user 2 has blue in field 3, they should still match.
Is there a way to manually edit the logic (for some fields)?
Thank you.
Hello,
setting the default values works great, except of that it does not work with checkboxes. Have you got a solution for that?
Thank you
Thank you.
Thanks for your reply.
Would it also be possible (for example) to match the users own field 5 with the other users field 6?
And is there any solution yet for making BP Profile Search work with Conditional Profile Fields for BuddyPress without having to write a custom form template?