PDA

View Full Version : New Posting Features - Allow URLs in posts only after a minimum number of posts (to reduce spam)


Xoligy
12-11-2006, 10:00 PM
With the recent increase in CAPTCHA-beating bots spamming their URLs, I have a feeling this mod will be very useful. Inspired by this (https://vborg.vbsupport.ru/showthread.php?t=44694) vBulletin 2 plug-in.

To install, first upload "bitfield_restricturls.xml" to "includes/xml", and then just install restricturls.xml via the product manager in the AdminCP. The plug-in should automatically rebuild the bitfields cache - as long as you upload "bitfield_restricturls.xml" first.

The amount of posts required is configurable in the usergroup manager, simply look for the group of settings with the header "Restrict URLs". The default is set to 5, however most bots tend to only make one or two spam posts at the most.

For obvious reasons, moderators and admins don't have this restriction, but if you want to add it, you can remove the group id from "bitfield_restricturls.xml".

If people find this useful, I may also update this to make an option so the posts containing URLs are set to be moderated rather than just completely restricted.

Enjoy :)

Update (13th Dec): Added code to rebuild bitfields, just re-install the .xml file. Also fixed a major bug. If you already have this installed... re-install it!

Note: This works by detecting the [url] tag and so it relies on vBulletin BBCode enabled and vBulletin to automatically parse URLs in to BBCode. If you have either of these disabled it will not work.


You're free to do what you like with this code, although credit is appreciated, it's not required.

