21309 Posts in 5738 Topics by 2603 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 872 Views |
-
Comment Spam

23 June 2011 at 12:36pm Last edited: 24 June 2011 9:15am
Hi everyone,
My client has got a news page, and it allows people to leave comments, unfortunately they've got loads of spam emails. I'm new to this, is there any way we can disable the comment field by default? How do I do it?
Thanks heaps.
SamUpdate - Because this is someone else's code, I just realised that they have some sort of spam protection already, so we are trying to disable the comment option. I have managed to set no comment by default by changing file BlogEntry.php
static $defaults = array(
"ProvideComments" => true,
'ShowInMenus' => false
);to
static $defaults = array(
"ProvideComments" => false, //changed
'ShowInMenus' => false
);Am I on the right track to disable comments by default? Also how can I stop on the news page showing the link of 0, or 5 or xxx comments? eg
Test
Posted by Admin on 21 June 2011 | 3 Comments
Tags: P
This is a test....
3 comments | Read the full post
Thanks. S:)
Update - If anyone is interested, I have been changing BlogSummary.ss since yesterday, but nothing changed on the news page. i have just found an old post, "because I was rebuilding the database by going to dev/build, but it was only rebuilding the main site, not the blog. when I added ?flush=1 to the blog url, it rebuilt and showed all my changes."
Thanks everyone.
-
Re: Comment Spam

23 June 2011 at 4:45pm
To hide existing comments after comments have been disabled, open the _config.php file in mysite folder and add the following lines:
//don't show existing comments if comments are disabled
PageCommentInterface::$show_comments_when_disabled = false; -
Re: Comment Spam

23 June 2011 at 4:56pm Last edited: 23 June 2011 5:09pm
Hi Bruce B,
Thanks for your reply, I paste the code in my _config.php, it did make the comment content disappear on each news, thank you. However on my news page there are still a couple of comment links on it. Please see example below. How do I delete those 3 Comments links on my news page (on Silverstripe it is Blog Holder as a page type)?
Test
Posted by Admin on 21 June 2011 | 3 Comments
Tags: p
This is a test.3 comments | Read the full post
| 872 Views | ||
|
Page:
1
|
Go to Top |


