Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'notification user id'

Viewing 25 results - 301 through 325 (of 768 total)
  • Author
    Search Results
  • doubleF
    Participant

    Hello @shanebp,

    I’ve changed the secondary_item_id with : get_current_user_id()

    And it’s the same issue, notification is created but doesn’t seem to be assigned to any profile :/

    Thanks for the help.

    shanebp
    Moderator

    'secondary_item_id' should be the user id of the person creating the notification.
    That might be the problem.

    #255647

    In reply to: Confirmation Email

    Dono12
    Participant

    Thanks for your prompt response and your help but that function did not achieve the goal I was looking for. I wanted the activation Key to come from Cymi User Extra Field. I found a solution from someone with a similar problem but it is a little too extreme for me. The result you get is a Cymi User Extra Field Key/URL, Looks like This(cimy_key=88fddcb568dcf2d6). It involved editing a core Buddypress file wp-content/plugins/buddypress/bp-core/bp-core-filters.php. Can you help with a function for my functions.php or bp-custom to achieve the same goal. If it’s not too much maybe generate the Cymi-Key in the Buddypress Email Template though not a priority. I’m fully aware that editing core files is not practical, especially being that you lose it during updates.

    https://buddypress.org/support/topic/activation-email-key-doesnt-work-i-may-have-the-fix/

    function bp_core_activation_signup_user_notification( $user, $user_email, $key, $meta ) {
    
    $activate_url = bp_get_activation_page() . "key=$key";
    $activate_url = esc_url($activate_url);
    $admin_email = get_site_option( 'admin_email' );
    
    if ( empty( $admin_email ) )
    $admin_email = 'support@' . $_SERVER;
    
    // Then it ends with, on line 255
    
    add_filter( 'wpmu_signup_user_notification', 'bp_core_activation_signup_user_notification', 1, 4 );
    #255632

    Topic: Confirmation Email

    in group forum Requests & Feedback
    Dono12
    Participant

    I’m using Cymi User Extra Field, when you enable email confirmation the user gets the Buddypress email template
    with the confirmation link. when the user clicks the link it takes them to the confirmation page of the site prompting them
    to login with username and password. Problem is the user name and password doesnt work. The user gets created because they
    are visible in the users list. How can I fix this problem.
    I’ve disabled the Buddypress sign up for the default WordPress using: BP CUSTOM

    function my_disable_bp_registration() {
      remove_action( 'bp_init',    'bp_core_wpsignup_redirect' );
      remove_action( 'bp_screens', 'bp_core_screen_signup' );
    }
    add_action( 'bp_loaded', 'my_disable_bp_registration' );
    add_filter( 'bp_get_signup_page', "firmasite_redirect_bp_signup_page");
        function firmasite_redirect_bp_signup_page($page ){
            return bp_get_root_domain() . '/wp-login.php?action=register'; 
     }

    and I found this code in a Buddpress Forum:

    https://buddypress.trac.wordpress.org/ticket/3443

    // Change the text on the signup page

    add_filter( 'bp_registration_needs_activation', '__return_false' );
    
    function my_disable_activation( $user, $user_email, $key, $meta = '' ) {
    	// Activate the user
    	bp_core_activate_signup( $key );
    
    	// Return false so no email sent
    	return false;
    }
    add_filter( 'wpmu_signup_user_notification', 'my_disable_activation', 10, 4 );
    
    

    I tried it with the hope that the key would be disabled and the key fired by WordPress would take over but it still didnt work.

    I really don’t care who fires the key I just want the user to be able to login after click the key in their email.

    Mike
    Participant

    How do you position the notification counter for dropdown items? For example,

    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

    if there was a dropdown menu below this menu item (below position 7,0), what would the position be labelled as? I’ve tried 7,1 but no luck.

    #255474
    ljmac
    Participant

    Unfortunately none of these are quite what I’m after – the following code comes close, but I don’t want a login redirect – just a standard redirect from /members/%username%/activity/mentions/ to /members/%username%/activity/. How can I modify this code to achieve my desired outcome?

    function jessicana_redirect_page( $redirect_to, $request, $user ) {
        $redirect_to = bp_core_get_user_domain($user->ID) . 'notifications/';
        return $redirect_to;
    }
    add_filter('login_redirect', 'jessicana_redirect_page', 11, 3);
    ljmac
    Participant

    Hi,

    I have a Facebook-style wall set up as the default tab for activity on users’ BuddyPress profiles. This makes some of the other subnavs redundant, so I’ve hidden them. However, when a user gets mentioned, the notification sends them to the Mentions tab (which I’ve also hidden). How can I redirect them to their wall (/members/%username%/activity/)? BuddyPress’ dynamic URLs make this much less straightforward than usual.

    #255314
    shanebp
    Moderator

    You should not change that function. You should use the hook.

    Try something like this in your theme functions.php:

    function hosam_delete_notification( $topic_id ) {
    
       // you cannot send an array
       // create individual variables
       $user_id = 386;  // etc
    
       bp_notifications_delete_notifications_by_item_id( $user_id, $item_id, $component_name, $component_action, $secondary_item_id = false );
    
    }
    add_action( 'bbp_trash_topic', 'hosam_delete_notification' );
    #255243
    sharmavishal
    Participant

    1. In BuddyPress, we by default get to see member page. I want to know how to redirect someone who is logging in/ new user after registration to News feed?

    search for login redirect plugins for buddypress

    2. I want to keep those wall, timeline and all in menu bar instead of profile tab. How to do that?

    check wp admin bar codex or associated plugins

    3. I am unable to hide admin bar/ that WordPress logo bar for non-admin user. no plugin helping me out.

    am aware of atleast 2 plugins which are working for me. u need to test/check which ones work with ur theme/setup

    4. how to make the menu such that signed in user can see log out button and other sign in/ register?

    via buddypress components in the menus. logged in and logged out menu links

    5. how to enable realtime notification and instant messaging private n groups both?

    notification is already there and its real time. i belive there is a group chat plugin for buddypress as well

    6. how to remove show dropdown menu in profile

    that would depend on ur theme which u are using

    PS:- I don’t know PHP much. moreover, I cannot afford to hire someone.

    then this would take much time and effort to customise it as per ur needs

    start from here

    Configure BuddyPress

    #255238
    kunaldas1997
    Participant

    hello there!

    I am new to BuddyPress.
    1. In BuddyPress, we by default get to see member page. I want to know how to redirect someone who is logging in/ new user after registration to News feed?
    2. I want to keep those wall, timeline and all in menu bar instead of profile tab. How to do that?
    3. I am unable to hide admin bar/ that WordPress logo bar for non-admin user. no plugin helping me out.
    4. how to make the menu such that signed in user can see log out button and other sign in/ register?
    5. how to enable realtime notification and instant messaging private n groups both?
    6. how to remove show dropdown menu in profile
    PS:- I don’t know PHP much. moreover, I cannot afford to hire someone.

    #255213
    m1000
    Participant

    After upgrade the custom loop with notifications doesn’t work anymore:

    if ( is_user_logged_in() ) {
       if ( function_exists( 'bp_is_active' ) ) {
    	if ( $notifications = bp_notifications_get_notifications_for_user( bp_loggedin_user_id(), $format = 'string' ) ) { ?>
    	<div class="notif-container">
    	<?php
    	}
    
    	if ( $notifications ) {
    		$counter = 0;
    		for ( $i = 0, $count = count( $notifications ); $i < $count; ++$i ) {
    			$alt = ( 0 == $counter % 2 ) ? ' alt' : ''; ?>
    			<div class="my-notification<?php echo $alt ?>"><?php echo $notifications[$i] ?></div>
    
    			<?php
    			 $counter++;
    			} ?>
    	</div><!-- notif-container -->
    	<?php
    	} else {}
       }
    }

    It returns ‘Array’

    #255157
    Andrew
    Participant

    I’ve been trying to work out how to get the user IDs for the notification items so I can display notification user avatars.

    Is this the best way to do it, I’ve tested this with a few users and seems to work:

    function test_notifications_avatar() {
    	
    	$bp      = buddypress();
    	$user_id = $bp->notifications->query_loop->notification->secondary_item_id;
    	
    	if ( empty( $user_id ) )
    		$user_id = $bp->notifications->query_loop->notification->item_id;
    
    	echo bp_core_fetch_avatar( array( 'item_id' => $user_id, 'type'  => 'thumb' ) );
    }
    #255156
    hosam020
    Participant

    @shanebp Thank you for the kindly reply
    Yes i am using it.
    i think you mean i have to call this action in theme funcation ourside the bp localfile.

    unction bbp_trash_topic( $topic_id = 0 ) {
    
    	// Validate topic ID
    	$topic_id = bbp_get_topic_id( $topic_id );
    
    	if ( empty( $topic_id ) || !bbp_is_topic( $topic_id ) )
    		return false;
    
    		$args = array(
    		'user_id'           => 386,
    		'item_id'           => $topic_id,
    		'secondary_item_id' => 0,
    		'component_name'    => 'forums',
    		'component_action'  => 'new_topic',
    		);
    	
    	bp_notifications_delete_notifications_by_item_id( $args );
    
    	do_action( 'bbp_trash_topic', $topic_id );

    Please ignore the args param just added a notification param to see if will delete it
    but never happend
    Sorry for my bad english i hope u understand me.

    jameshh93
    Participant

    I have been using this code to echo out a bubble for my header however it used to work flawlessly but now it just gives me ” Fatal error: Call to undefined function bp_get_total_unread_messages_count() in C:\Program Files (x86)\Ampps\www\retaggr101\wp-content\themes\twentysixteen\header.php on line 167″

    which kind of makes no sense at all.

    
    		              <?php 
    					  
    					            $count = bp_get_total_unread_messages_count( bp_loggedin_user_id() );
                                           if ( $count > 0 ) {
                                        echo '<div class="site-header-user-notifcations-bubble">'; echo $count; echo '</div>';
                                        } else {
                                       // The notif count is 0.
                                            }
    					  
    					  
    					  ?>

    espcially when this code works

     <?php 
    					  
    					            $count = bp_notifications_get_unread_notification_count( bp_loggedin_user_id() );
                                           if ( $count > 0 ) {
                                        echo '<div class="site-header-user-notifcations-bubble">'; echo $count; echo '</div>';
                                        } else {
                                       // The notif count is 0.
                                            }
    					  
    					  
    					  ?>
    #254722
    Andrew Tegenkamp
    Participant

    When a member requests to join a private group the button shows “Request Sent” but I’d like to change that to say “Request Sent – Cancel” and have that cancel the request (and delete the notification).

    I saw on this post from last year it would need to be a custom function and didn’t see it anywhere but wasn’t sure if that has been added or if there’s a best practice for it.

    Thanks,
    Andrew

    sharmavishal
    Participant

    if it helps following non bp errors with rc1

    Notice: bbp_setup_current_user was called incorrectly. The current user is being initialized without using $wp->init(). Please see Debugging in WordPress for more information. (This message was added in version 2.3.) in wp-includes/functions.php on line 3897

    Notice: bp_setup_current_user was called incorrectly. The current user is being initialized without using $wp->init(). === Trace: #6 wp-content/plugins/wordpress-seo/admin/class-yoast-notification-center.php(421): get_current_user_id() #7 wp-content/plugins/wordpress-seo/admin/class-yoast-notification-center.php(31): Yoast_Notification_Center->retrieve_notifications_from_storage() #8 wp-content/plugins/wordpress-seo/admin/class-yoast-notification-center.php(49): Yoast_Notification_Center->__construct() #9 wp-content/plugins/wordpress-seo/wp-seo-main.php(373): Yoast_Notification_Center::get() #10 [internal function]: load_yoast_notifications(”) #11 wp-includes/plugin.php(525): call_user_func_array(‘load_yoast_noti…’, Array) #12 wp-settings.php(277): do_action(‘plugins_loaded’) #13 /opt/www/hobbysocialnetwork.c in wp-includes/functions.php on line 3897

    even with yoast seo disabled the site doesnt come up

    #254626
    danbp
    Participant

    Private message

    A user must have friends to send private messages or visit the profile of another user to send him a msg.

    Messages

    To get it to work, you need also to enable following options in BP settings:
    – Friend Connections
    – Private messaging
    Additionnally, if you want to be notified by email
    – Notifications

    Whatever the option you activate, best practice is to control how it works on your config. To do that, use only WP, BP and one of Twenty’s theme before activating a third party theme and any other plugin.
    This will ensure you that BP is fully working on a standart WP config.

    Mention

    @mention use AJAX which can in some case, mostly with sophisticated themes or frameworks, lead to conflict. In that case, the culprit isn’t BP or WP, but the theme or a plugin whose code (generally) use a different standart as WP.

    If you get issues with mention or messaging, activate wp_debug in wp-config and check your browser JS console to track down errors. The one or the other can give you precious debug information. You can also use a debug tool like Firebug.

    #254614
    bryanbatcher
    Participant

    I want to remove “Notifications”, “Messages”, and “Settings” from the first nav bar on user pages.

    I’d also like to hide the user header (the profile pic, username, and cover photo section) on certain user pages.

    Any help would be appreciated.

    BP 2.5.3
    WP 4.5.2

    shanebp
    Moderator

    This will remove the Email tab.

    function waqas_remove_friends_activity_nav() {
    	bp_core_remove_subnav_item( 'settings', 'notifications' );
    }
    add_action( 'bp_setup_nav', 'waqas_remove_friends_activity_nav', 15 );

    This will set all the notification settings to ‘no’ for a specific user:

    function waqas_email_notifications( $user_id ) {
    	
    	$settings = bp_settings_get_registered_notification_keys(); 
    	
    	foreach ( $settings as $setting ) {
    		bp_update_user_meta( $user_id, $setting, 'no' );
    	}
    	
    }

    For new users, you could do this:

    function waqas_bp_core_activated_user(  $user_id, $key, $user ) {
         waqas_email_notifications( $user_id );
    }
    add_action( 'bp_core_activated_user', 'waqus_bp_core_activated_user', 10, 3 );
    waqastechlover
    Participant

    Hi all!
    I want to know that how can I remove email tab from the settings page of users profile.
    I mean that when a user opens his profile and go to settings. There is an Email tab to let the user to decide which email notifications he would like to receive. I want to remove this tab completely.
    I also want to disable every email notifications for users by default.
    Please tell me how to do both of these things. I shall be very very grateful!
    Thanks a lot in advance and best Regards, Waqas Ramzan Techlover, Web Master of Blind Help Project (BHP) http://www.blindhelp.tk

    Using latest version of WordPress and BuddyPress and the latest version of responsive theam.

    danbp
    Participant

    Give this a try: (add to bp-custom.php) 1) & 2):

    function bpfr_hide_tabs() {
    global $bp;
    
    	if ( bp_is_user() && !is_super_admin() ) {
    		bp_core_remove_nav_item( 'notifications' );
    		bp_core_remove_subnav_item( 'messages', 'compose' );
    	}
    	
    }
    add_action( 'bp_setup_nav', 'bpfr_hide_tabs', 15 );

    3) With BP and xprofile component activated, a user doesn’t need access to WP dashboard. He can change his profile credentials from front-end.
    Easiest way would be to use this plugin.

    Retrieving them the possibility to change their email is anyway not a good idea. What happen when a user changed from yahoo to gmail, but can’t login because he lost his password ? Where will the new pwd be sent ?

    Perhaps you have also to remove this from the BP usermenu on toolbar ?
    Here’s how you can do it:

    function admin_bar_remove_this(){
    global $wp_admin_bar;
    	$wp_admin_bar->remove_node('my-account-messages-compose');
    }
    add_action('wp_before_admin_bar_render','admin_bar_remove_this');
    Masoud
    Participant

    hi.
    i want to hide some tabs only for non-admins.
    for example “Compose
    underMessage > Compose.
    in bp-messages/classes/class-bp-component.php lines:199 & 287.
    it’s possible to add a conditional if().

    <strong>if(current_user_can(administrator))</strong>
    {
    $sub_nav[] = array(
    'name'=> __( 'Compose', 'buddypress' ),
    'slug'=> 'compose',
    'parent_url'=> $messages_link,
    'parent_slug'=> $slug,
    'screen_function'=> 'messages_screen_compose',
    'position'=> 30,
    'user_has_access'=> $access
    }

    and do this for line 287.
    so, both the Compose tab and the ability to composing a msg will be in admin hands.
    BUT it’s not a good way to hack core codes!
    so how can i do this?

    the things i want to hide from non-admins:
    1) Notification tab
    2) Compose (sub-nav)
    3) hide the panel and restrict the access to change Account email (from Setting > General)

    thanks in advance.

    cahara
    Participant

    Hey all,

    Been digging for a solution but can’t seem to find one. My site has 2 registration forms (Form A and Form B) on separate pages that are working great. When users signup to Form B a hidden field called subscriber_type is populated. Otherwise Form A and B are identical. Once the forms are submitted a user should only be auto-activated and logged-in if this subscriber_type field is populated.

    So far users filling out Form B are activated (and don’t get the activation email) and are logged in. But users filling out Form A aren’t getting their activation emails either even though they should. Looks like no users are getting any activation emails, regardless of the form they fill.

    Is there any way to make sending of the activation emails conditional?

    What I’ve tried so far:

    
    // Auto-activate users from Form B (This works)
    function auto_activate_user( $user_id ) {
    
        $subscriber_type = $_POST['subscriber_type'];
        if ($subscriber_type || $subscriber_type === 'current_subscriber'){
            global $wpdb;
    
            //Hook if you want to do something before the activation
            do_action('bp_disable_activation_before_activation');
    
            $activation_key = get_user_meta($user_id, 'activation_key', true);
            $activate = apply_filters('bp_core_activate_account', bp_core_activate_signup($activation_key));
            BP_Signup::validate($activation_key);
            $wpdb->query( $wpdb->prepare( "UPDATE $wpdb->users SET user_status = 0 WHERE ID = %d", $user_id ) );
    
            //Add note on Activity Stream
            if ( function_exists( 'bp_activity_add' ) ) {
                $userlink = bp_core_get_userlink( $user_id );
    
                bp_activity_add( array(
                    'user_id' => $user_id,
                    'action' => apply_filters( 'bp_core_activity_registered_member', sprintf( __( '%s became a registered member', 'buddypress' ), $userlink ), $user_id ),
                    'component' => 'profile',
                    'type' => 'new_member'
                ) );
    
            }
            //Send email to admin
            wp_new_user_notification( $user_id );
            // Remove the activation key meta
            delete_user_meta( $user_id, 'activation_key' );
            // Delete the total member cache
            wp_cache_delete( 'bp_total_member_count', 'bp' );
    
            //Hook if you want to do something before the login
            do_action('bp_disable_activation_before_login');
    
            //Automatically log the user in	.
            $user_info = get_userdata($user_id);
            wp_set_auth_cookie($user_id);
    
            do_action('wp_signon', $user_info->user_login);
    
            //Hook if you want to do something after the login
            do_action('bp_disable_activation_after_login');
    
        }
    }
    
    // Fix validation on Form B (This works)
    function fix_signup_form_validation_text() {
        $subscriber_type = $_POST['subscriber_type'];
        if ($subscriber_type || $subscriber_type === 'current_subscriber'){
            return false;
        }
    }
    
    // Disable autivation email only for Form B (This doesn't work)
    function disable_activation_email() {
        $subscriber_type = $_POST['subscriber_type'];
        if ($subscriber_type || $subscriber_type === 'current_subscriber'){
            return false;
        }
    }
    
    add_action( 'bp_core_signup_user', 'auto_activate_user');
    add_filter( 'bp_registration_needs_activation', 'fix_signup_form_validation_text');
    add_filter( 'bp_core_signup_send_activation_key', 'disable_activation_email');
    
    #253425
    Andrew Tibbetts
    Participant

    I am trying to add a new notification for all members of a group when a new user joins a group. I have registered a new dummy component, can successfully get the notification into the db, but returning the notification for formatting / display comes up empty. Here’s my code:

    
    add_filter( 'bp_notifications_get_registered_components', 'custom_bp_notifications_get_registered_components' );
    function custom_bp_notifications_get_registered_components( $component_names = array() ) {
     
    	if ( ! is_array( $component_names ) ) {
    
    		$component_names = array();
    	}
     
    	array_push( $component_names, 'custom' );
     
    	return $component_names;
    }
    
    add_action( 'groups_join_group', 'custom_groups_join_group', 10, 2 );
    function custom_groups_join_group( $group_id, $user_id ) {
    	
    	if ( bp_is_active( 'notifications' ) ) {
    		
    		if ( bp_group_has_members( 'group_id='.$group_id.'&per_page=10000000' ) ) {
    			
    			while ( bp_group_members() ) {
    				
    				bp_group_the_member();
    				
    				if ( bp_get_group_member_id() != $user_id ) {
    
    					bp_notifications_add_notification(array(
    						'user_id' 		=> bp_get_group_member_id(),
    						'item_id' 		=> $group_id,
    						'secondary_item_id' 	=> $user_id,
    						'component_name' 	=> 'custom',
    						'component_action' 	=> 'custom_group_join',
    						'date_notified' 	=> bp_core_current_time(),
    						'is_new' 		=> 1,
    					));
    				}
    			}
    		}
    	}
    }
    
    add_filter( 'bp_notifications_get_notifications_for_user', 'custom_bp_notifications_get_notifications_for_user', 10, 5 );
    function custom_bp_notifications_get_notifications_for_user( $action, $item_id, $secondary_item_id, $total_items, $format = 'string' ) {
    
    	if ( $action === 'custom_group_join' ) {
    
    		$group_id = $item_id;
    		$joining_user_id = $secondary_item_id;
    
    		$group = groups_get_group( array( 'group_id' => $group_id ) );
    		$group_link = bp_get_group_permalink( $group );
    
    		$user_fullname = bp_core_get_user_displayname( $joining_user_id );
    		$user_link = bp_core_get_user_domain( $joining_user_id );
    
    		$text = $user_fullname . ' joined the group ' . $group->name;
    		$notification_link = $group_link . 'admin/membership-requests/?n=1';
    		
    		if ( 'string' === $format ) {
    
    			$return = apply_filters(
    				'bp_groups_' . $action . '_notification', '<a href="' . $user_link . '" title="' . $user_fullname . '">' . $user_fullname . '</a> joined the group <a href="' . $group_link . '" title="' . $group->name . '">' . $group->name . '</a>', $group_link, $user_fullname, $group->name, $text, $notification_link );
    		}
    		else {
    
    			$return = apply_filters( 'bp_groups_' . $action . '_notification', array(
    				'link' => $notification_link,
    				'text' => $text
    			), $group_link, $user_fullname, $group->name, $text, $notification_link );
    		}
    	
    		return $return;
    	}
    }
    
    chiragsharma11
    Participant

    Hey Guys,
    I know that a lot of you guys have asked this question before but I still can’t find a solution to this problem anywhere.

    Whenever I try to set up new user, I never get the activation email. I hhave the WP SMTP plugin installed with the “from” email set to donotreply@mysite.com and all correct SMTP localhost and port settings. That being said, I get all the other emails , that is from the contact forms I have and I also get the BuddyPress notification emails such as the user addition, friend request. It is just that I am not getting any activation link at all. I have tested all the plugins (disabling and enabling them together and separately), but that doesn’t work out either. This is the only site left before I hand it over to the client, so any help would be appreciated.

Viewing 25 results - 301 through 325 (of 768 total)
Skip to toolbar