News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

No Spam by Guests!

Started by GTSdll, October 09, 2006, 08:37:43 AM

Previous topic - Next topic

ArrayInteractive

Quote from: waronyou on October 17, 2008, 10:43:50 PM
I made this work on 1.6 by adding 1.6 in the xml

">NoSpamByGuests010_105-107.mod</modification>
        </install>
        <uninstall for="1.0.5, 1.0.6, 1.0.7">
                <modification format="boardmod" type="file" reverse="true">NoSpamByGuests010_105-107.mod</modification>
        </uninstall>
        <install for="1.1 RC1, 1.1 RC2, 1.1 RC3, 1.1, 1.1.1, 1.1.2, 1.1.3, 1.1.4, 1.1.6.1.1.8">
                <readme type="inline">
"No Spam by Guests!" 0.2 for SMF


see here http://waronyou.com/forums

I was able to do the same thing to make work for 1.1.8.
smf 2.0.2

Rostam

Quote from: Poreman on November 19, 2008, 07:10:32 PM
Quote from: CvH on November 19, 2008, 06:09:03 PM
Quote from: Poreman on November 18, 2008, 09:45:41 PM
Tell me if I'm wrong, this only works on unregistered guest right.  The original you could setup a usergroup with no links, which I liked because I could make the starter members or new member not be able to leave links, I seem to get more fly by night members that register, leave a link to their or other site never to be seen again, I would set it up where after 10 posts they leave the group to one that will allow links.  Any thought on this?

What you mean is "Anti Spam: prevents posting links by group".
This only blocks guest spammposters.
yeah I realized that I posted on the guest spam, I was able to get the Anti Spam to work on 2.04 except it wouldn't show the error message from error language file
Thanks
Poreman

This is a great mod and it tried it on 2.0 RC1. It stops the spammer from posting a link, but it doesnt show the error message. Do you guys know how to solve that?

Groundhog

This is a great mod. Thanks very much.  8)

It appears to be working perfectly in 2.0 RC1.

Coyote90

does not work on 1.1.11....
please, tell me what to do to make it work....

Scratching my Head

Worked for 2.0 RC3

Thanks!


Klozi

#65
Hi there,

is this mod compatible with SMF 1.1.11? Otherwise is there a workaround to get the same result?

//Edit: I installed it by my own and it works as it has to. So 1.1.11 is supported.

vdrover

Working for 1.1.11 also. Here's what i did:

1. Extract the zip file.
2. Modify package-info.xml as follows:

<?xml version="1.0"?>
<!DOCTYPE package-info SYSTEM "http://www.simplemachines.org/xml/package-info">
<package-info xmlns="http://www.simplemachines.org/xml/package-info" xmlns:smf="http://www.simplemachines.org/">
        <name>No Spam by Guests!</name>
        <id>GTS:NoSpamByGuests</id>
        <type>modification</type>
        <version>0.3</version>
        <install for="1.0.5, 1.0.6, 1.0.7">
                <readme type="inline">
"No Spam by Guests!" 0.3 for SMF

This modification makes guests and spam-bots unable to post any links on your forum.
                </readme>
                <modification format="boardmod" type="file">NoSpamByGuests010_105-107.mod</modification>
        </install>
        <uninstall for="1.0.5, 1.0.6, 1.0.7">
                <modification format="boardmod" type="file" reverse="true">NoSpamByGuests010_105-107.mod</modification>
        </uninstall>
        <install for="1.1 RC1, 1.1 RC2, 1.1 RC3, 1.1, 1.1.1, 1.1.2, 1.1.3, 1.1.4, 1.1.5, 1.1.6, 1.1.7, 1.1.8, 1.1.9, 1.1.10, 1.1.11">
                <readme type="inline">
"No Spam by Guests!" 0.3 for SMF

