This topic has 7 replies, 2 voices, and was last updated 10 years by Abe.

  • Author
  • #8788
     frien337
    Participant

    Hello Everyone,

    I see a lot of mention about the following plugin in this forum:

    http://wordpress.org/plugins/buddypress-xprofile-custom-fields-type/

    However, it doesn’t seem to work very well for me. I have tried using it on several fresh installs but I always get the same problem. The problem seems to be that the template no longer recognises the date of birth field when I use this plugin.
    Going to “Sweet Date > BuddyPress > Age Field” i get a small message saying that there is no age field.

    Please do let me know how you got this plugin to work? I would like to use it so that the birthdate doesnt show on the profile page, but rather just the age in years.

    Thanks,
    Ryan

    #8816
     Abe
    Keymaster

    Hi, We did some changes to support the Birtdate field from this plugin. So please replace this files content until next update:
    wp-content/themes/sweetdate/custom_buddypress/bp-functions.php with https://archived.seventhqueen.com/files/bp-functions.txt

    wp-content/themes/sweetdate/custom_buddypress/kleo-bp-search.php with https://archived.seventhqueen.com/files/kleo-bp-search.txt

    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.

    #8819
     frien337
    Participant

    Thanks Abe, it has worked perfectly 🙂

    #8825
     Abe
    Keymaster

    Cool 🙂

    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.

    #8830
     frien337
    Participant

    Hey Abe – disaster 🙁 🙁 The fix works fine on the profile page and searching, however, it removes the Birthday selector from the registration page… any ideas?

    #8831
     Abe
    Keymaster

    My code doesn’t have anything to do with registration page 🙂

    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.

    #10137
     frien337
    Participant

    Hi Abe,

    I found a new problem with this plugin, unfortunately it doesn’t allow users to edit their profile. The user can access the edit profile page, can save his changes, but then they don’t appear when his profiled is viewed.
    Do you have more ideas on what to do? Or even how to get the standard birthday field to show the user’s age instead of the full birthdate (like the members directory does).

    Thanks,
    Ryan

    #10285
     Abe
    Keymaster

    Hello, I developed this function to show the age instead of the date. Add it to your functions.php file

    COPY CODE
    
    add_filter( 'bp_get_the_profile_field_value', 'kleo_get_field_value', 15, 3);
    
    	function kleo_get_field_value($value, $type, $field_id) {
    
    			$value_to_return = $value;
    	
    			$field = new BP_XProfile_Field($field_id);
    			
    			if ($type == 'datebox') {
    				$value_to_return = floor((time() - strtotime($field->data->value))/31556926);
    			}
    			
    			return $value_to_return;
    	}
    
    
    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 8 posts - 1 through 8 (of 8 total)

The topic ‘Xprofile Fields Plugin Compatability with Sweet date’ is closed to new replies.

Log in with your credentials

Forgot your details?