Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'notification user id'

Viewing 25 results - 501 through 525 (of 1,091 total)
  • Author
    Search Results
  • #229954
    @mercime
    Participant

    @hypnoscribe @milenushka @style960 default notifications are posted at https://codex.buddypress.org/member-guide/notifications/ set up in your Profile Settings > Notifications panel. If the feature you need is not available, do create a ticket in BP Trac. Log in using your WP username and password.

    #229904
    miama
    Participant

    and this:

    <?php
    
    /**
    * BuddyPress – Users Notifications
    *
    * @package BuddyPress
    * @subpackage bp-legacy
    */
    
    ?>
    
    <div class=”item-list-tabs no-ajax” id=”subnav” role=”navigation”>
    
        <?php bp_get_options_nav(); ?>
    
        <li id=”forums-order-select” class=”last filter”>
        <?php bp_notifications_sort_order_form(); ?>
    
    </div>
    
    <?php
    switch ( bp_current_action() ) :
    
    // Unread
    case ‘unread’ :
    bp_get_template_part( ‘members/single/notifications/unread’ );
    break;
    
    // Read
    case ‘read’ :
    bp_get_template_part( ‘members/single/notifications/read’ );
    break;
    
    // Any other
    default :
    bp_get_template_part( ‘members/single/plugins’ );
    break;
    endswitch;
    #229903
    miama
    Participant
    
    
    <?php
    
    /**
    * BuddyPress – Users Home
    *
    * @package BuddyPress
    * @subpackage bp-default
    */
    
    //get theme options
    global $oswc_bp;
    
    //set theme options
    $oswc_bp_sidebar_unique = $oswc_bp[‘bp_sidebar_unique’];
    $oswc_bp_members_sidebar_unique = $oswc_bp[‘bp_members_sidebar_unique’];
    
    //setup variables
    $sidebar=”Default Sidebar”;
    if($oswc_bp_sidebar_unique) { $sidebar=”BuddyPress Default Sidebar”; }
    if($oswc_bp_members_sidebar_unique) { $sidebar=”BuddyPress Members Sidebar”; }
    
    get_header( ‘buddypress’ ); ?>
    
    <div class=”main-content-left”>
    
    <div class=”page-content” id=”content”>
    
    <?php do_action( ‘bp_before_member_home_content’ ); ?>
    
    <div id=”item-header” role=”complementary”>
    
    <?php locate_template( array( ‘members/single/member-header.php’ ), true ); ?>
    
    </div><!– #item-header –>
    
    <div id=”item-nav”>
    <div class=”item-list-tabs no-ajax” id=”object-nav” role=”navigation”>
    
        <?php bp_get_displayed_user_nav(); ?>
    
        <?php do_action( ‘bp_member_options_nav’ ); ?>
    
    </div>
    </div><!– #item-nav –>
    
    <div id=”item-body”>
    
    <?php do_action( ‘bp_before_member_body’ );
    
    if ( bp_is_user_activity() || !bp_current_component() ) :
    locate_template( array( ‘members/single/activity.php’ ), true );
    
    elseif ( bp_is_user_blogs() ) :
    locate_template( array( ‘members/single/blogs.php’ ), true );
    
    elseif ( bp_is_user_friends() ) :
    locate_template( array( ‘members/single/friends.php’ ), true );
    
    elseif ( bp_is_user_groups() ) :
    locate_template( array( ‘members/single/groups.php’ ), true );
    
    elseif ( bp_is_user_messages() ) :
    locate_template( array( ‘members/single/messages.php’ ), true );
    
    elseif ( bp_is_user_profile() ) :
    locate_template( array( ‘members/single/profile.php’ ), true );
    
    elseif ( bp_is_user_forums() ) :
    locate_template( array( ‘members/single/forums.php’ ), true );
    
    elseif ( bp_is_user_settings() ) :
    locate_template( array( ‘members/single/settings.php’ ), true );
    
    elseif ( bp_is_user_notifications() ) :
    locate_template( array( ‘members/single/notifications.php’ ), true );
    // If nothing sticks, load a generic template
    else :
    locate_template( array( ‘members/single/plugins.php’ ), true );
    
    endif;
    
    do_action( ‘bp_after_member_body’ ); ?>
    
    </div><!– #item-body –>
    
    <?php do_action( ‘bp_after_member_home_content’ ); ?>
    
    </div>
    
    </div>
    
    <div class=”sidebar”>
    
    <?php if ( function_exists(‘dynamic_sidebar’) && dynamic_sidebar($sidebar) ) : else : ?>
    
    <div class=”widget-wrapper”>
    
    <div class=”widget”>
    
    <div class=”section-wrapper”><div class=”section”>
    
    <?php _e(‘ Made Magazine ‘, ‘made’ ); ?>
    
    </div></div>
    
    <div class=”textwidget”>
    
    <p><?php _e( ‘This is a widget panel. To remove this text, login to your WordPress admin panel and go to Appearance >> Widgets, and drag & drop a widget into the corresponding widget panel.’, ‘made’ ); ?></p>
    
    </div>
    
    </div>
    thats what I did:
    </div>
    
    <?php endif; ?>
    
    </div>
    
    <br class=”clearer” />
    
    <?php get_footer( ‘buddypress’ ); ?>
    
    #229862
    Brent Havill
    Participant

    Hi Henry

    I went to ‘plugins’/buddypress/settings, and found the following (I note that “account settings” is not ticked – could this be it?)
    I have bolded the ones that are ticked currently.

    Settings:

    Component Description
    Component Description
    Extended Profiles Customize your community with fully editable profile fields that allow your users to describe themselves.
    Account Settings Allow your users to modify their account and notification settings directly from within their profiles.
    Friend Connections Let your users make connections so they can track the activity of others and focus on the people they care about the most.
    Private Messaging Allow your users to talk to each other directly and in private. Not just limited to one-on-one discussions, messages can be sent between any number of members.
    Activity Streams Global, personal, and group activity streams with threaded commenting, direct posting, favoriting, and @mentions, all with full RSS feed and email notification support.
    Notifications Notify members of relevant activity with a toolbar bubble and/or via email, and allow them to customize their notification settings.
    User Groups Groups allow your users to organize themselves into specific public, private or hidden sections with separate activity streams and member listings.
    Site Tracking Record activity for new posts and comments from your site.
    BuddyPress Core It‘s what makes time travel BuddyPress possible!
    Community Members Everything in a BuddyPress community revolves around its members.

    #229209
    Security
    Participant

    Hi i think i know whats happening here i was working on status theme to make it work with the latest versions of both buddypress and wordpress and i faced the similar issue so this is what i did to resolve it goto wp-content>>themes>>yourthemename>>members folder>>single>>home.php and add these lines of code there

    elseif ( bp_is_user_notifications() ) :
    					locate_template( array( 'members/single/notifications.php' ), true );	
    

    just before this kinda statement // If nothing sticks, load a generic template
    next create a file named notifications.php in wp-content>>themes>>yourthemename>>members folder>>single folder and add these lines to it

    <?php
    
    /**
     * BuddyPress - Users Notifications
     *
     * @package BuddyPress
     * @subpackage bp-legacy
     */
    
    ?>
    
    <div class="item-list-tabs no-ajax" id="subnav" role="navigation">
    	<ul>
    		<?php bp_get_options_nav(); ?>
    
    		<li id="forums-order-select" class="last filter">
    			<?php bp_notifications_sort_order_form(); ?>
    		</li>
    	</ul>
    </div>
    
    <?php
    switch ( bp_current_action() ) :
    
    	// Unread
    	case 'unread' :
    		bp_get_template_part( 'members/single/notifications/unread' );
    		break;
    
    	// Read
    	case 'read' :
    		bp_get_template_part( 'members/single/notifications/read' );
    		break;
    
    	// Any other
    	default :
    		bp_get_template_part( 'members/single/plugins' );
    		break;
    endswitch;

    and try to reload your site now your problem should be solved.
    Note: only create notifications.php if its not already there and please backup your site before making these changes

    #228859
    mcpeanut
    Participant

    Hi, something i am a little stuck on with this, I would like to show the users Avatars in the notifications received via the notification bubble rather than just have the text, I cannot seem to find much about how i would do this after searching the net for answers, Can anyone point me in the right direction on how to do this?

    I believe i would have to echo the avatar from user id :

    echo bp_activity_avatar( array( ‘user_id’ => $user_id ) );

    something like this maybe within the notification loop?

    thx in advance.

    #228794
    mcpeanut
    Participant

    @sbaglia i really dont have a clue about this but ive just noticed a recent update on a plugin that adds seperate social networking functions to wordpress that i have been watching for a while, now the idea i had a while ago was wondering if this plugin could infact be ran alongside buddypress just for the comment notifications within wordpress, meaning i was wondering if all other notifications and workings of this other plugin could be disabled and used just for this one specific task, this way users would have a seperate notification system for blog and custom post comments, i really dont know as i have not messed around with them together but i know that this plugin does achieve what we want but seperately to buddypress, maybee you want to have a mess with the idea i had? i just dont have time at the minute and dont know if it will work well with buddypress running too, the plugin is here https://wordpress.org/plugins/wp-notifications/

    #228023

    In reply to: Live Notifications

    Paul Bursnall
    Participant

    Hi @henrywright

    Thanks for the quick reply. I’ll put a request in on Trac shortly. At present, I’m probably going to be forced into using my second choice as a theme just to have these feature. From a regular users point of view, I find it unlikely they’ll even bother to acknowledge new email notifications, whereas live web notifications are standard, even expected in other widely used applications, both personal and workplace.

    Thanks for your help.

    crina27
    Participant

    I created a plugin that allows the members in a group to have a video chat. When the admin starts the chat a notification is send to all the group members.
    The notifications are saved in the database but are not displayed in the notifications page.
    This is the function that sets up the global variables for the plugin:

    function bp_group_videochat_setup_globals() {
    global $bp, $wpdb;

    /* For internal identification */
    $bp->videochat=new BP_Group_videochat();
    $bp->videochat->id = ‘videochat’;

    $bp->videochat->table_name = $wpdb->base_prefix . ‘bp_group_videochat’;
    $bp->videochat->notification_callback=’bp_group_videochat_format_notifications’;
    $bp->videochat->slug = BP_GROUP_videochat_SLUG; //video-chat

    /* Register this in the active components array */
    $bp->active_components[$bp->videochat->slug] =’1′;
    do_action( ‘bp_group_videochat_setup_globals’ );
    }
    add_action( ‘bp_setup_globals’, ‘bp_group_videochat_setup_globals’ );

    And this is the format notifications function:

    function bp_group_videochat_format_notifications( $action, $item_id, $secondary_item_id, $total_items) {
    global $bp;
    switch ( $action ) {
    case ‘new_video_chat’:
    $group_id = $secondary_item_id;

    $group = new BP_Groups_Group( $group_id );
    $group_link = bp_get_group_permalink( $group );

    $groupSlug=groups_get_slug( $secondary_item_id);
    $url=home_url( $bp->groups->slug . ‘/’ .$groupSlug . ‘/group-chat’ );
    return ‘‘ . sprintf( __( ‘%s group broadcast invite!’, ‘video-chat’ ), $groupSlug ) . ‘‘;
    break;
    }
    do_action( ‘bp_group_videochat_format_notifications’);
    return false;

    }

    To create the notifications I use the bp_notifications_add_notification function:

    bp_notifications_add_notification( array(
    ‘user_id’ => $user,
    ‘item_id’ => rand(),
    ‘secondary_item_id’ => $bp->groups->current_group->id,
    ‘component_name’ => ‘video-chat’,
    ‘component_action’ => ‘new_video_chat’,
    ‘date_notified’ => bp_core_current_time(),
    ‘is_new’ => 1,
    ) );

    Is there anyone here that could help me? Should it work in theory?

    crina27
    Participant

    I created a plugin that allows the members in a group to have a video chat. When the admin starts the chat a notification is send to all the group members:

    
    bp_notifications_add_notification( array(
    'user_id'=> $value,
    'item_id'=> rand(),
    'secondary_item_id' => $bp->groups->current_group->id,
    'component_name'=> 'chat',
    'component_action'=> 'new_group_chat',
    'date_notified'=> bp_core_current_time(),
    'is_new' => 1,
    ) );

    The notifications are saved in the database but are not displayed in the notifications page.
    This is the function that sets up the global variables for the plugin:

    function bp_group_chat_setup_globals() {
    global $bp, $wpdb;
    
    /* For internal identification */
    $bp->chat->id = 'chat';
    
    $bp->chat->table_name = $wpdb->base_prefix . 'bp_group_chat';
    $bp->chat->notification_callback='bp_group_chat_format_notifications';
    $bp->chat->slug = BP_GROUP_chat_SLUG;
    
    /* Register this in the active components array */
    $bp->active_components[$bp->chat->slug] = $bp->chat->id;
    do_action( 'bp_group_chat_setup_globals' );
    }
    add_action( 'bp_setup_globals', 'bp_group_chat_setup_globals' );

    And this is the notifications format function:

    function bp_group_chat_format_notifications( $action, $item_id, $secondary_item_id, $total_items) {
    global $bp;
    switch ( $action ) {
    case 'new_group_chat':
    
    $group_id = $secondary_item_id;
    $group_link = bp_get_group_permalink( $group );
    $groupSlug=groups_get_slug( $secondary_item_id);
    $url=home_url( $bp->groups->slug . '/' .$groupSlug . '/' . 'group-chat' );
    
    if ( (int)$total_items > 1 ){
    return apply_filters('log_multiple_verifications_notification','' . sprintf( __( '%s group broadcast invite!', 'chat' ), $groupSlug ) . '',$total_items);
    }
    else{
    return apply_filters('log_single_verifications_notification','' . sprintf( __( '%s group broadcast invite!', 'chat' ), $groupSlug ) . '',$total_items);
    }
    break;
    }
    do_action( 'bp_group_chat_format_notifications', $action, $item_id, $secondary_item_id, $total_items );
    return false;
    }

    Any suggestions?

    #221393
    rudik123
    Participant

    Hi,
    I am looking for solutions to How to automatic scroll down page when i click for example “groups” or “notifications” or “frends”.
    I found this topic https://buddypress.org/support/topic/scroll-down-user-profile-page/ but i don’t know where i must paste this <div id='anchor'>whatever</div> code.
    I would like to when user click “groups” and then go to for example “notifications” he will be see your notifications at the top.

    He must scrool down page to see his notifications, groups, friends etc.

    Please help.
    Sorry for my english.

    #216041
    bjusters
    Participant

    In my budypress install (wp4.0, buddypress 2.1.1) a new reply message on the member notifications page is shown with an kader lid van fr_regiomanager” (yep dutch)

    Of course i don’t want the user link href to show up like this, it shouldn’t show the nested user link or the one around it. Any ideas on how i can fix this? i tried to disable the translation as well but no luck. i’ts part of the bbp_format_buddypress_notifications function by the way.

    hope someone has an idea, looks ugly 🙁

    #214084
    MuseMusic
    Participant

    Hello All,

    I’m looking to create a BuddyPress site that allows users to share youtube videos. My wish list of the features I would like to create are as follows:

    • Custom post type for adding a video (video post type).
    • Create a page containing a loop filtered for displaying each video post.
    • Create an entry in the activity stream alerting that a new video has been posted.
    • Create a notification that alerts users if their friends adds a video.

    I am pretty clear on how to create a custom post type and then create a filtered loop to display the custom posts. I’m not so sure about adding an entry to the activity stream and creating an alert for the users’ friends. Would anyone be able to give me some advice on how to achieve this?

    Cheers!

    Henry Wright
    Moderator

    Try this function:

    function bp_set_notification_default( $user_id ) {
        $keys = array( 'notification_activity_new_mention', 'notification_activity_new_reply', 'notification_friends_friendship_accepted', 'notification_friends_friendship_request', 'notification_groups_admin_promotion', 'notification_groups_group_updated', 'notification_groups_invite', 'notification_groups_membership_request', 'notification_messages_new_message', 'notification_messages_new_notice' );
    
        foreach ( $keys as $key ) {
            update_user_meta( $user_id, $key, 'no' );
        }
    }
    add_action( 'bp_core_signup_user', 'bp_set_notification_default', 100, 1 );

    Ref: http://premium.wpmudev.org/forums/topic/how-can-i-disable-buddypress-notification-email

    Halo Diehard
    Participant

    Yeah, I still will get the odd mention from old posts, have absolutely no idea what triggers them. And now that I’ve changed my display name recently, it will even occasionally send me ones where I’ve included myself in a quote, before the username change! It’s weird.

    The good news is it slows down! ;D The bad news is before it does it can drive your members to turn off their notifications, and if your server can’t handle it the process can crash your server.

    Does that code only stop old notifications, or does it stop all, or what?

    Shawn74
    Participant

    Hello, i’m using the latest BP release with the latest WP release but unfortunately some counters does not working correctly for me. Here a picture:

    no-count error

    Here the direct site:

    There is one group created, and the counter for groups is not showing 1 but count, reverse other counters does not show correctly the zero numeber (show no-count)

    I recently disabled with code the “Register” page, the one of BP, and also installed a registration anti-spam software.

    Already tried myself to change the original code i found: bp_get_total_group_count_for_user() with the only one is working for me (notifications): bp_get_total_group_count_for_user( bp_loggedin_user_id() )

    But this does not work. A little help should be creately appreciated… Stefano

    #197925
    Stevn204
    Participant

    i manipulated the selector for albums and now user are available to upload pictures to any album_id they want but now i always get a error notification.

    I think that buddypress check wheater the album exist or not. How can i switch this off?

    #192886
    #191887
    geistschatten
    Participant

    Alright, so I’m almost ripping out my hair over this. I’ve checked other threads on here, I’ve put the .po and .mo files in multiple directories (wp-content/languages, theme/languages, bp-languages), I’ve added the bp-custom file, tried to change the language with wp-config, and even selected the language from Settings->General.

    All I’m trying to do is change some of the words talking about friends to something else. I’m not using a BuddyPress theme, it’s the Duena theme (https://wordpress.org/themes/duena).

    I took the .pot file and edited it with a text editor for Ubuntu called gedit, then I saved it as .mo & .po files and named them accordingly. I’ve triple checked every other fix to the issue for the past few days and have had zero success.

    Since this is supposed to help, here is my info below. Any help is greatly appreciated! I just need a simple step-by-step of what to do for my versions of WP and BP, I can follow them to the letter, and then report what happens.

    1. Which version of WordPress are you running? 4.0

    2. Did you install WordPress as a directory or subdomain install? Directory.

    3. If a directory install, is it in root or in a subdirectory? Root.

    4. Did you upgrade from a previous version of WordPress? If so, from which version? The previous version, but was having the issue prior to the upgrade.

    5. Was WordPress functioning properly before installing/upgrading BuddyPress (BP)? e.g. permalinks, creating a new post, commenting. Yes, everything works perfect, I just need certain words like “Friends” changed to something else.

    6. Which version of BP are you running? 2.0.2

    7. Did you upgraded from a previous version of BP? If so, from which version? The previous one, had this issue prior to the upgrade.

    8. Do you have any plugins other than BuddyPress installed and activated? If so, which ones? (BuddyDev)BP Poke, All In One SEO Pack, BP Profile Search, BP Xtra Signup, Buddypress – Who clicked at my Profile?, BuddyPress Edit Activity Stream, BuddyPress Friends Only Activity Stream, BuddyPress Live Notification, BuddyPress Username Changer, BuddyPress Usernames Only, Gatekeeper, Limit Login Attempts, Maintenance, Membership Premium, Registration Honeypot, RS Buddypress Activity Refresh, rtMedia for WordPress BuddyPress and bbPress, Simple Login Log, Useful Banner Manager, and Welcome Pack.

    9. Are you using the standard BuddyPress themes or customized themes? Duena, so a regular theme? Not designed particularly for BuddyPress though.

    10. Have you modified the core files in any way? Other than uploading the .mo & .po files and the bp-custom.php, no.

    11. Do you have any custom functions in bp-custom.php? Yes, the function from every tutorial talking about the language, but changed for my custom language file.

    12. If running bbPress, which version? Or did your BuddyPress install come with a copy of bbPress built-in? Nope, no bbPress.

    13. Please provide a list of any errors in your server’s log files. None.

    14. Which company provides your hosting? My own, HostArmor.

    15. Is your server running Windows, or if Linux; Apache, nginx or something else? Linux + Apache.

    #191032
    ThatHostingCo
    Participant

    First off:
    1. Which version of WordPress are you running?
    a. Wordpress 4.0

    2. Did you install WordPress as a directory or subdomain install?
    a. Main directory

    3. If a directory install, is it in root or in a subdirectory?
    a. n/a

    4. Did you upgrade from a previous version of WordPress? If so, from which version?
    a. Yes, 3.8

    5. Was WordPress functioning properly before installing/upgrading BuddyPress (BP)? e.g. permalinks, creating a new post, commenting.
    a. No. Alphabetical pagination was only showing 20 members previously

    6. Which version of BP are you running?
    a. Version 2.0.2

    7. Did you upgraded from a previous version of BP? If so, from which version?
    a. No

    8. Do you have any plugins other than BuddyPress installed and activated? If so, which ones?
    a. Add New Default Avatar 1.3.1
    b. Backup 2.2
    c. BuddyPress 2.0.2
    d. BuddyPress Pending Activations 1.0.2
    e. BuddyPress Real Names 0.3.5
    f. Contact Form 7 3.9.3
    g. Custom Facebook Feed 2.1.1
    h. Email Address Encoder 1.0.4
    i. Google Analytics Dashboard for WP 4.3.3
    j. JotForm Feedback Button 1.0
    k. Newsletter 3.6.3
    l. Photo Gallery 1.1.30
    m. PHP Code for posts 1.2.0
    n. SYN Media WooCommerce USPS 2.1.0
    o. The Events Calendar 3.7
    p. The Events Calendar: WooCommerce Tickets 3.7
    q. The Events Calendar PRO 3.7
    r. WooCommerce 2.1.12
    s. WooCommerce Advanced Notifications 1.1.9
    t. WooCommerce Advanced Product Quantities 2.1.6
    u. WooCommerce Subscriptions 1.5.9
    v. WooCommerce Thumbnail Input Quantities 1.1.2
    w. WooThemes Helper 1.3.0
    x. WP-Members 2.9.6
    y. WPFront User Role Editor 1.2

    9. Are you using the standard BuddyPress themes or customized themes?
    a. Custom theme

    10. Have you modified the core files in any way?
    a. No, only member-loop

    11. Do you have any custom functions in bp-custom.php?
    a. No

    12. If running bbPress, which version? Or did your BuddyPress install come with a copy of bbPress built-in?
    a. N/A

    13. Please provide a list of any errors in your server’s log files.
    a. WordPress database error Unknown column ‘bprn_293’ in ‘having clause’ for query SELECT COUNT(u.ID) FROM vae_bp_xprofile_data u GROUP BY u.user_id HAVING bprn_293 IS NOT NULL AND bprn_1 IS NOT NULL made by require(‘wp-blog-header.php’), require_once(‘wp-includes/template-loader.php’), include(‘/themes/headway/index.php’), HeadwayDisplay::layout, HeadwayDisplay::grid, HeadwayLayoutRenderer->display, HeadwayGridRenderer->render_grid, HeadwayBlocks::display_block, do_action(‘headway_block_content_content’), call_user_func_array, HeadwayContentBlock->content, HeadwayContentBlockDisplay->display, HeadwayContentBlockDisplay->loop, HeadwayContentBlockDisplay->display_entry, HeadwayContentBlockDisplay->display_entry_content, the_content, apply_filters(‘the_content’), call_user_func_array, bp_replace_the_content, apply_filters(‘bp_replace_the_content’), call_user_func_array, BP_Members_Theme_Compat->directory_content, bp_buffer_template_part, bp_get_template_part, bp_locate_template, load_template, require(‘/themes/iherb/buddypress/members/index.php’), bp_get_template_part, bp_locate_template, load_template, require(‘/themes/iherb/buddypress/members/members-loop.php’), bp_has_members, BP_Core_Members_Template->__construct, bp_core_get_users, BP_User_Query->__construct, BP_User_Query->do_user_ids_query

    14. Which company provides your hosting?
    a. Our own – That Hosting Company (http://thathost.co)

    15. Is your server running Windows, or if Linux; Apache, nginx or something else?
    CentOS 5.8 (64 bits version) – Interworx Front End 5.0.14-580
    ———————

    The problem:
    We are using a custom members-loop. The pagination on the alphabetical list is limiting the members to the first 20 and not offering additional pages

    Troubleshooting:
    – We attempted to adjust the ajax search query, but it did not seem to make a difference.
    – We removed the custom buddypress member-loop and used the default. We found the same issue occurred.

    Notes:
    – We have 143 members
    – We are using a custom theme builder “Headway”
    – Pagination issue does not seem to be effecting “Latest”, “Random” or “Newest Registered” Options.
    – Site is live at http://www.iherb.org/members/

    #190941
    aghajoon
    Participant

    this code work for me but java script not work and when user favorite comment user can’t remove notification help me

    define("BP_FAVORITE_NOTIFIER_SLUG","fa_notification");
    
        function bp_favorite_setup_globals() {	
    	global $bp, $current_blog;
        $bp->bp_favorite=new stdClass();
        $bp->bp_favorite->id = 'bp_favorite';
        $bp->bp_favorite->slug = BP_FAVORITE_NOTIFIER_SLUG;
        $bp->bp_favorite->notification_callback = 'bp_favorite_format_notifications';//show the notification   
        $bp->active_components[$bp->bp_favorite->id] = $bp->bp_favorite->id;
    			
                do_action( 'bp_favorite_setup_globals' );
        }
                add_action( 'bp_setup_globals', 'bp_favorite_setup_globals' );
         
    
    function bp_favorite_format_notifications(  $action, $activity_id, $secondary_item_id, $total_items,$format='string'  ) { 
    $action_checker = explode('_', $action);
    $activities = bp_activity_get_specific( array( 'activity_ids' => $activity_id, 'display_comments' => true) );
    	$glue = '';
    	$user_names = array();
    
    	$users = find_favorite_involved_persons($activity_id, $action);
    	$total_user = $count = count($users);
    
    	if($count > 2) {
    		$users = array_slice($users, $count - 2);
    		$count = $count - 2;
    		$glue = ", ";
    	} else if($total_user == 2) {
    		$glue = " and ";
    	}
    
    	foreach((array)$users as $user_id) {
    		$user_names[] = bp_core_get_user_displayname($user_id);
    	}
    
    	if(!empty($user_names)) {
    		$favoriting_users = join($glue, $user_names);
    	}
    
    	switch ( $action ) {
    		case 'new_bp_favorite_'.$activity_id:
    			if($total_user > 2) {
    				$text = $favoriting_users.' and '.$count.' liked: '.substr($activities["activities"][0]->content,0,32).'...';
    			} else {
    				$text = $favoriting_users." like: ".substr($activities["activities"][0]->content,0,32)."...";
    			}
    		break;
    	}
    	$url = '<div id="'.$action.'"class="notification"><a href="#" class="social-delete" onclick="deleteAjaxNotification(\''.$action.'\',\''.$activity_id.'\', \''.admin_url( 'admin-ajax.php' ).'\'); return false;">x</a><span class="social-loader"></span></div>';
    	$link = favorite_activity_get_permalink( $activity_id );
    
    	if($format=='string') {
    		return apply_filters( 'bp_activity_multiple_favorite_notifications', '<a href="' . $link. '">' . $text . '</a>'. $url .'' ,$users, $total_user, $count, $glue, $link );
    	} else {
    		return array(
    			'link' => $link,
    			'text' => $text
    		);
    	}
    	return false;
    
    }
    function find_favorite_involved_persons($activity_id, $action) {
    	global $bp,$wpdb;
    	$table = $wpdb->prefix . 'bp_notifications';
    	return $wpdb->get_col($wpdb->prepare("select DISTINCT(secondary_item_id) from {$table} where item_id=%d and secondary_item_id!=%d and component_action = %s",$activity_id,$bp->loggedin_user->id, $action));
    }
    function favorite_activity_get_permalink( $activity_id, $activity_obj = false ) {
    	global $bp;
    
    	if ( !$activity_obj )
    		$activity_obj = new BP_Activity_Activity( $activity_id );
                        
    		if ( 'activity_comment' == $activity_obj->type )
    			$link = bp_get_activity_directory_permalink(). 'p/' . $activity_obj->item_id . '/';
    		else
    			$link = bp_get_activity_directory_permalink() . 'p/' . $activity_obj->id . '/';
    
    	return apply_filters( 'ac_notifier_activity_get_permalink', $link );
    
    }
    
    function favorite_notifier_remove_notification($activity ,$has_access){
           global $bp;
           if($has_access)		       
    	   bp_core_delete_notifications_for_user_by_type( $bp->loggedin_user->id, $bp->bp_favorite->id, 'new_bp_favorite_'.$activity->id );
    	}
    add_action("bp_activity_screen_single_activity_permalink","favorite_notifier_remove_notification", 10,2);
    
    function favorite_notification( $activity_id){  
                       global $bp;                 
    	               $activities = bp_activity_get_specific( array( 'activity_ids' => $activity_id, 'display_comments' => true) );
    				   $author_id = $activities['activities'][0]->user_id;
                       $user_id =  bp_loggedin_user_id();
    	// if favoriting own activity, dont send notification
    	if( $user_id == $author_id ) {
    		return false;
    	}
    				   if ( bp_is_active( 'notifications' ) ) {
    		bp_notifications_add_notification( array(
    			'user_id'           => $author_id,
    			'item_id'           => $activity_id,
    			'secondary_item_id' => $user_id,
    			'component_name'    => $bp->bp_favorite->id,
    			'component_action'  => 'new_bp_favorite_'.$activity_id,
    			'date_notified'     => bp_core_current_time(),
    			'is_new'            => 1,
    		) );
    	}				
    }
    add_action("bp_activity_add_user_favorite","favorite_notification", 10, 2);
    
    function deleteAjaxNotification(){
        global $bp;        
        bp_core_delete_notifications_by_item_id ($bp->loggedin_user->id, $bp->bp_favorite->id, 'new_bp_favorite_'.$activity->id);     
        die();        
    }	
    add_action('wp_ajax_deleteAjaxNotification', 'deleteAjaxNotification' ); 
    
    function bp_like_add_like_action() {
    global $bp, $activities_template; 
    	 if ( bp_activity_can_favorite() ) : 
    		
    				$my_fav_count = bp_activity_get_meta( bp_get_activity_comment_id(), 'favorite_count' );
    				
    				$my_fav_count = "<span>".$my_fav_count."</span>";
    				
    				$is_favorite = apply_filters( 'bp_get_activity_is_favorite', in_array( bp_get_activity_comment_id(), $activities_template->my_favs ) );
    		
    
    			 if ( !$is_favorite ) : ?>
    
    				<a href="<?php echo apply_filters( 'bp_get_activity_favorite_link', wp_nonce_url( home_url( bp_get_activity_root_slug() . '/favorite/' . bp_get_activity_comment_id() . '/' ), 'mark_favorite' ) ); ?>" class="tooltip-trigger fav bp-secondary-action bp-primary-action" title="<?php _e( 'Favorite', 'buddypress' ); ?>" style="position:relative;"><?php _e( 'Favorite', 'buddypress' ); ?><?php echo $my_fav_count; ?></a>
    
    			<?php else : ?>
    
    				<a href="<?php echo apply_filters( 'bp_get_activity_favorite_link', wp_nonce_url( home_url( bp_get_activity_root_slug() . '/favorite/' . bp_get_activity_comment_id() . '/' ), 'mark_favorite' ) ); ?>" class="tooltip-trigger unfav bp-secondary-action bp-primary-action" title="<?php _e( 'Remove Favorite', 'buddypress' ); ?>" style="position:relative;"><?php _e( 'Remove Favorite', 'buddypress' ); ?><?php echo $my_fav_count; ?></a>
    
    			<?php endif; 
    
    		 endif; 
    }
    add_filter( 'bp_activity_comment_options' , 'bp_like_add_like_action', 1000 );
    
    

    and java code

    function deleteAjaxNotification(action_id, activity_id, adminUrl){
        jQuery('#'+action_id).children(".social-delete").html("");
        jQuery('#'+action_id ).children(".social-loader").show(); 
    
        jQuery.ajax({
            type: 'post',
            url: adminUrl,
            data: { action: "deleteAjaxNotification", action_id:action_id, activity_id:activity_id },
            success:
            function(data) {
            	jQuery('#'+action_id).parent().hide();
            	
            }
         });  
    }
    #189599
    danbp
    Participant

    It is not an issue, it is intended so !

    The logged user’s profile tab comes with 3 sub menus:
    – View (public)
    – Edit (private)
    – Change avatar (private)

    On the main navigation of the member, you have at least
    – Settings with 3 sub nav items:
    – account credential (email, password)
    – notifications
    – field visibility settings

    And if component is activated:
    – Friends
    – Groups
    – Forum

    I agree that this Setting is confusing, at least, because those labels should indicate My Friends, My Groups, My Forums and My profile fields visibility settings, which is too long i grant you. 😉

    FYI: such distinction wern’t really possible untill now in the original english version.
    But the upcomming BP 2.1 brings some better context disambiguation just to improve such situation.

    To solve this today, you can:
    1) create a translation file and modify the wording (but, as said, without disambiguation)
    2) use a child theme and hardcode the text you want into the template file (best approach)
    3) wait a few days for 2.1 to use the first option

    natb19
    Participant

    Anton, I haven’t tried it yet, but could we hook onto the user login and then run the code fancyfiber provided above?

    That way all users will have their notification settings set after they have logged in. (not perfect, but it should work!?)

    #188501
    victord34
    Participant

    @henrywright

    do you have another exemple. to make page notif ?

    I try that, and many other setting… nothing appears.

    
    if ( bp_is_active( 'notifications' ) ) {
        bp_notifications_add_notification( array(
            'all'           => $user_id,
            'pages'          => $item_id,
            'pages/ edit' => $secondary_item_id,
            'component_name'    => $component_name,
            'component_action'  => $component_action,
            'date_notified'     => bp_core_current_time(),
            'is_new'            => 1,
        ) );
    }
    

    thank you

    #188354
    Henry Wright
    Moderator

    bp_notifications_add_notification() is used to add a notification. For example:

    if ( bp_is_active( 'notifications' ) ) {
        bp_notifications_add_notification( array(
            'user_id'           => $user_id,
            'item_id'           => $item_id,
            'secondary_item_id' => $secondary_item_id,
            'component_name'    => $component_name,
            'component_action'  => $component_action,
            'date_notified'     => bp_core_current_time(),
            'is_new'            => 1,
        ) );
    }

    See here for more info: https://codex.buddypress.org/developer/function-examples/bp_notifications_add_notification/

Viewing 25 results - 501 through 525 (of 1,091 total)
Skip to toolbar