Brought to you by eXaltic - vBulletin skins (http://www.exaltic.com).

Update: If you're looking for a more advanced version of this, I recommend this (https://vborg.vbsupport.ru/showthread.php?t=129390) or this (https://vborg.vbsupport.ru/showthread.php?t=123002). Because of these, this plug-in will no longer be updated unless needed. I recommend you use either of the first 2 if you're looking for more control.

DPSR
12-12-2006, 03:23 PM
Just saw the screenshot (https://vborg.vbsupport.ru/attachment.php?attachmentid=8440&d=1034857031), this is a really cool addon to stop spam

Thanks for the hack Xoligy

*installed ;)

TheBlackPoet
12-12-2006, 03:32 PM
thank you....

Distance
12-12-2006, 03:53 PM
Nice but i have an advanced version of this installed :D

Xoligy
12-12-2006, 04:34 PM
Nice but i have an advanced version of this installed :D

Care to elaborate?

Distance
12-12-2006, 04:54 PM
PM'd ;)..

bada_bing
12-12-2006, 07:41 PM
Care to elaborate?
I agee

WritersBeat
12-13-2006, 06:39 AM
didn't rebuilt bitfields for me.

tschai
12-13-2006, 08:02 AM
This sounds very usefull indeed. Will give it a try...

Xoligy
12-13-2006, 09:09 AM
didn't rebuilt bitfields for me.

Thanks, I'll look in to it. What version are you using?

EDIT: Fixed.

sduckie2k5
12-13-2006, 11:56 AM
Nice but i have an advanced version of this installed :D

Thank you, installed but I'm curious as well for my forum, what is an advanced version of this. Is there another product similar to this one out?

Xoligy
12-13-2006, 03:32 PM
Updated main post with information about better plug-ins. Unfortunately I didn't know about them until Distance notified me and I stumbled across the other.

If you're looking for more control, I recommend you use one of the 2 mentioned.

fxs158
12-13-2006, 06:46 PM
Sounds like a great hack, Installed it. Set registered group to 25 post prior to be able to post links. Logged in with a test account no post on it and it was able to post links. I uploaded the bitfield first then imported. What could be the problem?

Xoligy
12-13-2006, 07:54 PM
You're right, I made a mistake. Now going to upload the fixed version.

fxs158
12-13-2006, 07:59 PM
You're right, I made a mistake. Now going to upload the fixed version.


Thank you, I prefer your version as it gives them a message telling them why they cannot post url The other mods simply place the message as a moderated post. Then we would have to manually remove the crap and explain to them why.

Smoothie
12-14-2006, 12:20 AM
Update: If you're looking for a more advanced version of this, I recommend this or this. Because of these, this plug-in will no longer be updated unless needed. I recommend you use either of the first 2 if you're looking for more control.Think you should continue to develop this mod as the others don't really interest me, too many features when this is all that's needed.

BTW, has it been fixed yet?

fxs158
12-14-2006, 01:19 AM
yes it was fixed. This mod is just what the doctor ordered. Would be great if a message would come out in a block to tell a user why they cannot use links, As posted on the picture on the first post.

Smoothie
12-14-2006, 01:30 AM
yes it was fixed. This mod is just what the doctor ordered. Would be great if a message would come out in a block to tell a user why they cannot use links, As posted on the picture on the first post.I thought the error message was standard with this mod?

fxs158
12-14-2006, 02:54 AM
I thought the error message was standard with this mod?


The error message is below the navbit, basically it returns you to your post. It is fine, but I thought that the message would be something more noticeable, like when you try to access a private forum and you get the boxed message telling you that you do not have permission.

It is still cool as it is.

Xoligy
12-14-2006, 07:40 AM
Well if you want me to continue developing it, I will.

MrPHD
12-14-2006, 08:23 AM
Installed and running well. Regards

Smoothie
12-14-2006, 03:15 PM
The error message is below the navbit, basically it returns you to your post. It is fine, but I thought that the message would be something more noticeable, like when you try to access a private forum and you get the boxed message telling you that you do not have permission.

It is still cool as it is.Can you post a screenshot of what the error message looks like? Is it anything like this one:
https://vborg.vbsupport.ru/attachment.php?attachmentid=8440&d=1034857031

I'm assuming you can customize the message the user sees?

Smoothie
12-14-2006, 03:16 PM
Well if you want me to continue developing it, I will.
It would be cool if you did. Being able to customize the error message a user sees would be a nice addon.

Xoligy
12-14-2006, 03:17 PM
It's the same type of error message you get when you try and post an empty message. You can change the error via the phrase manager.

Smoothie
12-14-2006, 03:20 PM
It's the same type of error message you get when you try and post an empty message. You can change the error via the phrase manager.Shouldn't there be a separate phrase for this? Or does it use the same phrase as the empty message or did I misunderstand you altogether?

Xoligy
12-14-2006, 03:28 PM
I mean, it appears in the same place as other posting errors do (for example the empty post message) but it uses its own phrase. Sorry for not wording it clearly :P

fxs158
12-17-2006, 01:49 PM
Please do continue developing, this is a nice hack. Prior to it I was having spamers registering and posting four or five links and then never seen again.

Xoligy
12-17-2006, 04:46 PM
Thanks. When I have free time and I've finished the other plug-ins I promised, I'll add some extra functionality such as limiting sigs etc.

Smoothie
12-17-2006, 08:36 PM
Continue to develop as is, no new features are needed, except being able to cusomize the error message right from the setting. I hate searching for phrases. What we need is a reliable means of limiting what spammers can do, and only allowing url's after x number of posts is a good start. There are other modifications available here that take care of limiting sigs and such. Just my opinion.

Heck, in addition to not allowing url's, how about not allowing .com,.net, etc. because spammers could just type in spammer.com or spammer.net and it would still show.

xadoa
12-18-2006, 02:02 AM
i've installed, and all my members couldn't post anything, weird.. even though it's about url, but restricted everything as well..

Xoligy
12-18-2006, 12:39 PM
Make sure you're using the latest version. Do you have any other mods installed?

I see no logical reason why that would happen, since it requires '[url]' to be in the post before disallowing it.

SkyCatcher
12-19-2006, 10:18 PM
Just installed it. Works fantastic!

I've been having a few annoyances where a user would register and spam 20 porn links. They'd get banned, but it would still be annoying to see. This solves my problem perfectly.

Thanks for taking the time :)

