Simple Machines Community Forum

Customizing SMF => Modifications and Packages => Topic started by: GTSdll on October 09, 2006, 08:37:43 AM

Title: No Spam by Guests!
Post by: GTSdll on October 09, 2006, 08:37:43 AM
Link to Mod (http://mods.simplemachines.org/index.php?mod=369)
Rate this Mod (http://mods.simplemachines.org/index.php?action=review;sa=add;mod=369)

This small modification makes guests & spam-bots unable to post any links on your forum.

It works like a charm on my forum, it keeps all the spam bots away :)

When a guest tries to post a message that contains a link, he will not be able to submit the message and gets informed that he should register, if he still wants to.


You can try posting a link as guest on my forum (http://www.gts-stuff.com/) to see how it works.
Title: Re: No Spam by Guests!
Post by: 1964 on October 09, 2006, 08:48:15 AM
Oh, I like this, one forum will utilize this.

Thank you.
Title: Re: No Spam by Guests!
Post by: 1964 on October 09, 2006, 08:53:16 AM
Darn, doesn't work on RC3 yet.

I get... tried it many times.

Install Actions
Installations actions for "No Spam by Guests!":
The package you are trying to download or install is either corrupt or not compatible with this version of SMF.
Title: Re: No Spam by Guests!
Post by: Pedja on October 09, 2006, 10:37:35 AM
Is it fixed on guests only or we can set permisson on member group basis (meaning: can we set some user groups to post links ond forbid for others?)
Title: Re: No Spam by Guests!
Post by: GTSdll on October 11, 2006, 07:01:18 AM
I updated the mod for RC3.

Its currently fixed on guests only. Its a very simple mod anyways, i made it to keep the evil bots away ;)
I might change that if i have more free time though.

Btw,
does anyone know why "uninstall" doesnt work?
I think it worked fine on RC2... but i don't see the Uninstall link on RC3.

Edit: Nvm, installed a different version on my smf ;)
Title: Re: No Spam by Guests!
Post by: 1964 on October 11, 2006, 07:25:29 AM
Thank you, no problems, works like it should, comes in real handy for Site Help forum.
Title: Re: No Spam by Guests!
Post by: Mark0 on October 19, 2006, 02:42:25 PM
Thank you, very nice mod!

Bye!
Title: Re: No Spam by Guests!
Post by: Pedja on October 20, 2006, 02:25:42 AM
Great mod.

Can you add option not to have hardoced privielge on everybody but guests, but allow us to choose who can/cannot post URL's?

I have gusets disabled to post at all on my board. Everyone has to register to post. But if someone si registered it stil ldoes not mean he is spammer. Tehrefore I also have registered users quite limited in forum usage. I have user group where I put trustworthy users. When one is member of that group he has full access to forum.

I would like to use this mod of yours, but I want to allow posting url just for members of that user group.
Title: Re: No Spam by Guests!
Post by: Gobo on October 29, 2006, 09:00:47 PM
hi

could you please also include the option in future versions for restricting post based membergroups from posting links?

it would be extremely useful :D

aku
Title: Re: No Spam by Guests!
Post by: wing on November 03, 2006, 07:48:29 AM
Awesome! Thanks I never even thought about this and I have a spam problem as my site is growing.  I'll probably modify this to eliminate users with less than 10 post count as well, as I get people joining just to post a link at times.

Title: Re: No Spam by Guests!
Post by: wing on November 03, 2006, 08:40:52 AM
This wouldn't install in 1.0.9 I assume only the install package needs updating.  I updated the files to list 1.0.8 and 1.0.9 but when I zipped it back up it didn't recognize it as a package, I'm not sure how that works.  ???

I hate to do this, but I applied the mod manually which will come back to bite me later when I upgrade to 1.1 Final.

I'll start looking into modifying to work with users with <10 posts as a lot of spam comes that way as well.
Title: Re: No Spam by Guests!
Post by: lematt on December 09, 2006, 02:00:05 PM
I love this 'mod' but I am waiting for an update to update my forum, since it has made me to him essential. For when this version?.

Thank you very much

