Search Results for 'notification user id'
-
Search Results
-
Hi Everyone !
One year ago, i try to put the notifications of the Buddypress bar into my header.
And, thanks to the members of this forum, it works succesfully.
I have now a new item on my menu, and it’s a count of the notifications.But i want to see immediatly when there is a new notification !
I would like to change the color of the notification bubble only when there is a new (ou more) notification !
Can you help me ? :/There is my actual php code, on the bp-custom.php
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 alert">'. __(''). bp_notifications_get_unread_notification_count( bp_loggedin_user_id() ) .'</span> </a></li>'; $menu = $menu . $notif; return $menu; } add_filter( 'wp_nav_menu_items', 'my_nav_menu_notif_counter' ); add_filter( 'show_admin_bar', '__return_false' );
Sorry if my english is bad, i’m french
I have bad knowledges in Php, but i can try to understand the codeWP 4.4.5
BP 2.6.2Hi all
Im very new to this WordPress and right now I need help with BuddyPress, since I cannot find anything comprehensible on the net.
I am creating a dating website and what I want to do is:
1. On the homepage, have a registration form for non users AND a log in section for members.
See example like Facebook.com. It is important that there is space for images next to the registration form.2. New users can look around the site, but they cannot make contact with other members until they have validated their email account. Is it possible to show a notification/reminder on every page they visit?
Im grateful for any help ( but please have patience with me, Im not used to computers! )
BR, PositivaMussar
I am sending to notification to multiple users with following code
bp_notifications_add_notification( array( 'user_id' => 3,1, 'item_id' =>$postid, 'component_name' => 'Event2', 'component_action' => 'custom_action', 'date_notified' => bp_core_current_time(), 'is_new' => 1, ) );
but notification is only send to first user id 3. How I will send the notification to multiple user id. Please help
I installed https://wordpress.org/plugins/postman-smtp/ on my WP (v 4.6) + BuddyPress (v 2.6.2) site, then configured it to use my Gmail account’s SMTP server settings.
The emails sent by the site uses the SMTP settings when:
– A member registers and PMPRo (https://tl.wordpress.org/plugins/paid-memberships-pro/) sends out an email confirmation
– Emails sent using the plugin (https://wordpress.org/plugins/email-users/)(I can see these sent emails in the “Sent” folder of my Gmail account.)
However, when BuddyPress sends out an email (e.g. email notification for friend request, etc.), it seems to ignore the SMTP server settings I have configured. Instead, it uses the server’s default.
How do I make BuddyPress email notifications send using my Gmail SMTP server settings?
I was able to create my custom email notification. I would like to add an option in the settings so that user can enable/disable this email notification. Has anyone successfully implemented like this before? Any ideas on how to do this?
My theme does not support notification alert so i used this code to show the notification count:
<?php echo bp_notifications_get_unread_notification_count(bp_loggedin_user_id()); ?>But it is not clickable, can someone please help me with the link that i can paste inside the
a href = ” ” <?php echo bp_notifications_get_unread_notification_count(bp_loggedin_user_id()); ?> /aso that it can redirect them to their notification page slug ?
currently it http://www.example.comh/members/rvnamb/notifications/
how can i replace rvnamb with the currently logged in user id ? i searched a lot but could not find a solution
Hi guys, I created a custom notification that is added when an user receive a like on a custom post type.
All good unitl now, but I noticed that if the post receive 2 likes, from 2 different users, the user receive only the first notification and not the second one.
Any help would be really appreciated.
//Component declaration if(!function_exists('my_custom_register_wiki_notification')) { function my_custom_register_wiki_notification() { // Register component manually into buddypress() singleton buddypress()->my_custom_wiki = new stdClass; // Add notification callback function buddypress()->my_custom_wiki->notification_callback = 'my_custom_wiki_like_format_notifications'; // Now register components into active components array buddypress()->active_components['my_custom_wiki'] = 1; } }; //Notification format declaration if(!function_exists('my_custom_wiki_like_format_notifications')) { function my_custom_wiki_like_format_notifications( $action, $item_id, $secondary_item_id, $total_items, $format = 'string' ) { // New custom notifications if ( 'my_custom_wiki_like' === $action ) { $wiki_post = get_post( $item_id ); $post_title = get_the_title( $item_id ); $custom_title = sprintf( esc_html__( 'Your post "%1$s" received a like', 'my_custom' ), $post_title ); $custom_text = sprintf( esc_html__( 'Your post "%1$s" received a like', 'my_custom' ), $post_title ); $custom_link = get_permalink( $item_id ); // WordPress Toolbar if ( 'string' === $format ) { $return = apply_filters( 'my_custom_wiki_like_format', '<a href="' . esc_url( $custom_link ) . '" title="' . esc_attr( $custom_title ) . '">' . esc_html( $custom_text ) . '</a>', $custom_text, $custom_link ); // Deprecated BuddyBar } else { $return = apply_filters( 'my_custom_wiki_like_format', array( 'text' => $custom_text, 'link' => $custom_link ), $custom_link, (int) $total_items, $custom_text, $custom_title ); } return $return; } return $action; } } //Function that add the notification when like is triggered function my_custom_add_like() { //... //... if(my_custom_is_wiki_like_notification_enabled()) { bp_notifications_add_notification( array( 'user_id' => $post_object->post_author, 'item_id' => $post_id, 'secondary_item_id' => get_current_user_id(), 'component_name' => 'my_custom_wiki', 'component_action' => 'my_custom_wiki_like', 'date_notified' => bp_core_current_time(), 'is_new' => 1, ) ); } }
Hi,
I’m working on a wordpress website, and using Buddypress. I wanted to add posts notifications and it worked fine, except when I tried to filter them. First you need to know how I want to filter them.
– I’ve a profile field named ‘Field’ which is a dropdown list with 5 options.
– I have also 5 post categories with the exact names of the ‘Field’ values.
– When a post is added, If it has (e.g. A,B,C) categories I want a notification for every user who has his ‘Field’ value is equal to A,B or C.Here is my code:
foreach (users as $user) {
$acc_type = xprofile_get_field_data(‘Field’, $user->ID);
if (in_category($acc_type,$post_id)) {
bp_notifications_add_notification( array(
‘user_id’ => $user->ID,
‘item_id’ => $post_id,
‘component_name’ => ‘custom’,
‘component_action’ => ‘custom_action’,
‘date_notified’ => bp_core_current_time(),
‘is_new’ => 1,
) );
}}
Hey Guys β
I have a project where its a social community site where all the members create the site content on their own. I have 2 profiles(roles) that all users will fall under (employer & employee). Then I have 3 membership levels for each role (FREE, Standard & Premium). The idea is to pair up these users by category and control the level of access/features they have based on account type. So direct messaging is available only to premium members, push notifications only available to premium members. The more features and ability to build out your profile is based on your membership type. I would obviously add membership plugin to restrict access and capability as well as ecommerce capability for checkout.
I know bbPress and BuddyPress are forums and social communities but will they integrate well into membership type communities where clients need to pay for additional access to social community and forum features?
If not, is there a premium application that handles these types of projects?
Thanks so much!
I have custom plugin in which i have review approved and delete functions so when i do some sort of bulk action like delete or i approved a review.
i want to generate a bp custom notifications at that user dashboard or member page which review was approved or deleted
i place this where i perform approved action
do_action('review-approved');
Then i make function below
function bp_review_add_notification() {
if ( bp_is_active( 'notifications' ) ) {
bp_notifications_add_notification( array(
'user_id' => 1, // this is one because for testing just admin now
'component_name' => 'review',
'component_action' => 'review_approved',
'date_notified' => bp_core_current_time(),
'is_new' => 1,
) );
}
}
add_action( 'review-approved', 'bp_review_add_notification',10,5);
Review is added in database i checked that but it is not shown on dashboard or member page
how to do thator can you refer any complete guide to create a custom notification upon some action
I created many custom notifications on my theme, such as notification on post comments, but after a post is commented and the notification is sent, the listing of posts and of other custom post types display a 404 page.
This happens only on the listing page of posts, not on the single post pages.
I really hope in an help.
This is my code: