Forum Replies Created
-
In reply to: [Resolved] Notify by Email when xProfile Updated
Total rewrite.
The hook runs after a BP profile is updated.
Write a function to see what was changed and then maybe send an email.This should get you started…
function whelund_profile_updated(bp_displayed_user_id(), $posted_field_ids, $errors, $old_values, $new_values) { // dump the vars for orientation on what to write in the function var_dump( $posted_field_ids ); // decide whether to send an email, then use wp_email() } add_action( 'xprofile_updated_profile', 'whelund_profile_updated', 1, 5 );In reply to: [Resolved] Notify by Email when xProfile UpdatedThe hook you want is xprofile_updated_profile
Full hook:
do_action( 'xprofile_updated_profile', bp_displayed_user_id(), $posted_field_ids, $errors, $old_values, $new_values );See buddypress\bp-xprofile\bp-xprofile-screens.php
[ Please use a service like gist or pastebin to share large code segments. ]
In reply to: Groups: Are replies not suppose to be visible?Comments in all activity streams, including groups are not visible to the non-logged-in.
You can change that, but it will change it for all activity streams.
You need to create a template overload of this file:
\bp-templates\bp-legacy\buddypress\activity\entry.phpAnd then make your changes starting at ~Line 88.
Do not simply remove is_user_logged_in(). If you do, non-logged-in people will be able to comment!In reply to: Everything is unformated?!What theme are you using?
Switch to a WP theme like TwentyTwelve and recheck the formatting.
You don’t really need ‘prepare’ for a hard-coded query.
Your error is due to ‘prepare’ using of sprintf-like approach.
Read the codex: wpdbWhy use Select * when you only need ‘value’?
Why use get_row when you only need a single value? See ‘get_var’ in the link above.But why are you making a wpdb call?
If you’re not in the member loop or on a member page, try
$radius = xprofile_get_field_data('name-of-radius-field', $user_id);
Otherwise, try:
bp_get_member_profile_data('field=name-of-radius-field');Not a game changer, just requires (based on his code) a get_user_meta check.
>So I’m trying to do a member loop that shows only members with avatars.
And only members who have filled out ‘interests’.
Your code has some mistakes and unnecessary code.
I don’t know if this will help with the memory issue, but it should be a bit faster.
https://gist.github.com/shanebp/848d9c4e763fb0a51f2fPlease use a service like gist to share long code pieces.
@henrywright
Yup, that would optimize it a lot.
But he’s also checking facebook avatars, so the flag needs to account for that.In reply to: How to properly filter bp_member_avatar$defaults aren’t being passed by the filter.
Try:
add_filter('bp_member_avatar', 'mm_hide_name_in_alt_text', 1); function mm_hide_name_in_alt_text( $var ) { var_dump( $var ); return $var; }Then you should be able to tell what is being passed to the filter and adjust it accordingly.
You could also use the filters in bp_core_fetch_avatar()In reply to: Pulling from existing custom fields[off-topic]
@henrywright – can you ping me via the addy in my profile? thanks.
In reply to: New Members not Showing in SearchYou can post a job here:
In reply to: New Members not Showing in SearchYou could:
1. filter the bp_ajax_querystring
2. filter BP_User_Query
3. For each member that you import, add an entry to the {$wpdb->prefix}bp_activity table. The entry ‘type’ = ‘last_activity’ and requires a timestamp. That will make them ‘active’.
I suggest that #3 is your best approach.
How you create the entry is mainly based on how you’re importing.In reply to: overload template from pluginCreated a codex page: overload template part from plugin
In reply to: Custom field in admin groups backendYou may find some hints here:
In reply to: Translation fails only at "Sitewide Activity"You can always submit a ticket at
https://buddypress.trac.wordpress.org/In reply to: Avatar of group in MySql DatabaseIt’s not stored in the database.
It’s in /wp-content/uploads/group-avatars/[group_id]/[…bpthumb or bpfull]
In reply to: How add filter to bp_the_profile_group_field_ids?danbp’s function works fine here.
Although in BP 2.0+, bp_is_profile_edit() should be bp_is_user_profile_edit() to avoid the deprecation notice.Are you sure you’re inserting the correct ids?
Try this and see if it hides the Name field:
$retval['exclude_fields'] = '1';In reply to: Nothing seems to workCheck your permalink settings and re-save them.
In reply to: Creating subnav item to create a new groupYou can force the link. Try:
bp_core_new_subnav_item( array( 'name' => 'Create Virtual Village', 'slug' => 'create', 'parent_url' => 'groups', 'parent_slug' => 'groups', 'screen_function' => 'false', 'position' => 50, 'link' => get_option('siteurl') . '/groups/create/step/group-details/' ) );In reply to: Need help identifying errors found in debug modeAre you using a custom activation page?
>Notice: bp_setup_current_user was called incorrectly.
That can be a tricky one to solve. It means it was called too early in the load order.
>Fatal error: Call to undefined function bp_xprofile_create_field_type()
That means it was called before BP is loaded or is called on a non-BP page.
I suspect one of your plugins is causing this ( might be the theme ).
Try turning off your plugins one at a time.
The fact that it’s bp_xprofile_create_field_type() hints that it’s profile related.If that doesn’t identify the culprit, try switching themes.
Then you’ll have to contact the creator and submit a bug report.
Or hire somebody to fix it for you.In reply to: [Resolved] How to hide more than one profile field?Try:
while ( bp_profile_fields() ) : bp_the_profile_field(); if ( bp_get_the_profile_field_id() != 'ID # YOU WANT TO SKIP' && bp_get_the_profile_field_id() != 'ID # 2nd field YOU WANT TO SKIP' ) :In reply to: Probleme using BP core functionsYou’re probably calling the BP function before BP has loaded.
Read this: https://codex.buddypress.org/plugindev/checking-buddypress-is-active/There may be additional problems with your code including the issue raised by @henrywright
In reply to: Display total number of contributors@henrywright
Much better approach – thanks.In reply to: show profile data in specific groupsTry
if( bp_get_group_id() == 5 ) or if( bp_get_group_id() == '5' )In reply to: Translation fails only at "Sitewide Activity"Did you use poedit?
Did you include _x in Sources Keywords?
I don’t know why _x is used for ‘Sitewide Activity’.
You can see it in bp-activity\bp-activity-loader.php ~L. 109In reply to: Language of Item-Nav