Search Results for 'comment notification'
-
AuthorSearch Results
-
August 23, 2016 at 11:17 am #257925
In reply to: How to – Chapters and other blog question
Humiges
ParticipantHey @buddycore,
thanks for your reply.
Sorry, I’ll try π
1, Well, we have users (buddypress) they post their stories from front end – using social articles plugin. Sometime, their stories have chapters… so, it would be nice to link them somehow. I didn’t find the way to do that, so I thought I would try it here — maybe a bit of brainstorming π2, In regards of the images – I know lots of site have problems with copyrights, so I would like to control the images by allowing only selection from library.
3, allow buddypress users to follow certain blog posts β so, when itβs edited or commented they receive notification? – — I hope this one is clear π
Thanks a lot π
August 16, 2016 at 9:21 am #257664Paul Wong-Gibbs
KeymasterDo other BuddyPress emails get sent?
Do WordPress emails get sent? (comment notification, new user registration, etc).August 14, 2016 at 8:31 am #257597In reply to: Broken translation in some tabs
danbp
ParticipantDon’t hack core files. (never !) Which language do you use ?
Where have you done this ?
Iβve took a look at the files and found out that the working ones are using__( "Foo %s", "buddypress" )and the wrong ones are using_x( "Foo %s", "Blah blah blah", "buddypress" ).Actually all BP strings are working. If you need custom translation, you have to do that in po/mo and to use preferably the original strings. For example, if you build a template and want to use the notification count on it, you copy the original string to your work. If you don’t do that, you nedd 2 po/mo ! One for BP and one for your custom work. Which is certainly not the best and easiest solution.
The notification count is defined in wp-content/plugins/buddypress/bp-notifications/classes/class-bp-notification-component.php
The counter itself is inside a span and is defined separately.
/* translators: %s: Unread notification count for the current user */ _x( 'Notifications %s', 'Profile screen nav', 'buddypress' ), sprintf( '<span class="%s">%s</span>',The bla bla bla part you mention is a comment for translators who indicates him the context. This comment appears in the pot file like: Notification %s [Profile screen nav]
That’s BP’s default coding. You haven’t to modify this. Use it as is.
If you have difficulty to translate such a string, you have to check your theme or any custom function you added (by hand or another plugin).
The corresponding custom string should reflect the original one as gettext function wouldn’t translate a string which is not identic.
__( "Foo %s", "buddypress" )and_x( "Foo %s", "Blah blah blah", "buddypress" )are both working, and do technicaly the same thing (foo = something) which let you modify “foo” in both case, but as the original string is_x( "Foo %s", "Blah blah blah", "buddypress" ),you couldn’t replace it with__( "Foo %s", "buddypress" ). It is the translation prefix (_x or __) which is the important thing here.Hope to be clear. And you’re right, unfortunately your changes will be overwriten at next BP update as you hacked core files.
August 12, 2016 at 8:58 am #257553In reply to: Activation email
Paul Wong-Gibbs
KeymasterEmails not sending have many possible causes. For the sake of clear discussion, please make your own topics, don’t bundle in on the same one.
@jtburlew Please check to see if your site sends WordPress emails reliably? (i.e. comment notification, password resets). Please also let me know what plugins you are using. Anything that changes POP3 or IMAP behaviour, or redeclares thewp_mailfunction, in particular.August 12, 2016 at 8:52 am #257549Paul Wong-Gibbs
KeymasterWhat plugins do you have active?
Does your site send WordPress emails reliably? (i.e. password resets, comment notifications)
July 5, 2016 at 7:54 pm #255990danbp
ParticipantMerci @imath !
The old way
The following syntax to change the tab order is deprecated since 2.6 and will throw an error notice:
function rt_change_profile_tab_order() { global $bp; $bp->bp_nav['profile']['position'] = 10; $bp->bp_nav['activity']['position'] = 20; } add_action( 'bp_setup_nav', 'rt_change_profile_tab_order', 999 );The new way
Now the correct syntax to use for modifying – since 2.6 – the tabs position on the buddybar when you’re on a profile.
This example list all BP related items who appear by default on a profile nav, in order of appearance and include also the forum tab (if you use bbPress for group forums).
By default, activity tab comes as 1st. The snippet will move it to 4th position.To modify a position you simply change the numeric value.
If you want to move only one item, you remove or comment (add//at begin of the line) the ones you don’t want to move.function bpex_primary_nav_tabs_position() { buddypress()->members->nav->edit_nav( array( 'position' => 4, ), 'activity' ); buddypress()->members->nav->edit_nav( array( 'position' => 5, ), 'profile' ); buddypress()->members->nav->edit_nav( array( 'position' => 7, ), 'notifications' ); buddypress()->members->nav->edit_nav( array( 'position' => 9, ), 'messages' ); buddypress()->members->nav->edit_nav( array( 'position' => 2, ), 'friends' ); buddypress()->members->nav->edit_nav( array( 'position' => 6, ), 'groups' ); buddypress()->members->nav->edit_nav( array( 'position' => 3, ), 'forums' ); buddypress()->members->nav->edit_nav( array( 'position' => 1, ), 'settings' ); } add_action( 'bp_setup_nav', 'bpex_primary_nav_tabs_position', 999 );That’s it for the buddybar nav menu order on profile.
July 4, 2016 at 10:43 am #255764In reply to: auto-refresh “load newest” not working
maxgx
Participantok, moved on a clone, disabled all plugins and tested it throughout and i found it out:
new activity notifications do work ok, what is missing are notifications of comments to activity – actually, it’s not a problem with my setup, it’s really a (very much needed, badly missed, imho) missing feature…
luckily, BP Live Notification does seem to do the job, but it’s yet another addition to the ever growing list of plugins needed for covering up the lack of (quite obvious, always imho) features…
you could mark this as resolved, i guess (tho it’s not quite, really)
June 16, 2016 at 12:37 pm #254630In reply to: @mention notification not working on blog posts
danbp
Participantnotification not working on blog posts.
It’s not implemented. See why on #4046
But you can eventually try the one or other plugin actually available on WP repository.
Particulary Mentionable, Email Mentioned or Mention comment’s Authors
June 9, 2016 at 7:43 am #254358In reply to: How do buddypress Mark custom notification as read?
tauqeerabbas01
ParticipantThank you! both.
i have checked the bp-notifications folder also have read comments, but i am unable to find the logic behind, marking custom notifications as read.
Thanks.
June 9, 2016 at 7:31 am #254357In reply to: How do buddypress Mark custom notification as read?
danbp
Participantthere is also a bp-notification folder, where you can find all files related to notification. You can read them to check the used logic. Code is widely commented.
If you need quick functions informations, you can also visit this site (link goes to “notification” search result), who present a detailed BP code.
May 5, 2016 at 3:05 pm #253161In reply to: Birthday Notifications
lucaram
ParticipantThanks Henry,
Unfortunately I struggle to understand how to produce the code, I’m not a code expert like you guys.
Here is what I have and how I would like to implement it for my friend’s birthday:

I have found this that mentioned the “bp_notifications_add_notification()” function:
That is for notifications when someone comments on their blog post, but it is far too complex for me to modify for birthdays I’m afraid π
Any chance somebody could share the code?
March 24, 2016 at 3:18 pm #251761In reply to: Email Notifications Not Working
davidkey772
ParticipantI haven’t managed to upload the debug plugin but I have deleted the welcome email editor plugin. I then decided to try testing the site as you suggest – without having run the debug.
To test the system I have two logins – A (admin) and (B) member. When I login as B and post to a group that I am also in as A, A DOESN’T get a notification. HOWEVER, If I then comment as A B DOES get a notification.
I also get a notification if I post a friend request or send a personal message between A and B.
So… I’m wondering if I’ve messed up? I have made an assumption that I should get a notification email if someone posts in a group that I am also in? Am I right to expect this?!
March 23, 2016 at 8:12 pm #251720In reply to: Email Notifications Not Working
Paul Wong-Gibbs
KeymasterWe should be able to figure this out. π
Where is your website hosted?
Does your site send WordPress emails, without any other plugin activated, and using the default theme? For example, comment moderation / notification emails.
March 16, 2016 at 10:53 am #251321In reply to: Add @mentions in plugin
btees
ParticipantHi @djpaul,
Thanks a lot for that, now I’m getting somewhere!
Neither mentions.min.js or mentions.js were loading on awpcp pages so I put the following in my footer:
<?php if ( is_page( 4792 ) ): ?> <script type='text/javascript' src='http://mysite.com/wp-content/plugins/buddypress/bp-activity/js/mentions.min.js?ver=2.5.1'></script> <?php endif; ?>I also added the
bp-suggestsclass to the textarea.I’m now getting suggestions on the input box which is a good start!
But when the comments are posted they are still just appearing in plain text.
Is there a css class that should be added to the comment container? Or would this be part of implementing the activity stream and notification integration?
March 2, 2016 at 9:13 pm #250483@mcuk
ParticipantHi @mikee1001,
The code i used for inserting the bubble counters for notifications, unread messages and total friends is:
// Notification counter bubble function bptest_main_nav_notification_bubble( $items, $args ) { if( $args->theme_location == 'header-menu' ) { // In manage locations via WP Dash>Appearance>Menus $items_array = array(); while ( false !== ( $item_pos = strpos ( $items, '<li', 3 ) ) ) { $items_array[] = substr( $items, 0, $item_pos ); $items = substr( $items, $item_pos ); } $items_array[] = $items; array_splice( $items_array, 3, 0, '<li class="bubble">' . bp_notifications_get_unread_notification_count( bp_loggedin_user_id() ) . '</li>' ); // 0,0 1st position, 1,0 2nd, etc $items = implode( '', $items_array ); } return $items; } add_filter( 'wp_nav_menu_items', 'bptest_main_nav_notification_bubble', 10, 2 );// Unread message counter bubble function bptest_main_nav_message_bubble( $items, $args ) { if( $args->theme_location == 'header-menu' ) { // In manage locations via WP Dash>Appearance>Menus $items_array = array(); while ( false !== ( $item_pos = strpos ( $items, '<li', 3 ) ) ) { $items_array[] = substr( $items, 0, $item_pos ); $items = substr( $items, $item_pos ); } $items_array[] = $items; array_splice( $items_array, 5, 0, '<li class="bubble">' . bp_get_total_unread_messages_count( bp_loggedin_user_id() ) . '</li>' ); // 0,0 1st position, 1,0 2nd, etc $items = implode( '', $items_array ); } return $items; } add_filter( 'wp_nav_menu_items', 'bptest_main_nav_message_bubble', 10, 2 );// Total friends counter bubble // Note, 'bp_friend_get_total_requests_count' will give the total connection request count if desired function bptest_main_nav_friend_bubble( $items, $args ) { if( $args->theme_location == 'header-menu' ) { // In manage locations via WP Dash>Appearance>Menus $items_array = array(); while ( false !== ( $item_pos = strpos ( $items, '<li', 3 ) ) ) { $items_array[] = substr( $items, 0, $item_pos ); $items = substr( $items, $item_pos ); } $items_array[] = $items; array_splice( $items_array, 7, 0, '<li class="bubble">' . friends_get_total_friend_count( bp_loggedin_user_id() ) . '</li>' ); // 0,0 1st position, 1,0 2nd, etc $items = implode( '', $items_array ); } return $items; } add_filter( 'wp_nav_menu_items', 'bptest_main_nav_friend_bubble', 10, 2 );In each of the above you will want to change the
theme_location == 'header-menu'totheme_location == 'INSERT YOUR HEADER MENU NAME HERE'. The name of your menu is found via your WP Dashboard > Appearance > Menus. The three functions above were inserted into bp-custom.php .The positions of the bubbles will also need changing depending on where they should be in your menu. Do that by changing the numbers on the section
array_splice( $items_array, 7, 0, '<li class="bubble">'. The comment alongside the line in the code should help you.You’ll also need some CSS for the bubbles otherwise you probably won’t see them even if they are functioning. If you hit ctrl-A to select everything on your web page, they should show up somewhere in your menu (assuming the code has been implemented correctly of course).
As you can see in the functions above all the bubbles have been given a class called “bubble”. So put in your style.css (of your child theme) something like:
#main-navigation .main-nav ul li.bubble { transform: translate(0, 50%); width: 20px; height: 20px; padding: 2px 6px; border: 1px solid #000; border-radius: 50%; margin: 0 10px 0 0; background: #fff; color: #000; font-size: 11px; }The selector (
#main-navigation .main-nav ul li.bubble) may be different on your site because it will depend on your theme etc. So use the developer tools, F12 button, on your browser to find out the correct one. It will be the bit before the.bubblethat is different.Hopefully the above helps!
February 26, 2016 at 8:31 pm #250312In reply to: Question about notifications
shanebp
ModeratorYou will need to write custom code for that task.
There is lots of existing code/plugins that does similar things.
You could probably tweak an existing plugin to only work for your client.Google: ‘wordpress comment email notification plugin’
February 8, 2016 at 7:00 am #249574In reply to: Notify me of follow-up replies via email
CJBatson
ParticipantThanks for the reply!! Does that plugin work? I tried it and it didn’t work well with my theme. I was hoping there was a way to set it up within BuddyPress, using the BP notifications.
I actually thought that the older plugin “subscribe to comments” worked better but is not maintained any more, and I also had some issues with my theme.
What does BP use to put the checkbox down below this message?
February 2, 2016 at 12:37 pm #249393In reply to: queries on posting
kalaiyarasi
ParticipantNo, i just want to mention them through their profile notification not through mail,
(i.e)like mentioning our friends in facebook comment.January 3, 2016 at 2:44 am #248307In reply to: How to create a Like notification?
ibuddybook
ParticipantMr,Henry Wright
I was searching the like notification plugin in the internet. but not available. buddypress live notification plugin only available. this plugin is working in comment section. not working for share activity and like. so please help me to solve my problem????
Thank you
H.Suresh
January 2, 2016 at 3:30 pm #248285In reply to: How to create a Like notification?
ibuddybook
ParticipantThank you for your reply Mr.Henry Wright…
How to insert the code????? how to change the Parameters???. i am not understand. please tell me step by step…
here is my code…
/buddypress/bp-activity/bp-activity-notifications.php<?php /** * BuddyPress Activity Notifications. * * @package BuddyPress * @subpackage ActivityNotifications */ // Exit if accessed directly. defined( 'ABSPATH' ) || exit; /* Emails *********************************************************************/ /** * Send email and BP notifications when a user is mentioned in an update. * * @since 1.2.0 * * @uses bp_notifications_add_notification() * @uses bp_get_user_meta() * @uses bp_core_get_user_displayname() * @uses bp_activity_get_permalink() * @uses bp_core_get_user_domain() * @uses bp_get_settings_slug() * @uses bp_activity_filter_kses() * @uses bp_core_get_core_userdata() * @uses wp_specialchars_decode() * @uses get_blog_option() * @uses bp_is_active() * @uses bp_is_group() * @uses bp_get_current_group_name() * @uses apply_filters() To call the 'bp_activity_at_message_notification_to' hook. * @uses apply_filters() To call the 'bp_activity_at_message_notification_subject' hook. * @uses apply_filters() To call the 'bp_activity_at_message_notification_message' hook. * @uses wp_mail() * @uses do_action() To call the 'bp_activity_sent_mention_email' hook. * * @param int $activity_id The ID of the activity update. * @param int $receiver_user_id The ID of the user who is receiving the update. */ function bp_activity_at_message_notification( $activity_id, $receiver_user_id ) { // Don't leave multiple notifications for the same activity item. $notifications = BP_Core_Notification::get_all_for_user( $receiver_user_id, 'all' ); foreach( $notifications as $notification ) { if ( $activity_id == $notification->item_id ) { return; } } $activity = new BP_Activity_Activity( $activity_id ); $subject = ''; $message = ''; $content = ''; // Now email the user with the contents of the message (if they have enabled email notifications). if ( 'no' != bp_get_user_meta( $receiver_user_id, 'notification_activity_new_mention', true ) ) { $poster_name = bp_core_get_user_displayname( $activity->user_id ); $message_link = bp_activity_get_permalink( $activity_id ); $settings_slug = function_exists( 'bp_get_settings_slug' ) ? bp_get_settings_slug() : 'settings'; $settings_link = bp_core_get_user_domain( $receiver_user_id ) . $settings_slug . '/notifications/'; $poster_name = stripslashes( $poster_name ); $content = bp_activity_filter_kses( strip_tags( stripslashes( $activity->content ) ) ); // Set up and send the message. $ud = bp_core_get_core_userdata( $receiver_user_id ); $to = $ud->user_email; $subject = bp_get_email_subject( array( 'text' => sprintf( __( '%s mentioned you in an update', 'buddypress' ), $poster_name ) ) ); if ( bp_is_active( 'groups' ) && bp_is_group() ) { $message = sprintf( __( '%1$s mentioned you in the group "%2$s": "%3$s" To view and respond to the message, log in and visit: %4$s --------------------- ', 'buddypress' ), $poster_name, bp_get_current_group_name(), $content, $message_link ); } else { $message = sprintf( __( '%1$s mentioned you in an update: "%2$s" To view and respond to the message, log in and visit: %3$s --------------------- ', 'buddypress' ), $poster_name, $content, $message_link ); } // Only show the disable notifications line if the settings component is enabled. if ( bp_is_active( 'settings' ) ) { $message .= sprintf( __( 'To disable these notifications please log in and go to: %s', 'buddypress' ), $settings_link ); } /** * Filters the user email that the @mention notification will be sent to. * * @since 1.2.0 * * @param string $to User email the notification is being sent to. */ $to = apply_filters( 'bp_activity_at_message_notification_to', $to ); /** * Filters the @mention notification subject that will be sent to user. * * @since 1.2.0 * * @param string $subject Email notification subject text. * @param string $poster_name Name of the person who made the @mention. */ $subject = apply_filters( 'bp_activity_at_message_notification_subject', $subject, $poster_name ); /** * Filters the @mention notification message that will be sent to user. * * @since 1.2.0 * * @param string $message Email notification message text. * @param string $poster_name Name of the person who made the @mention. * @param string $content Content of the @mention. * @param string $message_link URL permalink for the activity message. * @param string $settings_link URL permalink for the user's notification settings area. */ $message = apply_filters( 'bp_activity_at_message_notification_message', $message, $poster_name, $content, $message_link, $settings_link ); wp_mail( $to, $subject, $message ); } /** * Fires after the sending of an @mention email notification. * * @since 1.5.0 * * @param BP_Activity_Activity $activity Activity Item object. * @param string $subject Email notification subject text. * @param string $message Email notification message text. * @param string $content Content of the @mention. * @param int $receiver_user_id The ID of the user who is receiving the update. */ do_action( 'bp_activity_sent_mention_email', $activity, $subject, $message, $content, $receiver_user_id ); } /** * Send email and BP notifications when an activity item receives a comment. * * @since 1.2.0 * * @uses bp_get_user_meta() * @uses bp_core_get_user_displayname() * @uses bp_activity_get_permalink() * @uses bp_core_get_user_domain() * @uses bp_get_settings_slug() * @uses bp_activity_filter_kses() * @uses bp_core_get_core_userdata() * @uses wp_specialchars_decode() * @uses get_blog_option() * @uses bp_get_root_blog_id() * @uses apply_filters() To call the 'bp_activity_new_comment_notification_to' hook. * @uses apply_filters() To call the 'bp_activity_new_comment_notification_subject' hook. * @uses apply_filters() To call the 'bp_activity_new_comment_notification_message' hook. * @uses wp_mail() * @uses do_action() To call the 'bp_activity_sent_reply_to_update_email' hook. * @uses apply_filters() To call the 'bp_activity_new_comment_notification_comment_author_to' hook. * @uses apply_filters() To call the 'bp_activity_new_comment_notification_comment_author_subject' hook. * @uses apply_filters() To call the 'bp_activity_new_comment_notification_comment_author_message' hook. * @uses do_action() To call the 'bp_activity_sent_reply_to_reply_email' hook. * * @param int $comment_id The comment id. * @param int $commenter_id The ID of the user who posted the comment. * @param array $params {@link bp_activity_new_comment()}. * @return bool */ function bp_activity_new_comment_notification( $comment_id = 0, $commenter_id = 0, $params = array() ) { // Set some default parameters. $activity_id = 0; $parent_id = 0; extract( $params ); $original_activity = new BP_Activity_Activity( $activity_id ); if ( $original_activity->user_id != $commenter_id && 'no' != bp_get_user_meta( $original_activity->user_id, 'notification_activity_new_reply', true ) ) { $poster_name = bp_core_get_user_displayname( $commenter_id ); $thread_link = bp_activity_get_permalink( $activity_id ); $settings_slug = function_exists( 'bp_get_settings_slug' ) ? bp_get_settings_slug() : 'settings'; $settings_link = bp_core_get_user_domain( $original_activity->user_id ) . $settings_slug . '/notifications/'; $poster_name = stripslashes( $poster_name ); $content = bp_activity_filter_kses( stripslashes($content) ); // Set up and send the message. $ud = bp_core_get_core_userdata( $original_activity->user_id ); $to = $ud->user_email; $subject = bp_get_email_subject( array( 'text' => sprintf( __( '%s replied to one of your updates', 'buddypress' ), $poster_name ) ) ); $message = sprintf( __( '%1$s replied to one of your updates: "%2$s" To view your original update and all comments, log in and visit: %3$s --------------------- ', 'buddypress' ), $poster_name, $content, $thread_link ); // Only show the disable notifications line if the settings component is enabled. if ( bp_is_active( 'settings' ) ) { $message .= sprintf( __( 'To disable these notifications please log in and go to: %s', 'buddypress' ), $settings_link ); } /** * Filters the user email that the new comment notification will be sent to. * * @since 1.2.0 * * @param string $to User email the notification is being sent to. */ $to = apply_filters( 'bp_activity_new_comment_notification_to', $to ); /** * Filters the new comment notification subject that will be sent to user. * * @since 1.2.0 * * @param string $subject Email notification subject text. * @param string $poster_name Name of the person who made the comment. */ $subject = apply_filters( 'bp_activity_new_comment_notification_subject', $subject, $poster_name ); /** * Filters the new comment notification message that will be sent to user. * * @since 1.2.0 * * @param string $message Email notification message text. * @param string $poster_name Name of the person who made the comment. * @param string $content Content of the comment. * @param string $thread_link URL permalink for the activity thread. * @param string $settings_link URL permalink for the user's notification settings area. */ $message = apply_filters( 'bp_activity_new_comment_notification_message', $message, $poster_name, $content, $thread_link, $settings_link ); wp_mail( $to, $subject, $message ); /** * Fires after the sending of a reply to an update email notification. * * @since 1.5.0 * * @param int $user_id ID of the original activity item author. * @param string $subject Email notification subject text. * @param string $message Email notification message text. * @param int $comment_id ID for the newly received comment. * @param int $commenter_id ID of the user who made the comment. * @param array $params Arguments used with the original activity comment. */ do_action( 'bp_activity_sent_reply_to_update_email', $original_activity->user_id, $subject, $message, $comment_id, $commenter_id, $params ); } /* * If this is a reply to another comment, send an email notification to the * author of the immediate parent comment. */ if ( empty( $parent_id ) || ( $activity_id == $parent_id ) ) { return false; } $parent_comment = new BP_Activity_Activity( $parent_id ); if ( $parent_comment->user_id != $commenter_id && $original_activity->user_id != $parent_comment->user_id && 'no' != bp_get_user_meta( $parent_comment->user_id, 'notification_activity_new_reply', true ) ) { $poster_name = bp_core_get_user_displayname( $commenter_id ); $thread_link = bp_activity_get_permalink( $activity_id ); $settings_slug = function_exists( 'bp_get_settings_slug' ) ? bp_get_settings_slug() : 'settings'; $settings_link = bp_core_get_user_domain( $parent_comment->user_id ) . $settings_slug . '/notifications/'; // Set up and send the message. $ud = bp_core_get_core_userdata( $parent_comment->user_id ); $to = $ud->user_email; $subject = bp_get_email_subject( array( 'text' => sprintf( __( '%s replied to one of your comments', 'buddypress' ), $poster_name ) ) ); $poster_name = stripslashes( $poster_name ); $content = bp_activity_filter_kses( stripslashes( $content ) ); $message = sprintf( __( '%1$s replied to one of your comments: "%2$s" To view the original activity, your comment and all replies, log in and visit: %3$s --------------------- ', 'buddypress' ), $poster_name, $content, $thread_link ); // Only show the disable notifications line if the settings component is enabled. if ( bp_is_active( 'settings' ) ) { $message .= sprintf( __( 'To disable these notifications please log in and go to: %s', 'buddypress' ), $settings_link ); } /** * Filters the user email that the new comment reply notification will be sent to. * * @since 1.2.0 * * @param string $to User email the notification is being sent to. */ $to = apply_filters( 'bp_activity_new_comment_notification_comment_author_to', $to ); /** * Filters the new comment reply notification subject that will be sent to user. * * @since 1.2.0 * * @param string $subject Email notification subject text. * @param string $poster_name Name of the person who made the comment reply. */ $subject = apply_filters( 'bp_activity_new_comment_notification_comment_author_subject', $subject, $poster_name ); /** * Filters the new comment reply notification message that will be sent to user. * * @since 1.2.0 * * @param string $message Email notification message text. * @param string $poster_name Name of the person who made the comment reply. * @param string $content Content of the comment reply. * @param string $settings_link URL permalink for the user's notification settings area. * @param string $thread_link URL permalink for the activity thread. */ $message = apply_filters( 'bp_activity_new_comment_notification_comment_author_message', $message, $poster_name, $content, $settings_link, $thread_link ); wp_mail( $to, $subject, $message ); /** * Fires after the sending of a reply to a reply email notification. * * @since 1.5.0 * * @param int $user_id ID of the parent activity item author. * @param string $subject Email notification subject text. * @param string $message Email notification message text. * @param int $comment_id ID for the newly received comment. * @param int $commenter_id ID of the user who made the comment. * @param array $params Arguments used with the original activity comment. */ do_action( 'bp_activity_sent_reply_to_reply_email', $parent_comment->user_id, $subject, $message, $comment_id, $commenter_id, $params ); } } /** * Helper method to map action arguments to function parameters. * * @since 1.9.0 * * @param int $comment_id ID of the comment being notified about. * @param array $params Parameters to use with notification. */ function bp_activity_new_comment_notification_helper( $comment_id, $params ) { bp_activity_new_comment_notification( $comment_id, $params['user_id'], $params ); } add_action( 'bp_activity_comment_posted', 'bp_activity_new_comment_notification_helper', 10, 2 ); /** Notifications *************************************************************/ /** * Format notifications related to activity. * * @since 1.5.0 * * @uses bp_loggedin_user_domain() * @uses bp_get_activity_slug() * @uses bp_core_get_user_displayname() * @uses apply_filters() To call the 'bp_activity_multiple_at_mentions_notification' hook. * @uses apply_filters() To call the 'bp_activity_single_at_mentions_notification' hook. * @uses do_action() To call 'activity_format_notifications' hook. * * @param string $action The type of activity item. Just 'new_at_mention' for now. * @param int $item_id The activity ID. * @param int $secondary_item_id In the case of at-mentions, this is the mentioner's ID. * @param int $total_items The total number of notifications to format. * @param string $format 'string' to get a BuddyBar-compatible notification, 'array' otherwise. * @return string $return Formatted @mention notification. */ function bp_activity_format_notifications( $action, $item_id, $secondary_item_id, $total_items, $format = 'string' ) { switch ( $action ) { case 'new_at_mention': $activity_id = $item_id; $poster_user_id = $secondary_item_id; $at_mention_link = bp_loggedin_user_domain() . bp_get_activity_slug() . '/mentions/'; $at_mention_title = sprintf( __( '@%s Mentions', 'buddypress' ), bp_get_loggedin_user_username() ); $amount = 'single'; if ( (int) $total_items > 1 ) { $text = sprintf( __( 'You have %1$d new mentions', 'buddypress' ), (int) $total_items ); $amount = 'multiple'; } else { $user_fullname = bp_core_get_user_displayname( $poster_user_id ); $text = sprintf( __( '%1$s mentioned you', 'buddypress' ), $user_fullname ); } break; } if ( 'string' == $format ) { /** * Filters the @mention notification for the string format. * * This is a variable filter that is dependent on how many items * need notified about. The two possible hooks are bp_activity_single_at_mentions_notification * or bp_activity_multiple_at_mentions_notification. * * @since 1.5.0 * * @param string $string HTML anchor tag for the mention. * @param string $at_mention_link The permalink for the mention. * @param int $total_items How many items being notified about. * @param int $activity_id ID of the activity item being formatted. * @param int $poster_user_id ID of the user posting the mention. */ $return = apply_filters( 'bp_activity_' . $amount . '_at_mentions_notification', '<a href="' . esc_url( $at_mention_link ) . '" title="' . esc_attr( $at_mention_title ) . '">' . esc_html( $text ) . '</a>', $at_mention_link, (int) $total_items, $activity_id, $poster_user_id ); } else { /** * Filters the @mention notification for any non-string format. * * This is a variable filter that is dependent on how many items need notified about. * The two possible hooks are bp_activity_single_at_mentions_notification * or bp_activity_multiple_at_mentions_notification. * * @since 1.5.0 * * @param array $array Array holding the content and permalink for the mention notification. * @param string $at_mention_link The permalink for the mention. * @param int $total_items How many items being notified about. * @param int $activity_id ID of the activity item being formatted. * @param int $poster_user_id ID of the user posting the mention. */ $return = apply_filters( 'bp_activity_' . $amount . '_at_mentions_notification', array( 'text' => $text, 'link' => $at_mention_link ), $at_mention_link, (int) $total_items, $activity_id, $poster_user_id ); } /** * Fires right before returning the formatted activity notifications. * * @since 1.2.0 * * @param string $action The type of activity item. * @param int $item_id The activity ID. * @param int $secondary_item_id @mention mentioner ID. * @param int $total_items Total amount of items to format. */ do_action( 'activity_format_notifications', $action, $item_id, $secondary_item_id, $total_items ); return $return; } /** * Notify a member when their nicename is mentioned in an activity stream item. * * Hooked to the 'bp_activity_sent_mention_email' action, we piggy back off the * existing email code for now, since it does the heavy lifting for us. In the * future when we separate emails from Notifications, this will need its own * 'bp_activity_at_name_send_emails' equivalent helper function. * * @since 1.9.0 * * @param object $activity Activity object. * @param string $subject (not used) Notification subject. * @param string $message (not used) Notification message. * @param string $content (not used) Notification content. * @param int $receiver_user_id ID of user receiving notification. */ function bp_activity_at_mention_add_notification( $activity, $subject, $message, $content, $receiver_user_id ) { if ( bp_is_active( 'notifications' ) ) { bp_notifications_add_notification( array( 'user_id' => $receiver_user_id, 'item_id' => $activity->id, 'secondary_item_id' => $activity->user_id, 'component_name' => buddypress()->activity->id, 'component_action' => 'new_at_mention', 'date_notified' => bp_core_current_time(), 'is_new' => 1, ) ); } } add_action( 'bp_activity_sent_mention_email', 'bp_activity_at_mention_add_notification', 10, 5 ); /** * Mark at-mention notifications as read when users visit their Mentions page. * * @since 1.5.0 * * @uses bp_notifications_mark_all_notifications_by_type() */ function bp_activity_remove_screen_notifications() { if ( ! bp_is_active( 'notifications' ) ) { return; } // Only mark read if you're looking at your own mentions. if ( ! bp_is_my_profile() ) { return; } bp_notifications_mark_notifications_by_type( bp_loggedin_user_id(), buddypress()->activity->id, 'new_at_mention' ); } add_action( 'bp_activity_screen_mentions', 'bp_activity_remove_screen_notifications' ); /** * Mark at-mention notification as read when user visits the activity with the mention. * * @since 2.0.0 * * @param BP_Activity_Activity $activity Activity object. */ function bp_activity_remove_screen_notifications_single_activity_permalink( $activity ) { if ( ! bp_is_active( 'notifications' ) ) { return; } if ( ! is_user_logged_in() ) { return; } // Mark as read any notifications for the current user related to this activity item. bp_notifications_mark_notifications_by_item_id( bp_loggedin_user_id(), $activity->id, buddypress()->activity->id, 'new_at_mention' ); } add_action( 'bp_activity_screen_single_activity_permalink', 'bp_activity_remove_screen_notifications_single_activity_permalink' ); /** * Delete at-mention notifications when the corresponding activity item is deleted. * * @since 2.0.0 * * @param array $activity_ids_deleted IDs of deleted activity items. */ function bp_activity_at_mention_delete_notification( $activity_ids_deleted = array() ) { // Let's delete all without checking if content contains any mentions // to avoid a query to get the activity. if ( bp_is_active( 'notifications' ) && ! empty( $activity_ids_deleted ) ) { foreach ( $activity_ids_deleted as $activity_id ) { bp_notifications_delete_all_notifications_by_type( $activity_id, buddypress()->activity->id ); } } } add_action( 'bp_activity_deleted_activities', 'bp_activity_at_mention_delete_notification', 10 );December 28, 2015 at 4:00 pm #248156jscmal
ParticipantHere the list of plugins installed in this moment:
advanced-lazy-load
advanced-recent-posts
affiliates-manager
affiliates-manager-simple-membership-integration
akismet
bp-activity-autoloader
bp-activity-comment-notifier
bp-activity-shortcode
buddypress
buddypress-cover-photo
buddypress-first-letter-avatar
buddypress-followers
buddypress-media
buddypress-members-only
buddypress-sticker
cookie-law-info
ewww-image-optimizer
eyes-only-user-access-shortcode
favorites
fb-like-notification-for-buddypress
google-analytics-dashboard-for-wp
hashbuddy
invite-anyone
jetpack
mailchimp-for-wp
options-importer
options-optimizer
redirection
simple-ajax-chat
simple-membership
simple-membership-after-login-redirection
simple-membership-custom-messages
simple-membership-form-shortcode
simple-membership-mailchimp-integration
simple-membership-menu
simple-membership-wp-user-import
stream
testimonials-by-woothemes
user-role-editor
user-switching
woosidebars
wordpress-database-reset
wordpress-importer
wordpress-seo
wp-optimize
wp-postviews
wp-super-cache
wp-sweep
wp-symposium-toolbar
wp-useronline
wp-video-lightboxDecember 26, 2015 at 11:03 pm #248121jscmal
ParticipantAnother detail…
If somebody receive a comment and he follows the notification, the Page opened doesn’t show only the post with the comment, but it shows ALL the posts going back since the latest.
Please I need help. Please..
December 16, 2015 at 3:46 pm #247810In reply to: No notifications for replies
fried_eggz
ParticipantYes @henrywright, the settings are correct.
Steps to repeoduce:
- Install vanilla WordPress 4.4
- Install vanilla BuddyPress 2.4.3
- Use default theme
- Post a status update
- Create a new user
- Log in as new user
- Comment on status
Just to be clear, I’m talking about notifications in WordPress toolbar. Have not checked if email notifications work since I’m on localhost.
December 16, 2015 at 9:12 am #247801In reply to: No notifications for replies
fried_eggz
ParticipantThat is wierd. It says here that this is core functionaliity: buddypress.org/about/notifications/
By default, notifications are created as soon as one of the following things happen:
- Activity
- A member mentions you in an update @usernameβ
- A member replies to an update or comment youβve posted
- …
December 16, 2015 at 3:45 am #247795In reply to: No notifications for replies
mrjarbenne
ParticipantI don’t think there is a core functionality to accomplish this. I’ve been using this plugin to serve up those notifications with good results:
-
AuthorSearch Results
