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.
(http://pics.gts-stuff.com/data/media/1/nospambyguests.png)
You can try posting a link as guest on my forum (http://www.gts-stuff.com/) to see how it works.
Oh, I like this, one forum will utilize this.
Thank you.
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.
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?)
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 ;)
Thank you, no problems, works like it should, comes in real handy for Site Help forum.
Thank you, very nice mod!
Bye!
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.
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
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.
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.
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
is working with 1.1?
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.
sorry ;) ;)
SMF 1.1 Final:
The package you are trying to download or install is either corrupt or not compatible with this version of SMF.
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!
Great Mod!!
I guess this mod doesn't work for 1.1.1 ?
:)
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.
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
please update to 1.1.2
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 !
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.
Thanks MacDo, I'll give that a try :)
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?
Ok... I guess you just click package manager, then slap that at the end of the URL. (I guess it's obvious. :) )
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
Any plan to upgrade this for 1.1.2?
Thanks,
Kyle
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.
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';
}
Thank you, very nice mod!
็Ho Jodddd very good
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?
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.
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.
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!
Updated the mod to be compatible with 1.1.3.
Also i included the little fix, floydpink pointet out ^^
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 ;)
Great mod. Just the ticket. Thanks.
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.
Will you be updating this for 1.1.4?
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.
Me do. Seems damn useful! But with 1.1.4 had no option to instal in Packages after uploading...
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.
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.
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.
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.
This MOD is f*cking awesome! I had NO SPAM after installing him!
Your test site (http://www.gts-stuff.com/index.php/topic,1786.msg26637.html#msg26637) appears to be broken.
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/
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!
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/img187/576/anonpostdu8.th.png) (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]
Awesome mod, thanks!
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)
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).
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
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)
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
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.
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
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. :(
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.
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?
This is a great mod. Thanks very much. 8)
It appears to be working perfectly in 2.0 RC1.
does not work on 1.1.11....
please, tell me what to do to make it work....
Worked for 2.0 RC3
Thanks!
(http://serve.mysmiley.net/sign/sign0201.gif)
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.
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.
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 :(
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.
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.