Jump to:

23487 Posts in 18996 Topics by 2878 members

General Questions

SilverStripe Forums » General Questions » Comment Spam

General questions about getting started with SilverStripe that don't fit in any of the categories above.

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

Page: 1
Go to End
Author Topic: 1168 Views
  • grumpypanda
    Avatar
    Community Member
    32 Posts

    Comment Spam Link to this post

    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.
    Sam

    Update - 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.

  • Bruce B
    Avatar
    Community Member
    145 Posts

    Re: Comment Spam Link to this post

    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;

  • grumpypanda
    Avatar
    Community Member
    32 Posts

    Re: Comment Spam Link to this post

    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

    1168 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.