Search Results for 'notification user id'
-
Search Results
-
Hi,
I tried this method. But it did not work. Any fix?
https://wordpress.stackexchange.com/questions/263950/new-post-notifications-for-users-buddypress/Please help.. Thanks.
Hello.
I am able to receive email notifications for all sign ups, logins as an admin of the site, however my users are not receiving BP emails when someone sends them a message or comments on their post. I am using Paid Memberships Pro and Wordfence so perhaps those emails come through those plugins but I also do not receive BP notifications of messages from users – I tested it by creating a separate account.
This is a new site so I wasn’t aware of the issue previously and I don’t know if it has worked before.
Any help appreciated. It will be difficult to uninstall all plugins as the site is active.
I’m using WordPress 4.8.2 and BuddyPress 2.9.1
Topic: @mentions after import
Dear Buddypress,
I hope you can help me with this…
I have just transferred 1000s of comments to articles – of my buddypress wordpress site.Those comments, have @mentions in them and users, didn’t receive the notifications about @mentions – which is great! It would be too much (some of them are old ect).
However, is there any way we can populate those mentions, without any notifications, so they show in their profiles – under mentions? So, they can look back when someone mentioned them?
Thank you very much 🙂
Topic: Disable notifications
Hi,
I’d like to disable user-notifications but keep the MP notifications.
Howcan I do it or which plugin should I use instead of BuddyPress Notifications Widget?
Thank’s in advance
My client has asked that notifications get sent everytime a user updates his profile. I have two profiles that require notifications – the base group, and a group called: ‘Personal Details’ – the code I am using is sending emails for both forms no matter which form is selected, I have tried using if statements but the do not send.
The current code:
function rc_buddypress_profile_update( $user_id ) { $admin_email = "barbara@lsdev.biz"; $message = sprintf( __( 'Dear Admin, "Base Profile" details have been updated for the following member: %1$s', 'buddypress' ), bp_core_get_user_displayname( $user_id ) ) . "\r\n\r\n"; $message .= sprintf( __( 'Name: %s' ), bp_get_profile_field_data('field=Name') ). "\r\n"; $message .= sprintf( __( 'Surname: %s' ), bp_get_profile_field_data('field=Surname') ). "\r\n"; $message .= sprintf( __( 'Company Name: %s' ), bp_get_profile_field_data('field=Company Name') ). "\r\n"; $message .= sprintf( __( 'Company Website: %s' ), bp_get_profile_field_data('field=Company Website') ). "\r\n"; wp_mail( $admin_email, sprintf( __( 'FISA Member Base Profile Update' ), FISA ), $message ); } $personalDetails = xprofile_get_field_id_from_name( 'Personal Details' ); function rc_buddypress_personal_details_update( $personalDetails ) { $admin_email = "barbara@lsdev.biz"; $message = sprintf( __( 'Dear Admin, "Personal Details" have been updated for the following member: %1$s', 'buddypress' ), bp_core_get_user_displayname( $personalDetails ) ) . "\r\n\r\n"; $message .= sprintf( __( 'Mobile Phone: %s' ), bp_get_profile_field_data('field=Mobile Phone') ). "\r\n"; $message .= sprintf( __( 'Work Phone: %s' ), bp_get_profile_field_data('field=Work Phone') ). "\r\n\r\n"; $message .= sprintf( __( 'Address Line 1: %s' ), bp_get_profile_field_data('field=Address Line 1') ). "\r\n"; $message .= sprintf( __( 'Address Line 2: %s' ), bp_get_profile_field_data('field=Address Line 2') ). "\r\n"; $message .= sprintf( __( 'Address Line 3: %s' ), bp_get_profile_field_data('field=Address Line 3') ). "\r\n\r\n"; $message .= sprintf( __( 'City: %s' ), bp_get_profile_field_data('field=City') ). "\r\n"; $message .= sprintf( __( 'Postal Code: %s' ), bp_get_profile_field_data('field=Postal Code') ). "\r\n"; $message .= sprintf( __( 'Region: %s' ), bp_get_profile_field_data('field=Region') ). "\r\n\r\n"; wp_mail( $admin_email, sprintf( __( 'FISA Member Personal Details Update' ), get_option('blogname') ), $message ); } add_action( 'xprofile_updated_profile', 'rc_buddypress_personal_details_update', 10, 5 ); add_action( 'xprofile_updated_profile', 'rc_buddypress_profile_update', 10, 5 );What I tried to use to separate them:
function rc_buddypress_profile_update( $user_id ) { if ( xprofile_get_field_data( "User Type") == "Personal Details" ) { $admin_email = "martin@lsdev.biz"; $message = sprintf( __( 'Dear Admin, "Personal Details" have been updated for the following member: %1$s', 'buddypress' ), bp_core_get_user_displayname( $user_id ) ) . "\r\n\r\n"; $message .= sprintf( __( 'Mobile Phone: %s' ), bp_get_profile_field_data('field=Mobile Phone') ). "\r\n"; $message .= sprintf( __( 'Work Phone: %s' ), bp_get_profile_field_data('field=Work Phone') ). "\r\n\r\n"; $message .= sprintf( __( 'Address Line 1: %s' ), bp_get_profile_field_data('field=Address Line 1') ). "\r\n"; $message .= sprintf( __( 'Address Line 2: %s' ), bp_get_profile_field_data('field=Address Line 2') ). "\r\n"; $message .= sprintf( __( 'Address Line 3: %s' ), bp_get_profile_field_data('field=Address Line 3') ). "\r\n\r\n"; $message .= sprintf( __( 'City: %s' ), bp_get_profile_field_data('field=City') ). "\r\n"; $message .= sprintf( __( 'Postal Code: %s' ), bp_get_profile_field_data('field=Postal Code') ). "\r\n"; $message .= sprintf( __( 'Region: %s' ), bp_get_profile_field_data('field=Region') ). "\r\n\r\n"; wp_mail( $admin_email, sprintf( __( 'FISA Member Personal Details Update' ), get_option('blogname') ), $message ); } else { $admin_email = "martin@lsdev.biz"; $message = sprintf( __( 'Dear Admin, "Base Profile" details have been updated for the following member: %1$s', 'buddypress' ), bp_core_get_user_displayname( $user_id ) ) . "\r\n\r\n"; $message .= sprintf( __( 'Name: %s' ), bp_get_profile_field_data('field=Name') ). "\r\n"; $message .= sprintf( __( 'Surname: %s' ), bp_get_profile_field_data('field=Surname') ). "\r\n"; $message .= sprintf( __( 'Company Name: %s' ), bp_get_profile_field_data('field=Company Name') ). "\r\n"; $message .= sprintf( __( 'Company Website: %s' ), bp_get_profile_field_data('field=Company Website') ). "\r\n"; wp_mail( $admin_email, sprintf( __( 'FISA Member Base Profile Update' ), FISA ), $message ); } add_action( 'xprofile_updated_profile', 'rc_buddypress_profile_update', 10, 5 );Would appreciate some help on this.
Topic: Buddypress + HyperDB
I’m trying to get HyperDB to work width Buddypress.
I’m trying to move bp_activity, bp_activity_meta, bp_notifications, notifications_meta, xprofile_data, xprofile_fields, bp_xprofile_groups, bp_xprofile_meta into there own ‘Buddypress’ database. But it does not work.
I’m getting this error: Undefined variable: server
Here is my current config:
$wpdb->add_database(array( 'host' => DB_HOST, 'user' => DB_USER, 'password' => DB_PASSWORD, 'name' => 'DATABASE-NAME', 'write' => 1, 'dataset' => 'bpress', ));else if(preg_match("/bp_activity/", $wpdb->table)){ return 'bpress'; }Witch preg_match should I use?
Anyone that is using HyperDB with Byddypress?
Hello!
Wordpress: Version 4.7.5
BuddyPress: Version 2.8.2
Site Link: http://www.shsmash.comI just started up a new site and have been having trouble finding an answer to some issues I’ve been having. This is related to the BuddyPress notification emails that get sent out to users when they register for the site and when they receive other notifications.
Here are some of the Email Macros being used:
{{{activate.url}}}
{{{message.url}}}
{{{group.url}}}ETC.
Whenever a URL like that is inserted automatically into the email it generates something strange that points to somewhere on the site that does not exist.
I don’t have a /c/ directory on my site, nor did I indicate wanting to use an “email” subdomain.
I’m not quite sure what is going on here so hopefully somebody can help!
I administer two social sites and both are asking of there is any way to remove notifications of people joining the group and who made friends with whom… It is plugging up the group notification area and users are getting annoyed.
I have searched for appropriate plugins and found a few but all are depreciated and mess up the site.
Wordpress 4.7.3
Buddypress 2.8.2
Bbpress 2.5.12I found a code hack for the functions.php but it can’t be used in the child “guideline” theme. When added to the child, I lose admin pages. code snippet below
// Remove (hide) various activities from streams.
function my_hidden_activities($a, $activities) {
//if admin we want to know
//if (is_site_admin())
// return $activities;$nothanks = array(“new_blog_post”, “created_group”, “joined_group”, “new_member”, “friendship_created”, “activity_liked”);
foreach ($activities->activities as $key => $activity) {
if (in_array($activity->type, $nothanks, true)) {
unset($activities->activities[$key]);
$activities->activity_count = $activities->activity_count-1;
$activities->total_activity_count = $activities->total_activity_count-1;
$activities->pag_num = $activities->pag_num -1;
}
}// Renumber the array keys to account for missing items.
$activities_new = array_values( $activities->activities );
$activities->activities = $activities_new;return $activities;
}
add_action(‘bp_has_activities’, ‘my_hidden_activities’, 10, 2 );The author suggests adding to functions.php but without using the child theme the code would be lost after an update. It also broke the site… Even after reverting the changes, the menu and page formatting was gone.
Is there any way that is up to date to filter what activity is reported on the group wall?
when i got a comment on a update that i made in Sitewide Activity
(its actually woocommerce product post)( then i get a notification _”commented on one of your updates- when i click on it, it just redirects me to users profile toppage. i never know on what he actuelly commented.
i try to use Activity Comment notifier-wich has the right notifiacion link( when click onit it redirects me to actual conversation)
but the problem is now i have double notification( 2 notification for same comment) 1 from buddypress itself 1 from plugin. how can i solve my link problem?
Hey all I’m attempting to modify the content returned by BuddyPress’ default ‘@’ mention notification. I’m using this as part of a custom profile page and would like to modify the “username mentioned you’ text to something more personalized based on post type.
// Change mention output function format_mention_notifications( $action, $item_id, $secondary_item_id, $total_items, $format = 'string', $component_action, $component_name, $notification_id) { if ( $component_action === 'new_at_mention') { // User mentioned notification $mentioned_source_type = get_post_type($item_id); $username = wl_get_username($secondary_item_id); $mention_avatar = wl_get_avatar($secondary_item_id); $mention_title = ''; $mention_text = $username; if ($mentioned_source_type == 'topic') { $mention_title = bbp_get_topic_title( $item_id ); $mention_text .= ' mentioned you in the forum post '; $mention_source_link = ''; // link to topic } else if ($mentioned_source_type == 'reply') { $parent_topic_id = bbp_get_reply_topic_id( $item_id ); $mention_title = bbp_get_topic_title( $parent_topic_id ); $mention_text .= ' mentioned you in their response to the forum post '; $mention_source_link = bbp_get_reply_url( $item_id ); // link to reply } else if ($mentioned_source_type == 'comment') { $comment = get_comment($item_id); $mention_text .= ' mentioned you in their comment'; $mention_source_link = get_comment_link($comment); } else { $mention_avatar = ''; $mention_title = get_the_title($item_id); $mention_text = 'You were mentioned in '; $mention_source_link = get_permalink($item_id); } $mention_source_link = wp_nonce_url( add_query_arg( array( 'action' => 'read', 'notification_id' => $notification_id), $mention_source_link ), 'bp_notification_mark_read_' . $notification_id); // WordPress Toolbar if ( 'string' === $format ) { $return = apply_filters( 'bp_activity_single_at_mentions_notification', '<a href="' . esc_url( $mention_source_link ) . '" title="New mention">'. $mention_avatar . esc_html( $mention_text ) . '<span class="activity-title">'.$mention_title.'</span></a>', (int) $total_items, $mention_text, $mention_source_link ); // Deprecated BuddyBar } else { $return = apply_filters( 'bp_activity_single_at_mentions_notification', array( 'text' => $mention_text . $mention_title, 'link' => $mention_source_link ), $mention_source_link, (int) $total_items, $mention_text, $mention_title ); } } return $return; } add_filter( 'bp_notifications_get_notifications_for_user', 'format_mention_notifications', 100, 8 );What I’ve tried so far:
– Changing the priority of the filter
– Moving my logic into theactivity_format_notificationsaction with various different priorities
– All of the above in a custom plugin file, bp-custom.php, and my themes’ function.php fileI’ve used a similar filter for custom notifications and that aspect works great. I just can’t seem to override the default content with my own. My thoughts are that the the filters/actions run too late to be noticed by BuddyPress.
Many thanks for your help.
Hello,
I use simple loop to display user notifications:
if ( $notifications = bp_notifications_get_notifications_for_user( bp_loggedin_user_id(), $format = 'string' ) ) { } if ( $notifications ) { $counter = 0; for ( $i = 0, $count = count( $notifications ); $i < $count; ++$i ) { $alt = ( 0 == $counter % 2 ) ? ' alt' : ''; ?> <div class="my-notification<?php echo $alt ?>"><?php echo $notifications[$i] ?></div> <?php $counter++; } }When user click and view any notification it disappears automatically except
“XX commented on one of your updates” notification. When I switch to a default wp theme and click on this notification it disappears. Both links on both themes are the same, it’s
activity/p/277/?nid=74#acomment-294Why it happens only to one notification? All other notifications works fine.
Hey guys,
first of all, awesome forum! I’ve already solved so many of my issues simply by reading the many helpful answers – hence never had the need to post anything myself, but now I’m a bit stuck.
Here’s what I wanted to do: Put a new profile group in a separate bp profile menu tab and make it visible to both, logged in as well as logged out users. Now, it works perfectly fine, except for the fact that logged out users for some reason get to see my personal profile group under my custom tab instead of the new profile group – which is displayed correctly for me as well as other logged in users.
Here’s my code:
/** BP Profile Tab Visibility */ function bpfr_hide_top_nav() { if( !is_user_logged_in() ) { // bp topnav items to hide bp_core_remove_nav_item( 'activity' ); bp_core_remove_nav_item( 'friends' ); bp_core_remove_nav_item( 'groups' ); bp_core_remove_nav_item( 'forums' ); bp_core_remove_nav_item( 'media' ); bp_core_remove_nav_item( 'docs' ); bp_core_remove_nav_item( 'location' ); //bp subnav (my activities, my groups, etc) bp_core_remove_subnav_item( 'activity', 'activity' ); bp_core_remove_subnav_item( 'activity', 'friends' ); bp_core_remove_subnav_item( 'activity', 'favorites' ); bp_core_remove_subnav_item( 'activity', 'groups' ); bp_core_remove_subnav_item( 'activity', 'mentions' ); bp_core_remove_subnav_item( 'activity', 'media' ); bp_core_remove_subnav_item( 'activity', 'docs' ); bp_core_remove_subnav_item( 'activity', 'comments' ); } } add_action( 'bp_ready', 'bpfr_hide_top_nav', 10 ); /** BP Tab Order Profile and Tab Rename */ function bpex_primary_nav_tabs_position() { buddypress()->members->nav->edit_nav( array( 'position' => 2, ), 'activity' ); buddypress()->members->nav->edit_nav( array( 'position' => 1, ), 'profile' ); buddypress()->members->nav->edit_nav( array( 'position' => 3, ), 'messages' ); buddypress()->members->nav->edit_nav( array( 'position' => 4, ), 'notifications' ); buddypress()->members->nav->edit_nav( array( 'position' => 5, ), 'friends' ); buddypress()->members->nav->edit_nav( array( 'position' => 6, ), 'groups' ); buddypress()->members->nav->edit_nav( array( 'position' => 7, ), 'forums' ); buddypress()->members->nav->edit_nav( array( 'position' => 8, ), 'criticalreview' ); buddypress()->members->nav->edit_nav( array( 'position' => 9, ), 'docs' ); buddypress()->members->nav->edit_nav( array( 'position' => 10, ), 'media' ); buddypress()->members->nav->edit_nav( array( 'position' => 11, ), 'location' ); buddypress()->members->nav->edit_nav( array( 'position' => 12, ), 'orders' ); buddypress()->members->nav->edit_nav( array( 'position' => 13, ), 'settings' ); } add_action( 'bp_setup_nav', 'bpex_primary_nav_tabs_position', 999 ); /** Put Critical Review Profile Group in BP Tab */ function buddydev_modifyy_user_profile_tab() { bp_core_new_nav_item( array( 'name' => 'Critical Review', 'slug' => 'criticalreview', 'screen_function' => 'buddydev_screen_profile_data', 'default_subnav_slug' => 'criticalreview-sub', 'show_for_displayed_user' => true, )); } add_action( 'bp_setup_nav', 'buddydev_modifyy_user_profile_tab', 8 ); function buddydev_screen_profile_data() { //filter loop add_filter( 'bp_after_has_profile_parse_args', 'buddydev_filter_args_for_profile_group' ); //load loop add_action( 'bp_template_content', 'buddydev_show_profile_group_data'); bp_core_load_template( 'members/single/plugins'); } function buddydev_filter_args_for_profile_group( $args ) { ///CHANGE IT $args['profile_group_id'] = '6'; //Your Profile Group ID Here return $args; } //Load the loop function buddydev_show_profile_group_data() { $profileslug = bp_get_profile_slug(); // if ( bp_is_my_profile() ) : // echo "Edit under Profile"; // endif; bp_get_template_part( 'members/single/profile/profile-loop' ); } function hide_profile_group( $grpid ) { if ( is_user_logged_in() && !bp_is_profile_edit() ) { $myfield = xprofile_get_field_data( 'Critical Review' ); $grpid['exclude_groups'] = '6'; } return $grpid; } add_filter( 'bp_after_has_profile_parse_args', 'hide_profile_group' );A few comments:
Most of the essential code is based on this threat. I am not really a coder myself, but usually I understand what the functions are doing.
For now I commented `// if ( bp_is_my_profile() ) :
// echo “Edit under Profile”;
// endif;` out, because if I leave it in, for some reason then also logged-in users only see the personal profile group instead of the Critical Review one?!Also, I’m not entirely sure about the use of the last function and its use / relevance, because it doesn’t seem to affect anything. This might however have to do with the fact that in order to avoid duplication of the Critical Review profile group under the actual profile tab, I’ve hidden the profile group via CSS.
Finally, I’m running the latest WP and BP installs and you can have a look at the described behavior here. Interestingly, as you can see in this instance, the profile fields are actually adjusted to my CSS for the Critical Review profiles group – but the actual content doesn’t show correctly.
Now, if any of you could help me out, I would highly appreciate it!
Thank you so much in advance! 🙂