1 (edited by TrackGeeks 2012-08-07 15:04)

Topic: Prevent HTML links in posts from new users

Is there a way to prevent new users from posting links in messages?

Every spammer that gets through the registration system on our forum makes a post in an existing thread and fills it with HTML links.

It would be helpful to limit the ability for users under "X" posts from entering links in their messages.

Re: Prevent HTML links in posts from new users

Check out Fancy Stop SPAM here: http://punbb.informer.com/forums/topic/ … stop-spam/

Re: Prevent HTML links in posts from new users

That plugin works well to prevent a user from posting a link in the first message of a thread. Spammers have been putting their junk in replies to existing threads and FancyStopSpam doesn't stop them.

What would be ideal is to have an option to prevent any links in posts if the user has a post count of less than 5.

Alternatively controlling that privilege through user groups would be Ok.

4 (edited by Kushi 2012-08-09 13:44)

Re: Prevent HTML links in posts from new users

I've got solution for You. I haven't got time to make an extension, but I will. Maybe even this week. You can do it manually ( which is very bad solution ) or wait. Or make extension by yourself.
Open post.php
Find (line 190)

    ($hook = get_hook('po_end_validation')) ? eval($hook) : null;

After paste:

    $query = array(
        'SELECT'    => 'u.num_posts',
        'FROM'        => 'users AS u',
        'WHERE'        => 'u.id='.$forum_user['id']
    );
    $result = $forum_db->query_build($query) or error(__FILE__, __LINE__);
    $user = $forum_db->fetch_assoc($result);
    $limit = 10;
    if($user['num_posts']<$limit && (preg_match('#\[url\]([^\[]*?)\[/url\]#e', $message) || preg_match('#\[url=([^\[]+?)\](.*?)\[/url\]#e', $message) || preg_match('#\[email\]([^\[]*?)\[/email\]#', $message) || preg_match('#\[email=([^\[]+?)\](.*?)\[/email\]#', $message) )) $errors[] = ('You have to write at least '.$limit.' posts to submit links.');

You can rise limit by modifying $limit variable. You can also write some other $error[] message.

If any of my dropbox link fails with 404 error, change dl.dropbox.com/u/56038890/punbb/*.zip in address to 82283017.

Currently working on rPlus - responsive theme for developers to create their own themes basing on this one.

Re: Prevent HTML links in posts from new users

That certainly does work. Thanks! smile

6 (edited by kudataz 2012-08-12 00:47)

Re: Prevent HTML links in posts from new users

great thta is help me too ^^ Very Thxx kushii
join to njn :laiqdiz..
https://s3.amazonaws.com/TrollEmoticons/trolldance.gif

sorry my BAD english T___T
Have a nice day >.<
(^____^)v