P.D Pardon for my English
Title: Re: No Spam by Guests!
Post by: warner83 on December 11, 2006, 03:14:03 PM
is working with 1.1?
Title: Re: No Spam by Guests!
Post by: DASBEAN on December 11, 2006, 04:00:10 PM
Quote from: warner83 on December 11, 2006, 03:14:03 PM
is working with 1.1?

Was about to ask the same :) I'll give it a shot when I get home and report back.
Title: Re: No Spam by Guests!
Post by: warner83 on December 11, 2006, 04:06:34 PM
sorry  ;) ;)
Title: Re: No Spam by Guests!
Post by: DASBEAN on December 11, 2006, 06:40:07 PM
SMF 1.1 Final:

The package you are trying to download or install is either corrupt or not compatible with this version of SMF.
Title: Re: No Spam by Guests!
Post by: 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!

Title: Re: No Spam by Guests!
Post by: MissYeh on December 28, 2006, 06:22:48 PM
Great Mod!!

I guess this mod doesn't work for 1.1.1 ?

:)
Title: Re: No Spam by Guests!
Post by: Mystique on January 04, 2007, 04:21:06 PM
Yes please let us know when this works with 1.1.1 final.. as I DON'T LIKE using hacks to get things to work, because then when upgrades come along.. nothing works right.
Title: Re: No Spam by Guests!
Post by: szinski on January 09, 2007, 07:37:09 AM
I too love this mod. But, I have spammers who sign up as members then proceed to spam my forum. So, I needed a solution to stop "New Members" from spamming my site. Here's a modified version of the script that I put together.

Add "newbie" classification to $user_array so we can easily find it later.

$sourcedir/Load.php

<search for>
// Set up the $user_info array.
$user_info += array(
'username' => $username,
'name' => isset($user_settings['realName']) ? $user_settings['realName'] : '',
'email' => isset($user_settings['emailAddress']) ? $user_settings['emailAddress'] : '',
'passwd' => isset($user_settings['passwd']) ? $user_settings['passwd'] : '',
'language' => empty($user_settings['lngfile']) || empty($modSettings['userLanguage']) ? $language : $user_settings['lngfile'],
'is_guest' => $ID_MEMBER == 0,
</search for>

<add after>
'is_newbie' => in_array(4, $user_info['groups']),
</add after>



Moved the hyperlink construct to outside of the "is guest" construct so that it could be used to check for both guests and new users.

$sourcedir/Post.php

<search 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;
}
}
</search for>

<add after>

// No spam by Guests (and New Members) mod
if ($user_info['is_guest'] || $user_info['is_newbie'])
{
$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;
}
}
</add after>

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

<add after>

// No spam by Guests (and New Members) mod
if ($posterIsGuest || $user_info['is_newbie'])
{
$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';
}
}

</add after>


And, I changed the wording of the error message.

$languagedir/Errors.english.php

<search for>
?>
</search for>

<add before>

// by NoSpamByGuests mod
$txt['error_guest_no_link'] = 'Sorry, Guests and New Members are not allowed to post messages containing hyperlinks.';
</add before>


Thanks for an excellent mod!

Steve
Title: Re: No Spam by Guests!
Post by: affbld on February 17, 2007, 10:33:18 PM
please update to 1.1.2
Title: Re: No Spam by Guests!
Post by: MacDo on February 26, 2007, 02:12:47 PM
I loved your mod and updated to 1.1.2... I would love too a version which is compatible with 1.1.2... Is that difficult ?
Thank you very much for your help !
Title: Re: No Spam by Guests!
Post by: MacDo on February 27, 2007, 03:43:11 AM
The mod seems to work properly with 1.1.2. I installed it using the package manager. I had to emulate the SMF 1.1 version by adding
;version_emulate=1.1
to the package manager url.
Hope this helps.
Title: Re: No Spam by Guests!
Post by: Dorte on February 27, 2007, 02:39:42 PM
Thanks MacDo, I'll give that a try :)
Title: Re: No Spam by Guests!
Post by: lucia2 on March 02, 2007, 08:32:53 AM
MacDo,
I want to install this for 1.1.2.
How, when and where do you add
;version_emulate=1.1