This modification makes guests and spam-bots unable to post any links on your forum.
                </readme>
                <modification format="boardmod" type="file">NoSpamByGuests010_11rc2.mod</modification>
        </install>
        <uninstall for="1.1 RC1, 1.1 RC2, 1.1 RC3, 1.1, 1.1.1, 1.1.2, 1.1.3, 1.1.4, 1.1.5, 1.1.6, 1.1.7, 1.1.8, 1.1.9, 1.1.10, 1.1.11">
                <modification format="boardmod" type="file" reverse="true">NoSpamByGuests010_11rc2.mod</modification>
        </uninstall>
</package-info>


3. Repackage all the files using a ZIP utility.

I've attached the modified version to this post. Good luck.

Biology Forums

#67
Can someone tell how to modify this modification so that users cannot use the character '@' (as in email addresses) in their posts? In other words, they are given an error message if they post their email address.

Please help :(

Biology Forums

Quote from: wing on December 11, 2006, 08:45:47 PM
I hope this helps.. it's a hack but it will solve your problem  :-X

In 1.1 final open post.php in the sources directory and look for:

if (empty($modSettings['guest_post_no_email']))
                                {       
                                        if (!isset($_REQUEST['email']) || $_REQUEST['email'] == '')
                                                $context['post_error']['no_email'] = true;
                                        elseif (preg_match('~^[0-9A-Za-z=_+\-/][0-9A-Za-z=_\'+\-/\.]*@[\w\-]+(\.[\w\-]+)*(\.[\w]{2,6})$~', stripslashes($_REQUEST['email'])) == 0)
                                                $context['post_error']['bad_email'] = true;
                                } 


Add after that block

// by NoSpamByGuests mod
                                $linkpos = strpos ($_POST['message'], "://"); // look for ://
                                if ($linkpos !== false) $context['post_error']['guest_no_link'] = true;
                                else { 
                                $linkpos = strpos ($_POST['message'], "www."); // look for www.
                                 if ($linkpos !== false) $context['post_error']['guest_no_link'] = true;
                                }


Then look for:
if (empty($modSettings['guest_post_no_email']))
                {
                        // Only check if they changed it!
                        if (!isset($row) || $row['posterEmail'] != $_POST['email'])
                        {
                                if (!allowedTo('moderate_forum') && (!isset($_POST['email']) || $_POST['email'] == ''))
                                        $post_errors[] = 'no_email';
                                if (!allowedTo('moderate_forum') && preg_match('~^[0-9A-Za-z=_+\-/][0-9A-Za-z=_\'+\-/\.]*@[\w\-]+(\.[\w\-]+)*(\.[\w]{2,6})$~', stripslashes($_POST['email'])) == 0)
                                        $post_errors[] = 'bad_email';
                        }

                        // Now make sure this email address is not banned from posting.
                        isBannedEmail($_POST['email'], 'cannot_post', sprintf($txt['you_are_post_banned'], $txt[28]));
                }


Then add after that block:
// by NoSpamByGuests mod
                $linkpos = strpos ($_POST['message'], "://"); // look for ://
                if ($linkpos !== false) $post_errors[] = 'guest_no_link';
                else {
                $linkpos = strpos ($_POST['message'], "www."); // look for www.
                if ($linkpos !== false) $post_errors[] = 'guest_no_link';

                }


You now have "NoSpamByGuests" 

If you want to make this more effective, I had people that would join and then immediately spam my site after adding this little mod and my own variation I don't think I've had a spot of spam in months!

Right after the 2 blocks of NoSpamByGuests code I added my own code:

if ($user_info['posts'] < 10) {
           $linkpos = strpos ($_POST['message'], "://"); // look for ://
           if ($linkpos !== false) $post_errors[] = 'newuser_no_link';
         else {
           $linkpos = strpos ($_POST['message'], "www."); // look for www.
           if ($linkpos !== false) $post_errors[] = 'newuser_no_link';
          }
         }


This blocks new users with less than 10 posts from posting links.  You can change this to any number you want.  It's not ideal, it would work better integrated into the options in the admin menu I suppose but it stops my spam!

It should be
if (context['user']['is_logged'] && $user_info['posts'] < 10) {
           $linkpos = strpos ($_POST['message'], "://"); // look for ://
           if ($linkpos !== false) $post_errors[] = 'newuser_no_link';
         else {
           $linkpos = strpos ($_POST['message'], "www."); // look for www.
           if ($linkpos !== false) $post_errors[] = 'newuser_no_link';
          }
         }


Otherwise both messages will be shown to a guest.

winsoft

is this still working for the current version of SMF or do you know any similiar mod that would stop guests posting links?

thank you

Quote from: Liam_michael on March 13, 2011, 11:45:08 PM
Quote from: wing on December 11, 2006, 08:45:47 PM
I hope this helps.. it's a hack but it will solve your problem  :-X

In 1.1 final open post.php in the sources directory and look for:

if (empty($modSettings['guest_post_no_email']))
                                {       
                                        if (!isset($_REQUEST['email']) || $_REQUEST['email'] == '')
                                                $context['post_error']['no_email'] = true;
                                        elseif (preg_match('~^[0-9A-Za-z=_+\-/][0-9A-Za-z=_\'+\-/\.]*@[\w\-]+(\.[\w\-]+)*(\.[\w]{2,6})$~', stripslashes($_REQUEST['email'])) == 0)
                                                $context['post_error']['bad_email'] = true;
                                } 


Add after that block

// by NoSpamByGuests mod
                                $linkpos = strpos ($_POST['message'], "://"); // look for ://
                                if ($linkpos !== false) $context['post_error']['guest_no_link'] = true;
                                else { 
                                $linkpos = strpos ($_POST['message'], "www."); // look for www.
                                 if ($linkpos !== false) $context['post_error']['guest_no_link'] = true;
                                }


Then look for:
if (empty($modSettings['guest_post_no_email']))
                {
                        // Only check if they changed it!
                        if (!isset($row) || $row['posterEmail'] != $_POST['email'])
                        {
                                if (!allowedTo('moderate_forum') && (!isset($_POST['email']) || $_POST['email'] == ''))
                                        $post_errors[] = 'no_email';
                                if (!allowedTo('moderate_forum') && preg_match('~^[0-9A-Za-z=_+\-/][0-9A-Za-z=_\'+\-/\.]*@[\w\-]+(\.[\w\-]+)*(\.[\w]{2,6})$~', stripslashes($_POST['email'])) == 0)
                                        $post_errors[] = 'bad_email';
                        }

                        // Now make sure this email address is not banned from posting.
                        isBannedEmail($_POST['email'], 'cannot_post', sprintf($txt['you_are_post_banned'], $txt[28]));
                }


Then add after that block:
// by NoSpamByGuests mod
                $linkpos = strpos ($_POST['message'], "://"); // look for ://
                if ($linkpos !== false) $post_errors[] = 'guest_no_link';
                else {
                $linkpos = strpos ($_POST['message'], "www."); // look for www.
                if ($linkpos !== false) $post_errors[] = 'guest_no_link';

                }


You now have "NoSpamByGuests" 

If you want to make this more effective, I had people that would join and then immediately spam my site after adding this little mod and my own variation I don't think I've had a spot of spam in months!

Right after the 2 blocks of NoSpamByGuests code I added my own code:

if ($user_info['posts'] < 10) {
           $linkpos = strpos ($_POST['message'], "://"); // look for ://
           if ($linkpos !== false) $post_errors[] = 'newuser_no_link';
         else {
           $linkpos = strpos ($_POST['message'], "www."); // look for www.
           if ($linkpos !== false) $post_errors[] = 'newuser_no_link';
          }
         }


This blocks new users with less than 10 posts from posting links.  You can change this to any number you want.  It's not ideal, it would work better integrated into the options in the admin menu I suppose but it stops my spam!

It should be
if (context['user']['is_logged'] && $user_info['posts'] < 10) {
           $linkpos = strpos ($_POST['message'], "://"); // look for ://
           if ($linkpos !== false) $post_errors[] = 'newuser_no_link';
         else {
           $linkpos = strpos ($_POST['message'], "www."); // look for www.
           if ($linkpos !== false) $post_errors[] = 'newuser_no_link';
          }
         }


Otherwise both messages will be shown to a guest.


Advertisement: