Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'notification user id'

Viewing 25 results - 326 through 350 (of 768 total)
  • Author
    Search Results
  • #253098
    bogski
    Participant

    Hi,

    Im looking at the email tokens available for use with BuddyPress and the automated emails sent from wordpress.

    My question relates to this token in particular…..{{{unsubscribe}}}

    If a user clicks this, does it just unsubscribe them from the email notifications, or does it cancel their registration?

    you know how sometimes you get an email and at the bottom there is a link along the lines of

    “Didnt sign up for our website? click here to unsubscribe”

    Is that what that token is for?

    Thanks,

    Phil

    jl3nz
    Participant

    I am having an issue with my Buddypress Notification Settings not saving. When you change any options from “Yes” to “No” and click the “Save” button at the bottom of the page, the page reloads but the changed options don’t save.

    WP version 4.4.1
    Theme PageLines Framework 2.4.6
    PHP version 5.4.13
    bbPress version 2.5.8-5815
    site url http://www.wpfilm.com
    Active Plugins Name and Version
    – p1 Gravity Forms 1.9.15
    – p2 Add Shortcodes Actions And Filters 2.0.3
    – p3 Akismet 3.1.8
    – p4 BAW Multipass for Protected Pages 1.4
    – p5 bbP Toolkit 1.0.6
    – p6 bbPress 2.5.8
    – p7 Better Notifications for WordPress 1.3.9.5
    – p8 BuddyPress Username Changer 1.1
    – p9 BuddyPress 2.4.3
    – p10 CloudFlare 1.3.20
    – p11 Display Categories Widget 2.0
    – p12 Disqus Comment System 2.84
    – p13 Gravity Forms ActiveCampaign Add-On 1.3.1
    – p14 Gravity Forms Authorize.Net Add-On 2.1.1
    – p15 Gravity Forms MailChimp Add-On 3.7.1
    – p16 Gravity Forms PayPal Standard Add-On 2.6
    – p17 Gravity Forms Survey Add-On 2.6
    – p18 Like Button Voting & Rating 2.1.9
    – p19 MemberPress Active Campaign 1.0.4
    – p20 MemberPress AWS 1.2.5
    – p21 MemberPress Developer Tools 1.0.2
    – p22 MemberPress Importer 1.2.3
    – p23 MemberPress to VHX.tv 1.0
    – p24 MemberPress WP Films Addons 1.0
    – p25 MemberPress Developer Edition 1.2.7
    – p26 Nav Menu Roles 1.7.7
    – p27 Open Graph Metabox 1.4
    – p28 bbPress for PageLines 2.0.2
    – p29 Recent Posts Widget Extended 0.9.9.5
    – p30 Shortcodes in Menus 3.1
    – p31 Stream 3.0.5
    – p32 Update Control 1.5
    – p33 UpdraftPlus – Backup/Restore 1.11.28
    – p34 WP Better Emails 0.3

    Zox Zin Min
    Participant

    Last two years ago, one of buddypress user MLDIA asked this question. I am also want to know and would like to make features that ..

    1- Users can upload their resume.
    2- Users can find jobs, people and business opportunities recommended by other users.
    3- Employers can list jobs and search for potential candidates.
    4- Job seekers can review the profile of hiring managers and discover which of their existing contacts can introduce them.
    5- Users can post their own photos and view photos of others to aid in identification.
    6- Users can follow different companies and can receive notifications about the new joining and offers available.
    7- Users can save (bookmark) jobs that they would like to apply for.
    8- Users can “like” and “congratulate” each other’s updates and new employments.
    9- Users can see who has visited their profile page.
    10- Questions & Answers
    11- Advertisments (for admin a.k.a me)
    12- Job listings
    13- “Apply with” button
    14- “Saved Jobs” button
    15- Users can endorse each other’s skills.
    16- Influencers (like the one in the linkedIn)

    Please help me. Thanks all.

    #252726
    Henry Wright
    Moderator

    Try this:

    $count = bp_notifications_get_unread_notification_count( bp_loggedin_user_id() );
    if ( $count > 0 ) {
        echo $count;
    } else {
        // The notif count is 0.
    }
    #252725
    jameshh93
    Participant

    At moment im using this code which display 0 if there are no notifcations how can I display nothing if there are 0 notifcations?

    echo bp_notifications_get_unread_notification_count( bp_loggedin_user_id() );

    Also is there a same sort of code for friends count too and or mentions?

    Thank you!

    singhnavjeet
    Participant

    Hey !

    Is there a way where I can have Friends request along with number of request and message notification on the website header ?

    I have hidden the wordpress bar for non-admin user so they have no quick access to the notification unless they visit the their profile page.

    I would like have this notification visible to signed in members so they can see the number of request right from the header.

    Thank you veyr much

    Georgio
    Participant

    Hi @mcuk
    The bubble works well, thank you very much!
    Here is a screenshot

    As you see, I put the notification link (Appearance>Menus) on the menubar and I added the bubble with negative left margin (-5 px) for the two elements to be near each other. So if a user has a notification, they can click the notification link (notif) directly to see it.

    Thanks again!

    @mcuk
    Participant

    Hi @aminipix,

    This css should work:

    #footer-menu ul li.bubble {
        transform: translate(0, 20%);
        min-width: 22px;
        height: 22px;
        padding: 4px;
        border: 1px solid #000;
        border-radius: 50%;
        margin: 0 10px 0 0;
        background: #fff;
        color: #000;
        font-size: 11px;
        line-height: normal;
        text-align: center;
    }

    The problem seemed to be mainly caused by the line-height properties of your .tab class which is also being used by the text in your bubble. If you use the F12 button and locate the line ul id="menu-app-footer" class="footer-menu tabs tabs-icon-top" (its just above where the bubble is), then scroll down the Styles window to the .tabs selector, you will see what i mean about the line-height (set to be 49px).

    The php code shows the notification count for the logged in user, so check that what is being displayed for a user is actually the correct number of notifications. If viewing the profile page of another user for example, the numbers will stay the same since the logged in user is the same. If the numbers are changing, then maybe there is a conflict with another function or plugin. As for when you are logged out, do you even need to see the notification bubbles? If not then maybe just prevent them being visible from anyone who is not logged in.

    #252390
    Dono12
    Participant

    No, the plugin is not online. I built it with bits of code and tuts across the web about customizing WordPress notification emails. if you can send me an email address (please black this out **** (removed at users request ~hnla)) I can send you the plugin and you look it over. I saw on the web that you should remove filter after applying it but it didn’t seem to have any affect.

    remove_filter( 'wp_mail_content_type','mycustom_mail_content_type' );

    wpmirwin
    Participant

    Hi all (hoping that @djpaul notices this),

    Email trouble in BP is apperantly very hard to solve (I’ve been sifting through email related posts in the forums for hours!), so I’m going to include as many clues here as possible. Hopefully someone has the patience to read all this and make sense of it, and hopefully this problem is not specific to my installation. Yes, I have a lot of plugins. But, I have disabled all of them at times to test this, and I’m fairly confident that it is not a plugin conflict.

    Problem Summary:

    It seems like some of the messages generated by BP are formed in such a way that they are being rejected (silently?) by external mail servers (i.e. google, yahoo, hotmail) while other email messages are fine. I think this may be giving the impression that BP is not sending the email, but the email messages are in fact being sent (in my case anyway). They just don’t seem to be handled properly on the recieving end. Why?… I have no idea. Hoping for some tips to continue troubleshooting here.

    Product Versions

    WP: v4.4.2
    BP: v2.5.2

    Relevant Plugins in use:

    wp-mail-smtp: In case the email problems were PHP mail() related
    bp-email-to-wp-mail-from-bridge: To fix BP ignoring existing mapping for the From email
    buddypress-group-email-subscription: To add group email functionality (mentioning only because email sent from this plugin works fine – plain text)

    Relevant Config Info:

    At first I wasn’t using an SMTP plugin, but my current config is using WP-Mail-SMTP.
    It is configured with the localhost as the SMTP Server (HostGator shared host).
    Outoing email seems to work fine (with or without the plugin). It’s only outgoing BP mail that isn’t working properly.

    High Level Details:

    Some BuddyPress generated email works and some doesn’t. There are 3 specific examples that I’ve been testing:

    * The “Friend Request” email works great! It’s a really nice HTML formatted email that informs the target of the request that the request has been made.
    * A PM to a member doesn’t work. No email notification is sent to the target of the PM (Notification settings are correct)
    * A Mention doesn’t work. No email is sent to the BP user targeted by the mention (Notification settings are correct).

    The email messages that don’t appear to be working (i.e. not reaching it’s destination) are actually being sent. However, it seems like they are completely ignored by the receiving mail server.

    * This has been confirmed with the debug plugin (bp-email-debug-2.php). In all cases it reports that the email was sent.
    * This has been confirmed by my ISP. I had them watch the email get sent out from the localhost (the smtp server) to a google mail server (for example) but the message was not received.

    I know that my mail server/domain is not blacklisted because as mentioned above, the “Friend Request” email is sucesfully sent and delivered to the same recipeint. Also, the buddypress-group-email-subscription plugin works well and sends email succesfully to the same recipients.

    NOTE:The same email (eg. PM and Metion related email) that is not delivered successfuly to external mail servers (google, yahoo, hotmail) IS sucessfully delivered to email addresses hosted on my local mail server (i.e. the mail server running on the same WP/BP host – Hostgator).

    Some steps I’ve taken to test/resolve

    I’ve ensured that the “From” email address is correct (i.e. not being rejected because it is “wordpress@domain.com”). BTW, this led me to the bp-email-to-wp-mail-from-bridge Plugin which bridges wp_mail_from settings that I had in WP functions.php (child theme) to BP Email fuction(s). Everything is fine here.

    I’ve installed and tested WP-Mail-SMTP plugin in every way I can imagine. No change in email behaviour

    I made sure all available options in the notification settings (i.e. to receive all types of notifications) are enabled and have tested the various email scenarios on many different users.

    Other important notes

    I’m using the plugin buddypress-group-email-subscription to send email to group members when things happen in the forums. As mentioned above, this plugin successfully sends email to the same recipeints that are not recieving the PM and Metnion emails. Worth noting is the email messages sent by this plugin are plain text.

    Finally

    Thanks for getting this far… that’s a lot of reading. Sorry. I’m not expecting a simple answer to this. I’m just hoping for someone to point me in the right troubleshooting direction.
    <br><br>

    jasonaring42
    Participant

    Woohoo! @berkelmudez excellent find!…….I have been working on this problem for three days and you are right; any combo of other SMTP plugins with various other mailing plugins etc. just did not work. Postman SMTP plugin suggests the proper port to use (of which I tried prior, but had everything else wrong!) and fixed all notifications.

    Note for others having this same problem: My system would only send out certain notifications regarding signups and email changes but anything dealing with activity in the BuddyPress system (why we USE BuddyPress!) it would not notify users of activity. Try the Postman SMTP plugin and get rid of the other stuff.

    #251943
    Angelo Rocha
    Participant

    Is possible insert a notification to specific user using php?
    Eg.:
    bbpress_insert_notification($user_id, $content_notification);

    Kieran
    Participant

    I’m looking to set up moderation through my BuddyPress install. I’ve looked at the permissions and no matter what I try I seem to come up empty handed – any thoughts on what permissions I would give to a user to allow them to delete others activity from the front end. I will have my site set up in such a way that the user (any level other than super admin) cannot see the back end.

    Further, I have set up a user called flag, (I have hidden flag from being visible anywhere on the site, and when a user attempts to go to the URL they’re forwarded to the support page I have setup) I wish to have their notifications forwarded to anyone who has X role or to a set of user ID’s that can delete said post if it offends.

    I used the above code to achieve the hidden user https://buddypress.org/support/topic/hide-admin-from-members-and-activity/#post-190874

    Does anyone have any thoughts on this? I’m pretty stuck.

    Thanks,

    Kieran

    #251744
    davidkey772
    Participant

    Yes, the issue has been there since day one – and I searched for plugins to add this functionality but couldn’t find one that worked. Then I saw the new BP update with the added BP Email functionality and I realised that a/. this functionality indeed hadn’t been there before and b/. it had now been officially added as a part of BP’s core code.

    The plugin that sends new blog post notifications is:
    =
    Post Notification by Email
    Version 4.1.2 | By Valerio Souza, Claudio Sanches
    =

    Here’s a list of ALL the plugins on the site:
    =
    Advanced Custom Fields Pro
    Version 5.3.2.2 | By elliot condon

    BP Group Activities Notifier
    Version 1.0.1 | By Brajesh Singh(BuddyDev)

    BP Group Hierarchy
    Version 1.4.3 | By David Dean

    BP Groupblog
    Version 1.8.12 | By Rodney Blevins, Marius Ooms, Boone Gorges

    BuddyPress
    Version 2.5.1 | By The BuddyPress Community

    BuddyPress Forum Editor
    Version 1.0 | By Taehan Lee

    BuddyPress Groups Import
    Version 0.1 | By Türker YILDIRIM

    Email Users
    Version 4.8.1 | By Mike Walsh & MarvinLabs

    Gravity Forms
    Version 1.9.17.5 | By rocketgenius

    Gravity Forms + Custom Post Types
    Version 3.1.1 | By David Smith

    Gravity Forms WYSIWYG
    Version 0.2 beta | By Brad Vincent

    Jetpack by WordPress.com
    Version 3.9.4 | By Automattic

    Post Notification by Email
    Version 4.1.2 | By Valerio Souza, Claudio Sanches

    SB Welcome Email Editor
    Version 4.8 | By Sean Barton
    =

    ds123
    Participant

    thanks for the reply its a themeforest theme called vivacity and here are the plugins i have installed:

    Akismet
    Version 3.1.8 | By Automattic | View details

    Audio player
    Version 2.0.4.1 | By Martin Laine | Visit plugin site

    Auto Post Thumbnail
    Version 3.3.4 | By Aditya Mooley , Tarique Sani | View details

    BuddyPress
    Version 2.5.1 | By The BuddyPress Community | View details

    CloudFlare
    Version 1.3.20 | By Ian Pye, Jerome Chen, James Greene, Simon Moore, David Fritsch, John Wineman

    Dashboard Widget Remover
    Version 1.0 | By Zihad Tarafdar | View details

    Disable wp new user notification
    Version 0.100323 | By Corey Salzano | View details

    Google Analytics by Yoast
    Version 5.4.6 | By Team Yoast | View details

    LayerSlider WP
    Deactivate | Edit
    Version 5.6.2 | By Kreatura Media | Visit plugin site

    Log Report Plugin
    Keeps Stop Spammer logs in CSV file
    Version 1.0 | By Keith P. Graham | Visit plugin site

    Mail From
    Version 1.0.1 | By Andrew Hamilton | View details

    Select SI CAPTCHA Anti-Spam
    Version 2.7.7.7 | By Mike Challis | View details

    Stop Spammers Spam Control
    Version 6.15 | By Keith P. Graham | View details

    Vivacity Plugin
    Version 1.2 | By GhostPool

    WP Maintenance Mode
    Version 2.0.3 | By Designmodo | View details

    WP Super Cache
    Version 1.4.8 | By Automattic | View details

    WP Widget Cache
    Version 0.26 | By Andrew Zhang | Visit plugin site

    WPBakery Visual Composer
    Version 4.9 | By Michael M – WPBakery.com | Visit plugin site

    Yoast SEO

    #251481

    In reply to: Display notifications

    neijisly
    Participant

    Ok go in editor theme, click in header.php and try to ad this code just before </nav><!– #site-navigation –>

    <?php if(bp_notifications_get_unread_notification_count( bp_loggedin_user_id() ) > 0 ) { ?>

      <#li>
      <#a href=”<?php echo bp_loggedin_user_domain() ?><?php echo BP_NOTIFICATIONS_SLUG ?>”><span style=”font-weight: bold; background: #37b5e4; padding: 2px 2px 2px 2px;”><?php echo bp_notifications_get_unread_notification_count( bp_loggedin_user_id() );
      ?></span> Notifications<#/a>
      <#/li>
      <?php } ?>
      <#li>
      <#a href=”<?php echo bp_loggedin_user_domain() ?><?php echo BP_MESSAGES_SLUG ?>”><?php if(messages_get_unread_count() > 0 ) { ?><span style=”font-weight: bold; background: #37b5e4; padding: 2px 2px 2px 2px;”><?php echo messages_get_unread_count();
      ?></span><?php } ?> Messages<#/a>
      <#/li>
      <#/ul>
      ( please delete all # symbol in this code )
    #251477

    In reply to: Display notifications

    neijisly
    Participant

    Here is the code

    <?php if(bp_notifications_get_unread_notification_count( bp_loggedin_user_id() ) > 0 ) { ?>
    <~li>
    <~a><?php echo BP_NOTIFICATIONS_SLUG ?>”>
    <?php echo bp_notifications_get_unread_notification_count( bp_loggedin_user_id() );
    ?> Notifications</~a>
    </li~>
    <?php } ?>
    <~li>
    <~a><?php echo BP_MESSAGES_SLUG ?>”><?php if(messages_get_unread_count() > 0 ) { ?>
    <?php echo messages_get_unread_count();
    ?>
    <?php } ?> Messages<~/a>
    <~/li>

    put in your php menu file
    ( delete all ~ in the code )

    pattz2016
    Participant

    i want to be the only one able to view the link as the admin. When users are viewing their notifications in the right side, there are links to WordPress.org on the left side. I don’t think this part is relevant to my users based on the forums they are discussing.

    Any advise Please?

    jemmatates
    Participant

    I’m using <?php bp_get_loggedin_user_nav(); ?>

    but it is only showing the message count inside the members profile, is there any code i can put in the bp-custom file to also show the message count outside of the users profile url?

    The other notification counts for other menu items work sitewide, only messages is missing. Any help would be greatly appreciated!!

    @mcuk
    Participant

    Hi @mikee1001,

    The code i used for inserting the bubble counters for notifications, unread messages and total friends is:

    // Notification counter bubble
    function bptest_main_nav_notification_bubble( $items, $args ) {
        if( $args->theme_location == 'header-menu' ) { // In manage locations via WP Dash>Appearance>Menus
        	$items_array = array();
            while ( false !== ( $item_pos = strpos ( $items, '<li', 3 ) ) ) {
                $items_array[] = substr( $items, 0, $item_pos );
                $items = substr( $items, $item_pos );
            }
            $items_array[] = $items;
            array_splice( $items_array, 3, 0, '<li class="bubble">' . bp_notifications_get_unread_notification_count( bp_loggedin_user_id() ) . '</li>' ); // 0,0 1st position, 1,0 2nd, etc
            $items = implode( '', $items_array );
        }
        return $items;
    }
    add_filter( 'wp_nav_menu_items', 'bptest_main_nav_notification_bubble', 10, 2 );
    // Unread message counter bubble 
    function bptest_main_nav_message_bubble( $items, $args ) {
        if( $args->theme_location == 'header-menu' ) { // In manage locations via WP Dash>Appearance>Menus
            $items_array = array();
            while ( false !== ( $item_pos = strpos ( $items, '<li', 3 ) ) ) {
                $items_array[] = substr( $items, 0, $item_pos );
                $items = substr( $items, $item_pos );
            }
            $items_array[] = $items;
            array_splice( $items_array, 5, 0, '<li class="bubble">' . bp_get_total_unread_messages_count( bp_loggedin_user_id() ) . '</li>' ); // 0,0 1st position, 1,0 2nd, etc
            $items = implode( '', $items_array );
        }
        return $items;
    }
    add_filter( 'wp_nav_menu_items', 'bptest_main_nav_message_bubble', 10, 2 );
    // Total friends counter bubble
    // Note, 'bp_friend_get_total_requests_count' will give the total connection request count if desired
    function bptest_main_nav_friend_bubble( $items, $args ) {
        if( $args->theme_location == 'header-menu' ) { // In manage locations via WP Dash>Appearance>Menus
            $items_array = array();
            while ( false !== ( $item_pos = strpos ( $items, '<li', 3 ) ) ) {
                $items_array[] = substr( $items, 0, $item_pos );
                $items = substr( $items, $item_pos );
            }
            $items_array[] = $items;
    		array_splice( $items_array, 7, 0, '<li class="bubble">' . friends_get_total_friend_count( bp_loggedin_user_id() ) . '</li>' ); // 0,0 1st position, 1,0 2nd, etc
            $items = implode( '', $items_array );
        }
        return $items;
    }
    add_filter( 'wp_nav_menu_items', 'bptest_main_nav_friend_bubble', 10, 2 );

    In each of the above you will want to change the theme_location == 'header-menu' to theme_location == 'INSERT YOUR HEADER MENU NAME HERE'. The name of your menu is found via your WP Dashboard > Appearance > Menus. The three functions above were inserted into bp-custom.php .

    The positions of the bubbles will also need changing depending on where they should be in your menu. Do that by changing the numbers on the section array_splice( $items_array, 7, 0, '<li class="bubble">'. The comment alongside the line in the code should help you.

    You’ll also need some CSS for the bubbles otherwise you probably won’t see them even if they are functioning. If you hit ctrl-A to select everything on your web page, they should show up somewhere in your menu (assuming the code has been implemented correctly of course).

    As you can see in the functions above all the bubbles have been given a class called “bubble”. So put in your style.css (of your child theme) something like:

    #main-navigation .main-nav ul li.bubble {
    	transform: translate(0, 50%);
    	width: 20px;
    	height: 20px;	
    	padding: 2px 6px; 
    	border: 1px solid #000;
    	border-radius: 50%;
    	margin: 0 10px 0 0;
    	background: #fff;
    	color: #000;
    	font-size: 11px;	
    }

    The selector (#main-navigation .main-nav ul li.bubble) may be different on your site because it will depend on your theme etc. So use the developer tools, F12 button, on your browser to find out the correct one. It will be the bit before the .bubble that is different.

    Hopefully the above helps!

    #249391

    In reply to: queries on posting

    Slava Abakumov
    Moderator
    #249233
    Kookidooki
    Participant

    Thank you!

    It works fine, but when a (non-administrator) user is logged in, they cannot log out anymore because the logout button is missing which you can find in the “Howdy… [name][avatar][settings][logout button]” box at the upper right side. Also missing is the name of the user with his avatar, messages / notifications, etc. So this box is missing.

    So what I need is a script that hides the admin bar on the front end when you’re logged out, but is visible when you’re logged in.

    Any idea?

    ThanX!

    #248285
    ibuddybook
    Participant

    Thank you for your reply Mr.Henry Wright…

    How to insert the code????? how to change the Parameters???. i am not understand. please tell me step by step…

    here is my code…
    /buddypress/bp-activity/bp-activity-notifications.php

    <?php
    /**
     * BuddyPress Activity Notifications.
     *
     * @package BuddyPress
     * @subpackage ActivityNotifications
     */
    
    // Exit if accessed directly.
    defined( 'ABSPATH' ) || exit;
    
    /* Emails *********************************************************************/
    
    /**
     * Send email and BP notifications when a user is mentioned in an update.
     *
     * @since 1.2.0
     *
     * @uses bp_notifications_add_notification()
     * @uses bp_get_user_meta()
     * @uses bp_core_get_user_displayname()
     * @uses bp_activity_get_permalink()
     * @uses bp_core_get_user_domain()
     * @uses bp_get_settings_slug()
     * @uses bp_activity_filter_kses()
     * @uses bp_core_get_core_userdata()
     * @uses wp_specialchars_decode()
     * @uses get_blog_option()
     * @uses bp_is_active()
     * @uses bp_is_group()
     * @uses bp_get_current_group_name()
     * @uses apply_filters() To call the 'bp_activity_at_message_notification_to' hook.
     * @uses apply_filters() To call the 'bp_activity_at_message_notification_subject' hook.
     * @uses apply_filters() To call the 'bp_activity_at_message_notification_message' hook.
     * @uses wp_mail()
     * @uses do_action() To call the 'bp_activity_sent_mention_email' hook.
     *
     * @param int $activity_id      The ID of the activity update.
     * @param int $receiver_user_id The ID of the user who is receiving the update.
     */
    
    function bp_activity_at_message_notification( $activity_id, $receiver_user_id ) {
    
    	// Don't leave multiple notifications for the same activity item.
    	$notifications = BP_Core_Notification::get_all_for_user( $receiver_user_id, 'all' );
    
    	foreach( $notifications as $notification ) {
    		if ( $activity_id == $notification->item_id ) {
    			return;
    		}
    	}
    
    	$activity = new BP_Activity_Activity( $activity_id );
    
    	$subject = '';
    	$message = '';
    	$content = '';
    
    	// Now email the user with the contents of the message (if they have enabled email notifications).
    	if ( 'no' != bp_get_user_meta( $receiver_user_id, 'notification_activity_new_mention', true ) ) {
    		$poster_name = bp_core_get_user_displayname( $activity->user_id );
    
    		$message_link  = bp_activity_get_permalink( $activity_id );
    		$settings_slug = function_exists( 'bp_get_settings_slug' ) ? bp_get_settings_slug() : 'settings';
    		$settings_link = bp_core_get_user_domain( $receiver_user_id ) . $settings_slug . '/notifications/';
    
    		$poster_name = stripslashes( $poster_name );
    		$content = bp_activity_filter_kses( strip_tags( stripslashes( $activity->content ) ) );
    
    		// Set up and send the message.
    		$ud       = bp_core_get_core_userdata( $receiver_user_id );
    		$to       = $ud->user_email;
    		$subject  = bp_get_email_subject( array( 'text' => sprintf( __( '%s mentioned you in an update', 'buddypress' ), $poster_name ) ) );
    
    		if ( bp_is_active( 'groups' ) && bp_is_group() ) {
    			$message = sprintf( __(
    '%1$s mentioned you in the group "%2$s":
    
    "%3$s"
    
    To view and respond to the message, log in and visit: %4$s
    
    ---------------------
    ', 'buddypress' ), $poster_name, bp_get_current_group_name(), $content, $message_link );
    		} else {
    			$message = sprintf( __(
    '%1$s mentioned you in an update:
    
    "%2$s"
    
    To view and respond to the message, log in and visit: %3$s
    
    ---------------------
    ', 'buddypress' ), $poster_name, $content, $message_link );
    		}
    
    		// Only show the disable notifications line if the settings component is enabled.
    		if ( bp_is_active( 'settings' ) ) {
    			$message .= sprintf( __( 'To disable these notifications please log in and go to: %s', 'buddypress' ), $settings_link );
    		}
    
    		/**
    		 * Filters the user email that the @mention notification will be sent to.
    		 *
    		 * @since 1.2.0
    		 *
    		 * @param string $to User email the notification is being sent to.
    		 */
    		$to 	 = apply_filters( 'bp_activity_at_message_notification_to', $to );
    
    		/**
    		 * Filters the @mention notification subject that will be sent to user.
    		 *
    		 * @since 1.2.0
    		 *
    		 * @param string $subject     Email notification subject text.
    		 * @param string $poster_name Name of the person who made the @mention.
    		 */
    		$subject = apply_filters( 'bp_activity_at_message_notification_subject', $subject, $poster_name );
    
    		/**
    		 * Filters the @mention notification message that will be sent to user.
    		 *
    		 * @since 1.2.0
    		 *
    		 * @param string $message       Email notification message text.
    		 * @param string $poster_name   Name of the person who made the @mention.
    		 * @param string $content       Content of the @mention.
    		 * @param string $message_link  URL permalink for the activity message.
    		 * @param string $settings_link URL permalink for the user's notification settings area.
    		 */
    		$message = apply_filters( 'bp_activity_at_message_notification_message', $message, $poster_name, $content, $message_link, $settings_link );
    
    		wp_mail( $to, $subject, $message );
    	}
    
    	/**
    	 * Fires after the sending of an @mention email notification.
    	 *
    	 * @since 1.5.0
    	 *
    	 * @param BP_Activity_Activity $activity         Activity Item object.
    	 * @param string               $subject          Email notification subject text.
    	 * @param string               $message          Email notification message text.
    	 * @param string               $content          Content of the @mention.
    	 * @param int                  $receiver_user_id The ID of the user who is receiving the update.
    	 */
    	do_action( 'bp_activity_sent_mention_email', $activity, $subject, $message, $content, $receiver_user_id );
    }
    
    /**
     * Send email and BP notifications when an activity item receives a comment.
     *
     * @since 1.2.0
     *
     * @uses bp_get_user_meta()
     * @uses bp_core_get_user_displayname()
     * @uses bp_activity_get_permalink()
     * @uses bp_core_get_user_domain()
     * @uses bp_get_settings_slug()
     * @uses bp_activity_filter_kses()
     * @uses bp_core_get_core_userdata()
     * @uses wp_specialchars_decode()
     * @uses get_blog_option()
     * @uses bp_get_root_blog_id()
     * @uses apply_filters() To call the 'bp_activity_new_comment_notification_to' hook.
     * @uses apply_filters() To call the 'bp_activity_new_comment_notification_subject' hook.
     * @uses apply_filters() To call the 'bp_activity_new_comment_notification_message' hook.
     * @uses wp_mail()
     * @uses do_action() To call the 'bp_activity_sent_reply_to_update_email' hook.
     * @uses apply_filters() To call the 'bp_activity_new_comment_notification_comment_author_to' hook.
     * @uses apply_filters() To call the 'bp_activity_new_comment_notification_comment_author_subject' hook.
     * @uses apply_filters() To call the 'bp_activity_new_comment_notification_comment_author_message' hook.
     * @uses do_action() To call the 'bp_activity_sent_reply_to_reply_email' hook.
     *
     * @param int   $comment_id   The comment id.
     * @param int   $commenter_id The ID of the user who posted the comment.
     * @param array $params       {@link bp_activity_new_comment()}.
     * @return bool
     */
    function bp_activity_new_comment_notification( $comment_id = 0, $commenter_id = 0, $params = array() ) {
    
    	// Set some default parameters.
    	$activity_id = 0;
    	$parent_id   = 0;
    
    	extract( $params );
    
    	$original_activity = new BP_Activity_Activity( $activity_id );
    
    	if ( $original_activity->user_id != $commenter_id && 'no' != bp_get_user_meta( $original_activity->user_id, 'notification_activity_new_reply', true ) ) {
    		$poster_name   = bp_core_get_user_displayname( $commenter_id );
    		$thread_link   = bp_activity_get_permalink( $activity_id );
    		$settings_slug = function_exists( 'bp_get_settings_slug' ) ? bp_get_settings_slug() : 'settings';
    		$settings_link = bp_core_get_user_domain( $original_activity->user_id ) . $settings_slug . '/notifications/';
    
    		$poster_name = stripslashes( $poster_name );
    		$content = bp_activity_filter_kses( stripslashes($content) );
    
    		// Set up and send the message.
    		$ud      = bp_core_get_core_userdata( $original_activity->user_id );
    		$to      = $ud->user_email;
    		$subject = bp_get_email_subject( array( 'text' => sprintf( __( '%s replied to one of your updates', 'buddypress' ), $poster_name ) ) );
    		$message = sprintf( __(
    '%1$s replied to one of your updates:
    
    "%2$s"
    
    To view your original update and all comments, log in and visit: %3$s
    
    ---------------------
    ', 'buddypress' ), $poster_name, $content, $thread_link );
    
    		// Only show the disable notifications line if the settings component is enabled.
    		if ( bp_is_active( 'settings' ) ) {
    			$message .= sprintf( __( 'To disable these notifications please log in and go to: %s', 'buddypress' ), $settings_link );
    		}
    
    		/**
    		 * Filters the user email that the new comment notification will be sent to.
    		 *
    		 * @since 1.2.0
    		 *
    		 * @param string $to User email the notification is being sent to.
    		 */
    		$to = apply_filters( 'bp_activity_new_comment_notification_to', $to );
    
    		/**
    		 * Filters the new comment notification subject that will be sent to user.
    		 *
    		 * @since 1.2.0
    		 *
    		 * @param string $subject     Email notification subject text.
    		 * @param string $poster_name Name of the person who made the comment.
    		 */
    		$subject = apply_filters( 'bp_activity_new_comment_notification_subject', $subject, $poster_name );
    
    		/**
    		 * Filters the new comment notification message that will be sent to user.
    		 *
    		 * @since 1.2.0
    		 *
    		 * @param string $message       Email notification message text.
    		 * @param string $poster_name   Name of the person who made the comment.
    		 * @param string $content       Content of the comment.
    		 * @param string $thread_link   URL permalink for the activity thread.
    		 * @param string $settings_link URL permalink for the user's notification settings area.
    		 */
    		$message = apply_filters( 'bp_activity_new_comment_notification_message', $message, $poster_name, $content, $thread_link, $settings_link );
    
    		wp_mail( $to, $subject, $message );
    
    		/**
    		 * Fires after the sending of a reply to an update email notification.
    		 *
    		 * @since 1.5.0
    		 *
    		 * @param int    $user_id      ID of the original activity item author.
    		 * @param string $subject      Email notification subject text.
    		 * @param string $message      Email notification message text.
    		 * @param int    $comment_id   ID for the newly received comment.
    		 * @param int    $commenter_id ID of the user who made the comment.
    		 * @param array  $params       Arguments used with the original activity comment.
    		 */
    		do_action( 'bp_activity_sent_reply_to_update_email', $original_activity->user_id, $subject, $message, $comment_id, $commenter_id, $params );
    	}
    
    	/*
    	 * If this is a reply to another comment, send an email notification to the
    	 * author of the immediate parent comment.
    	 */
    	if ( empty( $parent_id ) || ( $activity_id == $parent_id ) ) {
    		return false;
    	}
    
    	$parent_comment = new BP_Activity_Activity( $parent_id );
    
    	if ( $parent_comment->user_id != $commenter_id && $original_activity->user_id != $parent_comment->user_id && 'no' != bp_get_user_meta( $parent_comment->user_id, 'notification_activity_new_reply', true ) ) {
    		$poster_name   = bp_core_get_user_displayname( $commenter_id );
    		$thread_link   = bp_activity_get_permalink( $activity_id );
    		$settings_slug = function_exists( 'bp_get_settings_slug' ) ? bp_get_settings_slug() : 'settings';
    		$settings_link = bp_core_get_user_domain( $parent_comment->user_id ) . $settings_slug . '/notifications/';
    
    		// Set up and send the message.
    		$ud       = bp_core_get_core_userdata( $parent_comment->user_id );
    		$to       = $ud->user_email;
    		$subject = bp_get_email_subject( array( 'text' => sprintf( __( '%s replied to one of your comments', 'buddypress' ), $poster_name ) ) );
    
    		$poster_name = stripslashes( $poster_name );
    		$content = bp_activity_filter_kses( stripslashes( $content ) );
    
    $message = sprintf( __(
    '%1$s replied to one of your comments:
    
    "%2$s"
    
    To view the original activity, your comment and all replies, log in and visit: %3$s
    
    ---------------------
    ', 'buddypress' ), $poster_name, $content, $thread_link );
    
    		// Only show the disable notifications line if the settings component is enabled.
    		if ( bp_is_active( 'settings' ) ) {
    			$message .= sprintf( __( 'To disable these notifications please log in and go to: %s', 'buddypress' ), $settings_link );
    		}
    
    		/**
    		 * Filters the user email that the new comment reply notification will be sent to.
    		 *
    		 * @since 1.2.0
    		 *
    		 * @param string $to User email the notification is being sent to.
    		 */
    		$to = apply_filters( 'bp_activity_new_comment_notification_comment_author_to', $to );
    
    		/**
    		 * Filters the new comment reply notification subject that will be sent to user.
    		 *
    		 * @since 1.2.0
    		 *
    		 * @param string $subject     Email notification subject text.
    		 * @param string $poster_name Name of the person who made the comment reply.
    		 */
    		$subject = apply_filters( 'bp_activity_new_comment_notification_comment_author_subject', $subject, $poster_name );
    
    		/**
    		 * Filters the new comment reply notification message that will be sent to user.
    		 *
    		 * @since 1.2.0
    		 *
    		 * @param string $message       Email notification message text.
    		 * @param string $poster_name   Name of the person who made the comment reply.
    		 * @param string $content       Content of the comment reply.
    		 * @param string $settings_link URL permalink for the user's notification settings area.
    		 * @param string $thread_link   URL permalink for the activity thread.
    		 */
    		$message = apply_filters( 'bp_activity_new_comment_notification_comment_author_message', $message, $poster_name, $content, $settings_link, $thread_link );
    
    		wp_mail( $to, $subject, $message );
    
    		/**
    		 * Fires after the sending of a reply to a reply email notification.
    		 *
    		 * @since 1.5.0
    		 *
    		 * @param int    $user_id      ID of the parent activity item author.
    		 * @param string $subject      Email notification subject text.
    		 * @param string $message      Email notification message text.
    		 * @param int    $comment_id   ID for the newly received comment.
    		 * @param int    $commenter_id ID of the user who made the comment.
    		 * @param array  $params       Arguments used with the original activity comment.
    		 */
    		do_action( 'bp_activity_sent_reply_to_reply_email', $parent_comment->user_id, $subject, $message, $comment_id, $commenter_id, $params );
    	}
    }
    
    /**
     * Helper method to map action arguments to function parameters.
     *
     * @since 1.9.0
     *
     * @param int   $comment_id ID of the comment being notified about.
     * @param array $params     Parameters to use with notification.
     */
    function bp_activity_new_comment_notification_helper( $comment_id, $params ) {
    	bp_activity_new_comment_notification( $comment_id, $params['user_id'], $params );
    }
    add_action( 'bp_activity_comment_posted', 'bp_activity_new_comment_notification_helper', 10, 2 );
    
    /** Notifications *************************************************************/
    
    /**
     * Format notifications related to activity.
     *
     * @since 1.5.0
     *
     * @uses bp_loggedin_user_domain()
     * @uses bp_get_activity_slug()
     * @uses bp_core_get_user_displayname()
     * @uses apply_filters() To call the 'bp_activity_multiple_at_mentions_notification' hook.
     * @uses apply_filters() To call the 'bp_activity_single_at_mentions_notification' hook.
     * @uses do_action() To call 'activity_format_notifications' hook.
     *
     * @param string $action            The type of activity item. Just 'new_at_mention' for now.
     * @param int    $item_id           The activity ID.
     * @param int    $secondary_item_id In the case of at-mentions, this is the mentioner's ID.
     * @param int    $total_items       The total number of notifications to format.
     * @param string $format            'string' to get a BuddyBar-compatible notification, 'array' otherwise.
     * @return string $return Formatted @mention notification.
     */
    function bp_activity_format_notifications( $action, $item_id, $secondary_item_id, $total_items, $format = 'string' ) {
    
    	switch ( $action ) {
    		case 'new_at_mention':
    			$activity_id      = $item_id;
    			$poster_user_id   = $secondary_item_id;
    			$at_mention_link  = bp_loggedin_user_domain() . bp_get_activity_slug() . '/mentions/';
    			$at_mention_title = sprintf( __( '@%s Mentions', 'buddypress' ), bp_get_loggedin_user_username() );
    			$amount = 'single';
    
    			if ( (int) $total_items > 1 ) {
    				$text = sprintf( __( 'You have %1$d new mentions', 'buddypress' ), (int) $total_items );
    				$amount = 'multiple';
    			} else {
    				$user_fullname = bp_core_get_user_displayname( $poster_user_id );
    				$text =  sprintf( __( '%1$s mentioned you', 'buddypress' ), $user_fullname );
    			}
    		break;
    	}
    
    	if ( 'string' == $format ) {
    
    		/**
    		 * Filters the @mention notification for the string format.
    		 *
    		 * This is a variable filter that is dependent on how many items
    		 * need notified about. The two possible hooks are bp_activity_single_at_mentions_notification
    		 * or bp_activity_multiple_at_mentions_notification.
    		 *
    		 * @since 1.5.0
    		 *
    		 * @param string $string          HTML anchor tag for the mention.
    		 * @param string $at_mention_link The permalink for the mention.
    		 * @param int    $total_items     How many items being notified about.
    		 * @param int    $activity_id     ID of the activity item being formatted.
    		 * @param int    $poster_user_id  ID of the user posting the mention.
    		 */
    		$return = apply_filters( 'bp_activity_' . $amount . '_at_mentions_notification', '<a href="' . esc_url( $at_mention_link ) . '" title="' . esc_attr( $at_mention_title ) . '">' . esc_html( $text ) . '</a>', $at_mention_link, (int) $total_items, $activity_id, $poster_user_id );
    	} else {
    
    		/**
    		 * Filters the @mention notification for any non-string format.
    		 *
    		 * This is a variable filter that is dependent on how many items need notified about.
    		 * The two possible hooks are bp_activity_single_at_mentions_notification
    		 * or bp_activity_multiple_at_mentions_notification.
    		 *
    		 * @since 1.5.0
    		 *
    		 * @param array  $array           Array holding the content and permalink for the mention notification.
    		 * @param string $at_mention_link The permalink for the mention.
    		 * @param int    $total_items     How many items being notified about.
    		 * @param int    $activity_id     ID of the activity item being formatted.
    		 * @param int    $poster_user_id  ID of the user posting the mention.
    		 */
    		$return = apply_filters( 'bp_activity_' . $amount . '_at_mentions_notification', array(
    			'text' => $text,
    			'link' => $at_mention_link
    		), $at_mention_link, (int) $total_items, $activity_id, $poster_user_id );
    	}
    
    	/**
    	 * Fires right before returning the formatted activity notifications.
    	 *
    	 * @since 1.2.0
    	 *
    	 * @param string $action            The type of activity item.
    	 * @param int    $item_id           The activity ID.
    	 * @param int    $secondary_item_id @mention mentioner ID.
    	 * @param int    $total_items       Total amount of items to format.
    	 */
    	do_action( 'activity_format_notifications', $action, $item_id, $secondary_item_id, $total_items );
    
    	return $return;
    }
    
    /**
     * Notify a member when their nicename is mentioned in an activity stream item.
     *
     * Hooked to the 'bp_activity_sent_mention_email' action, we piggy back off the
     * existing email code for now, since it does the heavy lifting for us. In the
     * future when we separate emails from Notifications, this will need its own
     * 'bp_activity_at_name_send_emails' equivalent helper function.
     *
     * @since 1.9.0
     *
     * @param object $activity           Activity object.
     * @param string $subject (not used) Notification subject.
     * @param string $message (not used) Notification message.
     * @param string $content (not used) Notification content.
     * @param int    $receiver_user_id   ID of user receiving notification.
     */
    function bp_activity_at_mention_add_notification( $activity, $subject, $message, $content, $receiver_user_id ) {
    	if ( bp_is_active( 'notifications' ) ) {
    		bp_notifications_add_notification( array(
    			'user_id'           => $receiver_user_id,
    			'item_id'           => $activity->id,
    			'secondary_item_id' => $activity->user_id,
    			'component_name'    => buddypress()->activity->id,
    			'component_action'  => 'new_at_mention',
    			'date_notified'     => bp_core_current_time(),
    			'is_new'            => 1,
    		) );
    	}
    }
    add_action( 'bp_activity_sent_mention_email', 'bp_activity_at_mention_add_notification', 10, 5 );
    
    /**
     * Mark at-mention notifications as read when users visit their Mentions page.
     *
     * @since 1.5.0
     *
     * @uses bp_notifications_mark_all_notifications_by_type()
     */
    function bp_activity_remove_screen_notifications() {
    	if ( ! bp_is_active( 'notifications' ) ) {
    		return;
    	}
    
    	// Only mark read if you're looking at your own mentions.
    	if ( ! bp_is_my_profile() ) {
    		return;
    	}
    
    	bp_notifications_mark_notifications_by_type( bp_loggedin_user_id(), buddypress()->activity->id, 'new_at_mention' );
    }
    add_action( 'bp_activity_screen_mentions', 'bp_activity_remove_screen_notifications' );
    
    /**
     * Mark at-mention notification as read when user visits the activity with the mention.
     *
     * @since 2.0.0
     *
     * @param BP_Activity_Activity $activity Activity object.
     */
    function bp_activity_remove_screen_notifications_single_activity_permalink( $activity ) {
    	if ( ! bp_is_active( 'notifications' ) ) {
    		return;
    	}
    
    	if ( ! is_user_logged_in() ) {
    		return;
    	}
    
    	// Mark as read any notifications for the current user related to this activity item.
    	bp_notifications_mark_notifications_by_item_id( bp_loggedin_user_id(), $activity->id, buddypress()->activity->id, 'new_at_mention' );
    }
    add_action( 'bp_activity_screen_single_activity_permalink', 'bp_activity_remove_screen_notifications_single_activity_permalink' );
    
    /**
     * Delete at-mention notifications when the corresponding activity item is deleted.
     *
     * @since 2.0.0
     *
     * @param array $activity_ids_deleted IDs of deleted activity items.
     */
    function bp_activity_at_mention_delete_notification( $activity_ids_deleted = array() ) {
    	// Let's delete all without checking if content contains any mentions
    	// to avoid a query to get the activity.
    	if ( bp_is_active( 'notifications' ) && ! empty( $activity_ids_deleted ) ) {
    		foreach ( $activity_ids_deleted as $activity_id ) {
    			bp_notifications_delete_all_notifications_by_type( $activity_id, buddypress()->activity->id );
    		}
    	}
    }
    add_action( 'bp_activity_deleted_activities', 'bp_activity_at_mention_delete_notification', 10 );
    #248156
    jscmal
    Participant

    @shanebp

    Here the list of plugins installed in this moment:

    advanced-lazy-load
    advanced-recent-posts
    affiliates-manager
    affiliates-manager-simple-membership-integration
    akismet
    bp-activity-autoloader
    bp-activity-comment-notifier
    bp-activity-shortcode
    buddypress
    buddypress-cover-photo
    buddypress-first-letter-avatar
    buddypress-followers
    buddypress-media
    buddypress-members-only
    buddypress-sticker
    cookie-law-info
    ewww-image-optimizer
    eyes-only-user-access-shortcode
    favorites
    fb-like-notification-for-buddypress
    google-analytics-dashboard-for-wp
    hashbuddy
    invite-anyone
    jetpack
    mailchimp-for-wp
    options-importer
    options-optimizer
    redirection
    simple-ajax-chat
    simple-membership
    simple-membership-after-login-redirection
    simple-membership-custom-messages
    simple-membership-form-shortcode
    simple-membership-mailchimp-integration
    simple-membership-menu
    simple-membership-wp-user-import
    stream
    testimonials-by-woothemes
    user-role-editor
    user-switching
    woosidebars
    wordpress-database-reset
    wordpress-importer
    wordpress-seo
    wp-optimize
    wp-postviews
    wp-super-cache
    wp-sweep
    wp-symposium-toolbar
    wp-useronline
    wp-video-lightbox

    #248123
    jscmal
    Participant

    About the WordPress Debug, the log track always these errors:

    [27-Dec-2015 03:30:31 UTC] PHP Notice:  bp_setup_current_user was called <strong>incorrectly</strong>. The current user is being initialized without using $wp->init(). Please see <a href="https://codex.wordpress.org/Debugging_in_WordPress">Debugging in WordPress</a> for more information. (This message was added in version 1.7.) in /home/xxxxx/wp-includes/functions.php on line 3787
    [27-Dec-2015 03:30:31 UTC] PHP Notice:  The called constructor method for WP_Widget is <strong>deprecated</strong> since version 4.3.0! Use <pre>__construct()</pre> instead. in /home/xxxxx/wp-includes/functions.php on line 3619
    [27-Dec-2015 03:30:31 UTC] PHP Notice:  bp_core_get_notifications_for_user is <strong>deprecated</strong> since version 1.9! Use bp_notifications_get_notifications_for_user() instead. in /home/xxxxx/wp-includes/functions.php on line 3568

    What can I do to manage this situation?

    Please, help me!

Viewing 25 results - 326 through 350 (of 768 total)
Skip to toolbar