Search Results for 'notification user id'
-
AuthorSearch Results
-
February 3, 2015 at 9:15 pm #233516
In reply to: in profile hide notifications and settings
fanmusic
ParticipantHi,
Actually no, thats not it, there is no option for that in buddypress, I need to hide the buttons notifications and settings (that are along with profile, messages groupes etc.)
it’s in the front office.thanks a lot
PS : someone posted this, I think it’s on the right track but it doesn’t work :/
[ edited – please use ‘code’ button when posting code ]
Try this in bp-custom.phpfunction fanmusic_remove_profile_nav_remove( $nav ) { $nav = ''; return $nav; } add_filter('bp_get_displayed_user_nav_notifications', 'fanmusic_remove_profile_nav_remove', 10, 1 ); add_filter('bp_get_displayed_user_nav_settings', 'fanmusic_remove_profile_nav_remove', 10, 1 );February 2, 2015 at 9:51 am #233408In reply to: Notification
Brajesh Singh
ParticipantHi Christian,
There is one functionality in BuddyPress that allows it. You can see the feature as site wide notice(Mark a message as notice).The problem is currently, only a user with the capability ‘bp_moderate’ can send the notice. Do you want to allow this notification feature for all users or just selected few?
February 1, 2015 at 3:58 pm #233356In reply to: [Resolved] How To Get Notification Count? (Code)?
Brajesh Singh
ParticipantHi Chaitanya,
Try this code.function bpfr_add_notification_to_page_title( $title, $original_title, $sep ) { //do not change if the user is not logged in if( ! is_user_logged_in() ) return $title; $user_id = get_current_user_id();//logged in user's id $count = bp_notifications_get_unread_notification_count( $user_id ); if( $count > 0 ) $title = sprintf( "You Have %d New Notification(s) - ", $count ); return $title; } add_filter( 'wp_title', 'bpfr_add_notification_to_page_title', 100, 3 );I have modified the code from your last post. The difference is, It only does it for logged in users. Also, I have decreased the priority to make it work on BuddyPress pages( otherwide bp_modify_title would have overwritten it).
Hope that helps.
February 1, 2015 at 2:58 pm #233352In reply to: [Resolved] How To Get Notification Count? (Code)?
chatty24
Participant@danbp
I have edited the code a bit and now it is getting displayed on all the pages as I wanted but, How can I hide the modified title when the notification count is 0. By current code is below –function bpfr_add_notification_to_page_title( $title, $original_title, $sep, $seplocation ) { global $bp; if( bp_is_user() && ! bp_get_member_user_id() ) { $user_id = 'displayed: '. bp_displayed_user_id(); } else { $user_id = 'get_member_user: '. bp_get_member_user_id(); } if (bp_notifications_get_unread_notification_count( $user_id ) ) { $counter = 0; for ( $i = 0; $i < count($notifications); $i++ ) { echo $notifications[$i]; $counter++; } $title = "You Have " . bp_notifications_get_unread_notification_count() . " New Notification(s) - "; return $title; } } add_filter( 'wp_title', 'bpfr_add_notification_to_page_title', 9, 4 );Thanks
February 1, 2015 at 2:07 pm #233349In reply to: [Resolved] How To Get Notification Count? (Code)?
danbp
ParticipantTry this (tested on 2.2 RC2)
function bpfr_add_notification_to_page_title( $title, $original_title, $sep, $seplocation ) { global $bp; if( bp_is_user() && ! bp_get_member_user_id() ) { $user_id = 'displayed: '. bp_displayed_user_id(); } else { $user_id = 'get_member_user: '. bp_get_member_user_id(); } if (bp_notifications_get_unread_notification_count( $user_id ) ) { $counter = 0; for ( $i = 0; $i < count($notifications); $i++ ) { echo $notifications[$i]; $counter++; } if ( bp_is_profile_component() || bp_is_current_action( 'just-me' ) ) { $title .= bp_notifications_get_unread_notification_count() . " $sep "; } return $title; } } add_filter( 'bp_modify_page_title', 'bpfr_add_notification_to_page_title', 9, 4 );February 1, 2015 at 12:32 pm #233345In reply to: [Resolved] How To Get Notification Count? (Code)?
chatty24
ParticipantI tried using the below code but it is returning the value to zero too đ
echo bp_notifications_get_unread_notification_count( bp_loggedin_user_id() );February 1, 2015 at 12:13 pm #233344In reply to: [Resolved] How To Get Notification Count? (Code)?
Henry Wright
Moderator…how do I get it?
That depends. For example:
If you want the currently logged-in user:
$user_id = bp_loggedin_user_id();If the context is a member’s profile page and you want the displayed member:
$user_id = bp_displayed_user_id();So, depending on the above, what you need may be either:
bp_notifications_get_unread_notification_count( bp_loggedin_user_id() );or
bp_notifications_get_unread_notification_count( bp_displayed_user_id() );Because we’re talking about notifications, it’s likely you’ll want the former because you wouldn’t really need to show somebody else’s notifications count.
February 1, 2015 at 11:21 am #233340In reply to: [Resolved] How To Get Notification Count? (Code)?
chatty24
ParticipantThanks for the reply but
I used the below code to print the notification count on my page to match it with the notification count which is shown by wordpress and I noticed that the below code returns the value to zero no matter what ever the original notification count is.
echo bp_notifications_get_unread_notification_count( $user_id );and yes I need unread notification count.
February 1, 2015 at 11:08 am #233338In reply to: [Resolved] How To Get Notification Count? (Code)?
Henry Wright
ModeratorThere’s 2 types of notifications: a) read and b) unread.
bp_notifications_get_unread_notification_count( $user_id )will get you the unread count so you could use that value in the comparison you mentioned here.February 1, 2015 at 9:18 am #233333In reply to: [Resolved] How To Get Notification Count? (Code)?
danbp
ParticipantTry this
if ( $notifications = bp_notifications_get_notifications_for_user( $user_id, $format = 'string' ) ) { $counter = 0; for ( $i = 0; $i < count($notifications); $i++ ) { $alt = ( 0 == $counter % 2 ) ? ' class="alt"' : ''; echo '<span ="'.$alt.'">'. $notifications[$i] .'</span>'; $counter++; }January 21, 2015 at 6:27 pm #232685r-a-y
KeymasterWe’re looking to improve the invite process for BuddyPress 2.3.
I’m going to ping @dcavins, as he will be implementing the invite improvements, so he’s aware of this.
Just to answer your questions:
Notification in the profile windowâs (there are 3 notifications: message (1) â friends (1) â but in GROUPS there is no notification).
The “Groups > No Pending Invites” nav item is for invites you have requested. Not invites that are pending for the entire group.
The user (A) has posted in a group wallâs and the user (B) has done a comment.
The user (A) hasnât received notification neither admin toolbar or administration profile windows.Currently, notifications do not occur for activity comments. We’ll likely add this enhancement into core eventually, but for now, you’ll have to use a plugin for this:
The user (A) has opened a forum in a grup. The user (B) has done a comment.
The user (A) has received notification in the administratio toolbar. But when the user (A) has done a comment the user (B) donât has received the notification.How did user A reply to user B? On the group activity homepage or on the actual group forum topic? If user A replied on the group forum topic, then this sounds like an issue with bbPress, not BuddyPress.
January 17, 2015 at 4:54 pm #232466chatty24
ParticipantThe code is working fine. But, now the website is showing this strange behavior. Whenever I try to go to something like, example.com/username/profile or /notifications etc.
It gets me back to, example.com/username
And if I remove the code the error goes away.
Any ideas why is that happening?
Thanks
January 13, 2015 at 3:02 am #231894In reply to: Redirect users to their notifications after login
jessicana
ParticipantIn other way, I will be using this code for the whole site except login widgets (like BBpress log in sidebar widget):
function jessicana_redirect_page( $redirect_to, $request, $user ) { $redirect_to = bp_core_get_user_domain($user->ID) . 'notifications/'; return $redirect_to; } add_filter('login_redirect', 'jessicana_redirect_page', 11, 3);For widgets, I need a different function that redirects to the same page where users logs from. Is this possible?
I appreciate the help
January 13, 2015 at 12:29 am #231887In reply to: Redirect users to their notifications after login
jessicana
ParticipantOne more question. What if I want users who logs in using the sidebar widget to return to the same page where they were while I want users who logs in using homepage link to be directed to their notifications page?
January 12, 2015 at 11:51 pm #231885In reply to: Redirect users to their notifications after login
shanebp
ModeratorTry this:
function jessicana_redirect_page( $redirect_to, $request, $user ) { $redirect_to = bp_core_get_user_domain($user->ID) . 'notifications/'; return $redirect_to; } add_filter('login_redirect', 'jessicana_redirect_page', 11, 3);January 2, 2015 at 11:31 pm #231406In reply to: Function to check if group has notifications
danbp
ParticipantThxs @shanebp, i ignored that. đ
Corrected function here:
function bpfr_sidebar_notifications_menu() { global $bp; // if user is not logged, we do nothing if ( !is_user_logged_in() ) return false; // if user is group member, show him notification + count if ( groups_is_user_member( bp_loggedin_user_id(), $bp->groups->current_group->id ) && $notifications = bp_notifications_get_notifications_for_user( $user_id, $format = 'string' ) ) { $counter = 0; for ( $i = 0; $i < count($notifications); $i++ ) { $alt = ( 0 == $counter % 2 ) ? ' class="alt"' : ''; echo '<p ="'.$alt.'"><i class="fa fa-group"></i>'. $notifications[$i] .'</p>'; $counter++; } } }Shows anything group related to the concerned group member.
Mentions, membership request/reject, promotion,…January 2, 2015 at 6:34 pm #231399In reply to: Function to check if group has notifications
shanebp
ModeratorNice @danbp, but a couple of issues…
bp_core_get_notifications_for_useris deprecated.Instead use
bp_notifications_get_notifications_for_user( $user_id, $format = 'string' )And I’d try using
$format = 'object'so you can loop thru the results and only display those items related to that group.Of course, this will only get notifications for a single person.
I’m not sure if there would be notifications for a group other than activity update…?January 2, 2015 at 5:52 pm #231398In reply to: Function to check if group has notifications
danbp
Participanthi ouegy,
Add this snippet to your child-theme functions.php and give it a try.
First function grabs the notification
Second function allows to add a hook to the template (in your case sidebar.php)
And the hook to use.function bpfr_sidebar_notifications_menu() { global $bp; // if user is not logged, we do nothing if ( !is_user_logged_in() ) return false; // if user is group member, show him notification + count if ( groups_is_user_member( bp_loggedin_user_id(), $bp->groups->current_group->id ) && $notifications = bp_core_get_notifications_for_user( $bp->loggedin_user->id ) ) { echo '<ul>'; $counter = 0; for ( $i = 0; $i < count($notifications); $i++ ) { $alt = ( 0 == $counter % 2 ) ? ' class="alt"' : ''; echo '<li ="'.$alt.'"><i class="fa fa-group"></i>'. $notifications[$i] .'</li>'; $counter++; echo '</ul>'; } } } function bpfr_xtra_group_sidebar() { // show notification only on the group sidebar if(bp_is_groups_component() ): // your content bpfr_sidebar_notifications_menu(); endif; } add_action( 'xtragroup', 'bpfr_xtra_group_sidebar' );The hook to add to sidebar.php (or any other template)
<?php do_action( 'xtragroup' ); ?>Hope this help ! đ
December 9, 2014 at 11:33 pm #230355In reply to: BuddyPress group avatar spillage across networks
marvc
ParticipantI have the following on another network:
<?php /* Plugin Name: BP Multi Network Plugin URI: http://wpmututorials.com/news/new-features/multiple-buddypress-social-networks/ Description: Segregate your BP networks in a multi-network WP install (must be installed in the mu-plugins folder) Version: 0.1.1 Author: Ron Rennick Author URI: http://ronandandrea.com/ */ /* Copyright: (C) 2011 Ron Rennick, All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ function ra_bp_multinetwork_filter( $prefix ) { global $wpdb; if( $wpdb->siteid > 1 && $prefix == $wpdb->base_prefix ) { $current_site = get_current_site(); return $wpdb->get_blog_prefix( $current_site->blog_id ); } return $prefix; } add_filter( âbp_core_get_table_prefixâ, âra_bp_multinetwork_filterâ ); function ra_bp_multinetwork_meta_key_filter( $key ) { global $wpdb; static $user_meta_keys = array( âlast_activityâ => false, âbp_new_mention_countâ => false, âbp_favorite_activitiesâ => false, âbp_latest_updateâ => false, âtotal_friend_countâ => false, âtotal_group_countâ => false, ânotification_groups_group_updatedâ => false, ânotification_groups_membership_requestâ => false, ânotification_membership_request_completedâ => false, ânotification_groups_admin_promotionâ => false, ânotification_groups_inviteâ => false, ânotification_messages_new_messageâ => false, ânotification_messages_new_noticeâ => false, âclosed_noticesâ => false, âprofile_last_updatedâ => false, ânotification_activity_new_mentionâ => false, ânotification_activity_new_replyâ => false ); if( $wpdb->siteid < 2 || !isset( $user_meta_keys[$key] ) ) return $key; if( !$user_meta_keys[$key] ) { $current_site = get_current_site(); $user_meta_keys[$key] = $wpdb->get_blog_prefix( $current_site->blog_id ) . $key; } return $user_meta_keys[$key]; } add_filter( âbp_get_user_meta_keyâ, âra_bp_multinetwork_meta_key_filterâ );December 9, 2014 at 11:32 pm #230354In reply to: BuddyPress group avatar spillage across networks
marvc
ParticipantIn terms of the BP Multi-Network plugin I have the following on one network:
<?php /* Plugin Name: BP Multi Network Plugin URI: http://wpmututorials.com/news/new-features/multiple-buddypress-social-networks/ Description: Segregate your BP networks in a multi-network WP install (must be installed in the mu-plugins folder) Version: 0.1 Author: Ron Rennick Author URI: http://ronandandrea.com/ */ /* Copyright: (C) 2011 Ron Rennick, All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ function ra_bp_multinetwork_filter( $prefix ) { global $wpdb; if( $wpdb->siteid > 1 && $prefix == $wpdb->base_prefix ) { $current_site = get_current_site(); return $wpdb->get_blog_prefix( $current_site->blog_id ); } return $prefix; } add_filter( âbp_core_get_table_prefixâ, âra_bp_multinetwork_filterâ ); function ra_bp_multinetwork_meta_key_filter( $key ) { global $wpdb; static $user_meta_keys = array( âbp_new_mention_countâ => false, âbp_favorite_activitiesâ => false, âbp_latest_updateâ => false, âtotal_friend_countâ => false, âtotal_group_countâ => false, ânotification_groups_group_updatedâ => false, ânotification_groups_membership_requestâ => false, ânotification_membership_request_completedâ => false, ânotification_groups_admin_promotionâ => false, ânotification_groups_inviteâ => false, ânotification_messages_new_messageâ => false, ânotification_messages_new_noticeâ => false, âclosed_noticesâ => false, âprofile_last_updatedâ => false, ânotification_activity_new_mentionâ => false, ânotification_activity_new_replyâ => false ); if( $wpdb->siteid < 2 || !isset( $user_meta_keys[$key] ) ) return $key; if( !$user_meta_keys[$key] ) { $current_site = get_current_site(); $user_meta_keys[$key] = $wpdb->get_blog_prefix( $current_site->blog_id ) . $key; } return $user_meta_keys[$key]; } add_filter( âbp_get_user_meta_keyâ, âra_bp_multinetwork_meta_key_filterâ );December 8, 2014 at 8:52 pm #230308In reply to: Comment to Updates not triggering notification
Paul Bursnall
Participant@sebacar @mercime Hi Sebastien, from looking at replies to your Trac ticket, I think something is being lost in translation between ourselves and the devs.
To quote the official documentation :
Notifications are a central aspect of the user experience on a BuddyPress site. By default new notifications are displayed in the admin bar profile menu, right next to the navigation menus, some themes even integrate the notification counter in other places (like in the header or sidebar of a page).
Notifications are sent out to your community members as soon as one of the following things happen:
Activity
A member mentions you in an update @usernameâ
A member replies to an update or comment youâve postedThe activity in bold above definitely stopped triggering notifications on 3 different sites I was testing, where it had previously generated a notification (probably 4 months+ consistently). Quite simply, that notification trigger stopped working. This should not be a new feature, it was already there.
December 3, 2014 at 11:26 am #230051In reply to: Buddy Press Memory Spikes
tim_marston
ParticipantThanks @henrywright
Here is the list:
Admin Tweaks
Advanced Excerpt
Antispam Bee
bbPress
Bowe Codes
BP Auto Activate Autologin Redirect To Profile On Signup
Bp Clear Notifications
BP Group Activities Notifier
Broken Link Checker
BuddyBlock
BuddyPress
Buddy Press Activity Ads
BuddyPress Activity as Wire
BuddyPress Activity Comment Notifier
BuddyPress Activity Privacy
BuddyPress Block Activity Stream Types
BuddyPress Live Notification
BuddyPress Profile Visibility Manager
BuddyPress Security Check
BuddyPress Usernames Only
Delete Expired Transients
Duplicator
Email Login
Facebook Like User Activity Stream For BuddyPress
Google Analytics +
Imsanity
Infinite SEO
Insert Headers and Footers
Mailjet for WordPress
Menu Items Visibility Control
OPcache Dashboard
Post Voting
Pretty Link Lite
Query Monitor
Random Banner
rtMedia for WordPress, BuddyPress and bbPress
rtMedia Pro
s2Member Framework
SearchWP
SearchWP bbPress Integration
Social Likes
Subscribe To Comments
User Activity
Wordfence Security
WordPress FAQ Manager
WP-DBManager
WP-Memory-Usage
wp-Monalisa
WPBakery Visual Composer
WP Better Emails
WP External Links
WP Maintenance Mode
WPMU DEV Dashboard
WP Widget CacheNovember 30, 2014 at 4:52 pm #229954In reply to: Comment to Updates not triggering notification
@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.
November 29, 2014 at 10:48 am #229904In reply to: [Resolved] Notification – what's wrong here?
miama
Participantand 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;November 29, 2014 at 10:44 am #229903In reply to: [Resolved] Notification – what's wrong here?
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â ); ?> -
AuthorSearch Results