开发者

How can I disable StopForumSpam spam filter in BlogEngine.NET 2.0

I'm using BlogEngine.NET v2.0.0.44 and I don't want any spam filters enabled as I plan to moderate all comments manually. I successfully disabled AkismetFilter and TypePadFilter by disabling their extensions, however I can not find a way to disable StopFormSpam filter. How ca开发者_运维技巧n I disable this filter?


After little bit of debugging I found the root cause of this problem. StopForumSpam class seems to be a bit unfinished in this version of BlogEngine (2.0.0.44). You need Extension attribute StopForumSpam class like:

/// <summary>
/// StopForumSpam.com custom comment filter
/// </summary>
[Extension("StopForumSpam.com custom comment filter", "1.0", "<a href=\"http://dotnetblogengine.net\">BlogEngine.NET</a>")]
public class StopForumSpam : ICustomFilter
{

Also Initialize() method needs to look like:

/// <summary>
/// Enables or disables filter
/// </summary>
/// <returns>
/// True of false
/// </returns>
public bool Initialize()
{
    return ExtensionManager.ExtensionEnabled("StopForumSpam");
}

After this changes StopForumSpam extension will appear in the Extensions tab in admin panel where it can be enabled/disabled easily. It's strange that StopForumSpam class did not have this by default since both AksimetFilter and TypePadFilter have this and those classes have pretty much the same functionality.


Delete App_Code/Extensions/StopForumSpam.cs from your blog and it will be gone.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