Blog 4 Umbraco Comments - Can I Make It So They Have To Be Authorised?
I am using Blog4Umbraco for a recent project, but just noticed if you leave a comment it goes instantly live? I'm guessing I just need to switch a method in the comments usercontrol? Can you give me some pointers please...
You'd have to go into the code for that. Look in the frmBlogComment.acsx.cs. If you comment 2 lines (Publish and UpdateDocumentCache) it won't be published yet, but the comment will be saved in the backend.
@Peter: think Publish is required to make it appear in backend (ok, name's not really a good choice), but basically publish prepares a document for publishing (it's a two step process, making it possible for a 'code' user to publish and a real content editor to do the actual publish, so it becomes visible at the frontend)
Just to add: I've just implemented a simple anti-spam measure (if that's what you're after). I will enhance it later, but for now it seems to be working. If you're interested I can share the code. Will submit the code to Tim soon anyway :)
An alternative is to use doc2form like I did and set it so the comments become child nodes that are unpublished, I then modified the Content Maintenance add-on to make it list all unpublished comments, this was then put into a new section in the Umbraco backend so that Umbraco users could see a list of unpublished comments and then publish them as required.
You can do two things from the top of my head at least. You can add CAPTCHA or you can add a boolean value on the comment and only the ones you check will appear on the site. So you would have to check each comment.
@Scott - Authorize them? I'm looking to authorize anyone. I just wanted to adjust the markup in the user control so I can target it with css. I also want to improve the validation (prevent markup in the comment field, url validation, improve validation error UI). I might allow limited html comments with XSS protection.
Blog 4 Umbraco Comments - Can I Make It So They Have To Be Authorised?
I am using Blog4Umbraco for a recent project, but just noticed if you leave a comment it goes instantly live? I'm guessing I just need to switch a method in the comments usercontrol? Can you give me some pointers please...
You'd have to go into the code for that. Look in the frmBlogComment.acsx.cs. If you comment 2 lines (Publish and UpdateDocumentCache) it won't be published yet, but the comment will be saved in the backend.
Does this help?
Peter
Hi
I recently wrote an event handler which does exactly that.
Basically it stops publication of the blog comments until you have ticked an approved checkbox on the blog comment and published.
I'll dig it out for you - give me 5 mins!
T
@Peter: think Publish is required to make it appear in backend (ok, name's not really a good choice), but basically publish prepares a document for publishing (it's a two step process, making it possible for a 'code' user to publish and a real content editor to do the actual publish, so it becomes visible at the frontend)
Cheers,
/Dirk
@Dirk are you sure? Maybe it's just me that got used to the way it worked in v2 :P
Comment author was deleted
Nope Peter is correct, if you comment out the 2 line it won't be published.
Hi,
Here's my extension which will suppress publishing of comments unless a checkbox is ticked in the backend (so you can pre-vet them).
It can also be extended to allow for emailing the site owner when the new comment is added - however I've not got that enabled in this version.
If this is of interest I can add it in and package it all up.
http://www.thecogworks.co.uk/umbraco-cogworks-extensions.zip
You just need to drop the dll into your bn folder and add the following property to the BlogPostComment document type.
Name: Approved
Alias: approved
Type: True/False
Hope this helps!
T
Just to add: I've just implemented a simple anti-spam measure (if that's what you're after). I will enhance it later, but for now it seems to be working. If you're interested I can share the code. Will submit the code to Tim soon anyway :)
You can use the built in umbraco notifications to get email when a comment is added - select sendtopublish if you are not publishing.
Dan
An alternative is to use doc2form like I did and set it so the comments become child nodes that are unpublished, I then modified the Content Maintenance add-on to make it list all unpublished comments, this was then put into a new section in the Umbraco backend so that Umbraco users could see a list of unpublished comments and then publish them as required.
Works perfectly Tim - Thanks
Hi all,
Where would one find the source code for this package? I'd like the user control and dll source if at all possible so I can make some tweaks.
Thanks,
Nathan
I'm not sure where all the other post went that gave my question context. I'm looking for the source code from Blog 4.0.
Thanks
Comment author was deleted
Hi Nathan,
Check here: http://blog4umbraco.codeplex.com/
Nathan why do you want to authorize them?
You can do two things from the top of my head at least. You can add CAPTCHA or you can add a boolean value on the comment and only the ones you check will appear on the site. So you would have to check each comment.
But if it is for spamming comments I would put in CAPTCHA. I did it on this blog: http://www.valutabloggen.dk/2009/9/28/gbpusd-head-and-shoulders.aspx and it is rather easy to manage.
And by the way what kind of tweaks would you like to make?
Scott
@Tim - Thanks, not sure how I missed that.
@Scott - Authorize them? I'm looking to authorize anyone. I just wanted to adjust the markup in the user control so I can target it with css. I also want to improve the validation (prevent markup in the comment field, url validation, improve validation error UI). I might allow limited html comments with XSS protection.
is working on a reply...