mjp
12-20-2006, 05:28 AM
Doesn't work for me.

Only other product installed is the welcome headers:

https://vborg.vbsupport.ru/showthread.php?t=119572

Using the legacy postbit if that matters.

Xoligy
12-20-2006, 10:03 AM
Are you sure you uploaded the bitfileds file before installing it?

danielschnarr
12-21-2006, 07:52 PM
Looks good, but i found when you post once with a URL, it'll give you an error, click post after you get the error and it lets you.

Xoligy
12-21-2006, 08:49 PM
I'll look in to that. But don't forget, the bots aren't going to then click submit, so it's still effective.

chick
12-24-2006, 08:08 PM
It isn't working at all for me and I upped bits xml ect... correctly..... installed and set to 5 posts. I have spammers galore... I also took out allowing bb code urls.

they are still posting full url links as are new legitimate members in their 1st post.

Xoligy
01-10-2007, 01:08 PM
The reason it isn't working for you is because it relies on vBulletin automatically parsing the URL in to BBCode. Enable BBCode again and it should work. I'm now looking in to the other bugs.

[quote]Looks good, but i found when you post once with a URL, it'll give you an error, click post after you get the error and it lets you.[quote]

I'm un-able to replicate this.

grecostimpy
01-12-2007, 10:48 AM
OK, I found something that would be a great fix.

I installed this mod thinking my troubles were over (and mind you, they lessened), but I found I was still getting porn links, etc being posted.

It does not restrict them from making posts with [url = (though without the space between the url and "=")

So if they cover the url tags with a word(s) like this: Allow URLs in posts only after a minimum number of posts (https://vborg.vbsupport.ru/showthread.php?t=133826).. Then it allows the member to post.

Xoligy
01-13-2007, 09:56 AM
Good point, I'll fix than and re-upload.

EDIT: Fixed.

grecostimpy
01-13-2007, 01:16 PM
Good point, I'll fix than and re-upload.

EDIT: Fixed.

Thanks alot! I'll re-install. :)

grecostimpy
01-13-2007, 01:38 PM
OK...one last thing. I see you changed it to look for [ /url] (without the space obviously)

Problem is, if the bbcode is uppercase "[ /URL]", then it lets the post go through.

Any way it can look for both upper and lowercase?

Thanks!...sorry for being a pain. :)

Xoligy
01-14-2007, 09:53 AM
Good point, I'll use preg_match

grecostimpy
01-14-2007, 07:25 PM
Good point, I'll use preg_match

Awesome...thanks.

Please let us know when its updated. I think this is one of the best mods to date.

grecostimpy
01-19-2007, 12:39 AM
Good point, I'll use preg_match

Any news on an update with this? Thanks!

ricoche
01-19-2007, 06:23 AM
Perhaps the preg_match is what I need as well. I have this installed, but am still getting porn spam links galore. Something isn't working and I'm sure not yet. Thanks.

Sadie Frost
01-20-2007, 10:45 PM
I've been using this one by amykhar https://vborg.vbsupport.ru/showthread.php?t=96018 and it seems to work okay - does anyone have any insight as to whether I should switch to this one? Thanks :)

grecostimpy
01-29-2007, 11:52 AM
Bump for preg_match. Thanks. :)

Xoligy
01-29-2007, 03:38 PM
Oops, looks like I forgot to upload it, sorry!

Updated.

phreak2010
02-05-2007, 02:19 PM
Hi,

Your plugin is great and works fine apart
from one bug that i found today.

If you post a message and then edit it afterwards you
can get past the plugin. Would it be possible to make it
check when a message is edited to?

Cheers

