Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Blog Module /

Discuss the Blog Module.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

user comment needs approval first


Go to End


6 Posts   2356 Views

Avatar
iroy2000

Community Member, 15 Posts

1 March 2011 at 1:36pm

Hi, I like the blog module, but how do I configure so that when a user enter a comment, it requires approval first before going to the public??

Avatar
Johan

Community Member, 49 Posts

1 March 2011 at 10:55pm

I cant get it to work yet (been flushing lots)

The solution shouls be here

http://www.silverstripe.org/blog-module-forum/show/9707

Would presume:

BlogEntry.php


	static $defaults = array(
		"ProvideComments" => false,
		'ShowInMenus' => false
	);

Avatar
iroy2000

Community Member, 15 Posts

2 March 2011 at 6:43am

But sounds like it only turns off the comment for a blog entry.

So I want the work flow is

1) User [A] can enter comment as usual
2) User [A] comment won't show up in public by default
3) Admin will need to approve User [A] comment before the comment shows in the public.

Avatar
iroy2000

Community Member, 15 Posts

8 March 2011 at 8:23am

Edited: 08/03/2011 8:26am

I go through the blog module code.

You can change the PageComment.php to have comments moderated as default.

Search for

static $moderate = false;

and replace it with true;

( location: /cms/code/sitefeatures )

Avatar
Invader_Zim

Community Member, 141 Posts

8 March 2011 at 11:45am

Hi iroy2000,

the much better solution would be to call the enableModeration() method of PageComment.php in your mysite/_config.php like this:

PageComment::enableModeration();

This way, you won't need to edit core files and keep the ability for easy updates.

Cheers
Christian

Avatar
biapar

Forum Moderator, 435 Posts

10 March 2011 at 4:26am

Good