Search Results for 'comment notification'
-
AuthorSearch Results
-
January 23, 2013 at 8:58 pm #151573
In reply to: @mention in wordpress post comment
myladeybugg
ParticipantI did find this one: Tagged User Notification It seems to be working so far.
January 21, 2013 at 9:24 am #151272In reply to: @mention in wordpress post comment
myladeybugg
Participant@djpaul Do you know if there is any more news on this? Looks like the tracker was reopened about a year ago. It would be great to add notifications for @mentions in blog posts as well.
January 21, 2013 at 8:56 am #151267In reply to: Blog Comments Notifications Plugin
myladeybugg
Participant@nahummadrid Did you ever find an answer to this? I am also looking for this. And it seems like the BP notifications doesn’t pickup on @mentions in blog posts and comments.
January 4, 2013 at 1:02 pm #149658In reply to: customizing notifications!
Tammie Lister
ModeratorThe plugin I was going to suggest for this is a little out of date. https://wordpress.org/extend/plugins/post-author-comment-notification/ You could look at the code though perhaps to see how it’s done and adapt or see if there is going to be a new version or if indeed it needs a new version (probably best to try in a test environment).
January 2, 2013 at 4:52 pm #149470In reply to: Buddypress Like – Notification Hack
black key
Participant// the problem with your code:
$bp->bp_like->slug = ‘bp_like’;
——————————————————
function bp_like_setup_globals() {
global $bp, $current_blog;
$bp->bp_like=new stdClass();
$bp->bp_like->id = ‘bp-like’;
$bp->bp_like->slug = ‘bp_like’;
$bp->bp_like->notification_callback = ‘bp_like_format_notifications’;
$bp->active_components[$bp->bp_like->slug] = $bp->bp_like->id;
do_action( ‘bp_like_setup_globals’ );
}
add_action( ‘bp_setup_globals’, ‘bp_like_setup_globals’ );function bp_like_format_notifications( $action, $item_id, $secondary_item_id, $total_items,$format=’string’) {
global $bp;
$glue=”;
$user_names=array();
$activity = new BP_Activity_Activity( $activity_id );
$link=ac_notifier_activity_get_permalink2( $activity_id );//si c’est le posteur d’origine, dites que vous êtes, d’autre dire de% s après
if($activity->user_id==$bp->loggedin_user->id){
$text=__(“your”);
$also=””;
}
else{
$text=sprintf(__(“%s’s”), bp_core_get_user_displayname ($activity->user_id));//quelqu’un
$also=” also”;
}
$ac_action=’new_bp_like_’.$item_id;if($action==$ac_action){
//if ( (int)$total_items > 1 ) {
// $users=ac_notifier_find_involved_persons($activity_id);
$total_user= $count=count($users);//montrent de nombreux utilisateurs uniques ont commenté
if($count>2){
$users=array_slice($users, $count-2);//simplement indiquer le nom de deux affiches, le repos doit être aussi et ‘n’ autre a également commenté
$count=$count-2;
$glue=”, “;
}
else if($total_user==2)
$glue=” xxxxxxxxx “;//si il ya 2 utilisateurs uniques, disons x et y commentéforeach((array)$users as $user_id)
$user_names[]=bp_core_get_user_displayname ($user_id);if(!empty($user_names))
$commenting_users=join ($glue, $user_names);if($total_user>2)
$text=$commenting_users.” xxxxxxxxxxxxxxxx “.$count.” xxxxxxxxx”.$also.” xxxxxxxxxxxxxxxx on “.$text. ” post”;//peut-on changer la poste à quelque chose de significatif en fonction de l’élément d’activité?
else
$text=$commenting_users.$also .” xxxxxxxxxxxx on “.$text. ” post”;if($format==’string’)
return apply_filters( ‘bp_activity_multiple_new_likes_notification’, ‘‘ . $text . ‘‘);
else{
return array(‘link’=>$link,
‘text’=>$text);
}
return false;
}}
December 7, 2012 at 5:18 pm #146773Andrew Tibbetts
ParticipantOkaaay, the plugin IS working. Does anyone know why an entry in wp_bp_notifications would not be showing up in notifications?
entry in wp_bp_notifications:
id user_id item_id secondary_item_id component_name component_action date_notified is_new
196 4 209 0 pc_notifier new_post_comment_209 2012-12-07 17:08:16 1
User id#3 is creating the comment and user id#4 is not receiving the notification in the top bar. Anyone know why?
December 7, 2012 at 3:23 pm #146765Andrew Tibbetts
ParticipantOk, I think I’ve narrowed it down to this function in the plugin. I know that the function that it is hooking into works. Anyone know why this would fail?
function pc_notifier_notify($activity_id) {
global $bp;$activity = new BP_Activity_Activity($activity_id);
$comment = get_comment($activity->secondary_item_id);
$users = pc_notifier_find_involved_persons($comment->comment_post_ID);
$link = get_permalink($comment->comment_post_ID);if($activity->hide_sitewide) return;
if(!in_array($activity->user_id, $users)&&($bp->loggedin_user->id!=$activity->user_id)) array_push ($users, $activity->user_id);
foreach((array)$users as $user_id){
bp_core_add_notification( $activity_id, $user_id, $bp->pc_notifier->id, 'new_post_comment_'.$activity_id );
}}
add_action("bp_blogs_comment_recorded","pc_notifier_notify",10,1); // hook to bp_blogs_comment_recorded for adding notificationDecember 6, 2012 at 10:37 pm #146721Andrew Tibbetts
ParticipantActually, this function is working—it is creating activity items based on blog posts and comments. I found out that it’s my custom plugin that is supposed to hook into this custom post or comment action to create a notification. Here is the plugin. I know no one will even try to tackle this but I have to post this because it’s my only option and I one for due diligence…
/**
* Plugin Name:BuddyPress Post Comment Notifier
* Description: Mod of Brajesh Singh's BuddyPress Activity Comment Notifier to work for Blog Post Comments
*
*/// we are not much concerned with the slug, it is not visible
define("BP_COMMENT_NOTIFIER_SLUG","pc_notification");//register a dummy notifier component, I don't want to do it, but bp has no other mechanism for passing the notification data to function, so we need the format_notification_function
function pc_notifier_setup_globals() {
global $bp, $current_blog;
$bp->pc_notifier=new stdClass();
$bp->pc_notifier->id = 'pc_notifier';//I asume others are not going to use this is
$bp->pc_notifier->slug = BP_COMMENT_NOTIFIER_SLUG;
$bp->pc_notifier->notification_callback = 'pc_notifier_format_notifications';//show the notification
/* Register this in the active components array */
$bp->active_components[$bp->pc_notifier->slug] = $bp->pc_notifier->id;do_action( 'pc_notifier_setup_globals' );
}
add_action( 'bp_setup_globals', 'pc_notifier_setup_globals' );/**
* storing notification for users
* notify all the users who have commented, or who was the original poster of the update, when someone comments
* hook to bp_blogs_comment_recorded action
*/
function pc_notifier_notify($activity_id) {
global $bp;$activity = new BP_Activity_Activity($activity_id);
$comment = get_comment($activity->secondary_item_id);
$users = pc_notifier_find_involved_persons($comment->comment_post_ID);
$link = get_permalink($comment->comment_post_ID);if($activity->hide_sitewide) return;
if(!in_array($activity->user_id, $users)&&($bp->loggedin_user->id!=$activity->user_id)) array_push ($users, $activity->user_id);
foreach((array)$users as $user_id){
bp_core_add_notification( $activity_id, $user_id, $bp->pc_notifier->id, 'new_post_comment_'.$activity_id );
}}
add_action("bp_blogs_comment_recorded","pc_notifier_notify",10,1); // hook to bp_blogs_comment_recorded for adding notification/** our notification format function which shows notification to user
*
* @global $bp
* @param $action
* @param $activity_id
* @param $secondary_item_id
* @param $total_items
* @return
* @since 1.0.2
* @desc format and show the notification to the user
*/
function pc_notifier_format_notifications( $action, $activity_id, $secondary_item_id, $total_items, $format='string' ) {global $bp;
$glue = '';
$user_names = array();
$activity = new BP_Activity_Activity( $activity_id );
$comment = get_comment($activity->secondary_item_id);
$link = get_permalink($comment->comment_post_ID);
$comment_post = get_post($comment->comment_post_ID);if ( $activity->user_id == $bp->loggedin_user->id ) $text = __("your post");
else $text = sprintf(__("%s"), $comment_post->post_title);$pc_action = 'new_post_comment_'.$activity_id;
if ( $action == $pc_action ) {
$users = pc_notifier_find_involved_persons($comment->comment_post_ID);
$total_user = $count = count($users);//how many unique users have commented
if ( $count > 2 ) {
$users = array_slice($users, $count-2);//just show name of two poster, rest should be as and 'n' other also commeted
$count = $count-2;
$glue=", ";
}
else if ( $total_user == 2 ) $glue = " and ";//if there are 2 unique users , say x and y commentedforeach ( (array)$users as $user_id )
$user_names[] = bp_core_get_user_displayname($user_id);if ( !empty($user_names) )
$commenting_users = join($glue,$user_names);if ( $total_user > 2 )
$text = $commenting_users." and ".$count." others commented on ".$comment_post->post_title;
else
$text = $commenting_users." commented on ".$comment_post->post_title;if ( $format == 'string' )
return apply_filters('bp_activity_multiple_new_comment_notification','comment_ID.'">'.$text.'');
else {
$link .= '#comment-'.$comment->comment_ID;
return array('link'=>$link,'text'=>$text);
}}
return false;
}
/*
* Remove activity for the comments on new_blog_post & new_blog_comment activity item.
* Since these items do not have a single activity view and are linked to the single post screen, we will do the needed on single post view
*/function pc_notifier_remove_notification_for_blog_posts(){
if( !( is_user_logged_in() && is_singular() ) )
return;global $bp,$wpdb;
$blog_id = (int)$wpdb->blogid;
$post = wp_get_single_post();
$activity_id = bp_activity_get_activity_id(
array(
'user_id' => $post->post_author,
'component' => $bp->blogs->id,
'type' => "new_blog_post",
'item_id' => $blog_id,
'secondary_item_id' => $post->ID
)
);
//delete the notification for activity comment on new_blog_post
if( !empty($activity_id) )
bp_core_delete_notifications_by_item_id( $bp->loggedin_user->id, $activity_id, $bp->pc_notifier->id, 'new_post_comment_'.$activity_id );//for replies on blog comments in activity stream
$comments = pc_notifier_get_all_blog_post_comment_ids($post->ID);//get all the comment ids as array//added in v 1.0.3 for better database performance, no more looping to get individual activity ids
$activities = pc_notifier_get_activity_ids(
array(
"type"=>"new_blog_comment",
"component" => $bp->blogs->id,
"item_id"=>$blog_id,
"secondary_ids"=>$comments
)
);foreach( (array)$activities as $pc_id )
bp_core_delete_notifications_by_item_id( $bp->loggedin_user->id, $pc_id, $bp->pc_notifier->id, 'new_post_comment_'.$pc_id );}
add_action("wp_head","pc_notifier_remove_notification_for_blog_posts");/**
* @since v 1.0.2
* @desc delete notification when an activity is deleted, thanks to @kat_uk for pointing the issue
* @param pc_ids:we get an arry of activity ids
*/
function bp_pc_clear_notification_on_activity_delete($pc_ids){
global $bp;foreach ( (array)$pc_ids as $activity_id )
bp_core_delete_all_notifications_by_type( $activity_id, $bp->pc_notifier->id, 'new_post_comment_'.$activity_id, $secondary_item_id = false );
}
add_action("bp_activity_deleted_activities","bp_pc_clear_notification_on_activity_delete");/************************************ HELPER FUNCTIONS ********************************************************/
// find all users who commented on the post
function pc_notifier_find_involved_persons($comment_post_ID){
global $bp,$wpdb;return $wpdb->get_col($wpdb->prepare("SELECT DISTINCT(user_id) from {$wpdb->comments} where comment_post_ID=%d and user_id!=%d",$comment_post_ID,$bp->loggedin_user->id));
}// return an array of comment ids for the post
function pc_notifier_get_all_blog_post_comment_ids($post_id) {
global $wpdb;return $wpdb->get_col($wpdb->prepare("SELECT comment_ID as id FROM {$wpdb->comments} WHERE comment_post_ID = %d AND comment_approved = '1' ORDER BY comment_date", $post_id));
}// get activity ids when type, component, secondary_ids, item_id is specified
function pc_notifier_get_activity_ids($params){
global $bp,$wpdb;
extract($params);
$list="(".join(",", $secondary_ids).")";//create a set to use in the query;return $wpdb->get_col($wpdb->prepare("SELECT id from {$bp->activity->table_name} where type=%s and component=%s and item_id=%d and secondary_item_id in {$list}",$type,$component,$item_id));
}December 3, 2012 at 10:27 pm #146437In reply to: Screen Notifications. A comprehensive thread.
Andrew Tibbetts
ParticipantYikes! Sorry, Bob, I just realized I was not subscribed to this thread. Anyway, the functions that I had gotten to work for creating activity notifications from actual blog comments (not activity comments) was working but is now broken. :\ Here is the new thread I have created to tackle this new situation. Feel free to add a “bump”. 😉 https://buddypress.org/support/topic/help-me-fix-a-function-that-adds-blog-comments-to-activity/
November 14, 2012 at 2:06 am #144959In reply to: BuddyPress.org Forum Replies and Notifications
Toby Cryns (@themightymo)
Participant@mercime – Any other thoughts on what I can try here from a troubleshooting perspective or where to direct a trouble ticket? I would love to be notified via email of follow-up comments to my forum posts.
Thanks!
November 12, 2012 at 6:06 pm #144893In reply to: Settings template
drrxa
ParticipantThanks for reply Paul. And yes, WP won’t check for that and if called twice there will be double headers and footers.
What I have found that these settings files (located in `bp-themes/bp-default/members/single/settings/`) are not loaded by the file `members/single/settings.php` and that is maybe why they override the original layout (they have for example their own `get_header, get_footer`, and `get_sidebar`). I found that by commenting the block of code responsible for loading these files in `settings.php` file which is:
`
<?php
/*
if ( bp_is_current_action( ‘notifications’ ) ) :
locate_template( array( ‘members/single/settings/notifications.php’ ), true );elseif ( bp_is_current_action( ‘delete-account’ ) ) :
locate_template( array( ‘members/single/settings/delete-account.php’ ), true );elseif ( bp_is_current_action( ‘general’ ) ) :
locate_template( array( ‘members/single/settings/general.php’ ), true );else :
locate_template( array( ‘members/single/plugins.php’ ), true );endif;
*/
?>
`And the file still loading correctly, while doing the same thing in `members/single/profile.php` will break the theme loading.
I dont have specific need for that, but I am just curious about where these files are loaded from and why they dont follow the same procedure? I have made a custom header for logged-in users `get_heade(‘loggedin’)` and rather than only modifying the `home.php` file header only, I had to modify the header of these four settings files as well `capabilities.php, delete-account.php, general.php, notifications.php`.
October 20, 2012 at 2:48 pm #143740In reply to: Create private membership site with BuddyPress
angslycke
Participant@djpaul: Yes, but I want to redirect the “activate your account” e-mails to the site admin instead of the user to let the admin know that a new user has registred. I’m trying to figure out the best way to do this. Obviously I don’t want to edit core files, so best practice should be to use a filter to replace the users e-mail address with the site admin e-mail address I guess?
I found an old post regarding this here (from 2010):
http://www.thoughtsofjs.com/moderate-new-user-registration-in-buddypress.html
They’re editing core files there (bad!), but I found this in the comments as a function to achieve the above:
`
function filter_replace_with_moderator_email($user_email) {
return get_site_option( “admin_email” );
}
add_filter(‘bp_core_activation_signup_user_notification_to’, ‘filter_replace_with_moderator_email’);
`I added this to my themes custom functions.php-file but the e-mail is still sent to the user instead of the admin. Is there a change in BP 1.5 so that I need to change the hook in the filter? Does anyone know?
October 17, 2012 at 11:42 pm #143608In reply to: Buddypress Like – Notification Hack
meg@info
Participantthe bp_like_send_notification function is commented ? mybe if your remove the // in line 564 it work
October 15, 2012 at 5:59 pm #143498In reply to: Hide General Settings Tab
trailmix5
ParticipantThanks @modemlooper
I was able to comment out the entire form with /* and */, but the user is still directed to a general settings page (that is now blank except for the title “General Settings”). Granted this is better than having the password and email field, but is there a way for me to bypass that tab and go straight to the notifications?
Also, I have settings checked in the admin panel because I want the user to be able to change the notification and privacy preferences. Is that correct?
I’m not sure why I didn’t think of this before, but I could just hide the tab in CSS (like I did previously) and then use a 301 redirect match in my htaccess from settings to settings/notifications. Huh, is that a viable way to achieve this?
October 7, 2012 at 2:58 pm #143119In reply to: Screen Notifications. A comprehensive thread.
bobemil
ParticipantHello there Andrew! I have trouble with this too (months of frustration). I would really love if you could share your solution for viewing a comment notification to the post author. I can offer you a invite to Dribbble if you help me out with this!
October 5, 2012 at 4:20 pm #143032In reply to: Blog post comment Notification
bobemil
Participant+1
October 1, 2012 at 8:00 pm #142794laurengibbonz
ParticipantOh, I figured this out. Oddly, if you deactivate “Private Messaging” in BuddyPress it seems (at least for me) that the notifications information and content up until “Send a notification by email when:” stays. I was able to just comment out the Settings tab using CSS and move the update Password & Email fields to my Edit Profile section.
Thanks!
September 15, 2012 at 4:17 pm #141749bobemil
ParticipantPlease add notifications for native blog comments too. And for BP-likes would be awesome too
September 10, 2012 at 9:41 pm #141392Paul Wong-Gibbs
KeymasterI don’t think what you describe with the pending comments notification is a bug. As you say, if a user has a certain level of permission on a blog, then they might have enough permission to moderate comments. I figure you can test this easily by bumping one of those users down to a subscriber or a contributor role and see if it goes away for them.
September 7, 2012 at 3:46 pm #141212ploupas
MemberAbout 3)
quick and dirty, maybe could been added as feature when user registers and has made comments before
‘UPDATE wp_database.wp_comments SET user_id=’User_ID_our_member_got_after_succesfull_registration’ WHERE comment_author_email=”his/her_old@used_before_mail.com”;’
edit: Is it normal looking at bp_blogs_record_comment() function for a chance to import “properly”?
http://phpxref.ftwr.co.uk/buddypress/bp-blogs/bp-blogs-functions.php.source.html#l227August 30, 2012 at 4:01 am #140524In reply to: Notifications
r-a-y
KeymasterUnfortunately, at the moment, you’re correct.
Good news is there’s a plugin you can use for that:
https://github.com/sbrajesh/bp-activity-comment-notifierAugust 24, 2012 at 5:49 pm #140152SK
ParticipantIt’s needed by pretty much everyone, and hence really a “core” feature.
WP already has some image processing built in that BP could/should leverage. As a member of a social network, I should be able to create my own albums, add photos and videos to them and tag friends and places. That much is really core. (including automatic resizing and lossless compression, and post upload of photos/videos to activity stream)
If BuddyPress Media is good, perhaps it can be merged back into BP core?
Further functionality, such as watermarking, CDN support, user notifications, comments, are probably plugin territory.
August 24, 2012 at 4:45 pm #140147apellicone
ParticipantThanks. Will that also handle notifications from friending or commenting?
August 23, 2012 at 12:07 pm #140052In reply to: Blog Posts Don’t Appear in Activity
sims3fanatics
MemberYes, there is a page for activity, but there is no option to “activate blog” and there is no blog page?
My activity stream component (checked) does say this though:
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.^ I don’t see blog anywhere?
August 9, 2012 at 2:28 am #138923Tyler
MemberJust a suggestion though,
A plugin should not be needed for this functionality, this should be a native BP feature IMO.
-
AuthorSearch Results