Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'notification user id'

Viewing 25 results - 351 through 375 (of 1,091 total)
  • Author
    Search Results
  • #251744
    davidkey772
    Participant

    Yes, the issue has been there since day one – and I searched for plugins to add this functionality but couldn’t find one that worked. Then I saw the new BP update with the added BP Email functionality and I realised that a/. this functionality indeed hadn’t been there before and b/. it had now been officially added as a part of BP’s core code.

    The plugin that sends new blog post notifications is:
    =
    Post Notification by Email
    Version 4.1.2 | By Valerio Souza, Claudio Sanches
    =

    Here’s a list of ALL the plugins on the site:
    =
    Advanced Custom Fields Pro
    Version 5.3.2.2 | By elliot condon

    BP Group Activities Notifier
    Version 1.0.1 | By Brajesh Singh(BuddyDev)

    BP Group Hierarchy
    Version 1.4.3 | By David Dean

    BP Groupblog
    Version 1.8.12 | By Rodney Blevins, Marius Ooms, Boone Gorges

    BuddyPress
    Version 2.5.1 | By The BuddyPress Community

    BuddyPress Forum Editor
    Version 1.0 | By Taehan Lee

    BuddyPress Groups Import
    Version 0.1 | By Türker YILDIRIM

    Email Users
    Version 4.8.1 | By Mike Walsh & MarvinLabs

    Gravity Forms
    Version 1.9.17.5 | By rocketgenius

    Gravity Forms + Custom Post Types
    Version 3.1.1 | By David Smith

    Gravity Forms WYSIWYG
    Version 0.2 beta | By Brad Vincent

    Jetpack by WordPress.com
    Version 3.9.4 | By Automattic

    Post Notification by Email
    Version 4.1.2 | By Valerio Souza, Claudio Sanches

    SB Welcome Email Editor
    Version 4.8 | By Sean Barton
    =

    ds123
    Participant

    thanks for the reply its a themeforest theme called vivacity and here are the plugins i have installed:

    Akismet
    Version 3.1.8 | By Automattic | View details

    Audio player
    Version 2.0.4.1 | By Martin Laine | Visit plugin site

    Auto Post Thumbnail
    Version 3.3.4 | By Aditya Mooley , Tarique Sani | View details

    BuddyPress
    Version 2.5.1 | By The BuddyPress Community | View details

    CloudFlare
    Version 1.3.20 | By Ian Pye, Jerome Chen, James Greene, Simon Moore, David Fritsch, John Wineman

    Dashboard Widget Remover
    Version 1.0 | By Zihad Tarafdar | View details

    Disable wp new user notification
    Version 0.100323 | By Corey Salzano | View details

    Google Analytics by Yoast
    Version 5.4.6 | By Team Yoast | View details

    LayerSlider WP
    Deactivate | Edit
    Version 5.6.2 | By Kreatura Media | Visit plugin site

    Log Report Plugin
    Keeps Stop Spammer logs in CSV file
    Version 1.0 | By Keith P. Graham | Visit plugin site

    Mail From
    Version 1.0.1 | By Andrew Hamilton | View details

    Select SI CAPTCHA Anti-Spam
    Version 2.7.7.7 | By Mike Challis | View details

    Stop Spammers Spam Control
    Version 6.15 | By Keith P. Graham | View details

    Vivacity Plugin
    Version 1.2 | By GhostPool

    WP Maintenance Mode
    Version 2.0.3 | By Designmodo | View details

    WP Super Cache
    Version 1.4.8 | By Automattic | View details

    WP Widget Cache
    Version 0.26 | By Andrew Zhang | Visit plugin site

    WPBakery Visual Composer
    Version 4.9 | By Michael M – WPBakery.com | Visit plugin site

    Yoast SEO

    #251481

    In reply to: Display notifications

    neijisly
    Participant

    Ok go in editor theme, click in header.php and try to ad this code just before </nav><!– #site-navigation –>

    <?php if(bp_notifications_get_unread_notification_count( bp_loggedin_user_id() ) > 0 ) { ?>

      <#li>
      <#a href=”<?php echo bp_loggedin_user_domain() ?><?php echo BP_NOTIFICATIONS_SLUG ?>”><span style=”font-weight: bold; background: #37b5e4; padding: 2px 2px 2px 2px;”><?php echo bp_notifications_get_unread_notification_count( bp_loggedin_user_id() );
      ?></span> Notifications<#/a>
      <#/li>
      <?php } ?>
      <#li>
      <#a href=”<?php echo bp_loggedin_user_domain() ?><?php echo BP_MESSAGES_SLUG ?>”><?php if(messages_get_unread_count() > 0 ) { ?><span style=”font-weight: bold; background: #37b5e4; padding: 2px 2px 2px 2px;”><?php echo messages_get_unread_count();
      ?></span><?php } ?> Messages<#/a>
      <#/li>
      <#/ul>
      ( please delete all # symbol in this code )
    #251477

    In reply to: Display notifications

    neijisly
    Participant

    Here is the code

    <?php if(bp_notifications_get_unread_notification_count( bp_loggedin_user_id() ) > 0 ) { ?>
    <~li>
    <~a><?php echo BP_NOTIFICATIONS_SLUG ?>”>
    <?php echo bp_notifications_get_unread_notification_count( bp_loggedin_user_id() );
    ?> Notifications</~a>
    </li~>
    <?php } ?>
    <~li>
    <~a><?php echo BP_MESSAGES_SLUG ?>”><?php if(messages_get_unread_count() > 0 ) { ?>
    <?php echo messages_get_unread_count();
    ?>
    <?php } ?> Messages<~/a>
    <~/li>

    put in your php menu file
    ( delete all ~ in the code )

    pattz2016
    Participant

    i want to be the only one able to view the link as the admin. When users are viewing their notifications in the right side, there are links to WordPress.org on the left side. I don’t think this part is relevant to my users based on the forums they are discussing.

    Any advise Please?

    jemmatates
    Participant

    I’m using <?php bp_get_loggedin_user_nav(); ?>

    but it is only showing the message count inside the members profile, is there any code i can put in the bp-custom file to also show the message count outside of the users profile url?

    The other notification counts for other menu items work sitewide, only messages is missing. Any help would be greatly appreciated!!

    @mcuk
    Participant

    Hi @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' to theme_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 .bubble that is different.

    Hopefully the above helps!

    jemmatates
    Participant

    In the bp-custom.php file I am using this code to hide selected user nav tabs:

    /* hide submenu tabs */
    function bp_remove_nav_tabs() {
    global $bp;
    $bp->bp_nav[‘activity’] = false;
    $bp->bp_nav[‘logout’] = false;
    $bp->bp_nav[‘orders’] = false;
    $bp->bp_nav[‘mediapress’] = false;
    $bp->bp_nav[‘settings’] = false;
    $bp->bp_nav[‘notifications’] = false;
    $bp->bp_nav[‘forums’] = false;

    }
    add_action( ‘bp_init’, ‘bp_remove_nav_tabs’, 999 );

    It is working for all the tabs except :

    logout and the first blank link

    The menu I am using is:

    <?php bp_get_loggedin_user_nav(); ?>

    I know how to get it working editing the :

    buddypress/bp-members/bp-members-template.php

    file in Buddypress but I would rather not edit core files.

    I am not a php coder just a front end css web designer, can anyone help me in fairly easy to understand / non php coder terms a way to fix this without editing the core file?

    Thanks!

    #250297
    alpha2
    Participant

    Hello everyone

    I have a task to do and i don’t know if i can do this out of the box.

    Ok so my client manage a social fitness website, each user send their performance(they can create a new post with a youtube video inside) and my client (as administrator) let a comment on each post.

    He wants to receive an email notification each time a user replied to him in the comment section of the post. Actually if a user doesn’t tag him (with the @name), no notification will be send to my client and this way it’s hard for him to follow each conversation. Is there a way for my client to receive email notification for users replies only if he has written a comment on a post and without the need of the tag (because lots of users forget to include the tag on their answers)?

    Hope you understand my request and sorry for my english 😉

    #250281

    Topic: Widget memberbox

    in group forum Third Party Plugins
    Mathieu M.
    Participant

    Hello,

    I’m a new WordPress French user and I want to use Buddypress for some community projects I’ve in my mind.

    Well, there’s only one important thing I could not resolve at the moment : add a widget exactly like the one we can find in admin bar : Here’s an example

    Instead of the “login widget”, I would really love to see a complete and fully integrated widget with Buddypress member’s notifications, messages, etc…

    Is it possible ? Can you please give me some tips ?

    Thanks a lot ! 😉

    #249391

    In reply to: queries on posting

    Slava Abakumov
    Moderator
    #249233
    Kookidooki
    Participant

    Thank you!

    It works fine, but when a (non-administrator) user is logged in, they cannot log out anymore because the logout button is missing which you can find in the “Howdy… [name][avatar][settings][logout button]” box at the upper right side. Also missing is the name of the user with his avatar, messages / notifications, etc. So this box is missing.

    So what I need is a script that hides the admin bar on the front end when you’re logged out, but is visible when you’re logged in.

    Any idea?

    ThanX!

    jorrit91
    Participant

    Hi there,

    I’ve been looking for way to long to find a piece of code for my problem. Users of my forum can subscribe to a forum so they receive email notifications when a new topic is created. BUT. I’d like the email to contain just an excerpt of the new topic, since I want my users to view the topic on my website.

    I have found this topic, which is almost what I need, but not exactly, and my coding experience isn’t good enough to edit the code provided myself.

    Can anybody help me out?

    Thanks!

    Manuel Schmalstieg
    Participant

    I would love to get some feedback on this, before submitting a ticket to Trac:

    On a BP site I am managing, I am facing the issue of users responding to private messages by email, which results in their responses being sent to the site admin instead of the expected recipient.

    It’s a classic problem:

    See https://buddypress.org/support/topic/private-message-sent-to-admin-e-mail/

    …and https://buddypress.org/support/topic/why-is-site-admin-getting-users-private-messages/

    I was hoping to find a filter, that would allow me to set the Reply-To address to the address of the sender, not the site admin.

    I looked into this function, which is sending the messages: function messages_notification_new_message(...)

    Unfortunately, it uses wp_mail in this way:

    wp_mail( $email_to, $email_subject, $email_content );

    This doesn’t allow us to change the headers (such as: From, Reply to…).

    It looks a bit like an oversight, since there are filters in place for all the other pieces: for $email_to, $email_subject, $email_content.

    So my proposal for BuddyPress Core would be: add a new filter for email headers:

    $email_headers = apply_filters( 'messages_notification_new_message_headers', $headers, $sender_name, $sender_id, $ud );

    and change the wp_mail function accordingly:

    wp_mail( $email_to, $email_subject, $email_content, $email_headers );

    This would allow me to define the Reply-To header, by using a filter such as this:

    add_filter( 'messages_notification_new_message_headers', 'kino_set_notification_headers', 10, 4 );
    
    function kino_set_notification_headers( $headers, $sender_name, $sender_id, $ud ){
      
      $sender_data = get_userdata($sender_id);
      
      $headers = 'Reply-To: '.$sender_name.' <'.$sender_data->user_email.'>' . "\r\n";
      
      return $headers;
    }

    What do you think? Shall I propose this change on Trac?

    #248285
    ibuddybook
    Participant

    Thank 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 );
    Paul-tCGs
    Participant

    Hey folks,

    We at http://www.TheCaregiverSpace.org have been struggling to get our site back to regular operation for about two weeks now.

    – – WordPress instance ~ version 4.4 (latest as of 2015-12)
    – – Theme: Kami ~ version 1.4.2 (latest, and yes problem replicates on WP2013, ~14, & ~15)
    – – Envato WordPress Toolkit ~ Version 1.7.3

    – – bbPress (base) ~ Version 2.5.8 | By The bbPress Community
    – – bbPress – Sort topic replies ~ Version 1.0.3 | By Atif Naveed, Kevin Marshall
    – – bbPress Notifications ~ Version 1.0.1.1 | By dFactory
    – – bbPress WP Tweaks ~ Version 1.3.1 | By veppa

    First thing was that we started getting Fatal Error: memory Usage messages.. ..

    – – Fatal error: Allowed memory size of #### bytes exhausted (tried to allocate ### bytes)
    – – in /home/content/ … /html/wp-includes/wp-db.php on line 1779

    These messages were not focused on one file though: media.php, meta.php, cache.php were also shown as offending spots.

    ——— troubleshooting steps —————

    First thing I found was a number of memory limit suggestions that went back 4+ years on forums like this, and I did call our hosting site GoDaddy and they upped our memory space to the max.

    After those adjustments, no more error messages, only white screen.

    ~~ in the meantime, I’m digging into the google and WP searches to find some clue — at one point I did find a post, that I now can’t seem to find that suggested a limit to the number of groups & users that BuddyPress can manage; something like 20k users.. (seemed really low to me and my colleague at the office)

    Mind you, all along. the front end is pretty much working, but login and forum engagement is gone. As end users, we can see the posts, pages, and list of forums, but each forum brings up a 404 error.

    Next, playing with plugins.. removing all, adding in systematically, in a variety of configurations.. to see if there were conflicts. Also swapping out the Theme while adding/subtracting plugins gave us the same result.

    Bottom line.. as soon as BuddyPress is added, the admin page goes white, while the user-facing site hobbles along.

    Last troubleshooting step: this posting.

    —————-

    We’re pretty much dead in the water in terms of a social interface allowing FORUMS to show, and are ready to move on from BuddyPress. I’m not seeing light at the end of this tunnel.

    Hopefully this message will spark someone’s ingenuity or RECENT memory (vs so-called “RESOLVED” trouble tickets from years gone by) about a similar problem.

    Digitally yours,

    Paul
    paul@thecaregiverspace.org

    #248156
    jscmal
    Participant

    @shanebp

    Here 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-lightbox

    #248123
    jscmal
    Participant

    About the WordPress Debug, the log track always these errors:

    [27-Dec-2015 03:30:31 UTC] PHP Notice:  bp_setup_current_user was called <strong>incorrectly</strong>. The current user is being initialized without using $wp->init(). Please see <a href="https://codex.wordpress.org/Debugging_in_WordPress">Debugging in WordPress</a> for more information. (This message was added in version 1.7.) in /home/xxxxx/wp-includes/functions.php on line 3787
    [27-Dec-2015 03:30:31 UTC] PHP Notice:  The called constructor method for WP_Widget is <strong>deprecated</strong> since version 4.3.0! Use <pre>__construct()</pre> instead. in /home/xxxxx/wp-includes/functions.php on line 3619
    [27-Dec-2015 03:30:31 UTC] PHP Notice:  bp_core_get_notifications_for_user is <strong>deprecated</strong> since version 1.9! Use bp_notifications_get_notifications_for_user() instead. in /home/xxxxx/wp-includes/functions.php on line 3568

    What can I do to manage this situation?

    Please, help me!

    #247776
    Antonio
    Participant

    Hi Henry and r-a-y, I have the same request and I have to thank you for the replies.

    Specifically I would add a notification when a user read a received message, so i guess whene a message (or thread?) is marked as read.

    If I have to use these functions and hook as well, I understand how to use them, the only thing that I don’t know is how to get IDs. For example when I perform bp_after_message_thread_content, in the function that I call, how can I get the id of the thread? Adter I gues I have to get the id of the last message of that thread for change its meta, how can I get that id?

    Please give me some suggestions and let me know if there are better ways for this.
    Sorry for my poor english.

    #247589
    shanebp
    Moderator
    
        if ( bp_notifications_get_unread_notification_count( bp_loggedin_user_id() ) != 0 )
            $notif .= '<li class="notify"><a href=" ' .$notif_url. ' ">Notifications <div class="notifynumber topnavcount">'. bp_notifications_get_unread_notification_count( bp_loggedin_user_id() ).'</div></a></li>';
    
        else
            $notif .= '<li class="notify"><a href=" ' .$notif_url. ' ">Notifications</a></li>'; 
    #247583
    shanebp
    Moderator

    Try:

    function my_counter_nav_menu($menu) {  
    
         $notif_url = bp_core_get_user_domain(bp_loggedin_user_id()) .'notifications/';
         $friends_url = bp_core_get_user_domain(bp_loggedin_user_id()) .'friends/'; 
         $msg_url = bp_core_get_user_domain(bp_loggedin_user_id()) .'messages/';    
          
        if (!is_user_logged_in())
            return $menu;
        
        $notif = '<li class="notify"><a href=" ' .$friends_url. ' ">Connections <div class="friendnumber topnavcount">'.friends_get_friend_count_for_user( bp_loggedin_user_id() ) .'</div></a></li>';
    
        if ( bp_notifications_get_unread_notification_count( bp_loggedin_user_id() ) != 0 )
            $notif .= '<li class="notify"><a href=" ' .$notif_url. ' ">Notifications <div class="notifynumber topnavcount">'. bp_notifications_get_unread_notification_count( bp_loggedin_user_id() ).'</div></a></li>';
    
       if ( bp_get_total_unread_messages_count( bp_loggedin_user_id() ) != 0 )
            $notif .= '<li class="notify"><a href=" ' .$msg_url. ' ">Messages <div class="messagenumber topnavcount">'.bp_get_total_unread_messages_count( bp_loggedin_user_id() ) .'</div></a></li>';
    
        $menu .= $notif;
        return $menu;
    }
    add_filter( 'wp_nav_menu_items', 'my_counter_nav_menu' );
    #247576
    john_pawson
    Participant

    Hi there,

    I’m developing an intranet site for a client – I’m (very) new to the world of PHP, so I’m struggling with getting things customised with the buddypress part of the site. I’m after some pointers for hiding a notifications/new messages count if it’s 0. I’ve managed to get these showing in my user menu using the following code:

    <?php
    // hacks and mods will go here
    
    function my_counter_nav_menu($menu) {  
    
    $notif_url = bp_core_get_user_domain(bp_loggedin_user_id()) .'notifications/';
    $friends_url = bp_core_get_user_domain(bp_loggedin_user_id()) .'friends/'; 
    $msg_url = bp_core_get_user_domain(bp_loggedin_user_id()) .'messages/';    
          
        if (!is_user_logged_in())
            return $menu;
        else
            $notif = '
    
    <li class="notify"><a href=" ' .$friends_url. ' ">Connections <div class="friendnumber topnavcount">'.friends_get_friend_count_for_user( bp_loggedin_user_id() ) .'</div></a></li>
    <li class="notify"><a href=" ' .$notif_url. ' ">Notifications <div class="notifynumber topnavcount">'. bp_notifications_get_unread_notification_count( bp_loggedin_user_id() ).'</div></a></li>
    <li class="notify"><a href=" ' .$msg_url. ' ">Messages <div class="messagenumber topnavcount">'.bp_get_total_unread_messages_count( bp_loggedin_user_id() ) .'</div></a></li>
    
    ';
    				
        $menu = $menu . $notif;
        return $menu;
    }
    add_filter( 'wp_nav_menu_items', 'my_counter_nav_menu' );
    
    ?>

    My first issue was that these new menu items were showing up on both the main nav and the user menu of the site, but I’ve fixed that by applying the classes shown and hiding them using CSS (something I’m much more familiar with!)

    What I need is someone kind to spell out exactly what I need to do to hide the counts for notifications and unread messages above if they’re 0. The friends bit I’m not so worried about as I may either change how that works or drop it entirely (its a corporate client). I’ve already tried a number of javascript options to remove the div if the content is 0… but guess what, I’m as great at javascript as I am at PHP!

    Thanking everyone here in advance – it was only by searching these forums that I was able to get this far, so I appreciate all the effort everyone goes to to help people like me out!

    John

    #247422
    lolotrgeek
    Participant

    I am sending a user a message with the following function:

    		$msg = array(
    			'recipients' => $recipients, 
    			'subject' => $subject, 
    			'content' => $content
    		);
    
    		messages_new_message ($msg);

    I want the email subject that sends to the user when the message is sent to match the subject of the message.

    I’d imagine I could do this with a filter like:

    function messages_notification_new_message_subject($subject, $email_subject) {
    	$email_subject = $subject;
    }
    add_filter( 'messages_notification_new_message', 'messages_notification_new_message_subject', 10, 7 );

    But I have no idea which functions/variables to use to make a filter like this to work. Any suggestions?

    Thanks!

    Henry Wright
    Moderator

    Is there a table in the DB that deals specifically with notifications?

    Yes. That’d be bp_notifications

    If so, I guess I could just empty it before I emptied the stream and stream meta tables.

    Shout up if anyone thinks that could be a problem.

    Instead of deleting directly from the database, you should use these functions:

    • bp_notifications_delete_notifications_by_type()
    • bp_notifications_delete_notifications_by_item_id()
    • bp_notifications_delete_all_notifications_by_type()
    • bp_notifications_delete_notifications_from_user()

    Alternatively, if none of these quite suit your need, go straight for the class method:

    • BP_Notifications_Notification::delete()
    #247095
    Jld142
    Participant

    I have managed to customise the activation emails using the following filters:

    bp_core_signup_send_validation_email_subject
    bp_core_signup_send_validation_email_message

    Are there filters to customise the forgotten password emails ?

    Is there also a way to send emails everytime the user received a notification ? if so, are there any filters to customise ?

Viewing 25 results - 351 through 375 (of 1,091 total)
Skip to toolbar