josiespencer
02-15-2007, 04:13 PM
Great mod! Not only does it eliminate those nasty porn/drug SPAMmers, it allowed us to create a user group called LimitedUsers with a minimum posts restriction of 999999. Now we can control the users that are constantly redirecting threads to links outside our website when we already have the answer/resource posted somewhere on our site.

Gotta love it!

Hawk7173
02-16-2007, 02:48 AM
any way of adding [img] tags to this also?

LoreleiWeb
02-21-2007, 03:50 PM
Thanks for this awesome mod. installed and nominated it (if its not too late :D)

Xoligy
02-23-2007, 09:45 AM
phreak2010, good point, I'll look in to it - but hopefully spammers aren't clever enough yet to edit posts :P

Hawk7173, I'll possibly add that option too, but at the moment, you can use the attached one. It will block with images and URLs, but generally most spammers don't post images without URLs.

I'll also update this plug-in so that when "Automatically parse links in text" is unticked text links (eg. www.google.com) don't get through.

Hawk7173
02-23-2007, 12:38 PM
phreak2010, good point, I'll look in to it - but hopefully spammers aren't clever enough yet to edit posts :P

Hawk7173, I'll possibly add that option too, but at the moment, you can use the attached one. It will block with images and URLs, but generally most spammers don't post images without URLs.

I'll also update this plug-in so that when "Automatically parse links in text" is unticked text links (eg. www.google.com) don't get through.

Thanks a bunch! I'll give it a shot. Most appreciated! Hawk

sarahk
03-11-2007, 11:36 PM
I'm still trying to work out this gotcha but it appears that in the rebuild of forum permissions that locked down forums may be opened up - eg mods forums. Test for that after installing.

It's a shame development and support won't continue. Sometimes the simplest solutions are all that are needed. Those other options seemed like overkill when added to the existing vB functionality.

v12kid
05-10-2007, 09:03 PM
got it installed but cant find the settings in th admincp, anyone point out where I should be looking?

cheers

Tearstone
05-12-2007, 09:17 PM
Excellent, I've been looking for something to help with this.

Wild-Wing
06-21-2007, 10:24 PM
wow this is a cool *** mod man.

Masiello
06-28-2007, 05:18 PM
Hi, please tell me what products I've download for vB 3.6.7?

SpanishHarlem
06-29-2007, 06:08 PM
It doesn't help when they make other posts just to be able to put the url in.

hobsdv
08-05-2007, 08:34 AM
very handy mod to have i set the limit on mine to 20 posts

nMIK-3
09-05-2007, 12:39 PM
Thats what I needed.

THanks

pitzerwm
09-07-2007, 01:08 AM
I'm new or retarded, where do I set this: automatically parse URLs in to BBCode

cpvr
09-08-2007, 02:53 AM
Nice but i have an advanced version of this installed :D

Where?

JamesAB
09-28-2007, 03:22 AM
First off, thanks for this great mod.

Is there a way to check for email tags as well?

I looked at the orginal code:
// Restrict URLs
if ($vbulletin->userinfo['posts'] < $vbulletin->userinfo['permissions']['postsforurls'] && preg_match('/\[\/url\]/i', $post['message'])){
$errors[] = fetch_error('no_urls_for_you', $vbulletin->userinfo['permissions']['postsforurls']);

And then the mod posted to restrict IMG tags:
// Restrict URLs
if ($vbulletin->userinfo['posts'] < $vbulletin->userinfo['permissions']['postsforurls'] && preg_match('/(\[\/url\]|[\/img\])/i', $post['message'])){
$errors[] = fetch_error('no_urls_for_you', $vbulletin->userinfo['permissions']['postsforurls']);
}

So I tested this to try to catch email tags instead of img tags:
// Restrict URLs
if ($vbulletin->userinfo['posts'] < $vbulletin->userinfo['permissions']['postsforurls'] && preg_match('/(\[\/url\]|[\/email\])/i', $post['message'])){
$errors[] = fetch_error('no_urls_for_you', $vbulletin->userinfo['permissions']['postsforurls']);
}

but I get this error:
Warning: preg_match() [function.preg-match]: Compilation failed: missing terminating ] for character class at offset 22 in /includes/functions_newpost.php(360) : eval()'d code on line 2

