donmik
Forum Replies Created
-
Forum: Plugins
In reply to: [Buddypress Xprofile Custom Fields Type] Showing Age in members loopecho 'Age: '. xprofile_get_field_data('Date of Birth', bp_get_member_user_id());Something like this?
Hi,
I try to put register page as my front static page in my test site and it works. Have you tried to deactivate my plugin and check if my plugin is responsible of those errors?
My plugin only add field’s type to buddypress xprofile extension, I doubt it can cause all of this…
Forum: Plugins
In reply to: [Buddypress Xprofile Custom Fields Type] Issue members loop BirthdayCongratulations, you just found a bug…xDDDD. It was a bug from my plugin, when the user let birthdate blank, the plugin returns today.
This is solved in latest version 1.5.7.1.
Thanks!
Forum: Plugins
In reply to: [Buddypress Xprofile Custom Fields Type] File size type restrictionsIf you change my plugin code, yes… but for now there is no easy way to do this, if you’re asking for one… Maybe in future releases, sorry…
Forum: Plugins
In reply to: [Buddypress Xprofile Custom Fields Type] Showing Age in members loopSorry it’s not bp_member_user_id() but bp_get_member_user_id().
I write this in my members-loop.php:
echo xprofile_get_field_data('Date of Birth', bp_get_member_user_id());And all works as expected…
Forum: Plugins
In reply to: [Buddypress Xprofile Custom Fields Type] Age not formatted rightHave you check the FAQ ?
Forum: Plugins
In reply to: [Buddypress Xprofile Custom Fields Type] Showing Age in members loop$user_id need to have the id of the user. If you send a null value, the function can’t display anything.
If you use the function “bp_member_user_id()” instead of $user_id, I think it should work.
Forum: Plugins
In reply to: [Buddypress Xprofile Custom Fields Type] Showing Age in members loopHave you assigned a value to $user_id ?
Forum: Plugins
In reply to: [Buddypress Xprofile Custom Fields Type] Showing Age in members loopHi,
The correct way is the second way but I believe you have no output because you made a mistake
Date if birth instead of Date of birth
The correct code:
xprofile_get_field_data( 'Date of birth', $user_id );You can read more about this in the next thread.
Hi, thanks for the advice. I can’t use BP_PLUGIN_DIR because when I want to use it the constant doesn’t exist yet, so it doesn’t work…
Forum: Plugins
In reply to: [Buddypress Xprofile Custom Fields Type] Disable user to edit fieldsYes, you need to change the code in your theme. If you are using buddypress default theme, the file you need is located in:
/wp-content/plugins/buddypress/bp-themes/bp-default/members/single/profile/edit.php
Inside the while loop, you need to check if the field which is going to be displayed is the field you want to hide.
<?php while ( bp_profile_fields() ) : bp_the_profile_field(); ?> <?php if (bp_get_the_profile_field_name() == 'leave') continue; ?>I think this should work. You can hide usign javascript also, but it’s better this way I think.
No, you need to put it in the members page. If you are using the default buddypress theme, search in:
/wp-content/plugins/buddypress/bp-themes/bp-default/members/single/profile/profile-loop.php
You need to search this line:
<td class="label"><?php bp_the_profile_field_name(); ?></td>And replace it with my code.
In the members page, you can check if you are going to display Date of birth field and change the label by Age.
The code looks like this:
<?php if (bp_get_the_profile_field_name() == 'Date of birth'): ?> <td class="label">Age</td> <?php else: ?> <td class="label"><?php bp_the_profile_field_name(); ?></td> <?php endif; ?>Yes I think you can take the registration page and copy the same loop. Check with this function: bp_get_profile_group_name if this is the group you need.
Hi,
You just need to write the hook a little above. Search the code responsible of displaying privacy options, it looks like this:
<?php if ( bp_current_user_can( 'bp_xprofile_change_field_visibility' ) ) : ?> <p class="field-visibility-settings-toggle" id="field-visibility-settings-toggle-<?php bp_the_profile_field_id() ?>"> <?php printf( __( 'This field can be seen by: <span class="current-visibility-level">%s</span>', 'buddypress' ), bp_get_the_profile_field_visibility_level_label() ) ?> <a href="#" class="visibility-toggle-link"><?php _ex( 'Change', 'Change profile field visibility level', 'buddypress' ); ?></a> </p> <div class="field-visibility-settings" id="field-visibility-settings-<?php bp_the_profile_field_id() ?>"> <fieldset> <legend><?php _e( 'Who can see this field?', 'buddypress' ) ?></legend> <?php bp_profile_visibility_radio_buttons() ?> </fieldset> <a class="field-visibility-settings-close" href="#"><?php _e( 'Close', 'buddypress' ) ?></a> </div> <?php else : ?> <p class="field-visibility-settings-notoggle" id="field-visibility-settings-toggle-<?php bp_the_profile_field_id() ?>"> <?php printf( __( 'This field can be seen by: <span class="current-visibility-level">%s</span>', 'buddypress' ), bp_get_the_profile_field_visibility_level_label() ) ?> </p> <?php endif ?>Write the hook <?php do_action( ‘bp_custom_profile_edit_fields_pre_visibility’ ); ?>, before the previous code and it should work.