vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 2.x Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=4)
-   -   Allow URLs in posts only after a minimum number of posts (to reduce spam) (https://vborg.vbsupport.ru/showthread.php?t=44694)

Erwin 10-16-2002 10:00 PM

Allow URLs in posts only after a minimum number of posts (to reduce spam)
 
Allow URLs in posts only after a minimum number of posts (to reduce spam)

I did this mini-hack to reduce the amount of spammers and newbie mistakes at my forums. Most of the newbies at my site do not read the rules, and in their enthusiasm post links back to their own sites or forums.

I have made it so that members need to have a minimum number of posts before they can post URLs to website. On my site I've set it to 15, but you can set it to whatever you like. If a member has less than the required amount of posts, when they try to post they get redirected to an error page, telling them that they need to have a minimum amount of posts before they can post links in their post. In my error message, I also tell them to post links to their own site only in our forum designated for website links.

Update: Version 1.1 - fixed up a loophole. Just replace the old code with the new.
Version 2.0 - tidied up the code, added code to editpost.php, made it easier to change the variable


Anyway, installation is a breeze. The installation text file is below:

Erwin 10-17-2002 11:17 AM

<u>Screenshot</u>

This is a screenshot of the error message that the member will be redirected to if he or she has less that the minimum number of posts required and tries to post a message that has a website address or URL in it.

Remember, you can customize this error message to suit your site.

TECK 10-17-2002 11:21 AM

looks good erwin... :)
a little tip, when variable values are involved like that? try always to add them into global.php.

so your $allowurl should be identified to something like that:
Code:

// allow url's after xx posts
$allowurl = 15;

will be alot easier to be changed onto one file, then to look through several ones, in case the user tries to change the value after... that will make it easier on newcommers to find something in php files.

let me know what you think.

Erwin 10-17-2002 11:25 AM

True, but in the case of this mini-hack, editing 2 files is easier than 3 files for newbies. :) Not worth making the $allowurl variable global if it's only going to be used in those 2 files, plus I don't want newbies mucking around in global.php just in case. But yeah, people can do that if they wish.

NTLDR 10-17-2002 11:26 AM

Simple yet usefull Hack Erwin, thanks for sharing, I'll probably install this one :)

freeshares1 10-17-2002 11:35 AM

Erwin,

This is a fantasic but simple idea, I get a lot of spam and this would help to reduce that.

Thanks

Erwin 10-17-2002 11:41 AM

Thanks guys. :) If you like it and use it, please click install, so that I can keep track of how many installers there are, and also in case I update the hack and need to inform the installers. :)

John 10-17-2002 11:54 AM

Great hack Erwin!

It's a shame that after seeing the error message, a spammer would probably just type in the URL with a space after the "www." or something similar. :(

Neo 10-17-2002 02:21 PM

As a addon to what TECK said you could also place a unset(); just above it.

Erwin 10-17-2002 07:41 PM

Quote:

Originally posted by john.eovie
Great hack Erwin!

It's a shame that after seeing the error message, a spammer would probably just type in the URL with a space after the "www." or something similar. :(

Hi john! Long time no see! :)

Yeah, at least if they bypass this hack by adding spaces and such the URL won't be clickable. And we will know then that they are a "true spammer" rather than an unknowing newbie.


All times are GMT. The time now is 11:05 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01526 seconds
  • Memory Usage 1,734KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_code_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete