Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
0 votes
1.1k views
in Q2A Core by
I have these people posting their  twitter, links and other affiliate links almost everyday. These are real people,. I set "only registered with email confirmed" for member to post.

How to block any links contain specific keywords. I see theres option to censor words but the link is still clickable like http://*****.com/adlffd

3 Answers

+3 votes
by
You have the system of flags for this purpose.
Just make it more strict (in section Admin>Spam) - if anyone sets one flag, the abuse post will be hidden.

Automatic blocking posts is pointless, due to infinite abuse imagination of trolls. You will waste your time.
by
+1
And don't forget that all links are nofollowed, meaning the links are ignored by search engines.
0 votes
by

How to block comments containing *http*

i wrote this:

   public function process_event($event, $userid, $handle, $cookieid, $params)

    {

        switch ($event) {

            case 'c_post':

$content=$params['content'];

if(strpos($content, "http")>0)

       {

qa_post_delete($params['postid']);

}

                break;

        }

However, it creates a row in database and deletes it. I want to block database insertion
by
You have to write a filter module for this, not process_event. Because process_event means event is already over.
by
how to do?

    public function filter_comment(&$comment, &$errors, $question, $parent, $oldcomment)
    {
            if(strpos($content, "http")>0)
                        {
                        array_push($errors, 'dont post url');
                        return false;
                        }
    }
0 votes
by

If the link shows up like that ( http://*****.com/adlffd ) , then you could write a Javascript method like this:

$('a:contains("***")').remove();

I'm sure no plausible link would have 3 asterisks in a row, or even one if that matter, so it's safe to remove them.

You can try it on this post using the Dev Tools console.

...