in the package manager url?  
Title: Re: No Spam by Guests!
Post by: lucia2 on March 02, 2007, 09:34:25 AM
Ok... I guess you just click package manager, then slap that at the end of the URL. (I guess it's obvious. :) )
Title: Re: No Spam by Guests!
Post by: verderacer on March 02, 2007, 05:14:12 PM
Hi guys,

Trying the same thing here and not having any luck...  Below a copy of my example URL.  What am i missing?

http://xyxy.xxx/yabbse/index.php?action=packages;sa=install;package=NoSpamByGuests_010.zip;version_emulate=1.1


Title: Re: No Spam by Guests!
Post by: xxkylexx on March 05, 2007, 06:53:06 PM
Any plan to upgrade this for 1.1.2?

Thanks,
Kyle
Title: Re: No Spam by Guests!
Post by: floydpink on March 06, 2007, 10:21:00 PM
The attached zip worked for me.
It contains all the original files, but package-info.xml has been edited to allow 1.1.2 install as follows:
        <install for="1.1 RC1, 1.1 RC2, 1.1 RC3, 1.1, 1.1.1">
        changed to
        <install for="1.1 RC1, 1.1 RC2, 1.1 RC3, 1.1, 1.1.1, 1.1.2">

        <uninstall for="1.1 RC1, 1.1 RC2, 1.1 RC3, 1.1, 1.1.1">
        changed to
        <uninstall for="1.1 RC1, 1.1 RC2, 1.1 RC3, 1.1, 1.1.1, 1.1.2">

The mod is working fine for me - no guarantees of course.
Title: Re: No Spam by Guests!
Post by: floydpink on March 14, 2007, 02:26:49 AM
Great Mod!!!
Having installed into 1.1.2 I've been getting these errors:

8: Undefined index: message
File: /usr/home/westweb/public_html/hkpnetsforum/Sources/Post.php
Line: 1275
8: Undefined index: message
File: /usr/home/westweb/public_html/hkpnetsforum/Sources/Post.php
Line: 1272
Presumably this is because the spammer has not provided any message whatsoever (for some unknown reason!).
This hack seems to have resolved the problem:
       // by NoSpamByGuests mod
        if (isset($_POST['message']))
       {

           $linkpos = strpos ($_POST['message'], "://"); // look for ://    (line 1272)
           if ($linkpos !== false) $post_errors[] = 'guest_no_link';
           else {
             $linkpos = strpos ($_POST['message'], "www."); // look for www.  (line 1275)
             if ($linkpos !== false) $post_errors[] = 'guest_no_link';
        }
Title: Re: No Spam by Guests!
Post by: icman on March 26, 2007, 03:17:37 PM
Thank you, very nice mod!
็Ho Jodddd very good
Title: Re: No Spam by Guests!
Post by: jnix on March 27, 2007, 07:15:01 AM
Thanks for the mod - solving a big spam problem.

One slight problem though - when moderators or admin modify a guest post, to create a link, its also blocked by this mod. So if i decide that a link is ok to include, so want to change eg www.  legitsite. com to a proper link, I can't.

Any way round this? 
Title: Re: No Spam by Guests!
Post by: pintobuck on April 20, 2007, 05:30:59 AM
The author invited us to test this mod at his website.
NoSpamBot worked like a charm as long as I included "http://" in my spam URL.
But without including "http://", I posted 3 spam URLs on his web site.  The spam URLs are functioning, clickable, and take you the spam sites.

NoSpamBot is a great mod.  It just needs a little modification.
Title: Re: No Spam by Guests!
Post by: jnix on April 20, 2007, 06:38:23 AM
I've just had a go on that site, and it works okfor me (ie I can't post links, http:// or otherwise). They do show up in the preview, but together with the warning message, so thats all fine. All it works fine on my site too.
Title: Re: No Spam by Guests!
Post by: PheelGoodInc on June 29, 2007, 06:21:56 PM
Ok I'm having a huge problem with this. My site gets 7-10 spammers a day. We just upgraded to 1.1.3. I've tried modifying the post.php with the code on the first 2 pages, and it wouldn't let anyone post anything. Then I went into the xml file and modified it to allow to install to 1.1.3. It will upload, but when i click "apply mod" I get this error "You cannot download or install new packages because the Packages directory or one of the files in it are not writable!".

This is frustrating me to no end. I've spent hours trying to fix our spam problem. There has to be a solution somewhere!
Title: Re: No Spam by Guests!
Post by: GTSdll on June 30, 2007, 05:13:12 AM
Updated the mod to be compatible with 1.1.3.
Also i included the little fix, floydpink pointet out ^^
Title: Re: No Spam by Guests!
Post by: GTSdll on June 30, 2007, 05:16:17 AM
Quote from: pintobuck on April 20, 2007, 05:30:59 AM
The author invited us to test this mod at his website.
NoSpamBot worked like a charm as long as I included "http://" in my spam URL.
But without including "http://", I posted 3 spam URLs on his web site.  The spam URLs are functioning, clickable, and take you the spam sites.

NoSpamBot is a great mod.  It just needs a little modification.

You're right, but it still should be enough to keep the bots away. Thats the main purpose anyways.
If there comes up a real need to mod it more, i would do it ;)
Title: Re: No Spam by Guests!
Post by: mytreo on August 01, 2007, 03:17:17 AM
Great mod. Just the ticket. Thanks.
Title: Re: No Spam by Guests!
Post by: Mave on September 05, 2007, 02:53:25 AM
Nice mod. Thx.

Can you modifit it that i can see which IP want to post?
For example this mod give a entrie in the error log from forum.
Title: Re: No Spam by Guests!
Post by: Dirtrocker on October 02, 2007, 06:37:45 PM
Will you be updating this for 1.1.4?
Title: Re: No Spam by Guests!
Post by: chrishicks on October 05, 2007, 09:27:32 PM
Quote from: Dirtrocker on October 02, 2007, 06:37:45 PM
Will you be updating this for 1.1.4?

I was just coming here to ask this too.
Title: Re: No Spam by Guests!
Post by: ronread on October 08, 2007, 07:34:16 AM
Me do. Seems damn useful! But with 1.1.4 had no option to instal in Packages after uploading...
Title: Re: No Spam by Guests!
Post by: BigBen on October 08, 2007, 08:16:15 PM
I have a new version of SMF, and I get: The package you are trying to download or install is either corrupt or not compatible with this version of SMF.
Title: Re: No Spam by Guests!
Post by: Nutronic on October 12, 2007, 11:51:52 AM
I have version 0.1 of this and im running the latest SMF can you tell me how I can remove it as it doesn't have an uninstaller, can I just delete the files or do I have to go through everything and remove its references?

Im wanting to remove it cus guests have to login now, no other reason.
Title: Re: No Spam by Guests!
Post by: Fiery on November 12, 2007, 04:01:58 AM
Hello,

You can get this to work for 1.1.4 by doing the following.

Download the package to your computer and unzip it.

Find package-info.xml and open it in any text editing software

Look for the 2 instances of 1.1.3 and add 1.1.4 after it, dont forget the comma between the two.

Make sure you put 1.1.4 after both 1.1.3 instances, they will be in the install and uninstall section.

Save the file.

Rezip this file with the other two in the package.

Upload into the package manager and apply the mod.

It should work, let us know if it doesnt.

...Always remember to make backups first.
Title: Re: No Spam by Guests!
Post by: ^DooM^ on November 13, 2007, 04:27:50 PM
Quote from: pmp6nl on November 12, 2007, 04:01:58 AM
Hello,

You can get this to work for 1.1.4 by doing the following.

Download the package to your computer and unzip it.

Find package-info.xml and open it in any text editing software

Look for the 2 instances of 1.1.3 and add 1.1.4 after it, dont forget the comma between the two.

Make sure you put 1.1.4 after both 1.1.3 instances, they will be in the install and uninstall section.

Save the file.

Rezip this file with the other two in the package.

Upload into the package manager and apply the mod.

It should work, let us know if it doesnt.

...Always remember to make backups first.

I can confirm that this method works for installing with 1.1.4 and the mod works correctly.
Title: Re: No Spam by Guests!
Post by: Alenônimo on December 17, 2007, 01:27:37 AM
This MOD is f*cking awesome! I had NO SPAM after installing him!
Title: Re: No Spam by Guests!
Post by: ryanhellyer on January 01, 2008, 07:31:23 AM
Your test site (http://www.gts-stuff.com/index.php/topic,1786.msg26637.html#msg26637) appears to be broken.
Title: Re: No Spam by Guests!
Post by: MadnessRed on January 22, 2008, 05:37:25 PM
i too have the
QuoteYou cannot download or install new packages because the Packages directory or one of the files in it are not writable!
problem. Can you please tell me what to do. I have chmod to 0777 but it still says that, using fireftp, any help would be welcome, thanks/
Title: Re: No Spam by Guests!
Post by: LM on February 18, 2008, 12:59:41 AM
Works nicely on 1.1.4 without any changes before installing and it installed very smoothly. Only kink is after installation I had to manually copy and paste the $txt variable to the language files so it would show up.  Thanks for writing it!
Title: Re: No Spam by Guests!
Post by: - danny on February 25, 2008, 01:44:47 PM
i've got the mod installed and i think it works pretty good, but every now and then, i find a spam bot post, with live links, such as what you see in the image below.

(http://img187.imageshack.us/my.php?image=anonpostdu8.png)

any clue why this happens?

the code they wrote was simple:
<a href="celebsvideo.websearch-pro.com">celebs video</a>
[url=http://celebsvideo.websearch-pro.com]celebs video[/url]

<a href="celebssexvideo.websearch-pro.com">celebs video archive</a>
[url=http://celebssexvideo.websearch-pro.com]celebs video archive[/url]

<a href="celebsnudevideo.websearch-pro.com">celebs sex video</a>
[url=http://celebsnudevideo.websearch-pro.com]celebs sex video[/url]

<a href="freecelebsvideo.websearch-pro.com">celebs nude video</a>
[url=http://freecelebsvideo.websearch-pro.com]celebs nude video[/url]

<a href="videocelebs.websearch-pro.com">free video porn celebs</a>
[url=http://videocelebs.websearch-pro.com]free video porn celebs[/url]

<a href="hotcelebs.websearch-pro.com">free celebs video</a>
[url=http://hotcelebs.websearch-pro.com]free celebs video[/url]

<a href="freecelebs.websearch-pro.com">naked celebs video</a>
[url=http://freecelebs.websearch-pro.com]naked celebs video[/url]

<a href="hotvideo.websearch-pro.com">video celebs</a>
[url=http://hotvideo.websearch-pro.com]video celebs[/url]

<a href="sexonvideo.websearch-pro.com">video porno celebs</a>
[url=http://sexonvideo.websearch-pro.com]video porno celebs[/url]
Title: Re: No Spam by Guests!
Post by: ApplianceJunk on March 02, 2008, 08:29:43 AM
Awesome mod, thanks!
Title: Re: No Spam by Guests!
Post by: tallpaul on July 04, 2008, 04:59:00 AM
Hello,

You can get this to work for 1.1.5 by doing the following.

Download the package to your computer and unzip it.

Find package-info.xml and open it in any text editing software

Look for the 2 instances of 1.1.4 and add 1.1.5 after it, dont forget the comma between the two.

Make sure you put 1.1.5 after both 1.1.4 instances, they will be in the install and uninstall section.

Save the file.

Rezip this file with the other two in the package.

Upload into the package manager and apply the mod.

It should work, let us know if it doesnt.

...Always remember to make backups first.




(sorry for copying your post, i just upgraded to 1.1.5 and wanted this to work as it's so good,  the day it's been down i been getting loads of spam by guests grrrrrr)
Title: Re: No Spam by Guests!
Post by: Achillea on July 14, 2008, 07:02:01 PM
Does this block all links by guests throughout the entire forum without exception, or is it possible to configure it in such a way that guests may post links in a particular sub forum?  I ask because I have one subforum where guests need to be able to post links (my forum is an rpg and there's a reciprocal advertising protocol involved). 
Title: Re: No Spam by Guests!
Post by: 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">
                <readme type="inline">
"No Spam by Guests!" 0.2 for SMF


see here http://waronyou.com/forums
Title: Re: No Spam by Guests!
Post by: CvH on October 28, 2008, 08:05:19 PM
Hi i´ve made an SMF 2.0b4 Version of this mod (just redone the whole installation).
Tested and work with 2.0b4 also added German-utf8 Support.

Made just an temporary fix till the Mod Author update this mod.

mfg CvH
(Mod in Attachment)
Title: Re: No Spam by Guests!
Post by: Poreman on November 18, 2008, 09:45:41 PM
Quote from: CvH on October 28, 2008, 08:05:19 PM
Hi i´ve made an SMF 2.0b4 Version of this mod (just redone the whole installation).
Tested and work with 2.0b4 also added German-utf8 Support.

Made just an temporary fix till the Mod Author update this mod.

mfg CvH
(Mod in Attachment)

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?
Thanks
Poreman
Title: Re: No Spam by Guests!
Post by: 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 (http://custom.simplemachines.org/mods/index.php?mod=1095)".
This only blocks guest spammposters.

Title: Re: No Spam by Guests!
Post by: 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 (http://custom.simplemachines.org/mods/index.php?mod=1095)".
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
Title: Re: No Spam by Guests!
Post by: labradors on January 30, 2009, 07:26:39 PM
Hello.

Back in 2006, user "wing" posted a message regarding manual implementation of the "No Spam by Guests" mod, and included his own, additional code (http://www.simplemachines.org/community/index.php?topic=119091.msg852570#msg852570) for preventing new members with fewer than ten posts from having links in their messages.

I am running SMF version 1.1.7, and already have my forum set not to allow any posts by guests, so I don't really need the mod, itself.  I do, however, wish to implement the post-count-based limitation, and have tried that part of the code that was posted, but it didn't seem to have any effect when I logged in as a non-admin user with fewer than ten posts.

Should that code work in 1.1.7 without having to install the "No Spam by Guests" mod (which only goes up to 1.1.4), or is it dependent upon something that "No Spam by Guests" contains?

Franky, I'm surprised post-count-based link restriction is not a standard feature, and that I cannot find any mods here that implement it, other than the code I just mentioned above.  So many spambots, pornbots, and just general spammers register on forum sites just so they can post pictures and/or links in their messages right away that I can't imagine wanting to allow new, unproven users to post URLs.

Thanks!

P.S.:  I HAVE actually sent a PM with this question to that user, but realised, after sending the message, that his last activity date here was January of 2008, not 2009.  :(
Title: Re: No Spam by Guests!
Post by: ArrayInteractive on March 31, 2009, 02:27:19 AM
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.
Title: Re: No Spam by Guests!
Post by: Rostam on June 29, 2009, 01:56:48 PM
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 (http://custom.simplemachines.org/mods/index.php?mod=1095)".
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?
Title: Re: No Spam by Guests!
Post by: Groundhog on September 17, 2009, 05:51:07 PM
This is a great mod. Thanks very much.  8)

It appears to be working perfectly in 2.0 RC1.
Title: Re: No Spam by Guests!
Post by: Coyote90 on February 27, 2010, 05:07:54 AM
does not work on 1.1.11....
please, tell me what to do to make it work....
Title: Re: No Spam by Guests!
Post by: Scratching my Head on June 01, 2010, 03:57:54 PM
Worked for 2.0 RC3

Thanks!

Title: Re: No Spam by Guests!
Post by: Klozi on July 21, 2010, 11:48:13 AM
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.
Title: Re: No Spam by Guests!
Post by: vdrover on October 05, 2010, 01:20:15 PM
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.
Title: Re: No Spam by Guests!
Post by: Biology Forums on January 01, 2011, 03:08:32 PM
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 :(
Title: Re: No Spam by Guests!
Post by: Biology Forums 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.
Title: Re: No Spam by Guests!
Post by: winsoft on December 31, 2012, 02:38:50 PM
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.