Any ideas on this?

Thanks for your help.

JamesAB
09-28-2007, 04:16 AM
Nevermind. I found the missing \ character.

It works as:
// Restrict URLs
if ($vbulletin->userinfo['posts'] < $vbulletin->userinfo['permissions']['postsforurls'] && preg_match('/(\[\/url\]|\[\/email\])/i', $post['message'])){
$errors[] = fetch_error('no_urls_for_you', $vbulletin->userinfo['permissions']['postsforurls']);
}

David Bott
10-30-2007, 12:40 AM
Hello...

We use this and it is great. Looking for the same thing but with the PM's as well a spammers are now using that as a way to not only spam, but also SPOOF. Yes, we just had our site spoofed to collect user login info. (IE, a link to a page that looks like us but displays the You are not Logged in...and gives the boxes. This link was offered via PM from a member with zero posts. Thus the need.

Thank you.

Shaheen
11-27-2007, 01:41 PM
Is this works with 3.6.8 ??? any one tested ???
Advance thanks ;)

Calash
11-30-2007, 12:08 PM
Hello...

We use this and it is great. Looking for the same thing but with the PM's as well a spammers are now using that as a way to not only spam, but also SPOOF. Yes, we just had our site spoofed to collect user login info. (IE, a link to a page that looks like us but displays the You are not Logged in...and gives the boxes. This link was offered via PM from a member with zero posts. Thus the need.

Thank you.

I was able to get this to work with PM's as well by making a new plugin

Hook :private_insertpm_process


// Restrict URLs
if ($vbulletin->userinfo['posts'] < $vbulletin->userinfo['permissions']['postsforurls'] && preg_match('/\[\/url\]/i', $pm['message'])){
$errors[] = fetch_error('no_urls_for_you', $vbulletin->userinfo['permissions']['postsforurls']);
}


Just did a quick test and it works great for stopping URLs in PM messages.


The mod works fine on my 3.6.8 system.

Fox Mc Cloud
04-23-2008, 06:07 PM
Is it somehow possible to block html links too? Some spambots try it even tough it doesn't work. They can make posts which is pretty annoying.

islamicvd
04-27-2008, 11:03 AM
Does it works on 3.6.10?

LeonardoCal
05-21-2008, 09:41 PM
anyone tested this on 3.7.0?

King Justice
06-04-2008, 11:21 AM
Does this work on vB 3.7.1?

sarahk
07-21-2008, 11:50 PM
I've just installed this in a 3.7.2 forum and it's tested ok.

Bonus Paradise
10-01-2008, 07:54 PM
installed this today on VB 3.7.3
tested too
works good so far
many thnks

sarahk
10-02-2008, 01:01 AM
Important change needed to this plugin.

If people post, then edit their post they can add links.

Please add the following plugin
=============================
The hook is editpost_update_process
The code is // Restrict URLs
if ($vbulletin->userinfo['posts'] < $vbulletin->userinfo['permissions']['postsforurls'] && preg_match('/\[\/url\]/i', $edit['message'])){
$errors[] = fetch_error('no_urls_for_you', $vbulletin->userinfo['permissions']['postsforurls']);
}

Bonus Paradise
10-02-2008, 07:51 AM
thank you very much sarah :up:

please where exactly do i have to add this?

sarahk
10-02-2008, 09:48 PM
Go the plugin manager
click on "add new plugin"
then you get to
create a dummy user so that you can test the workaround. You need to see what you are fixing before you fix it.
choose the product - for the sake of linking I selected the url product that the other plugin is added to
choose the hook - scroll through until you find "editpost_update_process"
add the code above
mark as active
save
test

