donmik
Forum Replies Created
-
Forum: Plugins
In reply to: [Buddypress Xprofile Custom Fields Type] Birthdate not showingGreat! So I think I can mark this topic as solved finally! xD
Forum: Plugins
In reply to: [Buddypress Xprofile Custom Fields Type] Birthdate not showingDatepicker field is an html5 field, maybe you are using a browser that don’t support html5 fields.
Forum: Plugins
In reply to: [Buddypress Xprofile Custom Fields Type] Birthdate not showingCan you try to use the buddypress default theme and see if it works? If you look at the edit.php of buddypress default theme you can see where the hook needs to be.
Forum: Plugins
In reply to: [Buddypress Xprofile Custom Fields Type] Birthdate not showing@siewolf: If you are using my plugin with a version before 1.5.5, I was using an old hook of buddypress “bp_custom_profile_edit_fields”.
Since buddypress 1.7, there is a new hook introduced by buddypress called “bp_custom_profile_edit_fields_pre_visibility”. When you use a custom theme, and you update buddypress to 1.7, there is a chance your theme is not updated with the new hook, so the fields of my plugin cannot appear.
I can’t imagine another reason for this error.
Forum: Plugins
In reply to: [Buddypress Xprofile Custom Fields Type] Birthdate not showingWell, I’m sorry in your case too. I downloaded frisco theme and all works as expected. If you have the hook in edit.php, you can try to deactivate other plugins to see if they’re causing this error.
Forum: Plugins
In reply to: [Buddypress Xprofile Custom Fields Type] mkdir error when registeringHi,
If you have 777 permissions on uploads directory and inside uploads profiles directory needs to be with 777, it should work. The problem ocurrs when the plugin try to create the directory of the user.
The images are stored in this directory:
‘wp-content/uploads/profiles/USERID’
Your problem is when I try to create the directory “USERID”.
Is this error happening in edit form profile too?
Forum: Plugins
In reply to: [Buddypress Xprofile Custom Fields Type] Embedding mediaHi,
For youtube this works:
add_filter( 'bxcft_show_field_value', 'my_show_field', 15, 4); function my_show_field($value_to_return, $type, $id, $value) { if ($type == 'web') { $value = str_replace("<p>", "", $value); $value = str_replace("</p>", "", $value); $field = new BP_XProfile_Field($id); if ($field->name == 'Link test youtube') { $link_src = strip_tags(trim($value)); $link_src = str_replace('youtu.be/', 'youtube.com/embed/', $link_src); return '<iframe width="560" height="315" src="'.$link_src.'" frameborder="0" allowfullscreen></iframe>'; } } return $value_to_return; }First, I check if the type of the field is the type I used. In my case I use website field.
if ($type == 'web') {The next 3 lines are from my plugin:
$value = str_replace("<p>", "", $value); $value = str_replace("</p>", "", $value); $field = new BP_XProfile_Field($id);Buddypress returns the value of your field surrounded by a paragraph <p> so I remove it to take the value of field only. The third line I create $field so I can now access the name of the field.
I check now if it’s the field with the name I want. In my case I call my field “Link test youtube”.
if ($field->name == 'Link prueba') {When I edit my profile I use the share link of youtube: http://youtu.be/axQhG6-qNhA, so I need to transform this into: <iframe width=”560″ height=”315″ src=”http://www.youtube.com/embed/axQhG6-qNhA” frameborder=”0″ allowfullscreen></iframe>
First, I remove the tags my field has:
$link_src = strip_tags(trim($value));The strip_tags remove the tag . This tag is added automatically by a filter in buddypress. The trim function remove any extra whitespace at the beginning or end of value. After applying this two functions in $link_src I have only the link http://youtu.be/axQhG6-qNhA. Now I need to transform this into the embed link.
$link_src = str_replace('youtu.be/', 'youtube.com/embed/', $link_src);I replace youtu.be with youtube.com/embed/.
return '<iframe width="560" height="315" src="'.$link_src.'" frameborder="0" allowfullscreen></iframe>';This line return the iframe.
The last line is necessary to display the other fields you don’t want to modify. With soundcloud you need to do something similar.
Forum: Plugins
In reply to: [Buddypress Xprofile Custom Fields Type] Embedding mediaIf you need to convert field values, you can use the filter of my plugin. In the faq, you have an example:
add_filter( 'bxcft_show_field_value', 'my_show_field', 15, 4); function my_show_field($value_to_return, $type, $id, $value) { if ($type == 'birthdate') { $value = str_replace("<p>", "", $value); $value = str_replace("</p>", "", $value); $field = new BP_XProfile_Field($id); // Get children. $childs = $field->get_children(); $show_age = false; if (isset($childs) && $childs && count($childs) > 0) { // Get the name of custom post type. if ($childs[0]->name == 'show_age') $show_age = true; } if ($show_age) { return '<p>'.floor((time() - strtotime($value))/31556926).'</p>'; } return '<p>'.date_i18n( 'F j' , strtotime($value) ).'</p>'; } return $value_to_return; }In your case, you need to check the name of your field maybe, and return what you need to embed media.
Forum: Plugins
In reply to: [Buddypress Xprofile Custom Fields Type] Birthdate not showingcrypt0rchid, Great!
number55, I’m sorry but it’s a premium theme and I can’t buy all themes to try them. I don’t know why fields are not showing, the most likely cause is the missing hook, the hook is the key, but if you say the hook is there, I really don’t know what is happening…
Forum: Plugins
In reply to: [Buddypress Xprofile Custom Fields Type] Birthdate not showingFirst, thanks for reporting this. I download Custom Community theme and I see what you say. In your case, the problem is caused by the missing hook. Custom Community Theme doesn’t have the new hook introduced by BP 1.7.
So, for edit.php, go to custom-community/members/single/profile/edit.php. Just before this code:
<?php if ( bp_current_user_can( 'bp_xprofile_change_field_visibility' ) ) : ?>Write this:
<?php do_action( 'bp_custom_profile_edit_fields_pre_visibility' ); ?>The fields should appear. For registration page, do the same thing, before:
<?php do_action( 'bp_custom_profile_edit_fields' ) ?>Write this:
<?php do_action( 'bp_custom_profile_edit_fields_pre_visibility' ); ?>Try it and tell me if it solves your problem.
Forum: Plugins
In reply to: [Buddypress Xprofile Custom Fields Type] restoring deleted fieldsI don’t know but you cannot delete this field. I don’t know how you do this.
About your second question, sorry but I don’t know how to do this, maybe you need to ask better in buddypress forums…
Forum: Plugins
In reply to: [Buddypress Xprofile Custom Fields Type] restoring deleted fieldsWhen you install buddypress with xprofile module, you can see only one field “Name”, it’s not possible to delete this field. Maybe you installed a plugin who can delete this field. The last name field doesn’t appear if you don’t create it.
Sorry, but I’m not sure what you are talking about because on profile fields you can only modify the fields you create not the wordpress fields. Maybe you have another plugin to modify those fields but with buddypress or my plugin you cannot.
Forum: Plugins
In reply to: [Buddypress Xprofile Custom Fields Type] restoring deleted fieldsHi,
How have you deleted them ? Maybe I can help but I don’t think my plugin has nothing to do with this.
Forum: Plugins
In reply to: [Buddypress Xprofile Custom Fields Type] Russian Translationmmmm, but where is the problem in this? I don’t see where because you are seeing exactly what you need to see. In the first image you are seeing the form choosing datepicker field.
A datepicker field is an html5 field. So it will return what you see in second image:
<input type=”date” name=”xxxx” value=”” />
It’s not an error, it’s working as expected. Maybe you don’t want a datepicker, you want a birthdate or date selector.
Forum: Plugins
In reply to: [Buddypress Xprofile Custom Fields Type] Birthdate not showingR J, have you checked if you have the new hook in your edit.php?