Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'notification user id'

Viewing 25 results - 451 through 475 (of 1,091 total)
  • Author
    Search Results
  • mcpeanut
    Participant

    I have been customizing the way my notifications are shown and have split them out from the main notifications bubble, so far i have managed to do this via these hooks/filters

    bp_friend_get_total_requests_count
    bp_notifications_get_unread_notification_count
    messages_get_unread_count

    Now i don’t know the ones that relate specifically to the comment notifications a user receives when someone replies or comments on their status update etc, any ideas?

    5high
    Participant

    Back again, after just completing the above edits and BINGO! it works! But only because i followed your very clear step-by-step instructions above. Thank you @danbp and @hnla for your help and support – Only possible by the ‘paint by numbers’ approach for me at present!

    I presume that if i want to ‘hide a couple of other things in a user’s profile section I could do it the same way (just don’t know where of course!)? Both are in a user’s profile > Settings; one is the ‘Profile Visibilty’ tab and the other is the bottom section of the ‘Email’ notifications tab, which shows the Groups email notifications options (as I’ve set them all to default as off for new users, via my functions.php).

    But I’m happy to start a new thread for this as it might be better for others to follow?

    Cheers.

    5high
    Participant

    Hi,

    I’ve found some info about turning off email notifications by default for new users (here: https://buddypress.org/support/topic/how-to-disable-email-notification-to-all-newly-registered-users/) and would like to check 4 things.

    The 2 code options referenced there are these, added to the child theme functions.php:
    1.

    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 );

    2.

    add_action('bp_core_signup_user','bp_set_notification_default',100,1);
      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');
        }
    }

    So my questions are:

    1. which code should be used?
    2. Is this code still OK since the recent BP updates?
    3. Does it turn off email notifications to admin for new user signups too?
    4. If so, how can I keep just that functionality on?

    Many thanks.

    #236699

    In reply to: Double entries

    bluedawg
    Participant

    Interestingly when I set up users myself abd registered them I only get one email notification that a new user has registered. but when others register I get a double notification. See attached screengrab. Could they be spammers?
    Screen Grab

    Also on the activity page there is a double entry of their join date with one being squished off to the right side… also see attached screen grab:
    Activity

    #236652
    danbp
    Participant

    Post comments are outside of the user notification. @mention scope is handling site and user activities. A post is also an activity, but @mention in it is not an activity. It’s just a link to a profile in a post.

    When you go to message settings on your profile, you can see the whole items covered by mention and email notification. Blog post are not included.

    #236646
    briggsy326
    Participant

    @xander206 Thanks for the response. 🙂

    I had a quick look at the link your provided and I’m not really sure it’s quite what I am looking for.

    At present there is already a ‘notifications’ area on the profile page (and on the ‘admin’ bar at the top of the page) and notifications for @ mentions on the profile itself are working and also notifications for friend requests are working too.

    The only thing that isn’t working is notifications for @ mentions on comments on posts. Whenever someone replies to a comment on a post and starts it with @ username it is being linked to their profile but it is not sending a notification to that person that they have been mentioned.

    Cheers

    briggsy326
    Participant

    I have just recently installed BuddyPress on my own website after seeing it being used on another site and I very much like it. One thing that I am not 100% sure of is how the ‘notifications’ work – they seem to be working fine apart from there being no notifications when someone mentions a user in a comment on a post…

    … I’m not sure if it is meant to be that way or not, but I do know that the other site I saw BuddyPress on did have notifications whenever a user was mentioned in a comment on a post (so I know it’s possible).

    Am I missing something really obvious, or is BuddyPress designed to not give notifications for mentions in comments on a post (even though the ‘mention’ itself does link to the users profile).

    Any help much appreciated.

    Wordpress version 4.1.1
    BuddyPress version 2.2.1

    #236475
    5high
    Participant

    Hi @mrjarbenne,

    Thanks so much for helping – I’ve only just found your reply (don’t know what happened to the email notification this time). Anyway, I’ve added it into my bp-custom.php as suggested and Bingo! it works brilliantly. just tried a new test member and I’m instant joined to all 3 of my groups!

    Thanks so much for this. Just for clarity for others this is the code i used as per @modemlooper info above:

    function automatic_group_membership( $user_id ) {
       if( !$user_id ) return false;
     
       groups_accept_invite( $user_id, $group_id );
    }
    add_action( 'bp_core_activated_user', 'automatic_group_membership' );

    I have left the spacing exactly as he’d done, just in case… but maybe I could get rid of some of the extra spaces in it?

    Cheers 🙂

    aljo1985
    Participant

    This outputs “test left the group Group logo of Test GroupTest Group 16 seconds ago”
    Into your activity feed. Useful if you want to track who has currently left your group. As there is no way of knowing if your groups get large. It also inserts in show with disbanded groups to view all members who have disbanded.
    Just insert this code into your themes functions.php file and you are good to go.
    Preview Left Group Preview

    //////////////////////////////////////////
    ////////// LEFT GROUP ////////////////////
    //////////////////////////////////////////
    add_action( 'groups_leave_group', 'groups_left_group', 10, 2 );
    function groups_left_group( $group_id, $user_id = 0 ) {
    	global $bp;
    
    	if ( empty( $user_id ) )
    		$user_id = bp_loggedin_user_id();
    
    	// Record this in activity streams
    	groups_record_activity( array(
    		'type'    => 'left_group',
    		'item_id' => $group_id,
    		'user_id' => $user_id,
    	) );
    
    	// Modify group meta
    	groups_update_groupmeta( $group_id, 'last_activity', bp_core_current_time() );
    
    	return true;
    }
    function groups_register_left_actions() {
    	$bp = buddypress();
    
    	if ( ! bp_is_active( 'activity' ) ) {
    		return false;
    	}
    
    	bp_activity_set_action(
    		$bp->groups->id,
    		'left_group',
    		__( 'Left group', 'buddypress' ),
    		'bp_groups_format_activity_action_left_group',
    		__( 'Group Disbands', 'buddypress' ),
    		array( 'activity', 'group', 'member', 'member_groups' )
    	);
    
    	do_action( 'groups_register_activity_actions' );
    }
    add_action( 'bp_register_activity_actions', 'groups_register_left_actions' );
    function bp_groups_format_activity_action_left_group( $action, $activity ) {
    	$user_link = bp_core_get_userlink( $activity->user_id );
    
    	$group = groups_get_group( array(
    		'group_id'        => $activity->item_id,
    		'populate_extras' => false,
    	) );
    	$group_link = '<a href="' . esc_url( bp_get_group_permalink( $group ) ) . '">' . esc_html( $group->name ) . '</a>';
    
    	$action = sprintf( __( '%1$s left the group %2$s', 'buddypress' ), $user_link, $group_link );
    
    	return apply_filters( 'bp_groups_format_activity_action_joined_group', $action, $activity );
    }

    I do have a question for the developers here, how do you make this so that the join/left activity log cannot be deleted by the user who joined/left? I want it so that if a person joins/leaves, then they can’t delete their join/left activity from the log.

    I could probably use
    groups_is_user_member( $user_id, $group_id )
    For when the member leaves a group but what about posting that they joined a group? I would prefer if admins/mods of the group could only delete those.

    Enjoy, and hope someone can answer this question also.

    aljo1985
    Participant

    Okay so I realised that it would only send the activity to stream when you have the email option checked. I also noticed that upon doing that you post 2 pieces of information into the database that are exactly the same.. Well they are not structured the same but the information holds the same data.

    This is inside bp_groups_groupmeta and bp_activity
    So I have optimized my code to remove duplicate data, well just removed it from posting into groupsmeta really, as it doesn’t need to be in there… Maybe you can optimize your code to post the action in activity only and read from there, rather than have it posted in both. The system is great, don’t get me wrong I am just making suggestions.

    So I have removed one of your functions on remove action and copied it into my own function with edits to that function. I have added 2 extra fields, drop down boxs to be exact.

    Here is my code with a lot of comments as I was trying out many different things, then decided I don’t want it to do that lol. EDIT

    <?php
    // Add custom group fields.
    // Removed the default add activity stream. file /public_html/wp-content/plugins/buddypress/bp-groups/bp-groups-activity.php for reference.
    remove_action( 'groups_details_updated', 'bp_groups_group_details_updated_add_activity' );
    // On group update.
    add_action( 'groups_details_updated', 'group_details_update', 10, 3 );
    // Updated group details.
    // Updated group details.
    function group_details_update( $group_id, $old_group, $notify_members ) {
    	global $bp, $wpdb;
    	// Custom fields.
    	$plain_fields = array(
    		'server',
    		'country'
    		//'activity'
    	);
    	foreach( $plain_fields as $field ) {
    		$key = 'group-' . $field;
    		$metakey = 'h1z1_' . $field;
    		if ( isset( $_POST[$key] ) ) {
    			$value = $_POST[$key];
    			
    			// Do they want the update notification posted on their activity stream?
    			/*if ($value == '1')
    				$post_activity = true;
    			*/
    			//Make sure they selected an item from the required dropdown boxs.
    			if ($value == 'null')
    				return bp_core_add_message( __( 'There was an error updating group details. Please try again.', 'buddypress' ), 'error' );
    			else {
    				// changed1 is empty by default, not declared. If empty, get groupmeta.
    				if (empty($changed))
    					$changed = groups_get_groupmeta( $group_id, $metakey );
    				//if groupmeta(old value) == posted value changed is empty again, so we can check the next custom field to see if that also has the same old value.
    				if ($changed == $value)
    					$changed = '';
    				else
    					groups_update_groupmeta( $group_id, $metakey, $value );
    			}
     		}
    	}
    	// Optional removed checkbox for now.. Might use later
    	/*if ($post_activity == false)
    		return false;
    	*/
    	// Taken from /public_html/wp-content/plugins/buddypress/bp-groups/bp-groups-activity.php
    	// We removed the email notification check so that it will post an activity stream regardless.
    	// Bail if Activity is not active.
    	if ( ! bp_is_active( 'activity' ) )
    		return false;
    
    	if ( ! isset( $old_group->name ) || ! isset( $old_group->description ) )
    		return false;
    
    	// If the admin has opted not to notify members, don't post an activity item either
    	// Removed, I want updated posted if it sends and email or not.
    	/*if ( empty( $notify_members ) ) {
    		return;
    	}*/
    
    	$group = groups_get_group( array(
    		'group_id' => $group_id,
    	) );
    
    	/*
    	 * Store the changed data, which will be used to generate the activity
    	 * action. Since we haven't yet created the activity item, we store the
    	 * old group data in groupmeta, keyed by the timestamp that we'll put
    	 * on the activity item.
    	 */
    	
    	if ( $group->name !== $old_group->name || $group->description !== $old_group->description )
    		$changed = 'changed';
    
    	// If there are no changes, don't post an activity item.
    	if ( empty( $changed ) )
    		return;
    
    	$time = bp_core_current_time();
    	// Don't want a long description of what has been changed inside the details. Also reduces information posted in groupmeta table.
    	//groups_update_groupmeta( $group_id, 'updated_details_' . $time, $changed );
    	
    	// And finally, update groups last activity.. Currently doesn't in standard.
    	groups_update_groupmeta( $group_id, 'last_activity', $time );
    	
    	// Since we have removed the information from meta, we will record it directly into action on activity..
    	// You do not need the same information recorded twice in the database. This needs optimizing. Hence removing update groupmeta..
    	/*
    	$user_link = bp_core_get_userlink( bp_loggedin_user_id() );
    	$group_link = '<a href="' . esc_url( bp_get_group_permalink( $group ) ) . '">' . esc_html( $group->name ) . '</a>';
    	$action = sprintf( __( '%1$s changed the description of the group %2$s from "%3$s" to "%4$s"', 'buddypress' ), $user_link, $group_link, esc_html( $changed['description']['old'] ), esc_html( $changed['description']['new'] ) );
    	*/
    	// Record in activity streams.
    	return groups_record_activity( array(
    		'type'          => 'group_details_updated',
    		'item_id'       => $group_id,
    		'user_id'       => bp_loggedin_user_id(),
    		'recorded_time' => $time,
    	) );
    }

    If there is bugs in any code, I will find them and fix them.. That’s one of the downsides to being a perfectionist..

    I have not fixed the

    A few bugs I have found.

    From the first post yet, but will be doing after I have had my dinner 🙂
    My idea is to have a notification saying that the user has left the group when they leave/kicked/banned/ obviously if its after the 5 minutes mark lol.

    #235779
    dbarrell
    Participant

    Hi,

    Is there any way to set BP to create notifications when there is any activity within a group that the current user is a member of? It seems like a function that should be present by default, which is why I ask, though I can’t find it…

    Thanks,
    David

    #235634
    mariatrier
    Participant

    Hi guys,
    I’m thinking of using the KLEO theme (based on BuddyPress), but I am in need of the below features, perhaps you know if these are default BuddyPress or can be found in a plugin:

    1. From profile: Is it possible to send to two or more friends as once e.g. a group message?
    2. From profile: Is it possible to tag friends on status updates and thus the notification show up on friends profile e.g “going out with Maria and Patricia this weekend” where notification will show on Maria and Patricias profiles – like @ tagging on Facebook?
    3. From profile: Is it possible to report a user to the admins if they are insulting – like on Facebook?
    4. From profile: Is it possible for users to check-in (Patricia @Hard Rock Cafe) based on geo and show it on their profile – just like on Facebook?

    Thanks for your ideas!

    #235412
    Henry Wright
    Moderator

    Hi @sofijagb

    That particular email’s message isn’t filterable but the function which sends the email is pluggable, which means you can write your own function. For more info on pluggable function in WordPress, check out:

    https://codex.wordpress.org/Pluggable_Functions

    The function you’ll need to override is wp_new_user_notification()

    Hope this info helps!

    #235369
    car1979
    Participant

    Hi everyone!

    I have a custom field in the registration page asking the new user to give us his/her ideas of what’s on their mind about a personal project so we can help him/her make it possible.

    The thing is that I need that custom field to be part of the notification email that the admins recieves whenever somone registers.

    I tried to follow the instructions given here:
    https://buddypress.org/support/topic/using-xprofile-fields-in-notification-mail/

    But I’m not sure whre to put this code. In the functions.php? Is that code right?

    Thaks ahead!

    vitamincee
    Participant

    We just noticed on our Buddypress site that when an Admin user clicks on another user’s profile, and then to the Notifications tab, they can then read the private messages of other users.

    The URL changes from /members/the-user-account/notifications/read/ to /members/the-admin-account/messages/view/message#, and shows the admin’s profile, but feeds the user’s message.

    I’m wondering if this is a known bug? I searched the forum but did not find anything about this.

    Thanks!

    #234652
    alexterchum
    Participant

    I have installed BP notify post author on blog comment (http://buddydev.com/plugins/bp-notify-post-author-blog-comment/), it works but those notifications won’t be cleared unless I clicked the read button. Is that possible to solve this problem?

    Besides, if users commenting on other author’s blog posts, they won’t be notified when the author reply their comment. I would like to know if there is any codes to make blog comment reply notifications available.

    #234608
    tammywashington
    Participant

    Sorry about the lack of information. See the updated information:

    We are currently hosting on Amazon’s cloud running Amazon Web Services. Our PhP version is 5.4.31. Using the latest version of the Sweet Date theme. We have four major plugins installed. BuddyPress 2.2.0., bbPress 2.5.4, s2Member Framework Version 150203 + s2Member Pro v150203 and Event Espresso 4.6.6.p. The other plugin do not control permissions,groups our user classifications.

    We are not sure exactly when this problem occurred because we were not using the friend request feature. However we did test this successfully in the past but are not sure of the plugin versions.

    The changes we recently made were the following:
    We had Buddy Press, s2Member and Event Espresso installed with the latest versions. We then installed latest version of bbPress. We created users groups and assigned the appropriate permission of user to subscribe and receive invites to join the group. We learned that members can not join a group unless they are friends with an individual already in a particular group.

    When we send a friend request to a user that person receives the request. They are able to see the notification in their profile under Friends-Pending Request. At this point everything looks good. The user can see the requester image and can the ability to clink Accept Button or Reject Button. When either of the buttons are clicked nothing happens. We waited for exactly 2 minutes and just refreshed the page. We get the same actions if the Reject Button is selected also. Any advice or help is greatly appreciated.

    #234453
    jessiewordpress
    Participant

    I had two users in the backend sitting under “users > manage signups” and I didn’t even know they were there. I didn’t receive a notification.

    Were they “pending” because they didn’t click the activation email link?

    #234402
    spongo
    Participant

    Hey guys !

    I am searching since one week for a solution of my problem.

    My idea is to create 2 icons in my topbar (no bp-admin-bar, i have an own seperate topbar). I have already create a counter for notification and friends and have a dropdown function.

    In the friends dropdown i have input the code from friends-request.php and if you click on the icon there is an dropdown which shows the reqeuest. The problem is that it only shows the reqeust inside the dropdown if you are on a profilpage.

    If you hit the notification icon there should be only show new notifications and no friend requests.
    At the moment it shows everything.

    For the counter i use this function:

    <?php
    function bpfr_add_notification_to_page_title(   ) {
    	
    	//do not change if the user is not logged in
    	if( ! is_user_logged_in() )
    		
    	
    	$user_id = get_current_user_id();//logged in user's id
    	
    	$count = bp_notifications_get_unread_notification_count( $user_id );
    	
    	if( $count > 0 )
    		$title = sprintf( "You Have %d New Notification(s) - ", $count );
    		$anzahlNeuigkeiten = $count;
    		
    		echo '<a class="news" data-dropdown="news" aria-controls="autoCloseExample" aria-expanded="false"> <i class="fi-megaphone" ></i></a><span class="update" >'.$anzahlNeuigkeiten.'</span>';
    		echo '<a style="margin-left:10px;" class="frequest" data-dropdown="friendrequest" aria-controls="autoCloseExample" aria-expanded="false"><i class="fi-torsos"></i></a><span class="update">';
    		echo bp_friend_get_total_requests_count( bp_loggedin_user_id() ) ;
    		echo '</span>';
    		
    	
    	
    	
    }
    ?>

    I found already a thread which trys to explain how to fix it ”
    How to split out BuddyPress notifications drop down items to their own top level” but there is no content for the dropdown.

    So my question is . How can I show the requests of friends in the dropdown on every page? And how can filter notifications? It should be like on Facebook, if you hit the friends icon then it shows requests. If you hit the notification icon than it shows news.

    Thannk you guys for your help !

    Best Regards !

    Peter

    #234231
    Paul Bursnall
    Participant

    The latest WordPress release doesn’t display the WP Toolbar for Subscriber level users. Not only does this prevent access to the account menu via the Toolbar, it more importantly means that Notifications remain at zero, even on the user profile page.

    Upgrading the account to Contributor or above will reinstate the Toolbar and bring Notifications back to life.

    This problem isn’t theme specific or a plugin conflict. bbPress is affected in the same way.

    Any thoughts on this? WP is breaking a key component of two it’s most widely used plugins.

    #233516
    fanmusic
    Participant

    Hi,

    Actually no, thats not it, there is no option for that in buddypress, I need to hide the buttons notifications and settings (that are along with profile, messages groupes etc.)
    it’s in the front office.

    thanks a lot

    PS : someone posted this, I think it’s on the right track but it doesn’t work :/
    [ edited – please use ‘code’ button when posting code ]
    Try this in bp-custom.php

    function fanmusic_remove_profile_nav_remove( $nav ) { 
            
         $nav = '';
                    
         return $nav;
    }
    add_filter('bp_get_displayed_user_nav_notifications', 'fanmusic_remove_profile_nav_remove', 10, 1 );
    add_filter('bp_get_displayed_user_nav_settings', 'fanmusic_remove_profile_nav_remove', 10, 1 );
    #233408

    In reply to: Notification

    Brajesh Singh
    Participant

    Hi Christian,
    There is one functionality in BuddyPress that allows it. You can see the feature as site wide notice(Mark a message as notice).

    The problem is currently, only a user with the capability ‘bp_moderate’ can send the notice. Do you want to allow this notification feature for all users or just selected few?

    #233356
    Brajesh Singh
    Participant

    Hi Chaitanya,
    Try this code.

    
    
    function bpfr_add_notification_to_page_title( $title, $original_title, $sep  ) {
    	
    	//do not change if the user is not logged in
    	if( ! is_user_logged_in() )
    		return $title;
    	
    	$user_id = get_current_user_id();//logged in user's id
    	
    	$count = bp_notifications_get_unread_notification_count( $user_id );
    	
    	if( $count > 0 )
    		$title = sprintf( "You Have %d New Notification(s) - ", $count );
    	
    	return $title;
    	
    	
    }
    add_filter( 'wp_title', 'bpfr_add_notification_to_page_title', 100, 3 );
    

    I have modified the code from your last post. The difference is, It only does it for logged in users. Also, I have decreased the priority to make it work on BuddyPress pages( otherwide bp_modify_title would have overwritten it).

    Hope that helps.

    #233352
    chatty24
    Participant

    @danbp
    I have edited the code a bit and now it is getting displayed on all the pages as I wanted but, How can I hide the modified title when the notification count is 0. By current code is below –

    function bpfr_add_notification_to_page_title( $title, $original_title, $sep, $seplocation  ) {
    	global $bp;
    	if( bp_is_user() && ! bp_get_member_user_id() ) {
            $user_id = 'displayed: '. bp_displayed_user_id();
        } else {
            $user_id = 'get_member_user: '. bp_get_member_user_id();
        }
    
    	if (bp_notifications_get_unread_notification_count( $user_id ) ) {
    
    		$counter = 0;
    			for ( $i = 0; $i < count($notifications); $i++ ) {
    				echo $notifications[$i];
    			$counter++;
    			}	
    
    	
    		
    			$title = "You Have " . bp_notifications_get_unread_notification_count() . " New Notification(s) - ";
        
    		return $title;
    	}
    }
    add_filter( 'wp_title', 'bpfr_add_notification_to_page_title', 9, 4 );
    

    Thanks

    #233349
    danbp
    Participant

    Try this (tested on 2.2 RC2)

    function bpfr_add_notification_to_page_title( $title, $original_title, $sep, $seplocation  ) {
    	global $bp;
    	if( bp_is_user() && ! bp_get_member_user_id() ) {
            $user_id = 'displayed: '. bp_displayed_user_id();
        } else {
            $user_id = 'get_member_user: '. bp_get_member_user_id();
        }
    
    	if (bp_notifications_get_unread_notification_count( $user_id ) ) {
    
    		$counter = 0;
    			for ( $i = 0; $i < count($notifications); $i++ ) {
    				echo $notifications[$i];
    			$counter++;
    			}	
    
    	if ( bp_is_profile_component() || bp_is_current_action( 'just-me' ) ) {
    		
    			$title .= bp_notifications_get_unread_notification_count() . " $sep ";
        }
    		return $title;
    	}
    }
    add_filter( 'bp_modify_page_title', 'bpfr_add_notification_to_page_title', 9, 4 );
Viewing 25 results - 451 through 475 (of 1,091 total)
Skip to toolbar