Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'notification user id'

Viewing 25 results - 1 through 25 (of 772 total)
  • Author
    Search Results
  • teslavolt
    Participant

    I checked on the my buddypress’s /activity stream page and I noticed in the page source, there’s something defined:

    
    <script id="bp-nouveau-js-extra">
    var BP_Nouveau = {"ajaxurl":"https:\/\/mysite.com\/wp-admin\/admin-ajax.php","confirm":"Are you sure?","show_x_comments":"Show all %d comments","unsaved_changes":"Your profile has unsaved changes. If you leave the page, the changes will be lost.","object_nav_parent":"#buddypress","objects":{"0":"activity","1":"members","3":"blogs","4":"xprofile","5":"friends","7":"settings","8":"notifications"},"nonces":{"activity":"945da9770f","members":"3c2b470980","blogs":"0a006184ba","xprofile":"56da19c4b1","friends":"a437ee2b51","settings":"ce8e7d03fe","notifications":"ac5a574aa8"},"newest":"Load Newest","pulse":"15","activity":{"params":{"user_id":20,"object":"user","backcompat":{"before_post_form":false,"post_form_options":false},"post_nonce":"a7c93b3f4e","avatar_url":"\/\/www.gravatar.com\/avatar\/c4568b23422db4e779e93c73130989dd?s=50&r=g&d=mm","avatar_width":50,"avatar_height":50,"user_domain":"https:\/\/mysite.com\/members\/pen\/","avatar_alt":"Profile photo of Pen","objects":{"profile":{"text":"Post in: Profile","autocomplete_placeholder":"","priority":5}}},"strings":{"whatsnewPlaceholder":"What's new, Pen?","whatsnewLabel":"Post what's new","whatsnewpostinLabel":"Post in","postUpdateButton":"Post Update","cancelButton":"Cancel"}}};
    

    I can’t find what creates this script / variable.

    #336235
    emaralive
    Moderator

    Unfortunately, you’ve applied a band-aid at the Theme level. The next Theme update will remove your band-aid and you will have to apply it again, given the approach you’ve taken.

    The bp_loggedin_user_domain( ) function should have returned a URL with a trailing slash, for example:

    http://www.url.com/members/username/

    Which is why the Theme has it written as:

    bp_loggedin_user_domain() . $bp->notifications->slug

    Something is causing the trailing slash to be missing, solving for this will be the fix. Maybe a plugin or some custom code is filtering the return value, such that is stripping the trailing slash.

    Assuming you are using BuddyPress 14.3.3, see the following URL for the source code:

    bp_loggedin_user_domain()

    #336103
    emaralive
    Moderator

    Hi @dreampixel,

    Thanks for bringing this to my attention. It looks like some of the notifications are not being deleted when in actuality all should be deleted that are related to the deleted user.

    For example:

    • new_membership_request <- this is what you initially indicated
    • bbp_new_reply <- this what you indicated next
    • new_message <- notification for Private Messages

    The issue is that the function that deletes notifications in the event of a deleted user does not take into account that some notifications have the user_id of deleted user placed in the secondary_item_id column in the bp_notifications`database table.

    Long story shorter, I have a tentative patch that I am testing that will provide a remedy for this bug. I’ll create a ticket for a fix once I’m satisfied with the patch. I’ll keep you updated as to the progress and I’ll try to fit this into the next available release.

    #335944
    vadimfrost09
    Participant

    Hi Luca! It sounds like you’re building a unique feature with delayed visibility for interactions—cool idea! Let me break this down for you and provide some guidance:

    1. User Interactions Visibility Logic
    You’re debating between two strategies:

    Option 1: Posts become visible after X hours.
    Option 2: Posts become visible at the next 8AM local time, but only if it’s X hours after posting.
    Implementation Thoughts
    Database-level flags: Add a visible_from datetime column to your interaction records (e.g., posts, comments, stars). This way, you calculate when they should become visible at the time of creation.

    For Option 1, set visible_from = created_at + X hours.
    For Option 2, calculate visible_from as the next 8AM that occurs at least X hours after created_at.
    Query filtering: Use this visible_from column in your database queries. For example:

    sql
    Копировать код
    SELECT * FROM interactions WHERE visible_from <= NOW();
    This ensures you’re only fetching interactions that should be visible.

    Efficient templating: Instead of adding logic in templates, handle this at the query level. Templating frameworks (e.g., Django, React) should just display what is passed to them, avoiding inefficiency in loops.

    2. Handling Email Notifications
    You want to delay email notifications about interactions while ensuring administrative emails (like password resets) remain instant.

    Approach
    Separate email queues:
    Use a task queue like Celery (Python) or Sidekiq (Ruby) to handle email sending.
    Assign different priorities or queues for email types:
    High priority: Immediate emails (e.g., password resets).
    Delayed priority: Interaction notifications, where tasks are scheduled to run after visible_from.
    Notification scheduler:
    Add logic to enqueue email notifications for interactions only after they become visible.
    For example, enqueue interaction notifications at visible_from time using delayed task execution.
    Example: Scheduling Emails
    If using Python and Celery:

    python
    Копировать код
    from datetime import timedelta
    from celery import shared_task

    @shared_task
    def send_email(user_email, interaction_id):
    # Logic to send the email notification here
    pass

    # Schedule email when an interaction is created
    interaction_time = … # ‘visible_from’ datetime from logic above
    send_email.apply_async(
    (user_email, interaction_id),
    eta=interaction_time
    )
    3. Additional Considerations
    Time zones: If you’re using local time for visibility, store interactions in UTC and calculate visible_from based on the user’s time zone.
    Edge cases: Consider scenarios like users editing their posts or comments. Decide if you want to reset the delay or leave the visibility timing as-is.
    Testing: Ensure thorough testing, especially for time zone conversions and delays, to prevent unintended visibility or email timing issues.
    Summary Workflow
    On post creation:
    Calculate and store visible_from.
    Schedule any delayed notifications for visible_from.
    On content fetch:
    Query only interactions where visible_from <= NOW().
    Use task queues to handle email delays efficiently while prioritizing admin emails.
    Let me know if you’d like examples tailored to your tech stack or further clarifications! 😊
    You can find more info at our FAQ pages.

    #335647
    locker17
    Participant

    Hello,
    I have a follow up question to this old thread:
    https://buddypress.org/support/topic/how-to-get-notification-count-code/

    chatty24 asked “Could that also happen in real time (without refreshing the page)?”.

    I am having the same question. How can I ajaxify “bp_notifications_get_unread_notification_count( $user_id)”?

    Thanks for any help!

    #335389
    GyziieDK
    Participant

    Favorites to me is kinda the same as “liked posts”.. So either would work I guess.
    For now the favorites do work for the most part, but some areas do need an update.

    The “notifications” I’m talking about is on the
    #buddypress div.item-list-tabs.primary-list-tabs & activity-favorites

    – Basically the counter for the “marked as favorites” on the sub-navigation. If a member decides to remove an activity that another member has marked as a favorite the count dosen’t update or accomidate for this. So now the other user is left with an empty list but still a phantom “notification” on the sub navigation.

    The only way I’ve found to “reset” this is to go into the MySQL database itself and clear the meta-data from there in order to actually “reset”/update the counter. The issue is that it’s almost impossible to find the specific “favorite” data and dele only that one.

    Hope it makes sense! 🙂

    Error-065

    Antipole
    Participant

    BuddyPress site-wide notifications work well for me on all platforms except Android.

    On Android the notification is transparent – superimposed over the page and the dismiss button does not work. There is no way to dismiss it.

    Confirmed using
    Wordpress 6.6.2
    Buddypress 14.1.0
    No other plugins except StopEmails and UserSwitching
    Theme: Twenty Tweny-Four

    #334915
    cj74
    Participant

    Hello @pellepedersen

    You aren’t getting notification emails when a new user signs up? Am i understanding it right?

    I have the same setup as you. Discovered yesterday that people signing up are not receiving activation emails. Today i discovered I am not being notified when someone signs up.

    Did you find out why you aren’t getting any emails of a new user signing up. I would have thought that’s the most minimum of an alert which should work without any hiccups.

    #334864
    Renato Alves
    Moderator

    Three things:

    – I can’t replicate the issue you have.
    user_name is not a valid field, btw. It was deprecated.

    Using the followwing payload, I actually get this in BuddyPress 14.0 since you are using + in the user_login, that’s not valid.

    Request Payload.

    
    curl -X POST "https://bp-demo.test/wp-json/buddypress/v1/signup/" \
         -d "context=edit" \
         -d "user_email=pratik@testmail.com" \
         -d "user_login=testthe+request+" \
         -d "password=\"']));L)Q542q8dL3" \
         -d "signup_field_data[0][field_id]=1" \
         -d "signup_field_data[0][value]=testthe+request+" \
         -d "state=gggg" \
         -d "country=AZE" \
         -d "postal_code=444444" \
         -d "mobile_phone=555555555"
    
    
    {
      "code": "bp_rest_signup_validation_failed",
      "data": {
        "status": 500
      },
      "message": "Usernames can contain only letters, numbers, ., -, and @"
    }
    

    Here is the BP configuration I have locally, taken from my local site: https://bp-demo.test/wp-admin/site-health.php?tab=debug

    
    version: 14.0.0
    active_components: Extended Profiles, Settings, Friend Connections, Private Messages, Activity Streams, Notifications, User Groups, Site Directory, Members, Members Invitations
    url_parser: BP Rewrites API
    global_community_visibility: anyone
    template_pack: BuddyPress Nouveau 14.0.0
    ! hide-loggedout-adminbar: Yes
    ! bp-disable-account-deletion: Yes
    ! bp-disable-avatar-uploads: Yes
    ! bp-disable-cover-image-uploads: Yes
    bp-enable-members-invitations: No
    bp-enable-membership-requests: No
    ! bp-disable-profile-sync: Yes
    ! bp_restrict_group_creation: Yes
    ! bp-disable-group-avatar-uploads: Yes
    ! bp-disable-group-cover-image-uploads: Yes
    ! bp-disable-group-activity-deletions: Yes
    ! bp-disable-blogforum-comments: No
    _bp_enable_heartbeat_refresh: Yes
    
    #334662
    unbelievable
    Participant

    I just tested it and it worked here is my site to view it , view it on your desktop i haven’t added the bell to my mobile header yet

    Let me how it goes for you

    function register_bp_notification_bell_block() {
        // Inline JavaScript for the block
        $block_js = "
        (function (wp) {
            var registerBlockType = wp.blocks.registerBlockType;
            var el = wp.element.createElement;
            var withSelect = wp.data.withSelect;
            var __ = wp.i18n.__;
    
            registerBlockType('buddypress/notification-bell', {
                title: __('BuddyPress Notification Bell', 'buddypress'),
                icon: 'bell',
                category: 'widgets',
                edit: withSelect(function (select) {
                    return {
                        userId: select('core').getCurrentUser().id
                    };
                })(function (props) {
                    var userId = props.userId;
                    var unreadCount = 0;
    
                    // Dummy content for editor preview
                    if (!userId) {
                        return el(
                            'div',
                            { className: 'notification-bell' },
                            el('span', { className: 'bell-icon' }, '🔔'),
                            el('span', { className: 'unread-count' }, '0')
                        );
                    }
    
                    // Fetch notifications count
                    wp.apiFetch({ path: '/wp-json/bp/v1/notifications/unread_count/' + userId }).then(function(count) {
                        unreadCount = count;
                        props.setAttributes({ unreadCount: unreadCount });
                    });
    
                    return el(
                        'a',
                        { className: 'notification-bell', href: '/members/' + userId + '/notifications/' },
                        el('span', { className: 'bell-icon' }, '🔔'),
                        unreadCount > 0 && el('span', { className: 'unread-count' }, unreadCount)
                    );
                }),
                save: function () {
                    return null;
                }
            });
        })(window.wp);
        ";
    
        // Enqueue inline script
        wp_add_inline_script('wp-blocks', $block_js);
    
        // Register the block type
        register_block_type('buddypress/notification-bell', array(
            'render_callback' => 'bp_notification_bell_block_render',
        ));
    }
    add_action('init', 'register_bp_notification_bell_block');
    
    function bp_notification_bell_block_render($attributes) {
        if (!is_user_logged_in()) {
            return '';
        }
    
        $user_id = get_current_user_id();
        $unread_count = bp_notifications_get_unread_notification_count($user_id);
        $notifications_url = bp_loggedin_user_domain() . bp_get_notifications_slug() . '/';
    
        ob_start();
        ?>
        <a class="notification-bell" href="<?php echo esc_url($notifications_url); ?>">
            <span class="bell-icon">🔔</span>
            <?php if ($unread_count > 0) : ?>
                <span class="unread-count"><?php echo esc_html($unread_count); ?></span>
            <?php endif; ?>
        </a>
        <style>
            .notification-bell {
                position: relative;
                display: inline-block;
                width: 30px;
                height: 30px;
                text-decoration: none;
            }
            .bell-icon {
                font-size: 24px; /* Adjust the font size as needed */
                line-height: 30px; /* Match the container height */
                display: block;
                text-align: center;
            }
            .unread-count {
                position: absolute;
                top: -5px;
                right: -5px;
                background: red;
                color: white;
                border-radius: 50%;
                padding: 2px 6px;
                font-size: 12px;
            }
        </style>
        <?php
        return ob_get_clean();
    }
    
    add_action('rest_api_init', function() {
        register_rest_route('bp/v1', '/notifications/unread_count/(?P<user_id>\d+)', array(
            'methods' => 'GET',
            'callback' => 'get_bp_unread_notifications_count',
        ));
    });
    
    function get_bp_unread_notifications_count($request) {
        $user_id = $request['user_id'];
        if (!$user_id) {
            return new WP_Error('no_user', 'Invalid user ID', array('status' => 404));
        }
    
        return bp_notifications_get_unread_notification_count($user_id);
    }
    #334518

    In reply to: user engagement

    Venutius
    Moderator

    you could consider adding a chat facility like Wise Chat perhaps?

    Like new posts to user notifications, if there is a lot of blogging.

    Streamline the options you make available to users, complexity often puts people off.

    Kokiri
    Participant

    Hello BuddyPress Support Team / Community,

    I hope this message finds you well. I am writing to request a feature enhancement for our BuddyPress community. We would love to see an option to automatically display when a user uploads or updates their avatar in the activity feed. This feature would significantly enhance user engagement by keeping the community informed of profile updates and encouraging interactions.
    Benefits:

    Increased Visibility: Members can immediately see when someone updates their avatar, promoting profile visits and interactions.
    Enhanced Engagement: Users are more likely to comment or react to avatar changes, fostering a sense of community.
    Streamlined User Experience: Automated updates in the activity feed ensure that members do not miss out on important profile changes.

    Suggested Implementation:

    Avatar Update Trigger: When a user uploads or updates their avatar, a trigger should generate a new activity entry.
    Activity Message: The activity entry could display a message like “User [Username] has updated their avatar.”
    Integration with Existing Feed: The new activity entry should seamlessly integrate with the existing activity feed, appearing in chronological order.

    Customization Options:

    Privacy Settings: Allow users to opt-out of broadcasting their avatar changes if they prefer privacy.
    Activity Message Customization: Option for users to add a custom message along with their avatar update notification.

    We believe this feature would greatly benefit our community and enhance user experience. Thank you for considering our request. We look forward to your response and any potential updates on this feature. We did find a way to block certain activity types from showing up in the activity feed – however we’re looking for a way to add this particular type in our feeds.

    Best regards,

    #334190
    GyziieDK
    Participant

    After some testing this is indeed an issue that needs to be looked into.

    When a user marks something as “favorite” and that post is deleted – the notification is not being deleted with that said post.

    I’ve had to delete the row (usermeta) through my MySQL database before I managed to remove this. Clearing cache or anything like that will not work.

    Where do I report this to be “fixed?”.

    Thanks!

    #334093
    Koka boka
    Participant

    I created a small plugin where users can subscribe to authors, but for some reason users are not notified when the author publishes a new post. Please help to solve this problem. I checked the logs, it shows that the notification was sent, but the notification itself is not there!

    <?php
    /*
    Plugin Name: Author Subscription and Notification
    Description: Allows users to subscribe to authors and receive notifications when authors publish new posts.
    Version: 1.3
    Author: test
    */
    
    // Hook to create the database table upon plugin activation
    register_activation_hook(__FILE__, 'create_subscriptions_table');
    
    function create_subscriptions_table() {
        global $wpdb;
        $table_name = $wpdb->prefix . 'author_subscriptions';
        $charset_collate = $wpdb->get_charset_collate();
    
        $sql = "CREATE TABLE $table_name (
            id bigint(20) NOT NULL AUTO_INCREMENT,
            user_id bigint(20) NOT NULL,
            author_id bigint(20) NOT NULL,
            PRIMARY KEY (id),
            UNIQUE KEY user_author (user_id, author_id)
        ) $charset_collate;";
    
        require_once(ABSPATH . 'wp-admin/includes/upgrade.php');
        dbDelta($sql);
    }
    
    // Hook to add subscription button in the post content
    add_filter('the_content', 'add_author_subscription_button_to_post');
    
    function add_author_subscription_button_to_post($content) {
        if (is_single() && is_user_logged_in()) {
            $author_id = get_the_author_meta('ID');
            $current_user_id = get_current_user_id();
            
            global $wpdb;
            $table_name = $wpdb->prefix . 'author_subscriptions';
    
            // Check if user is already subscribed
            $is_subscribed = $wpdb->get_var($wpdb->prepare(
                "SELECT COUNT(*) FROM $table_name WHERE user_id = %d AND author_id = %d",
                $current_user_id, $author_id
            ));
    
            $button_text = $is_subscribed ? 'Unsubscribe' : 'Subscribe';
            $button_html = '<button id="subscribe-author" class="subscribe-button" data-author-id="' . esc_attr($author_id) . '">' . esc_html($button_text) . '</button>';
            $button_html .= '<div id="subscription-message"></div>';
            
            $content .= $button_html;
        }
        return $content;
    }
    
    // Enqueue the JavaScript file and localize script
    add_action('wp_enqueue_scripts', 'enqueue_subscription_script');
    
    function enqueue_subscription_script() {
        if (is_single() && is_user_logged_in()) {
            wp_enqueue_script('subscription-script', plugin_dir_url(__FILE__) . 'subscription.js', array('jquery'), '1.0', true);
            wp_localize_script('subscription-script', 'subscriptionData', array(
                'ajax_url' => admin_url('admin-ajax.php'),
                'nonce'    => wp_create_nonce('subscription_nonce')
            ));
        }
    }
    
    // Handle the AJAX request for subscription
    add_action('wp_ajax_handle_author_subscription', 'handle_author_subscription');
    
    function handle_author_subscription() {
        check_ajax_referer('subscription_nonce', 'nonce');
    
        if (is_user_logged_in()) {
            global $wpdb;
            $table_name = $wpdb->prefix . 'author_subscriptions';
    
            $current_user_id = get_current_user_id();
            $author_id = intval($_POST['author_id']);
            $operation = sanitize_text_field($_POST['operation']);
            
            if ($operation === 'subscribe') {
                $wpdb->insert($table_name, array(
                    'user_id' => $current_user_id,
                    'author_id' => $author_id
                ));
                wp_send_json_success('Subscribed successfully.');
                error_log("User ID $current_user_id subscribed to author ID $author_id");
            } else if ($operation === 'unsubscribe') {
                $wpdb->delete($table_name, array(
                    'user_id' => $current_user_id,
                    'author_id' => $author_id
                ));
                wp_send_json_success('Unsubscribed successfully.');
                error_log("User ID $current_user_id unsubscribed from author ID $author_id");
            }
        }
        wp_send_json_error('Failed to update subscription.');
    }
    
    // Hook to send notifications when an author publishes a new post
    add_action('publish_post', 'notify_subscribers_on_new_post');
    
    function notify_subscribers_on_new_post($post_id) {
        global $wpdb;
        $table_name = $wpdb->prefix . 'author_subscriptions';
    
        $post = get_post($post_id);
        $author_id = $post->post_author;
    
        error_log("New post published by author ID: " . $author_id);
    
        // Get subscribers
        $subscribers = $wpdb->get_results($wpdb->prepare(
            "SELECT user_id FROM $table_name WHERE author_id = %d",
            $author_id
        ));
    
        error_log("Subscribers found: " . count($subscribers));
    
        foreach ($subscribers as $subscriber) {
            // Send BuddyPress notification
            bp_notifications_add_notification(array(
                'user_id'           => $subscriber->user_id,
                'item_id'           => $post_id,
                'secondary_item_id' => $author_id,
                'component_name'    => 'buddypress',
                'component_action'  => 'new_post_by_subscribed_author',
                'date_notified'     => bp_core_current_time(),
                'is_new'            => true,
            ));
            error_log("Notification sent to user ID: " . $subscriber->user_id);
        }
    }
    
    // Custom notification format
    add_filter('bp_notifications_get_notifications_for_user', 'custom_bp_notification_format', 10, 5);
    
    function custom_bp_notification_format($content, $item_id, $secondary_item_id, $action, $component_name) {
        if ($component_name === 'buddypress' && $action === 'new_post_by_subscribed_author') {
            $author_name = get_the_author_meta('display_name', $secondary_item_id);
            $post_title = get_the_title($item_id);
            $post_url = get_permalink($item_id);
            
            $content = sprintf(__('New post by %s: <a href="%s">%s</a>', 'text-domain'), $author_name, $post_url, $post_title);
        }
        
        return $content;
    }
    ?>
    [23-May-2024 09:42:15 UTC] a:0:{}
    [23-May-2024 09:42:40 UTC] New post published by author ID: 1
    [23-May-2024 09:42:40 UTC] Subscribers found: 2
    [23-May-2024 09:42:40 UTC] Notification sent to user ID: 1
    [23-May-2024 09:42:40 UTC] Notification sent to user ID: 27
    [23-May-2024 09:42:43 UTC] a:0:{}
    Koka boka
    Participant

    I’m trying to create a block with notifications that should be displayed using a shortcode, but for some reason I get one message (Error: Unable to retrieve notification data.) in the place of the notifications themselves. Tell me where did I mess up?
    The code itself:

    <?php
    /*
    Plugin Name: BuddyPress Real-Time Notifications
    Description: 
    Version: 1.0
    Author: 
    */
    
    // JavaScript
    function bprtn_enqueue_scripts() {
        wp_enqueue_script('bprtn-scripts', plugin_dir_url(__FILE__) . 'scripts.js', array('jquery'), null, true);
    }
    
    add_action('wp_enqueue_scripts', 'bprtn_enqueue_scripts');
    
    // CSS
    function bprtn_enqueue_styles() {
        wp_enqueue_style('bprtn-styles', plugin_dir_url(__FILE__) . 'styles.css');
    }
    
    add_action('wp_enqueue_scripts', 'bprtn_enqueue_styles');
    
    // function
    function bprtn_display_notification($notification) {
        if (isset($notification->component_name) && isset($notification->component_action) && isset($notification->item_id)) {
            echo '<div class="bprtn-notification">';
            echo '<p class="bprtn-description">' . bp_the_notification_description($notification->component_action, $notification->item_id) . '</p>';
            echo '<p class="bprtn-date">' . bp_the_notification_time_since($notification->date_notified) . '</p>';
            echo '<div class="bprtn-actions">';
            // buttons
            bp_the_notification_action_links(array('before' => '<div class="bprtn-action">', 'after' => '</div>', 'notification' => $notification));
            echo '</div>';
            echo '</div>';
        } else {
            echo '<p class="bprtn-notification-error">Error: Unable to retrieve notification data.</p>';
        }
    }
    
    // function load notifications
    function bprtn_load_notifications() {
        $user_id = bp_loggedin_user_id();
        $notifications = bp_notifications_get_notifications_for_user($user_id);
    
        if (!empty($notifications)) {
            foreach ($notifications as $notification) {
                bprtn_display_notification($notification);
            }
        } else {
            echo '<p class="bprtn-no-notifications">No new notifications.</p>';
        }
    }
    
    // shortcode
    function bprtn_notifications_shortcode() {
        ob_start();
        bprtn_load_notifications();
        return ob_get_clean();
    }
    
    add_shortcode('bprtn_notifications', 'bprtn_notifications_shortcode');
    
    // AJAX
    function bprtn_mark_as_read() {
        if (isset($_POST['notification_id'])) {
            $notification_id = $_POST['notification_id'];
            bp_notifications_mark_notifications_by_id(array($notification_id), 'read');
        }
        wp_die();
    }
    
    add_action('wp_ajax_bprtn_mark_as_read', 'bprtn_mark_as_read');
    ?>
    #333989
    Koka boka
    Participant

    Hi @imath
    Thanks for the help!
    Maybe you can suggest something with this. I want to add a counter of new posts from the activity feed to the custom menu.
    I put it in functions.php but didn’t get any results. With my meager knowledge, I did not succeed. I can’t figure out how to add a counter to my custom menu.
    P.S I’m not sure that the code itself is workable!

    Here on the forum I was offered the following code:

    <?php
    function bp_update_last_visit() {
    if (is_user_logged_in()) {
    update_user_meta(get_current_user_id(), 'last_visit', current_time('mysql'));
    }
    }
    add_action('wp_login', 'bp_update_last_visit'); 
    add_action('wp', 'bp_update_last_visit'); 
    ?>
    <?php
    function bp_get_new_activity_count() {
    $last_visited = get_user_meta(get_current_user_id(), 'last_visit', true);
    $args = array(
    'action' => 'new_post', // Adjust based on the actions you want to count
    'since' => $last_visited, // Filter activities since the last visit
    );
    
    // Query BuddyPress activity with arguments
    $activities = new BP_Activity_Query($args);
    return $activities->get_total();
    }
    ?>
            <?php
            function add_activity_notification_count() {
    $count = bp_get_new_activity_count();
    if ($count > 0) {
    echo '<span class="activity-notification-count">' . $count . '</span>';
    }
    }
    add_action('bp_menu', 'add_activity_notification_count');
      ?> 
    #333582
    davinian
    Participant

    Hi @venutius, not sure if I am missing something, but it doesn’t appear to work – in-fact when enabled and user role is selected the User no only doesn’t receive an email but the notification in BP stops working.

    I might look at using a 3rd party registration plugin like Paid Memberships Pro.

    #333581
    jgasba
    Participant

    For the posterity: the Codex was not very clear for newer user: the Settings > Email mentionned is in the public user profile settings, and only available if you have the “Notifications” component enabled.

    It does not allow to define the default values for the users settings. Each user can customize their own themselves.

    If I’m not mistaken to customize the “default” you can use this code:

    
    add_action( 'bp_core_activated_user', 'wps_set_email_notifications_preference');
      
    function wps_set_email_notifications_preference( $user_id ) {
     
        $settings = array(
            'notification_activity_new_mention'         => 'yes',
            'notification_activity_new_reply'           => 'yes',
            'notification_friends_friendship_accepted'  => 'yes',
            'notification_friends_friendship_request'   => 'yes',
            'notification_groups_admin_promotion'       => 'yes',
            'notification_groups_group_updated'         => 'yes',
            'notification_groups_invite'                => 'yes',
            'notification_groups_membership_request'    => 'yes',
            'notification_messages_new_message'         => 'yes',
        );
      
        foreach( $settings as $setting => $preference ) {
            bp_update_user_meta( $user_id,  $setting, $preference );
        }
    }
    
    #333369
    wingflap
    Participant

    When I create a group and set it to hidden, it is not visible to me as admin (or any other user whether they’re members of the group or not.

    To test, I created a fresh WordPress install, installed the BuddyX (free) theme, then BuddyPress, bbPress, and finally BP Classic plugin. I’m logged in as admin. I created a user called sub1 who is a subscriber.

    I created a group called Normal which is set up as a public group. Then I created a second group called Private which is set up as private. Then I set up a group called Hidden which is set to hidden. When creating each group, I sent an invite to user Sub1.

    When I go to the Groups page (/groups), I see the group count as 3. I see the group Normal which I can click into and view group info, and the group Private which I can click into and see group info (since I’m logged in as admin who created the group). I do not see the group Hidden. But on the bottom it says “Viewing 1 – 3 of 3 groups” even though I can only see 2.

    If I log out, I can see the group Normal and click into it and see group info. I can see the group Private and click into it, but see a message saying that this is a private group. No group Hidden when logged out (as expected) and on the bottom it says “Viewing 1 – 2 of 2 groups”.

    If I log in as user Sub1, I only see 2 groups but “Viewing 1 – 3 of 3 groups”. The group Private says I have to be a member of the group to see anything. Then I accept the invite to group Private. Then I can see everything in the group. I don’t see the group Hidden. In my notifications, I click on the invitation to group Hidden and nothing happens.

    I tried and succeeded to reproduce this in a vanilla environment. Any help would be appreciated.

    Thanks.

    #333300
    thinlizzie
    Participant

    Hi dvalken

    Just to add info:

    This issue has also been on my site for four years.
    Only affects Android devices, not iPhone or pc/laptop.

    When the buddypress drop-down items in the admin bar are clicked (top-right on screen) , for example Activity, Profile, Notifications, Messages, then the first sub-menu item is automatically selected and clicked without any user action. The user is unable to select the second or third sub-menu item.

    Default WordPress Twenty Sixteen Theme.
    Buddypress 10.6.1

    #333206
    eluyawi
    Participant

    I have a problem with the notifications page, because when you are in the user’s profile, and you want to see your notifications, the page is not shown, a page error appears, because it does not exist.

    https://tudominio.com/miembros/horacios/notifications/
    BuddyPress Versión 12.2.0

    I don’t have any idea how fix it.

    #333045
    Mathieu Viet
    Moderator

    Hi @gomle

    Thanks a lot for your feedback. About Notifications, I believe using the Notification Web API can improve your “pulling the user to the site” need.

    Hi @oumz99

    I agree we should look into import/export. To comply with GDPR, users can export the data they created on the site from their profile settings. But a more global tool would be great to easily develop BuddyPress themes or move community generated content to another site.
    See & contribute to it there: https://buddypress.trac.wordpress.org/ticket/1058

    Hi @bclaim

    So do I! I totally agree with you. We need to rethink the Private Messages component/feature with the goal:
    1. to make it a chat like system for member(s) to member(s) discussions as well as between group members discussions. What are channels in Slack could be groups in BuddyPress Private Messages. I’m looking carefully to the Block Editor live collaboration system as it may help us to reach this goal.
    2. to move the Community wide notice feature outside of it.


    @priyam1234

    It should be the case. So it’s not an evolution to me but more a bug. I’ll look into it.

    @everyone:
    I’ll make sure to talk about it with other members of the BP Core Developers team during our next development meeting.

    Here’s my 2 main wishes for 14.0.0:
    – Review our different registration flows and allow Administrators to easily disable these BuddyPress registration flows.
    – Build new BP Blocks along with a new BP Blocks only Theme to start using the WP Site Editor to customize our community area.

    #332751
    raoof12323
    Participant

    Hi drstrats,

    Greetings! I understand the challenge you’re facing with BuddyPress email notifications ending up in the spam folder. To resolve this issue, follow these steps:

    1. BuddyPress SMTP Settings:
    Ensure that BuddyPress is configured to use SMTP for sending emails. Navigate to the BuddyPress settings, and look for the email configuration section. You might find options to input SMTP details like server, port, username, and password. Set these up according to your email provider’s specifications.

    2. WP Mail SMTP Plugin:
    It’s great that you’ve installed the WP Mail SMTP plugin. To make sure it integrates with BuddyPress, go to the WP Mail SMTP settings. You’ll find an option to enable SMTP for BuddyPress emails. Ensure it’s checked, and save the settings.

    3. Testing:
    After configuring the above settings, send a test email through BuddyPress. Check the spam folder and see if the issue persists. Sometimes, it might take a little time for the changes to take effect.

    If the problem continues, consider reaching out to your hosting provider to verify if there are any server-specific configurations affecting email delivery.

    On a lighter note, when it comes to making moments special, have you ever considered expressing yourself with flowers? Explore the offerings from the best flower shops in McAllen, TX. Their delightful arrangements might just be the perfect touch for any occasion.

    Wishing you success in resolving the SMTP matter, and may your BuddyPress notifications reach their recipients seamlessly.

    Best regards,

    [raoof]
    Best Flower Shops in McAllen, TX

Viewing 25 results - 1 through 25 (of 772 total)
Skip to toolbar