This topic has 1 reply, 2 voices, and was last updated 9 years by Abe.

  • Author
  • #51102
     omtr
    Participant

    Hi Forums,

    cause i don’t like the age matching feauture in sweetdate, i tried to modify it:

    the more the two ages vary, the less score your get.

    i assume that if the age difference is lager thatn 15, you don’t get any extra points for the matching score.

    it’s a simple job if you know where to drop some extra lines of code. to be honest: i’m not really a good php coder, that’s why i call it an “Idio’s guide”. feel free to improve it – and share.

    here is how to modify your code:

    1. open wp-content/themes/sweetdate/custom_buddypress/bp-functions.php
    2. search for:

    COPY CODE
    			//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;
    					}
    				}
    			}

    3. add the following code below:

    COPY CODE
    			//age match
    			$age1 = get_member_age($userid1);
    			$age2 = get_member_age($userid2);
    			if ($age1 > $age2) {
    				$agediff = $age1 - $age2;
    			} else {
    				$agediff = $age2 - $age1;
    			}
    			$score += 15 - $agediff;

    that’s it!

    p.s. maybe someone can post how to put that stuff into sweetdate-child/functions.php? i think that’s a bette place to put that stuff, but as i already mentioned i am not very good at coding.

    #54151
     Abe
    Keymaster

    Hi, thanks for the info, I am sure others will find it useful and I have added it to the FAQ sub forum.

    Cheers

    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.

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.

Log in with your credentials

Forgot your details?