donmik
Forum Replies Created
-
Great work! Now, I have too much work, but I hope I can integrate this in my plugin or in the FAQ in next days.
Thanks!
Hi,
Sorry for the delay, I have too much work lately.
What I said before is you can create a field like a drop down select box and define the roles as options. Then using a registration hook like (here you have more info) you can map the value of this field with the role you want. In this function, you need to check the value selected by user and assign the role you want.
Then, to hide the field to other users, you can use my plugin and the visibility setting “Nobody”. This will hide the field for all users, only the current user can see it.
Great! You’re welcome!
You need to put into your functions.php. This function uses the hook that is already in member-header.php: bp_before_member_header.
If the wiki pages are a custom post type, yes. If wiki pages are only normal pages from wordpress, no.
The best example for this field is when you want to create a field Country but you don’t want to write all countries. So you download this plugin Countries. This plugin create a custom post type with all countries. Then you create a field selecting Custom post type Selector and you select the post type countries.
Hi,
I believe something like this should be the way:
function get_total_members($field_id, $field_value) { global $wpdb, $bp; $res = $wpdb->query($wpdb->prepare( 'SELECT COUNT(*) FROM ' . $wpdb->prefix . $bp->table_prefix . 'bp_xprofile_data WHERE field_id = %s AND value = \'%s\' GROUP BY field_id ', $field_id, $field_value )); return $res; }You need to call this function with the field id and the field value you want to search. It will return the number of members having this value in this field.
I don’t know if there is an easy way to achieve this… I think you will need a custom query…
Forum: Plugins
In reply to: [Buddypress Xprofile Custom Fields Type] Avatar (Image)mmm, weird…
I believe sidebar widget is using bp_core_fetch_avatar too. You can write an echo “HI THERE!” inside the code to check if it enters in your filter. I don’t know really why this is happening.
Try to check the arguments passed to your filter and see what happens inside.
Forum: Plugins
In reply to: [Buddypress Xprofile Custom Fields Type] Avatar (Image)You can modifying the code and search the avatar in two places. Try to look into my plugin directory and if not show the original avatar.
function display_avatar($avatar, $params) { $bxcft_avatar = bp_get_member_profile_data(array('field' => 'IMAGEFIELD', 'user_id' => $params['item_id'])); if ($bxcft_avatar != '') { $avatar = $bxcft_avatar; } return $avatar; } add_filter('bp_core_fetch_avatar_url', 'display_avatar', 15, 2); function display_avatar_html($avatar_html, $params) { $new_avatar = bp_get_member_profile_data(array('field' => 'IMAGEFIELD', 'user_id' => $params['item_id'])); if ($new_avatar != '') { $upload_dir = wp_upload_dir(); $new_avatar = $upload_dir['baseurl'] . $new_avatar; $parts = explode('"', $avatar_html); for ($i=0; $i<count($parts);$i++) { if (strpos($parts[$i], 'src=')) { break; } } $i++; $prev_avatar = $parts[$i]; $avatar_html = str_replace($prev_avatar, $new_avatar, $avatar_html); } return $avatar_html; } add_filter('bp_core_fetch_avatar', 'display_avatar_html', 15, 2);I didn’t try the code but I hope you get the idea.
Forum: Plugins
In reply to: [Buddypress Xprofile Custom Fields Type] Show description on profile pageCheck you template file located in your-theme/members/single/profile/edit.php.
You must have this line:
<p class="description"><?php bp_the_profile_field_description(); ?></p>If you don’t have it, it’s probably because you are using a custom theme, check the default buddypress theme and copy this line at the same placement.
Forum: Plugins
In reply to: [Buddypress Xprofile Custom Fields Type] Changing markupI released today version 1.5.8 with filters for labels and inputs. I hope this helps you.
Forum: Plugins
In reply to: [Buddypress Xprofile Custom Fields Type] Fields not showingMmm, try to activate the default buddypress theme and see if it works. If yes, then the problem is in your template, maybe there is a hook missing.
Forum: Plugins
In reply to: [Buddypress Xprofile Custom Fields Type] Fields not showingIs the input not showing or the value you have wrriten?
Forum: Plugins
In reply to: [Buddypress Xprofile Custom Fields Type] Field "Telephone number"Hi, it’s probably the best solution, yes. I have not much time now to look into this. I hope in next weeks I can try to create this new field type.
Thanks!
Forum: Plugins
In reply to: [Buddypress Xprofile Custom Fields Type] Update child xprofile fields.Hi,
This is not an issue from my plugin. My plugin only add new field’s type like Birthdate or Website. You have an issue with the Xprofile extension from Buddypress plugin. You need to contact with Buddypress authors.
Sorry 😉