Search Results for 'notification user id'
-
Search Results
-
I currently have the following in my bp-custom.php, which creates my welcome email.
add_action( 'bp_core_activated_user', 'bpdev_welcome_user_notification', 0, 3 ); function bpdev_welcome_user_notification( $user_id, $key = false, $user = false ) { if ( is_multisite() ) { return ;// we don't need it for multisite } //send the welcome mail to user //welcome message $welcome_email = __( 'Hi USER_DISPLAY_NAME, welcome to SITE_NAME. Thankyou for signing up and helping us grow our community. Your new account is all set up and ready to go, you can login with the following information: Username: USERNAME Please let us know if you have any issues using the site via the contact us page: http://mysite.com/contact-us/ The SITE_NAME Team' ); //get user details $user = get_userdata( $user_id ); //get site name $site_name = get_bloginfo( 'name' ); //update the details in the welcome email $welcome_email = str_replace( 'USER_DISPLAY_NAME', $user->first_name, $welcome_email ); $welcome_email = str_replace( 'SITE_NAME', $site_name, $welcome_email ); $welcome_email = str_replace( 'USERNAME', $user->user_login, $welcome_email ); $welcome_email = str_replace( 'LOGINLINK', wp_login_url(), $welcome_email ); //from email $admin_email = get_site_option( 'admin_email' ); if ( empty( $admin_email ) ) { $admin_email = 'support@' . $_SERVER['SERVER_NAME']; } $from_name = $site_name . "<$admin_email>" ;//from $message_headers = array( 'from' => $from_name, 'content-type' => 'text/plain; charset='. get_option('blog_charset') ); //EMAIL SUBJECT $subject = sprintf( __( 'Welcome to %1$s ' ), $site_name ) ; //SEND THE EMAIL wp_mail( $user->user_email, $subject, $welcome_email, $message_headers ); return true; }
As the action is set to bp_core_activated_user, any user that does not need to be activated will not receive an email.
What other functions are there that will allow me to send an email to all users, and not just those that have to activate their accounts? I know I’ve come across it before, but I can’t seem to find it nowI’ve seen a dozen support questions on this topic and the answer has always been “another plugin must be redeclaring wp_mail(), so on my test site I disabled every plugin except bbpress and buddypress (and akismet) and still emails are sent in plain text.
On my live site, the only way I can get the html emails sent is when I have the Buddypress Group Email Subscriptions plugin activated, and then, no matter what other email-related plugins I have active all buddypress emails are sent in html format.
But, the group subscription plugin has it’s own problem: slows down page-reload when replying if too many members are subscribed to a Topic (can take up to 30 seconds for the reply to process and page to reload on our site), and we haven’t found other solutions to that. So…. we want to disable that subscription plugin, but when we do we lose the html formatted emails.
Can someone please provide some kind of solution for this plain-text vs. html issue. Like I said, even with no other plugins active we’re still not getting html emails.
Thanks for the help.
Our info from our test site (when still getting plain text emails):
WP version 4.7
Theme Goodnews 5 Child Theme 1.0
PHP version 5.6.29
bbPress version 2.6-alpha-6091
site url http://staging-nexus.universaltheosophy.com
Active Plugins Name and Version
– p1 Akismet 3.2
– p3 bbPress 2.6-alpha
– p4 BuddyPress 2.7.4Our info from our live site:
WP version 4.7
Theme Goodnews 5 Child Theme 1.0
PHP version 5.6.29
bbPress version 2.6-alpha-6091
site url http://nexus.universaltheosophy.com
Active Plugins Name and Version
– p1 Adminimize 1.11.2
– p2 Akismet 3.2
– p3 All In One SEO Pack 2.3.11.1
– p4 bbP Toolkit 1.0.6
– p5 bbPress 2.6-alpha
– p6 Better Notifications for WordPress 1.6
– p7 BP Registration Options 4.3.1
– p8 BuddyPress Group Email Subscription 3.7.0
– p9 BuddyPress Sitewide Activity Widget 1.3.2
– p10 BuddyPress 2.7.4
– p11 Contact Form 7 4.6
– p12 Google XML Sitemaps 4.0.8
– p13 Header and Footer 2.0.3
– p14 Random Content 1.3.1
– p15 TinyMCE Advanced 4.4.3
– p16 User Role Editor 4.31.1
– p17 WP-Mail-SMTP 0.10.1Topic: delete notifications
if buddypress clear notifications plugin does not working for u , this is a solution how to do it ,we will add a button”clear all notifications” in the notifications nav menu , first we will edit a php script called test.php wich contain this code
<?php function clear_all_notifications() { require_once( 'wp-load.php' ); //put correct absolute path for this file $id = get_current_user_id(); // on se connecte à MySQL $db = mysql_connect('localhost', 'user', 'password'); //replace user and password mysql_select_db('name of database',$db); $requete = 'SELECT * FROM prefix_bp_notifications WHERE user_id='. $id ; // verify the name of table here prefix_bp_notifications can be wp_bp_notifications $sql = 'DELETE FROM prefix_bp_notifications WHERE user_id ='. $id ; // verify the name of table here prefix_bp_notifications can be wp_bp_notifications $reponse = mysql_query($requete); $resultat = mysql_num_rows($reponse); if($resultat > 0){ $req = mysql_query($sql) or die('Erreur SQL !<br>'.$sql.'<br>'.mysql_error()); mysql_close(); echo "Notifications supprimees"; } else { echo $resultat ; echo "pas de notifications"; mysql_close(); } } clear_all_notifications(); ?> copy this script into ur document root where u have installed ur wordpress then add this code to wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/notifications.php under <?php bp_get_options_nav(); ?> line 13 <li id="notifications-my-notifications-personal-li" class="current selected"> <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script> <script type = "text/javascript"> function myAjax () { $.ajax( { type : 'POST', data : { }, url : 'ur website adresse/test.php', // <=== CALL THE PHP FUNCTION HERE. success: function ( data ) { return 1; // <=== VALUE RETURNED FROM FUNCTION. }, error: function ( ) { return 1; } }); } //function execute_del(){ //myAjax(); //window.location.reload(); //} </script> <button onclick="myAjax();window.location.reload();">delete all notifications</button> <!-- BUTTON CALL PHP FUNCTION --> </li>
that’s all 🙂
So we’re using the “BuddyPress Group Email Subscription” plugin, and are experiencing a bottleneck when members submit a reply to a topic within a BP group. It can take 15-30 seconds for the reply to finish, from the moment of clicking “reply” to page reload.
Looks like this is because the reply doesn’t finish posting until all notification emails are composed and sent. There’s a plugin to solve this for bbpress (AsynCRONous bbPress Subscriptions), but nothing I can find to solve the problem when it’s the BP email sending routine that’s being used.
Does anyone have a solution to eliminate the slow reply issue here? We want to continue using the subscriptions plugin for several other reasons, so eliminating it isn’t the solution we’re looking for.
Thanks for the help.
Plugin we’re using: https://wordpress.org/plugins/buddypress-group-email-subscription/
Other info:
WP version 4.7
PHP version 5.6.28Active Plugins
– p1 Adminimize 1.11.2
– p2 Akismet 3.2
– p3 All In One SEO Pack 2.3.11.1
– p4 bbP Toolkit 1.0.6
– p5 bbPress 2.6-alpha
– p6 Better Notifications for WordPress 1.6
– p7 BP Registration Options 4.3.0
– p8 BuddyPress Group Email Subscription 3.7.0
– p9 BuddyPress Sitewide Activity Widget 1.3.2
– p10 BuddyPress 2.7.3
– p11 Contact Form 7 4.6
– p12 Goodnews Shortcodes editor 1.0
– p13 Google XML Sitemaps 4.0.8
– p14 Header and Footer 2.0.3
– p15 TinyMCE Advanced 4.4.1
– p16 User Role Editor 4.31
– p17 WP-Mail-SMTP 0.10.1
– p18 WP Super Cache 1.4.8Topic: buddypress notifications
i want to know how to redirect all the notification of buddy press for a specific url , not the default url like site.com/memberes/id-user/notification-id/…. because when i click on a specific notification i get only empty page .thks
WP version: 4.6.1
BP version: 2.7.2Hi all. I’m surprised this solution isn’t easy to find as it seems like a lot of people would want to do this, but I guess most themes have it already. I’m trying to integrate BP into a theme that isn’t BP compatible. It works but isn’t styled for it.
I moved the user navigation menu from the admin bar to the header so I could get rid of the admin bar altogether. Everything works except the Profile menu item isn’t showing the sub-menu. All the links are under Settings so I could just remove the Profile item. I just don’t know where the code is. I believe it’s pulling from ‘bp_nav_menu’ but I don’t know which file to tweak. Could you tell me where to look?
Also, the main issue is the styling. I can’t seem to find the CSS code to modify the navigation menu. I’ve been messing with it but a few things I can’t seem to find.
The code I used was from answer #2 on this link. (#1 didn’t seem to work as well.)
The php code was fine but the CSS code was kind of a mess and needs a lot of padding and alignment adjustments. Mainly, could you tell me two things…
1. Where do you add the alignment so the menu items are flush left?
2. Which section is the styling for the individual menu items (Activity/Profile/etc.) in the dropdown? Thought I found it but the code doesn’t seem to be appearing.
I know we’re supposed to post the link to our site but the menu only shows when you’re logged in and I’m still working on it so I prefer not to post it.
Also, I’m not a programmer. I can use Firebug and tweak php code and CSS but I’m still learning a lot of the stuff you guys probably know really well. If I sound stupid, well, in a lot of things I am. 🙂
Thanks for any help.
Hi, I have previously been asked to set my site up so that buddyprerss members’ profiles can not be found by search engines. They want theme to only be accessible by visiting the site. I have put a robots file on my site (see below) but am still getting profiles appearing in searches – please can you tell me if there is anything I need to add to the file. Thanks, Matt.
User-agent: *
Disallow: */activity/p/*
Disallow: /docs/
Disallow: *send-invites*
Disallow: */groups/*members*
Disallow: */groups/*media*
Disallow: *widget-title*
Disallow: *members/*activity*
Disallow: *members/*notifications*
Disallow: *members/*friends*
Disallow: *members/*groups*
Disallow: *members/*docs*
Disallow: *members/*media*
Disallow: *acpage*
Disallow: *messages*
Disallow: *friends*
Disallow: *settings*
Disallow: /*/comment-page*
Disallow: *register*
Disallow: *login*
Disallow: *profile*
Disallow: *admin*
Disallow: *includes*
Disallow: *content*Topic: Automatic Friend Requests
Every time I manually create a new user on my multisite (via the admin interface) the new user instantly gets THREE “friend requests” from existing users. The minute the new user logs in after registration, they already have these three notifications waiting.
I found one thread (3 years old) that describes something similar — but it’s related to the Invite Anyone plugin, the friend request comes from the Group Admin when a user responds to an invitation. I do use the Invite Anyone plugins, so I added this filter:
add_filter( ‘invite_anyone_send_friend_requests_on_acceptance’, ‘__return_false’ );
But it’s not changing anything as far as I can tell. I’m not even sure that the IA plugin is responsible. I’ve logged in as the users who are “sending” these automated friend requests, and I can’t find anything that they can do to force sending a friend request to new users.
Any ideas at all where I should look for the cause?
Hi
I just installed wordpress yaost seo on my website and I got this error message.
The error disapear whit I install buddypress.Could you please help pe to fix it?
Thanks
Warning: call_user_func_array() expects parameter 1 to be a valid callback, function ‘bp_admin’ not found or invalid function name in /homepages/4/s654646546/htdocs/mywebsite/wp-includes/plugin.php on line 524
Notice: bp_setup_current_user was called incorrectly. L’utilisateur actuel est en cours d’initialisation sans utiliser $wp->init() === Trace: #6 /homepages/4/s654646546/htdocs/mywebsite/wp-content/plugins/wordpress-seo/admin/class-yoast-notification-center.php(31): Yoast_Notification_Center->retrieve_notifications_from_storage() #7 /homepages/4/s654646546/htdocs/mywebsite/wp-content/plugins/wordpress-seo/admin/class-yoast-notification-center.php(49): Yoast_Notification_Center->__construct() #8 /homepages/4/s654646546/htdocs/mywebsite/wp-content/plugins/wordpress-seo/wp-seo-main.php(399): Yoast_Notification_Center::get() #9 /homepages/4/s654646546/htdocs/mywebsite/wp-includes/plugin.php(524): load_yoast_notifications(”) #10 /homepages/4/s654646546/htdocs/mywebsite/wp-settings.php(295): do_action(‘plugins_loaded’) #11 /homepages/4/s654646546/htdocs/mywebsite/wp-config.php(100): require_once(‘/homepages/4/d1…’) #12 /homepages/4/s654646546/htdocs/mywebsite/wp-load.php(39): require_once(‘/homepages/4/d in /homepages/4/s654646546/htdocs/mywebsite/wp-includes/functions.php on line 3996s654646546
Topic: Bp custom Menu
I posted up on this a little while ago, and danbp was a boss and helped me out, and I thought I could get it to work, but the end fix ended up unfortunately not really fixing the problem.
I’m having difficulty with a profile tab that is supposed to link to a separate forums profile (wpForo) via a dynamic link that recognizes the displayed user’s page. danbp set me up with something like the below, I changed a bit to make it work better…
function tab_custom_link_to_page() { if ( bp_is_page( 'BP_MEMBERS' ) || bp_is_activity_component() || bp_is_profile_component () || bp_is_groups_component () || bp_is_notifications_component () || bp_is_messages_component () || bp_is_settings_component () || bp_is_following_component () || bp_is_followers_component () ) { $link = bp_get_root_domain() . '/community/profile/'. bp_get_displayed_user_username(); echo '<li><a href="'. $link .'">Community</a></li>'; } } add_action( 'bp_member_options_nav', 'tab_custom_link_to_page', 10 );
but I couldnt change the location of the tab, using code or BuddyBoss Reorder Tabs plugin, which is an issue because the theme I’m using (BuddyBoss Boss.) hides the tabs at the end under a clickable “…”. I spoke to someone at BuddyBoss and they told me I wouldn’t be able to move the tab unless it was registered as a “bp_core_new_nav_item( array(“, which requires an array like:
function add_communityprofile_tab() { global $bp; bp_core_new_nav_item( array( 'name' => 'Community', 'slug' => 'community', 'parent_url' => $bp->displayed_user->domain, 'parent_slug' => $bp->profile->slug, 'position' => 200, 'default_subnav_slug' => 'community' ) ); } add_action( 'bp_setup_nav', 'add_communityprofile_tab', 100 );
which works fine until I have to link it, apparently I can’t use the tab array/slug thing to reach a dynamic link without the same “$bp->displayed_user->domain”. The link I’m trying to reach is currently at:
http://localhost/wordpress/community/profile/*displayeduser*/
from:
http://localhost/wordpress/users/*displayeduser*/
If nobody has any helpful suggestions otherwise, I’m thinking the best route might be to have the page
http://localhost/wordpress/users/*displayeduser*/community/
redirect to
http://localhost/wordpress/community/profile/*displayeduser*/
via a dynamic redirect…I’m trying to figure out how to do that.
If anyone has any helpful advice it would be super appreciated. My boss wants me to take the site live this week and I think I’m just about there…aside from this huge disconnect between the two separate user profiles…not too bad for someone who has barely any idea what they’re doing. but yeah, sorry for the super long post. thanks for reading and hopefully you can throw me a line.
– Andrew
I am going to create a new custom notification for a user that if someone mention the user in any review with @, the related user will get a email and a new notification has been generated, this notification I created dynamically, but I get empty message showing on user profile notification area, I checked the db_table for notification as well it has proper entries as well,
$description = apply_filters_ref_array( 'bp_notifications_get_notifications_for_user', array( $notification->component_action, $notification->item_id, $notification->secondary_item_id, 1, 'string', $notification->component_action, $notification->component_name, $notification->id ) );
In the above line I found that ‘bp_notifications_get_notifications_for_user’ filter return me the empty description of my notification from line no 523 in function “bp_get_the_notification_description” of file buddypress/bp-notifications/bp-notifications-template.php
Below is my custom code for generate notification:
//add new notification mention_in_comment function mention_in_comment_filter_notifications_publish_post_get_registered_components( $component_names = array() ) { // Force $component_names to be an array if ( ! is_array( $component_names ) ) { $component_names = array(); } // Add 'custom' component to registered components array array_push( $component_names, 'mention_in_comment' ); // Return component's with 'custom' appended return $component_names; } add_filter( 'bp_notifications_get_registered_components', 'mention_in_comment_filter_notifications_publish_post_get_registered_components' ); //show new notification text function bp_mention_in_comment_format_buddypress_notifications( $action, $item_id, $secondary_item_id, $total_items, $format = 'string' ) { // New custom notifications if ( 'mention_in_comment_action' === $action ) { $comment_info = get_comment( $item_id ); $author_name = ($comment_info->user_id) ? get_the_author_meta( 'display_name', $comment_info->user_id ) : $comment_info->comment_author; $custom_title = $author_name. ' mentioned you in a new comment on '.get_the_title($comment_info->comment_post_ID); $custom_link = get_comment_link( $comment_info->comment_ID ); $custom_text = $author_name. ' mentioned you in a new comment: <br/>' . $comment_info->comment_content; // WordPress Toolbar if ( 'string' === $format ) { $return = apply_filters( 'mention_in_comment_filter', '' . esc_html( $custom_text ) . '', $custom_text, $custom_link ); // Deprecated BuddyBar } else { $return = apply_filters( 'mention_in_comment_filter', array( 'text' => $custom_text, 'link' => $custom_link ), $custom_link, (int) $total_items, $custom_text, $custom_title ); } //var_dump($return); return "Just say hello."; } } add_filter( 'bp_notifications_get_notifications_for_user', 'bp_mention_in_comment_format_buddypress_notifications', 1, 5 ); //add notification to the mentioned user $notification = bp_notifications_add_notification( array( 'user_id' => $user_id, 'item_id' => $comment->comment_ID, 'secondary_item_id' => $user_id, 'component_name' => 'mention_in_comment', 'component_action' => 'mention_in_comment_action', 'date_notified' => bp_core_current_time(), 'is_new' => 1) );
Could you please let me knwo what is wrong with my code or something else, how can more debug and solve this.
Sorry for the double-post. I can’t close the other…and he’s not rightful.
I actually have this code to display the notifications on header and it works.I just want to know how i can get a “count” condition for the notifications, and if it’s more than 1, that’s change the class “pending-count” to “pending-count-alert”…
Thanks by advance
function my_nav_menu_notif_counter($menu) { if (!is_user_logged_in()) return $menu; else $notif = '<li ><a class="ab-item" href="' . bp_core_get_user_domain(bp_loggedin_user_id() ) . 'notifications/">'. __('').'<span id="ab-pending-notifications" class="pending-count">'. __(''). bp_notifications_get_unread_notification_count( bp_loggedin_user_id() ) .'</span> </a></li>'; $count = !empty( $notif ) ? count( $notif ) : 0; $menu = $menu . $notif; return $menu; } add_filter( 'wp_nav_menu_items', 'my_nav_menu_notif_counter' ); add_filter( 'show_admin_bar', '__return_false' ); ?>