Bonus Paradise
10-02-2008, 10:27 PM
Thank you very much Sarah
found it :)

Bonus Paradise
10-02-2008, 10:50 PM
i did that
have the plugin in there
can see it
all seems fine
but i tested it out
and i as the new dummy user now
can still add url if i edit post.

Maybe this dont work on Vbulletin 3.7.3 PL1 ?

sarahk
10-03-2008, 07:19 AM
I have it working with 3.7.2

I can't imagine that they've made huge changes to that part of the code in this release.

I'd check
* you have activated the plugin
* you have set the post count in the user groups

Bonus Paradise
10-03-2008, 10:42 AM
I have it working with 3.7.2

I can't imagine that they've made huge changes to that part of the code in this release.

I'd check
* you have activated the plugin
* you have set the post count in the user groups

I def. did something wrong
sorry, but sometimes its really hard for me to understand all in english

in the usergroup i see this
Restrict URLs
Minimum posts required to post URLs? 5


In my Plugins i see now this:
2nd one is what i made,

Product : Restrict URLS
Check for URLs newpost_process [Edit] [Delete]
Restrict URLS edit posts editpost_update_process [Edit] [Delete]

both are active.

sarahk
10-03-2008, 09:00 PM
Go to User Group Manager and select the usergroup that newly registered users go into. Scroll down to the section called "Restrict URLs" and make sure you have 10 (or something in there)

Send me a PM with your forum and I'll take a look.

satam2k
11-21-2008, 11:35 PM
Thank you

myown
04-22-2009, 12:12 PM
does it work with 3.8.x

rrudeboy
06-01-2009, 12:02 PM
does it work with 3.8.x

ditto question here....

does it ?

mdawg
06-06-2009, 10:20 PM
I really hate forums that make you have to post more than one thread in order to post URLs. I suppose if this were set to just 1, allowing URLs on the second post, might be something.

Blade-uk
06-08-2009, 11:31 AM
Working here on 3.8.2

Thanks :D

Andy

vinss
12-25-2009, 02:33 PM
Thanks :)

asiaphoto
02-08-2010, 05:01 AM
this is a great mod/add-on

is there any plan to release a version workable on VB4?

vijayninel
03-09-2010, 01:33 AM
The mod is working great on 3.8.4 but sarahk (https://vborg.vbsupport.ru/member.php?u=58094)'s additional plugin to improve functionality did not work.

djxkon
02-25-2011, 12:03 AM
So I'm trying to plug it in, I'm using version 4x under plug ins & products > add new plug in > what do I put for hook location?

djxkon
02-25-2011, 12:22 AM
I can't get it to work at all errr, I really want it, my site has been up for 5 days, not advertised at all, and already spammers found me. I have followed the directions, but i'm on 4x maybe that's the problem?

djxkon
02-25-2011, 12:28 AM
ok i figured out the hook thing... but now I get an error...

Parse error: syntax error, unexpected '<' in /home/financi5/public_html/includes/functions_newpost.php(443) : eval()'d code on line 1

Redirecting...
Thank you for posting! You will now be taken to your post. If you opted to post a poll, you will now be allowed to do so.
Click here if your browser does not automatically redirect you.

Louva-Deus
12-20-2011, 02:53 AM
This does not appear to work for posts where the poster doesn't actually use any of the three bbcodes checked for (meaning they rely on the 'Automatically parse links in text' feature). So more advanced regex parsing is needed.

I'm running 3.8.7.

HMBeaty
12-20-2011, 03:04 AM
This does not appear to work for posts where the poster doesn't actually use any of the three bbcodes checked for (meaning they rely on the 'Automatically parse links in text' feature). So more advanced regex parsing is needed.

I'm running 3.8.7.
https://vborg.vbsupport.ru/showthread.php?t=269704

SaN-DeeP
04-14-2012, 11:26 AM
works like a charm.. wanted to quickly install this to control spam..