WordPress.org

Ready to get started?Download WordPress

Forums

Buddypress Xprofile Custom Fields Type
[resolved] Birthday field should display as age. (26 posts)

  1. nola.geek
    Member
    Posted 1 year ago #

    The 'Birthdate' field should show on the user's profile as their current age, NOT as their actual birthday. Also, even though I have visibillity set to 'let user decide' the option for the to hide the information does not show in their profile. If possible, they should have the following options:

    1) Anyone
    2) Logged in users
    3) Age only (birthdate hidden)
    4) Hidden

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

  2. donmik
    Member
    Plugin Author

    Posted 1 year ago #

    Great idea! In the version 1.3, we just added this. We put a checkbox that if it's checked will show age instead of birthdate.

    Try it and let us know what you think!

    Thanks!

  3. nola.geek
    Member
    Posted 1 year ago #

    Awesome, thanks for the change! Not if you can fix this next item, but this plugin (or maybe it's the other way around) doesn't play nice with the profile search plugin. The plugin has a place where you can select your profile option for birthdate but your birthdate doesn't show as one that can me selected.

    http://buddypress.org/community/groups/bp-profile-search/

  4. donmik
    Member
    Plugin Author

    Posted 1 year ago #

    We just release version 1.4. The plugin works now with bp profile search plugin. I think now you can select birthdate and the searchform will work.

    Try the new version and we're in touch.

  5. nola.geek
    Member
    Posted 1 year ago #

    I'm still seeing 'There is no date field in your profile'. Thanks for the great support!

  6. donmik
    Member
    Plugin Author

    Posted 1 year ago #

    Ummm, check the versions maybe.

    In our case, we are using latest versions in all of plugins.

    WordPress 3.4.2
    Buddypress 1.6.1
    BP Profile Search 3.1

    Maybe another plugin is interfering. In this update the only thing we made is if BP Profile Search plugin is installed, we add another filter in bp_the_profile_field_type changing the type returned in birthdate's case, returning "datebox".

  7. buddhatunes
    Member
    Posted 1 year ago #

    I am having the same birthday issue with "There is no date field in your profile."

    Also, where do I make certain profile fields not public? Or at least a group field not public?

  8. buddhatunes
    Member
    Posted 1 year ago #

    Xprofile 1.4.1
    WordPress 3.4.2
    Buddypress 1.6.1
    BP Profile Search 3.1

  9. donmik
    Member
    Plugin Author

    Posted 1 year ago #

    Hi,

    If you want to make profile fields not public you can use the field Default Visibility and choose Logged in Users or My friends. It's buddypress functionality.

    I cannot see this issue with birthdate field. I try different settings but it always works. Maybe another plugin is interfering with this.

  10. buddhatunes
    Member
    Posted 1 year ago #

    Ok, got the default visibility working.

    The birthdate issue is still confusing. I have a Birth Date field in my profile, and it shows my age correctly in my profile field. Everything else works, I am doubtful there is a plugin interfering.

    Is the Profile field supposed to be 'Birthdate' or 'Birth Date'?

    Above, you reference 'datebox' but I do not see that option anywhere. I only see 'Birthdate', 'Date Selector' and 'Datepicker'

  11. donmik
    Member
    Plugin Author

    Posted 1 year ago #

    What I was saying above is when we adapt the plugin to bp profile search, we only make one change.

    Bp Profile Search looks for a datebox field type to use as a date field. Our birthdate field returns "birthdate" and not "datebox" when asking for the type of the field. The only thing we change is return "datebox" as the type of the field and then BP Profile Search could use our birthdate field.

    So, if you have Birthdate selected in profile field type, it should work. With the same versions of plugins, it works in my wordpress.

    If you can, you could show us what type of field is returning. To do this, you need to modify bps-functions.php, file of bp-profile-search. Put this code in bold, after line 21:

    while (bp_profile_fields ()) :
        bp_the_profile_field();
        <strong>var_dump(bp_get_the_profile_field_type ());</strong>
        switch (bp_get_the_profile_field_type ())

    Then if you reload the profile search page in administration, you can ser the type of each field above. Tell us what type of field it returns. It must return datebox for your birthdate field, if not, there is another plugin or filter interfering with xprofile plugin.

  12. donmik
    Member
    Plugin Author

    Posted 1 year ago #

    while (bp_profile_fields ()) :
        bp_the_profile_field();
        var_dump(bp_get_the_profile_field_type ());
        switch (bp_get_the_profile_field_type ())

    Avoid the , put only this line:

    var_dump(bp_get_the_profile_field_type ());

  13. buddhatunes
    Member
    Posted 1 year ago #

    Avoid the what? Add or not to below?

    var_dump(bp_get_the_profile_field_type ());

  14. buddhatunes
    Member
    Posted 1 year ago #

    After looking at the missing 'strong' from my reply above, my guess is you are saying to not place the 'strong' before and after the code below?

    var_dump(bp_get_the_profile_field_type ());

    And yes, just got the parse error...

  15. buddhatunes
    Member
    Posted 1 year ago #

    I get this in front of Selected Profile Fields for 'Birth Date' and 'Age Range'

    string(9) "birthdate"

  16. buddhatunes
    Member
    Posted 1 year ago #

    For Age Range Search and Birth Date Field, I still get "There is no date field in your profile"

  17. donmik
    Member
    Plugin Author

    Posted 1 year ago #

    Ok, I think there is another filter who is interfering with the filter of xprofile plugin. I just released a new version. Try it, I hope it solves this issue.

  18. specex
    Member
    Posted 1 year ago #

    Great plugin! I like the birthdate field capable to let user to select show only birthdate but hide the age. As i know many girls like to hide their age.

    thank you

  19. buddhatunes
    Member
    Posted 1 year ago #

    There is some progress. The Birth Date Field now shows, and gives me the following options: Birth Date, Age Range, Age Range. I cannot select both, but have switched between them, but do not see any difference on the Field Type Choices or result.

    I have chosen 'Birthdate' and checked the box to show age instead of birthdate. On the Xprofile form, I still only see the option to choose Birth Date with 3 drop down boxes for day, month, year.

  20. buddhatunes
    Member
    Posted 1 year ago #

    There is no age range choices showing

  21. donmik
    Member
    Plugin Author

    Posted 1 year ago #

    Ummm, I'm totally lost now...xD. I don't understand what you need.

    The issue was in BP Profile Search you want select the Birth Date Field to activate Age Range Search. You cannot do this, the plugin BP Profile Search show the message "There is no date field in your profile".

    With the latest update, we solve this issue. Now you can select Birthdate field to activate Age Range Search, or not ?

    Where do you see those options? Birth Date, Age Range, Age Range ? In the selector of "Birth Date Field" in Age Range Search?

    About the last thing, if you check to show age instead of birthdate, in the form it doesn't change anything. This option only changes one thing, instead of showing your birthdate it will show your age, but in the form, you still need to introduce your birthdate with the drop down boxes.

  22. donmik
    Member
    Plugin Author

    Posted 1 year ago #

    specex

    If you want to show only birthdate, don't check the option "Show age (hide birthdate)". If you check this, it will show your age, if you don't check this, it will show your birthdate.

  23. specex
    Member
    Posted 1 year ago #

    Hi atallos, i didn't check "Show age (hide birthdate)" option, it display a value e.g. "May 1, 1982"

    Here what i expected is "May 1" only

    Appreciate your help, thanks

  24. donmik
    Member
    Plugin Author

    Posted 1 year ago #

    Ummm, ok, so what should be good for you it's to choose the way to display the birthdate.

    I can work in this update, but if you need this now, you can change the code of the plugin. Search the function bxcft_get_field_value. Replace this line of code:
    return '<p>'.date_i18n(get_option('date_format') ,strtotime($value) ).'</p>';

    By this line:
    return '<p>'.date_i18n('F j' ,strtotime($value) ).'</p>';

    You are doing here, instead of using the date format you adjust in settings, you use a custom format "F j" month and day only.

    I will try to put this possibility in a future update.

  25. specex
    Member
    Posted 1 year ago #

    Thank you atallos, it's very useful

  26. donmik
    Member
    Plugin Author

    Posted 1 year ago #

    This topic is solved too.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic