-
Author
-
December 25, 2013 at 07:00 #8757jaybiniParticipant
I want to fix the matching system since i changed the sex fields to “gender” instead of “I am a” and “looking for” so that if gender is man when search for a woman it gets him 49% matching for example, now it gives the same match whether its a man or woman, i dont want a man searching for a man and woman for a woman
December 27, 2013 at 14:28 #8792AbeKeymasterHi, if you no longer have the I am a, Looking for and you have just one Gender field, disable sex matching with:
$kleo_config[‘matching_fields’][‘sex_match’] = 0;
and add the Gender as a single value field, like:
$kleo_config[‘matching_fields’][‘single_value’] = array (
‘Gender’ => 50,
‘Country’ => 5,
‘City’ => 5
);Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution---
@ SeventhQueen we do our best to have super happy customers. Thanks for being our customer.December 29, 2013 at 04:56 #8885daniellemarieParticipantHi,
I’ve read all of the above comments but can’t quite get the matching system working correctly on my site.
My site is for people looking to meet others of the same sex. I have the following fields:
“I am/We are” (Gay Man, Bisexual Man, Lesbian Woman, Bisexual Woman, etc)
“Interested in Meeting” (Gay Men, Bisexual Men, Lesbian Women, Bisexual Women, etc)I also want to match the following Single Value fields:
“Status”
“Country”
“City”
“Drinking Habits”
“Dietary Preferences”
“Smoking Habits”As well as the following Multiple Value fields:
“For”
“Interests”Can you provide me with the code to add to my child theme’s functions.php file?
Thank you!
December 31, 2013 at 19:31 #8945AbeKeymasterHi, this should be the full code:
COPY CODE//change matching system add_action('after_setup_theme','kleo_my_match'); function kleo_my_match() { global $kleo_config; $kleo_config['matching_fields']['starting_score'] = 1; //If we want to match by members sex. values: 0|1 $kleo_config['matching_fields']['sex_match'] = 1; //required for initial match. If the sex preference matches it will continue to the specified fields below $kleo_config['matching_fields']['sex'] = 'I am/We are'; $kleo_config['matching_fields']['looking_for'] = 'Interested in Meeting'; //sex percentage $kleo_config['matching_fields']['sex_percentage'] = 49; //single value fields like select, textbox,radio $kleo_config['matching_fields']['single_value'] = array ( 'Status' => 10, 'Country' => 5, 'City' => 5, 'Drinking Habits' => 5, 'Dietary Preferences' => 5, 'Smoking Habits' => 5 ); //multiple values fields like multiple select or checkbox $kleo_config['matching_fields']['multiple_values'] = array ( 'For' => 5, 'Interests' => 5, ); }
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution---
@ SeventhQueen we do our best to have super happy customers. Thanks for being our customer.December 31, 2013 at 19:32 #8946AbeKeymasterHi, You are missing first line from the code:
add_action(‘after_setup_theme’,’kleo_my_match’);Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution---
@ SeventhQueen we do our best to have super happy customers. Thanks for being our customer.January 1, 2014 at 10:12 #8973daniellemarieParticipantHi Abe,
I’ve tried this code however the matches appear at 1% on all profiles. How can I fix this?
Thanks
January 1, 2014 at 22:48 #8981jaybiniParticipantI did it and still not working
This is my code now i made small numbers to c if its working its still gives me 80 match and so whatever
add_action('after_setup_theme','kleo_my_match');
function kleo_my_match() {
global $kleo_config;
$kleo_config['matching_fields']['starting_score'] = 1;
/*required for initial match. If the sex preference matches it will continue to the specified fields below
$kleo_config['matching_fields']['sex'] = 'I am a';
$kleo_config['matching_fields']['looking_for'] = 'Looking for a'; */
//sex percentage
$kleo_config['matching_fields']['sex_percentage'] = 0;
//single value fields like select, textbox,radio
$kleo_config['matching_fields']['single_value'] = array (
'Gender' => 2,
'Marital status' => 3,
'Country' => 5,
'City' => 5,
'Occupation' => 8,
'Annual Income' => 9,
'Education' => 8,
'Political Views' =>2,
'Religion' => 1,
'Body Type' => 2,
'Ethnicity' => 6
);
//multiple values fields like multiple select or checkbox
$kleo_config['matching_fields']['multiple_values'] = array (
'Interests' => 2,
'Languages Spoken' => 3
);
}
January 3, 2014 at 13:04 #9022AbeKeymasterHi, If the field names are correct in the code and users have added them to the profile the code should work.
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution---
@ SeventhQueen we do our best to have super happy customers. Thanks for being our customer.January 3, 2014 at 13:20 #9025AbeKeymasterHi, Sorry, the gender won’t match since it should be different option and not the same value as other fields so you should exclude it and change $kleo_config[‘matching_fields’][‘sex_match’] = 1;
COPY CODEadd_action('after_setup_theme','kleo_my_match'); function kleo_my_match() { global $kleo_config; $kleo_config['matching_fields']['starting_score'] = 1; /*required for initial match. If the sex preference matches it will continue to the specified fields below*/ $kleo_config['matching_fields']['sex'] = 'I am a'; $kleo_config['matching_fields']['looking_for'] = 'Looking for a'; //sex percentage $kleo_config['matching_fields']['sex_match'] = 1; //single value fields like select, textbox,radio $kleo_config['matching_fields']['single_value'] = array ( 'Marital status' => 3, 'Country' => 5, 'City' => 5, 'Occupation' => 8, 'Annual Income' => 9, 'Education' => 8, 'Political Views' =>2, 'Religion' => 1, 'Body Type' => 2, 'Ethnicity' => 6 ); //multiple values fields like multiple select or checkbox $kleo_config['matching_fields']['multiple_values'] = array ( 'Interests' => 2, 'Languages Spoken' => 3 ); }
Also redefine the function for the matching calculation
COPY CODEfunction compatibility_score($userid1=false, $userid2=false) { global $kleo_config; if ($userid1 && $userid2) { $score = $kleo_config['matching_fields']['starting_score']; //Sex match if ((isset($kleo_config['matching_fields']['sex_match']) && $kleo_config['matching_fields']['sex_match'] == '1') || !isset($kleo_config['matching_fields']['sex_match']) ) { $field1_u1 = xprofile_get_field_data($kleo_config['matching_fields']['sex'], $userid1); $field1_u2 = xprofile_get_field_data($kleo_config['matching_fields']['sex'], $userid2); if ( $field1_u1 != $field1_u2 ) { $score += $kleo_config['matching_fields']['sex_percentage']; } //if no sex match, return the score else { return $score; } } //single fields match if (is_array($kleo_config['matching_fields']['single_value'])) { foreach ($kleo_config['matching_fields']['single_value'] as $key => $value) { if ( xprofile_get_field_data($key, $userid1) && xprofile_get_field_data($key, $userid2) && xprofile_get_field_data($key, $userid1) == xprofile_get_field_data($key, $userid2) ) { $score += $value; } } } //multiple fields match if (is_array($kleo_config['matching_fields']['multiple_values'])) { foreach ($kleo_config['matching_fields']['multiple_values'] as $key => $value) { $field1 = xprofile_get_field_data($key, $userid1); $field2 = xprofile_get_field_data($key, $userid2); if ( $field1 && $field2 && $field1 == $field2 ) { $intersect = array_intersect((array)$field1,(array)$field2); if ( count($intersect) >= 1 ) { $score += $value; } } } } return $score; } }
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution---
@ SeventhQueen we do our best to have super happy customers. Thanks for being our customer.January 3, 2014 at 13:39 #9028daniellemarieParticipantHi Abe,
Was that last comment of yours for me or jaybini?
Thanks
January 4, 2014 at 23:38 #9120AbeKeymasterHi, This was the reply for you: https://archived.seventhqueen.com/forums/topic/match-numbers#reply-9022
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution---
@ SeventhQueen we do our best to have super happy customers. Thanks for being our customer.January 5, 2014 at 08:40 #9142jaybiniParticipantthe function compatibility_score is giving me score of 1 for all members even if they are have different gender
January 5, 2014 at 09:00 #9143daniellemarieParticipantSame here, still not working for me. I am using this code you gave me and still getting 1% match.
Is this the correct code for matching same sex?
January 5, 2014 at 09:28 #9144daniellemarieParticipantActually, it’s really about matching same sex for me. It’s just about getting the “sex” and “looking for” fields to match. So that if a female is looking for a female, the match is a success if they are viewing a profile of a female also looking for a female.
Hope this makes sense. Any more help you could give me would be appreciated. Thanks!
January 5, 2014 at 09:28 #9145daniellemarieParticipantActually, it’s not about matching same sex for me. It’s just about getting the “sex” and “looking for” fields to match. So that if a female is looking for a female, the match is a success if they are viewing a profile of a female also looking for a female.
Hope this makes sense. Any more help you could give me would be appreciated. Thanks!
January 6, 2014 at 10:28 #9192AbeKeymasterHi @daniellemarie
If you only want to match I am a with Looking for fields this is the code:COPY CODEadd_action('after_setup_theme','kleo_my_match'); function kleo_my_match() { global $kleo_config; $kleo_config['matching_fields']['starting_score'] = 1; $kleo_config['matching_fields']['sex_match'] = 1; /*required for initial match. If the sex preference matches it will continue to the specified fields below*/ $kleo_config['matching_fields']['sex'] = 'I am a'; $kleo_config['matching_fields']['looking_for'] = 'Looking for'; //sex percentage $kleo_config['matching_fields']['sex_percentage'] = 99; //single value fields like select, textbox,radio $kleo_config['matching_fields']['single_value'] = array (); //multiple values fields like multiple select or checkbox $kleo_config['matching_fields']['multiple_values'] = array (); }
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution---
@ SeventhQueen we do our best to have super happy customers. Thanks for being our customer.January 6, 2014 at 10:32 #9194AbeKeymastergive me some FTP access to take a look at your code if it still not working
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution---
@ SeventhQueen we do our best to have super happy customers. Thanks for being our customer.January 7, 2014 at 00:27 #9266AbeKeymasterYou need to follow the example and you need basic PHP knowledge
COPY CODEadd_action('after_setup_theme','kleo_my_match'); function kleo_my_match() { global $kleo_config; $kleo_config['matching_fields']['starting_score'] = 1; $kleo_config['matching_fields']['sex_match'] = 1; /*required for initial match. If the sex preference matches it will continue to the specified fields below*/ $kleo_config['matching_fields']['sex'] = 'I am a'; $kleo_config['matching_fields']['looking_for'] = 'Looking for'; //sex percentage $kleo_config['matching_fields']['sex_percentage'] = 99; //single value fields like select, textbox,radio $kleo_config['matching_fields']['single_value'] = array ("Status", "City", "Drinking Habits","Dietary Preferences","Smoking Habits","For" ); //multiple values fields like multiple select or checkbox $kleo_config['matching_fields']['multiple_values'] = array ("Interests"); }
FTP access isn’t correct. Please add it yourself
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution---
@ SeventhQueen we do our best to have super happy customers. Thanks for being our customer.January 7, 2014 at 00:43 #9268AbeKeymasterYou have missed my function above: https://archived.seventhqueen.com/forums/topic/match-numbers#reply-9025
I added it and all works 😉Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution---
@ SeventhQueen we do our best to have super happy customers. Thanks for being our customer.March 1, 2014 at 23:18 #11724BoblebadParticipantHi
I’m new to this and have read through the whole thread, but can’t figure out how this is working in detail.
How is age matched, can i have a range like 35-45 ?
How is text boxes matched, is the system matching the written text or ?
And what about the sexual preferences (straight, gay, bisexual) ?I also need to have match sections like this for more detailed match.
One for the physical (height, weight a.s.o.)
One for eating preferences (vegetarian, vegan, organic a.s.o.)
One for spiritual practice (meditation, working with energy a.s.o.)And maybe some more sections.
The main profile matc meter could be an overall meter calculated upon the sections totals, but i would like a more detailed match page where the sections are shown.
How is that possible ?
EDIT: Is it possible to have some kind of match/progress meter of some kind for how much the members have written about them selves, e.g. 200, 400, 600 charcters ?
All the best
CarstenMarch 5, 2014 at 21:01 #11977AbeKeymasterHi,
Age range can’t be matched, only field values can be matched so you can match the exact same age if you like
Text boxes are matched by the whole value as well as other single value fields.
Add your fields from Users – Profile fields and then include them in the code above
Right now the matching calculates the sum based on your fields. You will have to hire a developer to extend the functionality.See this http://wordpress.org/plugins/buddypress-profile-progression/
Cheers
AbeHi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution---
@ SeventhQueen we do our best to have super happy customers. Thanks for being our customer.March 5, 2014 at 23:17 #12000BoblebadParticipantHi Abe
Thanks for your reply 🙂
Just to understand this right, so the matching of a text box, is matching each word in it against the other members, so that each word that is not the same in them, will result in a lower match, and the ones that are the same will result in a higher match ?
And are you saying, if i make some check boxes, they will automatically be matched as well ?
Is there in the match some kind of graduation involved, like Very important, Important, Little important and Not important, has someone done that ?
And last, so i have to fit the code to match on the separate sections ?
And also the character count in progression, as to how much a member has written about him-/herself, cause the plugin you linked to, is just an overall progressen of the profile ?
Btw, has anyone tried to set a min input on the text boxes e.g. 200 characters ?
All the best
CarstenMarch 6, 2014 at 20:56 #12135BoblebadParticipantJust an addition.
Is the fields on the profile treated as posts ?
If so, then i might have a solution for the progression of each field 🙂
All the best
CarstenMarch 7, 2014 at 23:53 #12284AbeKeymasterIn the textbox the content has to be exactly to increase the matching otherwise it won’t
Checboxes will be matched if you add them in that code, yes
You add the fields you want to the example codeTry a plugin to set limitations for the profile fields or character count
Fields are fields,, they are not related to posts
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution---
@ SeventhQueen we do our best to have super happy customers. Thanks for being our customer.March 12, 2014 at 18:37 #12559JohnDoeParticipantJust wondering, but how would I add a third gender ( transgender ) in there?
Ps; Decided to re-launch my site 🙂 been gone for a while, hopefully ill have a nice stay again 😉
O and , are there any major changes since 2.2?
March 15, 2014 at 16:20 #12741AbeKeymasterHi, You should update. See the changelog: https://archived.seventhqueen.com/forums/topic/sweetdate-updates-change-log
Edit profile fields from Users – Profile fields
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution---
@ SeventhQueen we do our best to have super happy customers. Thanks for being our customer.March 15, 2014 at 16:22 #12743AbeKeymasterPs: glad you are back. Good luck with your site 😉
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution---
@ SeventhQueen we do our best to have super happy customers. Thanks for being our customer.October 20, 2014 at 10:34 #32174AbeKeymasterHi, you should take a look at my reply here that shows you how to change the fields that impact the matching: https://archived.seventhqueen.com/forums/topic/match-numbers/#post-2254
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution---
@ SeventhQueen we do our best to have super happy customers. Thanks for being our customer.October 21, 2014 at 16:42 #32410AbeKeymaster@Andrey48rus it only matches what they have chosen in their profile in “I am a” and “Looking for” fields.
If you want to change the functionality you can modify the function named compatibility_score in wp-content/themes/sweetdate/custom_buddypress/bp-functions.phpHi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution---
@ SeventhQueen we do our best to have super happy customers. Thanks for being our customer.October 21, 2014 at 16:53 #32414AndreyParticipantYes I understand, help me with this theme, it is more urgent for me!
October 21, 2014 at 16:55 #32415AbeKeymasterWill look sure
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution---
@ SeventhQueen we do our best to have super happy customers. Thanks for being our customer. -
AuthorPosts
The forum ‘Sweetdate – WordPress’ is closed to new topics and replies.