By default, BuddyPress does not include comments from non-members (or non-logged-in users more generally) in the sitewide activity stream. This plugin records activity items for those comments.
The plugin has been tested on version 1.1.3 of BP, as well as the 1.2 release candidate. If you want to use the plugin for 1.1.3 or lower, you will need to uncomment the first few add_action and add_filter lines in the plugin file.
Technical caveat: Non-logged-in commenters have BP user_id 0. When BP creates the activity stream, it decides whether or not to show the Delete button by checking to see whether the user_id for the currently logged in user is the same as the user_id of the person to whom the comment belongs. Presumably, though, you don’t want non-logged-in viewers of the activity stream to be able to delete items from the activity stream at all. BP’s core code is not currently set up to make it easy to remove these buttons, so I employed an ugly fix. If you have changed your theme significantly from the default, you might have to adjust the filter bp_nonmember_comment_content (near the end of the plugin) to remove the button properly.
BP Include Non-Member Comments has been downloaded [downloadstat url=”http://wordpress.org/extend/plugins/bp-include-non-member-comments/stats/” get=”total” autop=”false”] times. Are you using this plugin? Consider a donation.
- 1.2.1 – April 15, 2010
- Added checks for spam status
- Fixed bug that made approved comments from site members appear twice (Thanks, Andrius!)
- 1.2 – April 6, 2010
- Adapted to BuddyPress’s new comment activity recording method
- Comment approval now posts to the activity stream as well
- 1.1 – February 22, 2010
- Normalized file structure to latest BP standards (bp_init)
- Fixed problem with deprecated bp_post_get_permalink
- 1.0 – February 7, 2010
- Initial release
Cool! Does the “Visitor” button link to a visitor profile?
Hi Ray – No, I should have been more clear about the screenshot. It says “Visitor” because that’s the name I put in the blog comment box. The plugin inserts whatever name the commenter entered, which in turn links to the URL they entered.
Hey there Boone, good one there!
Wouldn’t it be more appropriate to link to the comment though? there they can still click the imo. The link to the post is just a link to the top of the post i’m assuming!
Hi iSimone –
The “View” button goes to the comment, while the post title links to the top of the post. I just copied what happens with comment activity items created by BP core. Or are you seeing something different?
It’s good that your plugin doesn’t create a visitor profile!
However, I do see the potential of people spamming a blog post’s comments just to put their backlink on the BP activity page.
I guess the issue lies with the WP blog admin and how s/he deals with allowing comments.
I figured the same thing, Ray. If you’ve got a spammer leaving porno links all over your comments section, the problem does not lie in BP, it lies in how you manage your comment spam.
Wow, thanks Boone. I guess I’m officially a fan of your work now. 🙂
Actually, the comments to delete are on lines 13 and 14 (not 12 and 13 like the readme.txt says).
Oh, one request. When a blog post mentions another blog post it ends up pinging iteself but when displayed in the sitewide activity stream it says “[insert the name of blog post] commented on the blog post [then insert the name of the blog post that was pinged]”.
Is there a way that could read “[name of the pinged blog post] was pinged by [name of the pinging blog post]”?
Hi Boone, great plugin-idea – I already wondered, if that is possible, because alot of commenters on our site are not logged in. GREAT & THANX!
I installed it on my test-Site (Subdirectories, WMPU 188.8.131.52. and BP 1.2RC) and it doesn’t seem to work… There are no settings, right? Do you have any idea why it’s not working? PS: I installed wordpress in a subblog – could that cause the troubles?
Another question: Would you make that plugin translatable? I would love to do it for german (doesn’t seem like alot of work 🙂 –>are your other bp-plugins translatable already? any POT-Files?)
Paul – I will take a look at making the “pinged” change. I’m not sure how ping objects are handled differently from trackbacks, but it should be easy enough.
Miguael – Not sure why it doesn’t work – the setup you describe is the same setup I used to develop it. There are no settings, it should just work. I don’t think subblog or subdirectory issues should affect anything, because the plugin activates with comment_post, which doesn’t care about URL. Do member blog comments appear on your activity stream without a problem?
The plugin shouldn’t need any translation. I didn’t change any of the strings from the buddypress defaults, so the bp text domain should do all the translation out of the box. That’ll change if I implement Paul’s suggestion, in which case I will make sure to generate a POT. My other plugins http://wordpress.org/extend/plugins/profile/boonebgorges are a mixed bag: Group Forum Subscription is fully translatable (and ships with a handful of languages, including German) but some of the others need some TLC in order to be localized. One of these weekends.
@Boone, oh so everything is fine. Seems I missunderstood your earlier comment. Btw. another good one on the new plugin!
Though is that not something that should be core material?
i always get a blank page after commenting, than the comment is posted to the blog, but there is nothing in the activity stream
What version of BP are you using?
Here is the soultion to get this plugin to work with 1.2 final.
$comment_link = bp_post_get_permalink( $comment->post, $wpdb->blogid ) . ‘#comment-‘ . $comment_id;
$comment_link = get_permalink( $comment->comment_post_ID );
Thanks, unknown – I just found the problem myself, fixed it, checked it in, and then came here and read your comment! Could have saved myself a few minutes by coming here first 🙂
In any case, the new version should work correctly.
Actually there is still a bug, this bug is also in the bp-core. The link to the comment is wrong…
$comment_link = get_permalink( $comment->comment_post_ID ) . ‘#comment-‘ . $comment_id;
$comment_link = get_permalink( $comment->comment_post_ID );
Aha. That’s close, but I think it’s better to keep $comment_link how it is and change how $activity_content is built (otherwise the View link breaks). Just uploaded a fix – thanks for the help.
I habe the problem that when the plugin is turned on, comments that are pending in the admin area will be displayed on the activity stream, also comments that “spam karma” detected and correctly filed under spam will appear on the front page.
Hi ubik. You are the second person to report that problem, but I can’t seem to replicate it myself. What version of BP/WP are you using? Do you have any other plugins that affect how comments work?
Hey boon thanks for this plugin!!!
Not sure what I am doing wrong. It’s installed but non-logged in user comments don’t seem to be apearing in the activity stream.
Hi Avi. Is the plugin activated on the blog where the comments are being left? It can’t just be activated on the BP blog. (Assuming you’re running WPMU.)
What version of WP/BP?
Great plugin and exactly what we’re looking for…however, I’m seeing the same problem as Avi.
I’m running BP1.2.3 on WPMU 2.8.6 (for one reason or another…we’ll be u[dating soon!)
I’ve got your plugin activated sitewide from the main blog plugin menu
Hope that helps!
Cheers for the great work!
Sam – thanks for the heads up. It looks like BP was reconfigured to record comment activity in a totally different way on BP 1.2.2+. I just reconfigured the plugin to work the right way with the new code. Seems to be working well for me. Download version 1.2 of the plugin (should show up in the repo and on your plugin screen shortly) and give it a go.
That was quick!! Thank you 🙂 out of interest, should it be activated sitewide or just on the main blog as it doesn’t seem to be quite working still…although this may possibly be due to the fact i’m using a staging server. I’ll try it on production and get back to you
Hmmm – I tried it on our production server and it still (unfortunately) doesn’t appear to be working. We’re still in a private beta mode at the moment but if you want to look at it and maybe see where it’s falling flat then I will happily send you a link to the activity stream.
We’re using quite a few other plugins but not too many for BP
Also, I’ve curently got it activated sitewide…let me know if this is wrong!!
Cheers again – Sam
Hm, it works well on my local install. I am running BP trunk and WPMU 2.9.2, though I don’t think these version differences should make a difference. There’s a chance that the problem is with blogs other than the BP root blog. Have you tried posting a non-member comment on the BP root blog to see if it works there?
Sorry this week was Passover and so I wasnt really online enuff to follow up. Anyhow, I wanted to let you know that the latest up date seems to have fixed the issue at least for me!
Thanks so much for the quick fix and for all your great work!!!
Hi. New version has a bug: I have double items in activity stream – one from BP user and one from anonymous. But comment belongs to BP user.
Glad it works, Avi!
Mac – what version of BP/WP are you using? Are you getting double activity items only for blog comments by logged in users, or for other kinds of users/activity items as well?
I’ve not actually tried that just yet – I’ll have a play now and get backk to you 🙂
I am using the latest versions of BP and WPMU.
Bug takes place only for registered (and logged) in users.
I have to confirm Mac’s issue [BP 1.2.3, WPMU 2.9.2]
Hey, spam comments appears in activity stream. I use Akismet for spam detection and it works perfectly, but comments still reaches wall. How can I fix that?
Maybe this will help? if($comment->comment_approved == 1) in function bp_blogs_record_nonmember_comment?
Also I have just detected, that have same problems like Mac and m@rk do.
Eek, sorry that everyone is having problems. I will have a look and figure it out. Andrius, thanks for the suggestion about spam – I was relying on $is_approved but maybe it’s not working.
I think that these two IF’s solved a problem (needs more testing)
if( $comment->comment_approved == ‘spam’ )
if( email_exists($comment->comment_author_email) )
I’ve added them after
$comment = get_comment($comment_id);
Andrius – Good call. I tested this out and I think it fixes both problems.
The only problem still remaining is that I believe that site members who post comments while not logged in will not have their comments appear in the stream (because email_exists will return true for them, but the normal BP hooks won’t work – I think at least). But this is a small issue.
I just rolled in 1.2.1 with the fixes. Thanks again, Andrius.
Thanks for fixing the spam problem!
Doesn’t seem to be working for my. In fact, I don’t get activity for ANY comments. I’m using 184.108.40.206.
I tried to upgrade and I got:
Fatal error: Cannot redeclare bp_include_non_member_comments_init() (previously declared in /home1/seoword1/public_html/selfpublishingreview/wp-content/plugins/bp-include-non-member-comments/bp-include-non-member-comments.php:18) in /home1/seoword1/public_html/selfpublishingreview/wp-content/plugins/bp-include-non-member-comments/bp-include-non-member-comments.php on line 24
This works great but … The avatars are wrong. They all seem to be the same avatar. See http://jorjafox.net/activity/ for an example.
Ipstenu – Yup, that seems about right. I think that when user_id = 0, BP just shows the same avatar over and over again. Not quite sure the way around that, other than ditching Gravatar.
Can the email address be grabbed to hash that?
Eh. I changed my theme to do a check. If bp_get_activity_user_id() is 0, display mystery-man. It’s not perfect, but it’ll do 😉
Smart thinking. There should be a way to make bp look for the Gravatar for user 0 based on email address. I’ll have to look at the code to see how that’ll work though.
Can you explain your code in a little more detail Ipstenu? I’m not getting any avatars at all on BP 1.7.