donmik
Forum Replies Created
-
Forum: Plugins
In reply to: [Buddypress Xprofile Custom Fields Type] Default values DOB fieldHi,
You can change in wordpress settings – General – Date Format.
Or you can create a filter in your functions.php like this:
function my_show_field_value($value_to_return, $type, $id, $value) { $field = new BP_XProfile_Field($id); if ($type == 'birthdate') { // Get children. $childs = $field->get_children(); $show_age = false; if (isset($childs) && $childs && count($childs) > 0 && is_object($childs[0])) { if ($childs[0]->name == 'show_age') $show_age = true; } if ($value != '') { if ($show_age) { $value_to_return = '<p>'.floor((time() - strtotime($value))/31556926).'</p>'; } else { $value_to_return = '<p>'.date_i18n('Here goes your date format' ,strtotime($value) ).'</p>'; } } } return $value_to_return; } add_filter('bxcft_show_field_value', 'my_show_field_value', 10, 4);Replace the sentence “Here goes your date format” with your date format.
Forum: Plugins
In reply to: [Buddypress Xprofile Custom Fields Type] Calling Image URL from Profile FieldYou’re welcome 😉
Forum: Plugins
In reply to: [Buddypress Xprofile Custom Fields Type] Avatar (Image)I believe you can use filters to modify the avatar displayed. With these 2 filters you could use the xprofile field instead of avatar.
function display_avatar($avatar, $params) { $avatar = bp_get_member_profile_data(array('field' => 'IMAGEFIELD', 'user_id' => $params['item_id'])); return $avatar; } add_filter('bp_core_fetch_avatar_url', 'display_avatar', 15, 2); function display_avatar_html($avatar_html, $params) { $upload_dir = wp_upload_dir(); $new_avatar = $upload_dir['baseurl'] . bp_get_member_profile_data(array('field' => 'IMAGEFIELD', 'user_id' => $params['item_id'])); $parts = explode('"', $avatar_html); for ($i=0; $i<count($parts);$i++) { if (strpos($parts[$i], 'src=')) { break; } } $i++; $prev_avatar = $parts[$i]; return str_replace($prev_avatar, $new_avatar, $avatar_html); } add_filter('bp_core_fetch_avatar', 'display_avatar_html', 15, 2);Replace IMAGEFIELD with the name of your image field.
Forum: Plugins
In reply to: [Buddypress Xprofile Custom Fields Type] Calling Image URL from Profile FieldOk, I think I understand now.
You can do it. If you are in the member’s page, you can use:
bp_member_profile_data('field=Image');You can see this code in your member-header.php. Search in your theme /members/single/member-header.php.
/*** * If you'd like to show specific profile fields here use: * bp_member_profile_data( 'field=About Me' ); -- Pass the name of the field */Forum: Plugins
In reply to: [Buddypress Xprofile Custom Fields Type] Calling Image URL from Profile FieldI’m not sure I understand you.
So, one member will upload this banner and you want to show this banner url to all profiles?
Forum: Plugins
In reply to: [Buddypress Xprofile Custom Fields Type] Compact Registration FormYes, of course you can. You need to change the registration page in your theme. The registration page is located in: your-theme/registration/register.php.
You need to avoid displaying all profile fields but name field. So inside the loop, you need to write this if.
Search this line:
<?php while ( bp_profile_fields() ) : bp_the_profile_field(); ?>After this line, write this:
<?php if ('Name' != bp_get_the_profile_field_name()) continue; ?>If you give another name to this field, you need to change ‘Name’ by the name you put.
Remember if you want this to work all the profile fields you are hiding need to be Not required. If they’re required this should not work.
Forum: Plugins
In reply to: [Buddypress Xprofile Custom Fields Type] Conditional fields?You can hide the field manually in your template, so the user can’t modify because the field will not be displayed in the form.
Forum: Plugins
In reply to: [Buddypress Xprofile Custom Fields Type] Bold TextYou can try this. Put this in your functions.php:
function remove_xprofile_links() { remove_filter( 'bp_get_the_profile_field_value', 'xprofile_filter_link_profile_data', 9, 2 ); } add_action( 'bp_init', 'remove_xprofile_links' );Forum: Plugins
In reply to: [Buddypress Xprofile Custom Fields Type] Bold TextI believe there is a filter in buddypress that is filtering all the html tags. So I don’t think you can put html tags in a profile field.
When the text turns blue is it a link? If it’s a link, buddypress add links to the value of profile fields.
Forum: Plugins
In reply to: [Buddypress Xprofile Custom Fields Type] Date of birth field issueThis is the normal behaviour of an html5 field. HTML5 field validates before submitting the form. So the other warning messages can’t be displayed.
If you don’t want this behaviour you need to use another type of field.
Forum: Plugins
In reply to: [Buddypress Xprofile Custom Fields Type] Showing Age in members loopOf course, if I can help you. Send me an email at miguel@donmik.com.
Forum: Plugins
In reply to: [Buddypress Xprofile Custom Fields Type] Field type "number"You’re right! I forgot it! In 1.5.7.2, I’ve just added a new field type: Number.
Forum: Plugins
In reply to: [Buddypress Xprofile Custom Fields Type] Conditional fields?I believe you can attach gravity forms to buddypress already. Check this link
Forum: Plugins
In reply to: [Buddypress Xprofile Custom Fields Type] Conditional fields?Hi,
I don’t think this feature is in the scope of this plugin. Remember that Buddypress Xprofile Custom Fields Type only add new types to the default types provided by xprofile. Xprofile is an extension from buddypress.
Anyway, I was thinking of the possibilities of doing this, and I’m sure a plugin for doing this is not easy to do. Maybe you can solve your needs using javascript…
Forum: Plugins
In reply to: [Buddypress Xprofile Custom Fields Type] Image Uploading Not WorkingI tried it and in my test site it works. What theme are you using ?