donmik
Forum Replies Created
-
If you are talking about the datepicker field type, I don’t believe you can remove day selection. If you are talking about the birthdate field type, you need to modify my plugin hiding the day selector or maybe you can do it using javascript or just css.
Titles and descriptions are saved by buddypress not by my plugin, so I cannot do anything about it. Buddypress apply filter to remove html code, so if you don’t remove the filters applied by buddypress this is not possible.
Forum: Plugins
In reply to: [Buddypress Xprofile Custom Fields Type] Calling Image URL from Profile FieldIt’s not in the faq, the faq only shows an example using the filter. For your case, if you want to show only image url, try this:
add_filter( 'bxcft_show_field_value', 'my_show_field', 15, 4); function my_show_field($value_to_return, $type, $id, $value) { if ($type == 'image') { $uploads = wp_upload_dir(); $value = str_replace("<p>", "", $value); $value = str_replace("</p>", "", $value); $value_to_return = '<p>'.$uploads['baseurl'].$value.'</p>'; } return $value_to_return; }You’re welcome! 😉
Hi,
It’s because xprofile_get_field_data(‘Twitter’) is returning the link after the filter was applied, so your link is wrong, it’s something like this:
<a href="http://www.twitter.com/<p><a href="http://www.twitter.com/username" target="_blank">username</a></p>" target="_blank"><img src="'. get_bloginfo('template_url') .'/images/social_icons/twitter_icon.png">I think you can solve this, using strip_tags:
if ( $twitter_name = strip_tags(xprofile_get_field_data('Twitter')) ) { echo '<a href="http://www.twitter.com/' . $twitter_name . '" target="_blank"><img src="'. get_bloginfo('template_url') .'/images/social_icons/twitter_icon.png"> '; }If you write this, xprofile_get_field_data will return only the username without the p and a tags. I suppose you know that you need to close the a tag. The correct way should be:
if ( $twitter_name = xprofile_get_field_data('Twitter') ) { echo '<a href="http://www.twitter.com/' . $twitter_name . '" target="_blank"><img src="'. get_bloginfo('template_url') .'/images/social_icons/twitter_icon.png" /></a> '; }Great!! I’m glad to read this.
Forum: Plugins
In reply to: [Buddypress Xprofile Custom Fields Type] file download field displayI think you can force download in your code, or in htaccess, or in the configuration of your server, but you cannot force a doc or pdf to show in browser. To show a pdf in your browser, you need first the plugin from adobe reader and I think you need your server allow this and don’t force download instead of viewing.
What I’m saying is I don’t think you can solve this changing the code of my plugin…
Forum: Plugins
In reply to: [Buddypress Xprofile Custom Fields Type] Image display on profile brokenHi,
I think it could be caused by a filter you have in your website. In my case it works fine. Maybe you have some plugin or some functions creating links for images.
If you don’t find it, you can check the faq of this plugin and try to use the filter I’ve created to modify the way the value of the field are displayed.
You can get the field value and check if it’s correct, if it’s not rewrite the html.
What version of buddypress are you using? Are you using some plugin to show images in thickbox or other plugins who can be related with this issue ?
Forum: Plugins
In reply to: [Buddypress Xprofile Custom Fields Type] Custom post type multiselector bug ?Hi, sorry for the delay, I was moving from my home.
In the new version 1.5.6.2, this is solved.
Forum: Reviews
In reply to: [Buddypress Xprofile Custom Fields Type] Gravity FormsI’ve just improved the faq, if you don’t find those pages in your theme, you can check in the bp-default theme of buddypress.
/buddypress/bp-themes/bp-default/members/single/profile/edit.php.
/buddypress/bp-themes/bp-default/registration/register.php.
Hi,
In the faq, I explain how to use the filter bxcft_show_field_value to modify the way you show your fields in profile page.
In your case, I think the best way is to create a textbox field named “Facebook”. Then in your functions.php of your theme, write this code:
add_filter( 'bxcft_show_field_value', 'my_show_field', 15, 4); function my_show_field($value_to_return, $type, $id, $value) { if ($type == 'textbox') { $value = str_replace("<p>", "", $value); $value = str_replace("</p>", "", $value); $field = new BP_XProfile_Field($id); if ($field->name == 'Facebook') { $value = trim(strip_tags($value)); $new_value = sprintf('<a href="http://www.facebook.com/%s">%s</a>', $value, $value); } else { $new_value = $value; } return '<p>'.$new_value.'</p>'; } return $value_to_return; }This code will execute every time you need to show a profile field. It will check if the type of the field is a “textbox” and then it will check if the name of the field is “Facebook” if you create the field with a distinct name, please change this line:
if ($field->name == 'Facebook') {Instead of “Facebook”, write the name of your field.
Then it creates the link to facebook with the name of the user in facebook.
Check this and tell me if it works. Thanks!
Forum: Reviews
In reply to: [Buddypress Xprofile Custom Fields Type] Gravity FormsI cannot try with gravity forms, but can you check the faq of my plugin. When the field doesn’t appear, it can be because you missed a hook in your form.
Forum: Plugins
In reply to: [Buddypress Xprofile Custom Fields Type] Display Field Group in a Widget?Hi,
Well, I don’t know, I think maybe you need to ask in buddypress suport forums because the group fields feature is originally from buddypress, my plugin only adds new types of fields.
Forum: Plugins
In reply to: [Buddypress Xprofile Custom Fields Type] file download field displayI think it depends on what type of file you are showing and maybe the configuration of your browse, I don’t know. In my case if I upload a pdf, I can see it directly in the browser.
What type of file are you uploading, if it’s a doc, I believe this is not possible.
Forum: Plugins
In reply to: [Buddypress Xprofile Custom Fields Type] Birthdate not showingSorry for the delay.
I really don’t know why this happens. Can you try to turn on debug mode and see if any error, warning or something appears.
This function “bxcft_edit_render_new_xprofile_field” is responsible of showing the fields of my plugin. If you know a little of php you can put code to see if this function is working or not.
Forum: Plugins
In reply to: [Buddypress Xprofile Custom Fields Type] Plugin broken for meI think, it’s the same issue.
Check the answer and tell if it works or not.