Forum Replies Created
-
In reply to: Adding xprofile data in my Activity Stream
Yikes – that was just a skeleton that needs actual code in the function.
Given your code ability and the number of code requests you’ve recently made on these forums,
I recommend that you post a job listing here.In reply to: Accept and Reject for groups Button MissingIt’s probably something about how you built the theme.
So the issue appears re bp_button, but is actually due to something else.In reply to: Adding xprofile data in my Activity Stream> Any thoughts?
Use a service like gist to show the code that you tried.
In reply to: Adding xprofile data in my Activity StreamNever put code into the buddypress plugin files.
Use your theme functions.php or use bp-custom.php.
In reply to: Accept and Reject for groups Button MissingDo you have debug turned on in wp-config.php ?
In reply to: Adding xprofile data in my Activity StreamUse the ‘xprofile_updated_profile’ hook
function josh_profile_check( $user_id, $posted_field_ids, $errors ) { /* check $posted_field_ids to see if one of the fields you are interested in has changed if yes, then use bp_activity_add to add to activity stream */ } add_action( 'xprofile_updated_profile', 'josh_profile_check', 10, 3 );In reply to: Accept and Reject for groups Button MissingAssign the button to a var, then dump it to see what is returned.
$asdf = bp_get_button( etc. ) var_dump( $asdf );Your bp_button calls look ok, afaik.
Take a look at the function
buddypress\bp-core\bp-core-template.php ~L. 487In reply to: Accept and Reject for groups Button MissingUse
bp_get_buttonIn reply to: add page to a groupYou can do that with the Group Extension API.
In reply to: Did I just loose 10k users?Then it would seem to be a WP issue.
Or something happened during the migration.Have you looked at this premium plugin?
BuddyProfileDataYou’ll probably get a better answer using the support forum for that plugin.
My guess would be that you are hooking too early and the remove_action calls fire before those add_actions exist.
Maybe try a hook other than ‘plugins_loaded’.
Have you tried ‘bp_include’.In reply to: Remove add_friend buttonfunction hideAddFriend($button){ $role = mika_user_has_role( bp_get_member_user_id() ); if( $role ) return ''; return $button; } add_filter( 'bp_get_add_friend_button', 'hideAddFriend'); function mika_user_has_role( $id, $role = 'inactive' ){ $roles = mika_get_user_roles( $id ); if ( $roles && in_array ( $role, $roles ) ) return true; else return false; } function mika_get_user_roles( $id ) { $user = new WP_User( $id ); if ( $user ) { $roles = $user->roles; return $roles; } else return false; }In reply to: Remove add_friend buttonFilters have to return something.
You’re only returning if a condition is met.
So no buttons will appear.And you aren’t passing the $arg, so you can’t return it.
Try:
function hideAddFriend($button){ $caps = get_user_meta(bp_get_member_user_id(), 'wp_capabilities', true); $roles = array_keys((array)$caps); // Hide friendship buttons if(in_array("inactive", $roles)){ return ''; } return $button; } add_filter( 'bp_get_add_friend_button', 'hideAddFriend');also – are you sure that your get_user_meta approach to retrieving ‘inactive’ is working?
In reply to: Did I just loose 10k users?It may be a WP issue.
To confirm, deactivate BP.
If it remains, try deactivating other plugins.In reply to: Did I just loose 10k users?Based on your screenshots, I’d guess users were added or duplicated.
Try comparing the total number of rows, dev vs. new install, for the users and activity tables.
In reply to: Did I just loose 10k users?How did you transfer / copy the database?
In reply to: Did I just loose 10k users?What do you mean by migrated?
Transferred to a new install?
Upgraded to a new version of BP ?
Both?Did you use any of the tools in the new version:
…/wp-admin/tools.php?page=bp-toolsIn reply to: importing from Drupal 6BuddyPress uses bbPress for forums.
So you want to import into bbPress.
Try asking bbpress support.In reply to: Get E-mail addresses of users without Photos?untested:
function no_photos() { global $wpdb; $emails = array(); $ids = $wpdb->get_col( "SELECT ID FROM {$wpdb->prefix}users" ); foreach( $ids as $id ) { $avatar_check = false; if ( bp_core_fetch_avatar( array( 'item_id' => $id, 'no_grav' => true, 'html'=> false ) ) != bp_core_avatar_default() ) $avatar_check = true; if( ! $avatar_check ) { $email = $wpdb->get_var( "SELECT user_email FROM {$wpdb->prefix}users WHERE ID = $id" ); $emails[] = $email; } } $emails = implode(",", $emails); return $emails; }In reply to: Buddypress members/group map/locationsI’ve done several maps:
Wordpress posts, based on editable location field: http://www.newspebbles.com/map/
BuddyPress members, based on signup / profile field: http://www.deeptimejourney.org/members-map/This does markers just for groups: https://github.com/naton/bp-group-location
The issue with a distributed plugin is the time-based limits imposed by various geocode web services. So it’s a scaling issue. There are ways to get around that for per-site custom plugins.
Use
bp_get_member_profile_data( 'field=Hair' );Try:
$hair = bp_member_profile_data( 'field=Hair' ); if( ! $hair ) echo 'Hair: Not Provided'; else echo 'Hair: ' . $hair;In reply to: [Resolved] Timestamps in members timezone@colabsadmin @henrywright-1 @djpaul
Here’s a plugin: https://github.com/shanebp/BP-Timezones
Currently it only uses this filter hook:
‘bp_get_message_thread_last_post_date’Hook suggestions ?
In reply to: Order members by specific ID setDon’t use both include and user_ids parameters.
Use a service like pastebin to show us your code.