Search Results for 'notification user id'
-
Search Results
-
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.
Topic: Email Message Tokens
Hi,
Im looking at the email tokens available for use with BuddyPress and the automated emails sent from wordpress.
My question relates to this token in particular…..
{{{unsubscribe}}}
If a user clicks this, does it just unsubscribe them from the email notifications, or does it cancel their registration?
you know how sometimes you get an email and at the bottom there is a link along the lines of
“Didnt sign up for our website? click here to unsubscribe”
Is that what that token is for?
Thanks,
Phil
I am having an issue with my Buddypress Notification Settings not saving. When you change any options from “Yes” to “No” and click the “Save” button at the bottom of the page, the page reloads but the changed options don’t save.
WP version 4.4.1
Theme PageLines Framework 2.4.6
PHP version 5.4.13
bbPress version 2.5.8-5815
site url http://www.wpfilm.com
Active Plugins Name and Version
– p1 Gravity Forms 1.9.15
– p2 Add Shortcodes Actions And Filters 2.0.3
– p3 Akismet 3.1.8
– p4 BAW Multipass for Protected Pages 1.4
– p5 bbP Toolkit 1.0.6
– p6 bbPress 2.5.8
– p7 Better Notifications for WordPress 1.3.9.5
– p8 BuddyPress Username Changer 1.1
– p9 BuddyPress 2.4.3
– p10 CloudFlare 1.3.20
– p11 Display Categories Widget 2.0
– p12 Disqus Comment System 2.84
– p13 Gravity Forms ActiveCampaign Add-On 1.3.1
– p14 Gravity Forms Authorize.Net Add-On 2.1.1
– p15 Gravity Forms MailChimp Add-On 3.7.1
– p16 Gravity Forms PayPal Standard Add-On 2.6
– p17 Gravity Forms Survey Add-On 2.6
– p18 Like Button Voting & Rating 2.1.9
– p19 MemberPress Active Campaign 1.0.4
– p20 MemberPress AWS 1.2.5
– p21 MemberPress Developer Tools 1.0.2
– p22 MemberPress Importer 1.2.3
– p23 MemberPress to VHX.tv 1.0
– p24 MemberPress WP Films Addons 1.0
– p25 MemberPress Developer Edition 1.2.7
– p26 Nav Menu Roles 1.7.7
– p27 Open Graph Metabox 1.4
– p28 bbPress for PageLines 2.0.2
– p29 Recent Posts Widget Extended 0.9.9.5
– p30 Shortcodes in Menus 3.1
– p31 Stream 3.0.5
– p32 Update Control 1.5
– p33 UpdraftPlus – Backup/Restore 1.11.28
– p34 WP Better Emails 0.3Last two years ago, one of buddypress user MLDIA asked this question. I am also want to know and would like to make features that ..
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)Please help me. Thanks all.
At moment im using this code which display 0 if there are no notifcations how can I display nothing if there are 0 notifcations?
echo bp_notifications_get_unread_notification_count( bp_loggedin_user_id() );
Also is there a same sort of code for friends count too and or mentions?
Thank you!
Hi all (hoping that @djpaul notices this),
Email trouble in BP is apperantly very hard to solve (I’ve been sifting through email related posts in the forums for hours!), so I’m going to include as many clues here as possible. Hopefully someone has the patience to read all this and make sense of it, and hopefully this problem is not specific to my installation. Yes, I have a lot of plugins. But, I have disabled all of them at times to test this, and I’m fairly confident that it is not a plugin conflict.
Problem Summary:
It seems like some of the messages generated by BP are formed in such a way that they are being rejected (silently?) by external mail servers (i.e. google, yahoo, hotmail) while other email messages are fine. I think this may be giving the impression that BP is not sending the email, but the email messages are in fact being sent (in my case anyway). They just don’t seem to be handled properly on the recieving end. Why?… I have no idea. Hoping for some tips to continue troubleshooting here.
Product Versions
WP: v4.4.2
BP: v2.5.2Relevant Plugins in use:
wp-mail-smtp: In case the email problems were PHP mail() related
bp-email-to-wp-mail-from-bridge: To fix BP ignoring existing mapping for the From email
buddypress-group-email-subscription: To add group email functionality (mentioning only because email sent from this plugin works fine – plain text)Relevant Config Info:
At first I wasn’t using an SMTP plugin, but my current config is using WP-Mail-SMTP.
It is configured with the localhost as the SMTP Server (HostGator shared host).
Outoing email seems to work fine (with or without the plugin). It’s only outgoing BP mail that isn’t working properly.High Level Details:
Some BuddyPress generated email works and some doesn’t. There are 3 specific examples that I’ve been testing:
* The “Friend Request” email works great! It’s a really nice HTML formatted email that informs the target of the request that the request has been made.
* A PM to a member doesn’t work. No email notification is sent to the target of the PM (Notification settings are correct)
* A Mention doesn’t work. No email is sent to the BP user targeted by the mention (Notification settings are correct).The email messages that don’t appear to be working (i.e. not reaching it’s destination) are actually being sent. However, it seems like they are completely ignored by the receiving mail server.
* This has been confirmed with the debug plugin (bp-email-debug-2.php). In all cases it reports that the email was sent.
* This has been confirmed by my ISP. I had them watch the email get sent out from the localhost (the smtp server) to a google mail server (for example) but the message was not received.I know that my mail server/domain is not blacklisted because as mentioned above, the “Friend Request” email is sucesfully sent and delivered to the same recipeint. Also, the buddypress-group-email-subscription plugin works well and sends email succesfully to the same recipients.
NOTE:The same email (eg. PM and Metion related email) that is not delivered successfuly to external mail servers (google, yahoo, hotmail) IS sucessfully delivered to email addresses hosted on my local mail server (i.e. the mail server running on the same WP/BP host – Hostgator).
Some steps I’ve taken to test/resolve
I’ve ensured that the “From” email address is correct (i.e. not being rejected because it is “wordpress@domain.com”). BTW, this led me to the bp-email-to-wp-mail-from-bridge Plugin which bridges wp_mail_from settings that I had in WP functions.php (child theme) to BP Email fuction(s). Everything is fine here.
I’ve installed and tested WP-Mail-SMTP plugin in every way I can imagine. No change in email behaviour
I made sure all available options in the notification settings (i.e. to receive all types of notifications) are enabled and have tested the various email scenarios on many different users.
Other important notes
I’m using the plugin buddypress-group-email-subscription to send email to group members when things happen in the forums. As mentioned above, this plugin successfully sends email to the same recipeints that are not recieving the PM and Metnion emails. Worth noting is the email messages sent by this plugin are plain text.
Finally
Thanks for getting this far… that’s a lot of reading. Sorry. I’m not expecting a simple answer to this. I’m just hoping for someone to point me in the right troubleshooting direction.
<br><br>Topic: Insert Notification
Is possible insert a notification to specific user using php?
Eg.:
bbpress_insert_notification($user_id, $content_notification);I’m looking to set up moderation through my BuddyPress install. I’ve looked at the permissions and no matter what I try I seem to come up empty handed – any thoughts on what permissions I would give to a user to allow them to delete others activity from the front end. I will have my site set up in such a way that the user (any level other than super admin) cannot see the back end.
Further, I have set up a user called flag, (I have hidden flag from being visible anywhere on the site, and when a user attempts to go to the URL they’re forwarded to the support page I have setup) I wish to have their notifications forwarded to anyone who has X role or to a set of user ID’s that can delete said post if it offends.
I used the above code to achieve the hidden user https://buddypress.org/support/topic/hide-admin-from-members-and-activity/#post-190874
Does anyone have any thoughts on this? I’m pretty stuck.
Thanks,
Kieran
i want to be the only one able to view the link as the admin. When users are viewing their notifications in the right side, there are links to WordPress.org on the left side. I don’t think this part is relevant to my users based on the forums they are discussing.
Any advise Please?
I’m using <?php bp_get_loggedin_user_nav(); ?>
but it is only showing the message count inside the members profile, is there any code i can put in the bp-custom file to also show the message count outside of the users profile url?
The other notification counts for other menu items work sitewide, only messages is missing. Any help would be greatly appreciated!!