Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'notification user id'

Viewing 25 results - 301 through 325 (of 638 total)
  • Author
    Search Results
  • #229862
    Brent Havill
    Participant

    Hi Henry

    I went to ‘plugins’/buddypress/settings, and found the following (I note that “account settings” is not ticked – could this be it?)
    I have bolded the ones that are ticked currently.

    Settings:

    Component Description
    Component Description
    Extended Profiles Customize your community with fully editable profile fields that allow your users to describe themselves.
    Account Settings Allow your users to modify their account and notification settings directly from within their profiles.
    Friend Connections Let your users make connections so they can track the activity of others and focus on the people they care about the most.
    Private Messaging Allow your users to talk to each other directly and in private. Not just limited to one-on-one discussions, messages can be sent between any number of members.
    Activity Streams Global, personal, and group activity streams with threaded commenting, direct posting, favoriting, and @mentions, all with full RSS feed and email notification support.
    Notifications Notify members of relevant activity with a toolbar bubble and/or via email, and allow them to customize their notification settings.
    User Groups Groups allow your users to organize themselves into specific public, private or hidden sections with separate activity streams and member listings.
    Site Tracking Record activity for new posts and comments from your site.
    BuddyPress Core It‘s what makes time travel BuddyPress possible!
    Community Members Everything in a BuddyPress community revolves around its members.

    #229209
    Security
    Participant

    Hi i think i know whats happening here i was working on status theme to make it work with the latest versions of both buddypress and wordpress and i faced the similar issue so this is what i did to resolve it goto wp-content>>themes>>yourthemename>>members folder>>single>>home.php and add these lines of code there

    elseif ( bp_is_user_notifications() ) :
    					locate_template( array( 'members/single/notifications.php' ), true );	
    

    just before this kinda statement // If nothing sticks, load a generic template
    next create a file named notifications.php in wp-content>>themes>>yourthemename>>members folder>>single folder and add these lines to it

    <?php
    
    /**
     * BuddyPress - Users Notifications
     *
     * @package BuddyPress
     * @subpackage bp-legacy
     */
    
    ?>
    
    <div class="item-list-tabs no-ajax" id="subnav" role="navigation">
    	<ul>
    		<?php bp_get_options_nav(); ?>
    
    		<li id="forums-order-select" class="last filter">
    			<?php bp_notifications_sort_order_form(); ?>
    		</li>
    	</ul>
    </div>
    
    <?php
    switch ( bp_current_action() ) :
    
    	// Unread
    	case 'unread' :
    		bp_get_template_part( 'members/single/notifications/unread' );
    		break;
    
    	// Read
    	case 'read' :
    		bp_get_template_part( 'members/single/notifications/read' );
    		break;
    
    	// Any other
    	default :
    		bp_get_template_part( 'members/single/plugins' );
    		break;
    endswitch;

    and try to reload your site now your problem should be solved.
    Note: only create notifications.php if its not already there and please backup your site before making these changes

    #228794
    mcpeanut
    Participant

    @sbaglia i really dont have a clue about this but ive just noticed a recent update on a plugin that adds seperate social networking functions to wordpress that i have been watching for a while, now the idea i had a while ago was wondering if this plugin could infact be ran alongside buddypress just for the comment notifications within wordpress, meaning i was wondering if all other notifications and workings of this other plugin could be disabled and used just for this one specific task, this way users would have a seperate notification system for blog and custom post comments, i really dont know as i have not messed around with them together but i know that this plugin does achieve what we want but seperately to buddypress, maybee you want to have a mess with the idea i had? i just dont have time at the minute and dont know if it will work well with buddypress running too, the plugin is here https://wordpress.org/plugins/wp-notifications/

    #228023

    In reply to: Live Notifications

    Paul Bursnall
    Participant

    Hi @henrywright

    Thanks for the quick reply. I’ll put a request in on Trac shortly. At present, I’m probably going to be forced into using my second choice as a theme just to have these feature. From a regular users point of view, I find it unlikely they’ll even bother to acknowledge new email notifications, whereas live web notifications are standard, even expected in other widely used applications, both personal and workplace.

    Thanks for your help.

    Henry Wright
    Moderator

    Try this function:

    function bp_set_notification_default( $user_id ) {
        $keys = array( 'notification_activity_new_mention', 'notification_activity_new_reply', 'notification_friends_friendship_accepted', 'notification_friends_friendship_request', 'notification_groups_admin_promotion', 'notification_groups_group_updated', 'notification_groups_invite', 'notification_groups_membership_request', 'notification_messages_new_message', 'notification_messages_new_notice' );
    
        foreach ( $keys as $key ) {
            update_user_meta( $user_id, $key, 'no' );
        }
    }
    add_action( 'bp_core_signup_user', 'bp_set_notification_default', 100, 1 );

    Ref: http://premium.wpmudev.org/forums/topic/how-can-i-disable-buddypress-notification-email

    Halo Diehard
    Participant

    Yeah, I still will get the odd mention from old posts, have absolutely no idea what triggers them. And now that I’ve changed my display name recently, it will even occasionally send me ones where I’ve included myself in a quote, before the username change! It’s weird.

    The good news is it slows down! ;D The bad news is before it does it can drive your members to turn off their notifications, and if your server can’t handle it the process can crash your server.

    Does that code only stop old notifications, or does it stop all, or what?

    #190941
    aghajoon
    Participant

    this code work for me but java script not work and when user favorite comment user can’t remove notification help me

    define("BP_FAVORITE_NOTIFIER_SLUG","fa_notification");
    
        function bp_favorite_setup_globals() {	
    	global $bp, $current_blog;
        $bp->bp_favorite=new stdClass();
        $bp->bp_favorite->id = 'bp_favorite';
        $bp->bp_favorite->slug = BP_FAVORITE_NOTIFIER_SLUG;
        $bp->bp_favorite->notification_callback = 'bp_favorite_format_notifications';//show the notification   
        $bp->active_components[$bp->bp_favorite->id] = $bp->bp_favorite->id;
    			
                do_action( 'bp_favorite_setup_globals' );
        }
                add_action( 'bp_setup_globals', 'bp_favorite_setup_globals' );
         
    
    function bp_favorite_format_notifications(  $action, $activity_id, $secondary_item_id, $total_items,$format='string'  ) { 
    $action_checker = explode('_', $action);
    $activities = bp_activity_get_specific( array( 'activity_ids' => $activity_id, 'display_comments' => true) );
    	$glue = '';
    	$user_names = array();
    
    	$users = find_favorite_involved_persons($activity_id, $action);
    	$total_user = $count = count($users);
    
    	if($count > 2) {
    		$users = array_slice($users, $count - 2);
    		$count = $count - 2;
    		$glue = ", ";
    	} else if($total_user == 2) {
    		$glue = " and ";
    	}
    
    	foreach((array)$users as $user_id) {
    		$user_names[] = bp_core_get_user_displayname($user_id);
    	}
    
    	if(!empty($user_names)) {
    		$favoriting_users = join($glue, $user_names);
    	}
    
    	switch ( $action ) {
    		case 'new_bp_favorite_'.$activity_id:
    			if($total_user > 2) {
    				$text = $favoriting_users.' and '.$count.' liked: '.substr($activities["activities"][0]->content,0,32).'...';
    			} else {
    				$text = $favoriting_users." like: ".substr($activities["activities"][0]->content,0,32)."...";
    			}
    		break;
    	}
    	$url = '<div id="'.$action.'"class="notification"><a href="#" class="social-delete" onclick="deleteAjaxNotification(\''.$action.'\',\''.$activity_id.'\', \''.admin_url( 'admin-ajax.php' ).'\'); return false;">x</a><span class="social-loader"></span></div>';
    	$link = favorite_activity_get_permalink( $activity_id );
    
    	if($format=='string') {
    		return apply_filters( 'bp_activity_multiple_favorite_notifications', '<a href="' . $link. '">' . $text . '</a>'. $url .'' ,$users, $total_user, $count, $glue, $link );
    	} else {
    		return array(
    			'link' => $link,
    			'text' => $text
    		);
    	}
    	return false;
    
    }
    function find_favorite_involved_persons($activity_id, $action) {
    	global $bp,$wpdb;
    	$table = $wpdb->prefix . 'bp_notifications';
    	return $wpdb->get_col($wpdb->prepare("select DISTINCT(secondary_item_id) from {$table} where item_id=%d and secondary_item_id!=%d and component_action = %s",$activity_id,$bp->loggedin_user->id, $action));
    }
    function favorite_activity_get_permalink( $activity_id, $activity_obj = false ) {
    	global $bp;
    
    	if ( !$activity_obj )
    		$activity_obj = new BP_Activity_Activity( $activity_id );
                        
    		if ( 'activity_comment' == $activity_obj->type )
    			$link = bp_get_activity_directory_permalink(). 'p/' . $activity_obj->item_id . '/';
    		else
    			$link = bp_get_activity_directory_permalink() . 'p/' . $activity_obj->id . '/';
    
    	return apply_filters( 'ac_notifier_activity_get_permalink', $link );
    
    }
    
    function favorite_notifier_remove_notification($activity ,$has_access){
           global $bp;
           if($has_access)		       
    	   bp_core_delete_notifications_for_user_by_type( $bp->loggedin_user->id, $bp->bp_favorite->id, 'new_bp_favorite_'.$activity->id );
    	}
    add_action("bp_activity_screen_single_activity_permalink","favorite_notifier_remove_notification", 10,2);
    
    function favorite_notification( $activity_id){  
                       global $bp;                 
    	               $activities = bp_activity_get_specific( array( 'activity_ids' => $activity_id, 'display_comments' => true) );
    				   $author_id = $activities['activities'][0]->user_id;
                       $user_id =  bp_loggedin_user_id();
    	// if favoriting own activity, dont send notification
    	if( $user_id == $author_id ) {
    		return false;
    	}
    				   if ( bp_is_active( 'notifications' ) ) {
    		bp_notifications_add_notification( array(
    			'user_id'           => $author_id,
    			'item_id'           => $activity_id,
    			'secondary_item_id' => $user_id,
    			'component_name'    => $bp->bp_favorite->id,
    			'component_action'  => 'new_bp_favorite_'.$activity_id,
    			'date_notified'     => bp_core_current_time(),
    			'is_new'            => 1,
    		) );
    	}				
    }
    add_action("bp_activity_add_user_favorite","favorite_notification", 10, 2);
    
    function deleteAjaxNotification(){
        global $bp;        
        bp_core_delete_notifications_by_item_id ($bp->loggedin_user->id, $bp->bp_favorite->id, 'new_bp_favorite_'.$activity->id);     
        die();        
    }	
    add_action('wp_ajax_deleteAjaxNotification', 'deleteAjaxNotification' ); 
    
    function bp_like_add_like_action() {
    global $bp, $activities_template; 
    	 if ( bp_activity_can_favorite() ) : 
    		
    				$my_fav_count = bp_activity_get_meta( bp_get_activity_comment_id(), 'favorite_count' );
    				
    				$my_fav_count = "<span>".$my_fav_count."</span>";
    				
    				$is_favorite = apply_filters( 'bp_get_activity_is_favorite', in_array( bp_get_activity_comment_id(), $activities_template->my_favs ) );
    		
    
    			 if ( !$is_favorite ) : ?>
    
    				<a href="<?php echo apply_filters( 'bp_get_activity_favorite_link', wp_nonce_url( home_url( bp_get_activity_root_slug() . '/favorite/' . bp_get_activity_comment_id() . '/' ), 'mark_favorite' ) ); ?>" class="tooltip-trigger fav bp-secondary-action bp-primary-action" title="<?php _e( 'Favorite', 'buddypress' ); ?>" style="position:relative;"><?php _e( 'Favorite', 'buddypress' ); ?><?php echo $my_fav_count; ?></a>
    
    			<?php else : ?>
    
    				<a href="<?php echo apply_filters( 'bp_get_activity_favorite_link', wp_nonce_url( home_url( bp_get_activity_root_slug() . '/favorite/' . bp_get_activity_comment_id() . '/' ), 'mark_favorite' ) ); ?>" class="tooltip-trigger unfav bp-secondary-action bp-primary-action" title="<?php _e( 'Remove Favorite', 'buddypress' ); ?>" style="position:relative;"><?php _e( 'Remove Favorite', 'buddypress' ); ?><?php echo $my_fav_count; ?></a>
    
    			<?php endif; 
    
    		 endif; 
    }
    add_filter( 'bp_activity_comment_options' , 'bp_like_add_like_action', 1000 );
    
    

    and java code

    function deleteAjaxNotification(action_id, activity_id, adminUrl){
        jQuery('#'+action_id).children(".social-delete").html("");
        jQuery('#'+action_id ).children(".social-loader").show(); 
    
        jQuery.ajax({
            type: 'post',
            url: adminUrl,
            data: { action: "deleteAjaxNotification", action_id:action_id, activity_id:activity_id },
            success:
            function(data) {
            	jQuery('#'+action_id).parent().hide();
            	
            }
         });  
    }
    #189599
    danbp
    Participant

    It is not an issue, it is intended so !

    The logged user’s profile tab comes with 3 sub menus:
    – View (public)
    – Edit (private)
    – Change avatar (private)

    On the main navigation of the member, you have at least
    – Settings with 3 sub nav items:
    – account credential (email, password)
    – notifications
    – field visibility settings

    And if component is activated:
    – Friends
    – Groups
    – Forum

    I agree that this Setting is confusing, at least, because those labels should indicate My Friends, My Groups, My Forums and My profile fields visibility settings, which is too long i grant you. 😉

    FYI: such distinction wern’t really possible untill now in the original english version.
    But the upcomming BP 2.1 brings some better context disambiguation just to improve such situation.

    To solve this today, you can:
    1) create a translation file and modify the wording (but, as said, without disambiguation)
    2) use a child theme and hardcode the text you want into the template file (best approach)
    3) wait a few days for 2.1 to use the first option

    natb19
    Participant

    Anton, I haven’t tried it yet, but could we hook onto the user login and then run the code fancyfiber provided above?

    That way all users will have their notification settings set after they have logged in. (not perfect, but it should work!?)

    #188501
    victord34
    Participant

    @henrywright

    do you have another exemple. to make page notif ?

    I try that, and many other setting… nothing appears.

    
    if ( bp_is_active( 'notifications' ) ) {
        bp_notifications_add_notification( array(
            'all'           => $user_id,
            'pages'          => $item_id,
            'pages/ edit' => $secondary_item_id,
            'component_name'    => $component_name,
            'component_action'  => $component_action,
            'date_notified'     => bp_core_current_time(),
            'is_new'            => 1,
        ) );
    }
    

    thank you

    #188354
    Henry Wright
    Moderator

    bp_notifications_add_notification() is used to add a notification. For example:

    if ( bp_is_active( 'notifications' ) ) {
        bp_notifications_add_notification( array(
            'user_id'           => $user_id,
            'item_id'           => $item_id,
            'secondary_item_id' => $secondary_item_id,
            'component_name'    => $component_name,
            'component_action'  => $component_action,
            'date_notified'     => bp_core_current_time(),
            'is_new'            => 1,
        ) );
    }

    See here for more info: https://codex.buddypress.org/developer/function-examples/bp_notifications_add_notification/

    #187080

    In reply to: Forwarding Messages

    danbp
    Participant

    Hi @akovia,

    each logged in user has access to his profile settings. Eg. on the top right user menu (howdy…)
    or on the buddybar under the profile header.

    /membres/xxxx/settings/notifications/

    Settings > Email
    Once on this setting page, each user can decide for what he want to receive an alert.

    But it is an emailed notice he will receive, not the complete message.

    This messaging system is intended to work internally. This means the content of the message stays on the site. BP eventually sends only a reference to the content. Eg. xxx send you a private message (site url), not the full message.

    Screenshot:
    BuddyPress 2.x notification settings

    Findolfin
    Participant

    Hi

    Thanks, for your fast respond! Unfortunately it doesn’t work. But I could fix it by myself with trying.
    With poEdit the words were translatet but when I opened the file with CodeStyling Localization and searched for the “</span>” – tag I found message, notification, friends and groups twice:

    Once translatet to German and once not. I translatet all to German who were not translatet and it worked. I have no idea why this was that way but now I’m happy.
    I sent the file also to deckerweb and a topic in German WordPress so the other user with this issue can use the file.

    Maybe you have an idea what that could be?

    #183977
    Chris Perryman
    Participant

    Just wanted to follow up…we did come up with a solution for this in case any one else is looking for it.

    Full details are now on my blog at Revelation Concept.

    function rc_buddypress_profile_update( $user_id ) { 
     
         $admin_email = "YOUR-EMAIL@DOMAIN.COM";
         $message = sprintf( __( 'Member: %1$s', 'buddypress' ), bp_core_get_user_displayname( $user_id ) ) . "\r\n\r\n"; 
         $message .= sprintf( __( 'Color: %s' ), bp_get_profile_field_data('field=Color') ). "\r\n\r\n";
         wp_mail( $admin_email, sprintf( __( '[YOUR SITE] Member Profile Update' ), get_option('blogname') ), $message );
     }
     
     add_action( 'xprofile_updated_profile', 'rc_buddypress_profile_update', 10, 5 );
    #183850
    godavid33
    Participant

    Ok, well I had to figure this one out. It’s a bit of a lengthy solution. I’m not going to explain everything, as I can’t for either lack of knowledge or fear of being incorrect. I’ll just give you the code, tell you what it does, and where it goes.

    First, lets add the favorite button to the comments template. Find comment.php (in /activity) and add the code:

    
    		<?php global $activities_template; ?>
    		<?php if ( bp_activity_can_favorite() ) : ?>
    			<?php
    				$my_fav_count = bp_activity_get_meta( bp_get_activity_comment_id(), 'favorite_count' );
    				
    				$my_fav_count = "<span>".$my_fav_count."</span>";
    				
    				$is_favorite = apply_filters( 'bp_get_activity_is_favorite', in_array( bp_get_activity_comment_id(), $activities_template->my_favs ) );
    			?>
    
    			<?php if ( !$is_favorite ) : ?>
    
    				<a href="<?php echo apply_filters( 'bp_get_activity_favorite_link', wp_nonce_url( home_url( bp_get_activity_root_slug() . '/favorite/' . bp_get_activity_comment_id() . '/' ), 'mark_favorite' ) ); ?>" class="tooltip-trigger fav bp-secondary-action bp-primary-action" title="<?php echo god_get_favorited_usernames(bp_get_activity_comment_id()); ?>" style="position:relative;"><?php _e( 'Like', 'buddypress' ); ?><?php echo $my_fav_count; ?></a>
    
    			<?php else : ?>
    
    				<a href="<?php echo apply_filters( 'bp_get_activity_favorite_link', wp_nonce_url( home_url( bp_get_activity_root_slug() . '/favorite/' . bp_get_activity_comment_id() . '/' ), 'mark_favorite' ) ); ?>" class="tooltip-trigger unfav bp-secondary-action bp-primary-action" title="<?php echo god_get_favorited_usernames(bp_get_activity_comment_id()); ?>" style="position:relative;"><?php _e( 'Unlike', 'buddypress' ); ?><?php echo $my_fav_count; ?></a>
    
    			<?php endif; ?>
    
    		<?php endif; ?>	
    

    This code simply adds the buttons, and gets all the necessary info and variables.

    Then, you’re going to need to modify the buddypress javascript. I personally modified both global.js and buddypress.js (through overriding in my template, which is a topic for a whole other thread), though I might be wrong in this. At any rate, look for the line (around 264 in buddypress.js):

    
    var parent = target.closest('.activity-item');
    

    and change it to

    
    var parent = target.closest('li');
    

    The reason we changed this line is so that our custom favorite button doesn’t default to grabbing the top level activity id. Now you can actually favorite comments!

    But wouldn’t it be nice if the user received a notification when someone favorited their activity? Add this bad boy to functions.php

    
    
    add_action("bp_activity_add_user_favorite","favorite_notification", 10, 2);
    
    function favorite_notification( $activity_id, $user_id = 0){
    	// By type and item_id
    	if($user_id != $activities["activities"][0]->user_id){
    		$activities = bp_activity_get_specific( array( 'activity_ids' => $activity_id, 'display_comments' => true) );
    		
    		bp_core_add_notification( $activity_id, $activities["activities"][0]->user_id, "notifier", bp_core_get_username(bp_loggedin_user_id())." liked: '".substr($activities["activities"][0]->content,0,20)."...'", $activity_id ) ;		
    	}
    }
    

    Hope this helped someone. It mostly works for me.

    #183649
    godavid33
    Participant

    I know this is a very old thread, but here’s some useful code for solving this problem (put it in functions.php) in case someone else stumbles upon it

    
    add_action("bp_activity_add_user_favorite","favorite_notification", 10, 2);
    
    function favorite_notification( $activity_id, $user_id = 0){
    
    	$activities = bp_activity_get_specific( array( 'activity_ids' => $activity_id) );
    
    	bp_core_add_notification( $activity_id, $activities["activities"][0]->user_id, "notifier", "<a href='".get_site_url()."/activity/p/$activity_id'>New Like!</a>" ) ;
    }
    
    Henry Wright
    Moderator

    Hi @godavid33

    I’m 99% sure you can. I do believe it’s store in secondary_item_id.

    I think you can access it by doing something like this:

    $notifications = BP_Notifications_Notification::get( array(
        'id' => $notification_id,
        'user_id' => $user_id
    ) );
    
    // I assume there will only be one result but i'll do a loop anyway
    if ( $notifications ) {
        foreach( $notifications as $notification ) {
            // this should output the friendship ID
            echo $notification->secondary_item_id;
        }
    }
    godavid33
    Participant

    I swear, probably 80% of my posts result in me solving my own damn problem.

    Inside your notification loop, if you can not see the item_id when using print_r on the notification object (returned by bp_core_get_notifications_for_user($uid, ‘object’) ) then call this function on the notification ID: bp_notifications_get_notification( $notif->id )

    The object this returns contains the item_id (print_r it to see what’s up).

    Hope this helps someone

    #181844
    MLDIA
    Participant

    Hi agin Thank u & sorry for my late response.

    @henrywright
    & @bphelp this is the feuters that I want:
    1- Users can upload their resume.
    2- Users can find jobs, people and business opportunities recommended by other users.
    3- Employers can list jobs and search for potential candidates.
    4- Job seekers can review the profile of hiring managers and discover which of their existing contacts can introduce them.
    5- Users can post their own photos and view photos of others to aid in identification.
    6- Users can follow different companies and can receive notifications about the new joining and offers available.
    7- Users can save (bookmark) jobs that they would like to apply for.
    8- Users can “like” and “congratulate” each other’s updates and new employments.
    9- Users can see who has visited their profile page.
    10- Questions & Answers
    11- Advertisments (for admin a.k.a me)
    12- Job listings
    13- “Apply with” button
    14- “Saved Jobs” button
    15- Users can endorse each other’s skills.
    16- Influencers (like the one in the linkedIn)
    thx u all

    #181577
    jessicana
    Participant

    Well, I did that and I have buddypress default registration page. The default registration page has the name as a required field and it can be seen by everyone, I am having problem with buddypress default registration page for many reasons:
    1) If you visit the default buddypress registration page, and leave all the fields blanks and hit complete sign up, you will only receive three red notifications for required accounts details as follows:
    a. Please enter a username
    b. Please check your email address.
    c. Please make sure you enter your password twice
    Although the name is a required field, but you don’t receive similar message for a required field, and if the user don’t fill the name, the page refreshes without asking the user to fill the name.

    2) Having the name as a required feild, will discourage users registration and I am not sure how to make it optional at the registration stage.

    Thank you

    #181030
    godavid33
    Participant

    Awesome, a post that isn’t years old that I may actually be able to help!

    In functions.php add the following function:

    
    function cg_current_user_notification_count() {
        $notifications = bp_core_get_notifications_for_user(bp_loggedin_user_id(), 'object');
        $count = !empty($notifications) ? count($notifications) : 0;
    
        return $count;
    }
    

    In frontend-noajax.inc.php (you can find this in plugins/bp-direct-menus/inc) add the following code around line 150 (near where all the counts are initialized):

    
    $notifcount = cg_current_user_notification_count();
    $item->title = str_ireplace("%notificationcount%", $notifcount, $item->title);
    $item->title = str_ireplace("%(notificationcount)%", ($notifcount > 0) ? '('.$notifcount.')' : '', $item->title);
    

    Hope that helps you, or if you already figured it out, helps somebody else.

    Cheers,
    Gabe

    #180665
    sundev
    Participant

    @modemlooper

    // I got it working by putting these lines of your code on my existing function

    if ( bp_is_user() && bp_user_has_access() ) {
    $count = bp_notifications_get_unread_notification_count( bp_displayed_user_id() );
    $class = ( 0 === $count ) ? ‘no-count’ : ‘count’;
    $bp->bp_nav[‘notifications’][‘name’] = sprintf( __( ‘Alerts <span class=”%s”>%s</span>’, ‘buddypress’ ), esc_attr( $class ), number_format_i18n( $count ) );
    }

    I really appreciate your gesture. Thank you very much.

    #180630
    modemlooper
    Moderator

    BP 1.9+

    function custom_notification_menu_tabs(){
    	global $bp;
    	if ( bp_is_user() && bp_user_has_access() ) {
    		$count    = bp_notifications_get_unread_notification_count( bp_displayed_user_id() );
    		$class    = ( 0 === $count ) ? 'no-count' : 'count';
    		$bp->bp_nav['notifications']['name'] = sprintf( __( 'Alerts <span class="%s">%s</span>', 'buddypress' ), esc_attr( $class ), number_format_i18n( $count ) );
    	} 
    
    }
    add_action('bp_setup_nav', 'custom_notification_menu_tabs', 201);
    #179842
    colabsadmin
    Participant

    Looks like 3 of them are from the same topic (15959). Go into the db and do a search on the activity table for secondary_item_id = 15959. That will give you a link to the topic. Go to it and 1: see if it exists still (probably does) and 2: see if there is something weird about it.

    OH. Is bbpress up to date? Maybe there is a bbpress plugin causing issues?

    I just tested this on my site. I created a topic as one user. I logged in as another and replied to the top. Notification was sent… no problem. I logged in as administrator and deleted the topic completely. The notification title still showed up, so I doubt deletions are your issue.

    Sorry that I’m grabbing at straws. It would help if I was having this problem (glad I’m not) 🙂

    #179656
    Henry Wright
    Moderator

    That sounds like a better approach than mine. I just have a rather crude looking button which marks as read all unread notifications.

    bp_notifications_mark_notifications_by_type is the function I’m using to do the marking. For example:

    if ( bp_is_active( 'notifications' ) ) {
        bp_notifications_mark_notifications_by_type( bp_loggedin_user_id(), buddypress()->messages->id, 'new_message' );
        bp_notifications_mark_notifications_by_type( bp_loggedin_user_id(), buddypress()->activity->id, 'new_at_mention' );
    }
Viewing 25 results - 301 through 325 (of 638 total)
Skip to toolbar