Search Results for 'notification user id'
-
Search Results
-
Hello,
I’m using DAP as a membership plugin and it synchs to WP, so I never want the users of the site to see wp-login. I’m having a problem with the notifications emails BP sends out. For instance, on a friend request, the email will list http://www.website.com/username/settings/notifications. If a user is not logged in they will be redirected to wp-login which I don’t want. I need them to redirect to my custom login page http://www.website.com/login.
I believe I traced it back to bp-core-catchuri.php, but my php knowledge is falling a bit short.
I tried to modify the code to the following but it didn’t work, I’m just trying to redirect the bpnoaccess to my custom page:
case 2 :
if ( !empty( $redirect ) ) {
bp_core_redirect( add_query_arg( array( ‘action’ => ‘bpnoaccess’ ), wp_login_url( $redirect ) ) );
} else {
bp_core_redirect( “http://YourSite.com/login/” );
}There’s also this code, which I may have to change…ugh.
$url = $root;
if ( !empty( $redirect ) )
$url = add_query_arg( ‘redirect_to’, urlencode( $redirect ), $root );if ( !empty( $message ) ) {
bp_core_add_message( $message, ‘error’ );
}bp_core_redirect( $url );
Am I way off base here? Can someone with more knowledge help me out? Thanks so much!
Hi,
I’m trying to create a new action which sends an email to the relevant user when his/her activity is deleted by a moderator. So far I have:
add_action( 'bp_before_activity_delete', 'pa_send_notification_email');
function pa_send_notification_email( $args ) {
// If current user deletes his/her own activity, do nothing
if ($args['user_id'] != bp_loggedin_user_id()) {
$ud = get_userdata($args['user_id']);
$to = $ud->user_email;
if (($to) && ($to != '')) {
$subject = 'Your activity has been removed';
$message = 'A moderator has removed your activity posting. If you want to know why, please contact the moderation team.';
$message .= 'Original text:';
$message .= bp_get_activity_content_body();//sends email
wp_mail($to, $subject, $message, 'content-type: text/html' );
}
}
}This works fine except for the line
$message .= bp_get_activity_content_body();, which is attempting to include the original content of the activity (I want to include it so that the user knows exactly what was deleted).I’ve tried
$message .= bp_get_activity_content_body($args['id']);but that didn’t work either.Does anyone know how I ought to be pulling in the activity content body text?
David
How can I force email notifications for new messages and site notifications to be enabled for all users? I don’t want the users to be able to disable this. I’m creating a member site for a organization, and I want to use the message system to communicate with the members.
I don’t mind adding/editing PHP code, but I would prefer to add outside the main plugin, to avoid having to do changes every time I update BuddyPress.
Anyone able to help me?
Howdy folks. I’m currently using both BuddyPress and Gravity Forms. The problem lies when a user fills out a regular contact form built with Gravity Forms. The “Mail From” name shows up as my WP Site Title instead of the name of the user that fills out the form.
The moment I disable BuddyPress, the GF notifications have the correct “Mail From” name.
It seems that BP’s mailer is overriding the default WP mailer. Not sure if there’s a way to fix this or not? I’ve used a couple add-ons that let you change the from name and email address that BP notifications get sent from, but unfortunately it’s just a static setting. Thanks for any insight.
Topic: Hookable Notifications
Hi,
I am trying to create a community using buddypress with live events, so everytime a friend login I get a push notification saying that he is online. The same happens when a friend is offline.
This kind of notifications only have sense when the user is online, and I don’t want to store them as normal bp_notifications, but I do want bp_notifications to push live notifications.To do so, the easiest way would hooking an action when the bp_notification is created, but there are not hooks there

Could you please add some actions or filters to bp_core_add_notification and bp_core_delete_notification functions in bp-members/bp-members-notifications.php file for some next version??
I’ve already modified my bp to do so, but it would be great to have it out of the box.
Cheers and thanks
Topic: How do I find code snippets
I am using the bp sliding login panel plugin and it’s amazing, unfortunately I noticed that it does not notify me or any user of friend requests. However the default admin bar (which I removed) does this perfectly. My solution? Since I’m not a coder, it was to locate the working code in the admin bar and try to make it work with the slider plugin.
Problem is that I CANNOT find the code snippet for it. Right next to where notification number shows up there’s the “howdy admin!” text. I figured I would go open up every file and search for “howdy” but it is NOWHERE??!
I’ts driving me nuts!
Does anyone know where I can find the hard codes for the admin bar, AS WELL as the Nav bar in the latest buddypress? I wanted to change the labels for the nav items but all I can find online are functions that overwrite the labels, which is not what I want, I want to find the ORIGINAL and see how it was actually done. This not only allows me to modify what I want down to the smallest level of detail, but also to understand how this whole thing is built (I would like to learn to make my own themes in the future.)
Sorry for using caps at times but it’s 4:59 in the morning and I realized that I just spent over 4 hours trying to locate various snippets of code with little success!
I’m currently using wordpress 3.4.2
Buddypress latest version.Cheers
Topic: Hide General Settings Tab

I love the snippit feature, but what I and i guess other users mean is if you could share the code used to build mashan.com
I have this function that I pieced together a few months back that worked until a recent WP or BP upgrade (not sure which or when). The function adds blog comments as activity items so that I can have them show up in notifications without actually using the activity feed. It no longer works. Does anyone know why this wouldn’t work anymore?
function rt_bp_blogs_record_comment( $comment_id, $is_approved = true ) {
global $bp;
// Get the users comment
$recorded_comment = get_comment( $comment_id );
// Don't record activity if the comment hasn't been approved
if ( empty( $is_approved ) )
return false;
// Don't record activity if no email address has been included
if ( empty( $recorded_comment->comment_author_email ) )
return false;
// Get the user_id from the comment author email.
$user = get_user_by( 'email', $recorded_comment->comment_author_email );
$user_id = (int)$user->ID;
// If there's no registered user id, don't record activity
if ( empty( $user_id ) )
return false;
// Get blog and post data
$blog_id = get_current_blog_id();
$recorded_comment->post = get_post( $recorded_comment->comment_post_ID );
if ( empty( $recorded_comment->post ) || is_wp_error( $recorded_comment->post ) )
return false;
// If this is a password protected post, don't record the comment
if ( !empty( $recorded_comment->post->post_password ) )
return false;
// Don't record activity if the comment's associated post isn't a WordPress Post
if ( !in_array( $recorded_comment->post->post_type, apply_filters( 'bp_blogs_record_comment_post_types', array( 'post' ) ) ) )
return false;
$is_blog_public = apply_filters( 'bp_is_blog_public', (int)get_blog_option( $blog_id, 'blog_public' ) );
// If blog is public allow activity to be posted
if ( $is_blog_public ) {
// Get activity related links
$post_permalink = get_permalink( $recorded_comment->comment_post_ID );
$comment_link = htmlspecialchars( get_comment_link( $recorded_comment->comment_ID ) );
// Prepare to record in activity streams
if ( is_multisite() )
$activity_action = sprintf( __( '%1$s commented on the post, %2$s, on the site %3$s', 'buddypress' ), bp_core_get_userlink( $user_id ), '' . apply_filters( 'the_title', $recorded_comment->post->post_title ) . '', '' . get_blog_option( $blog_id, 'blogname' ) . '' );
else
$activity_action = sprintf( __( '%1$s commented on the post, %2$s', 'buddypress' ), bp_core_get_userlink( $user_id ), '' . apply_filters( 'the_title', $recorded_comment->post->post_title ) . '' );
$activity_content = $recorded_comment->comment_content;
// Record in activity streams
$activity_id = bp_blogs_record_activity( array(
'user_id' => $user_id,
'action' => apply_filters_ref_array( 'bp_blogs_activity_new_comment_action', array( $activity_action, &$recorded_comment, $comment_link ) ),
'content' => apply_filters_ref_array( 'bp_blogs_activity_new_comment_content', array( $activity_content, &$recorded_comment, $comment_link ) ),
'primary_link' => apply_filters_ref_array( 'bp_blogs_activity_new_comment_primary_link', array( $comment_link, &$recorded_comment ) ),
'type' => 'new_blog_comment',
'item_id' => $blog_id,
'secondary_item_id' => $comment_id,
'recorded_time' => $recorded_comment->comment_date_gmt
) );
// Update the blogs last active date
bp_blogs_update_blogmeta( $blog_id, 'last_activity', bp_core_current_time() );
}
do_action('bp_blogs_comment_recorded',$activity_id);
return $recorded_comment;
}
remove_action( 'comment_post', 'bp_blogs_record_comment', 10, 2 );
remove_action( 'edit_comment', 'bp_blogs_record_comment', 10 );
add_action( 'comment_post', 'rt_bp_blogs_record_comment', 10, 2 );
add_action( 'edit_comment', 'rt_bp_blogs_record_comment', 10 );