Search Results for 'notification user id'
-
Search Results
-
Topic: Confirmation Email
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 CUSTOMfunction 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.
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.
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.Topic: Notification avatars
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' ) ); }
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. } ?>
Topic: Cancel Membership Request?
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,
AndrewI 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.2Hi 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.tkUsing latest version of WordPress and BuddyPress and the latest version of responsive theam.
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.
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 thissubscriber_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');
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; } }
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.