Search Results for 'notification user id'
-
AuthorSearch Results
-
February 1, 2015 at 9:18 am #233333
In 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’ ); ?>November 29, 2014 at 3:28 am #229862In reply to: Our Member Posts Pages Not Showing in Buddypress
Brent Havill
ParticipantHi 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.November 19, 2014 at 6:58 pm #229209In reply to: [Resolved] Notification – what's wrong here?
Security
ParticipantHi 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 changesNovember 9, 2014 at 10:05 am #228794In reply to: Buddypress comment notification
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/
October 31, 2014 at 5:28 pm #228023In reply to: Live Notifications
Paul Bursnall
ParticipantHi @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.
October 5, 2014 at 1:14 pm #204289Henry Wright
ModeratorTry 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
September 22, 2014 at 9:21 pm #199814Halo Diehard
ParticipantYeah, 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?
September 8, 2014 at 2:51 pm #190941In reply to: Activity Favorite Notification
aghajoon
Participantthis 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(); } }); }September 4, 2014 at 10:52 am #189599In reply to: Extended Profiles / Can't edit the fields
danbp
ParticipantIt 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 settingsAnd if component is activated:
– Friends
– Groups
– ForumI 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 optionAugust 26, 2014 at 6:44 pm #188529natb19
ParticipantAnton, 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!?)
-
AuthorSearch Results