Disallow guests to post URL's

All new MODs released in our MOD Database will be announced in here. All support for released MODs needs to take place in here. No new MODs will be accepted into the MOD Database for phpBB2
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

On February 1, 2009 this forum will be set to read only as part of retiring of phpBB2.

Rating:

Excellent!
8
89%
Very Good
0
No votes
Good
1
11%
Fair
0
No votes
Poor
0
No votes
 
Total votes: 9

GilaMonster
Registered User
Posts: 83
Joined: Mon Jan 10, 2005 12:52 am
Location: CSC Scania, Iraq - Silver City, NM
Contact:

Post by GilaMonster »

OK, I guess I am stupid. How do I do the following? I have no problems editing the .php files and .tpl file but I am completely in the dark with this..

Code: Select all

#
#-----[ SQL ]-----------------------------------------------------------
#
INSERT INTO phpbb_config (config_name, config_value) VALUES ('disallow_guesturl', '0');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('disallow_guesturl_text','[url, www., http:');
Anyone want to give me a quick lesson on how to do this?
Thanks
bao mingguang
Registered User
Posts: 5
Joined: Mon Dec 11, 2006 12:14 am

Post by bao mingguang »

OK, I guess I am stupid. How do I do the following?

I use phpMyAdmin found in the control panel from my web host. There are of course, other ways to do it.

More help found in this thread:
http://www.phpbb.com/phpBB/viewtopic.php?t=506074
neilbombd
Registered User
Posts: 85
Joined: Thu May 22, 2003 2:09 am

Post by neilbombd »

So this completely stops guest posts with urls? The entire post isn't let through?

If so, that's exactly what I want. Thanks.
Melian01
Registered User
Posts: 42
Joined: Thu Jan 25, 2007 1:03 am
Contact:

Post by Melian01 »

Would be great if this mod would work with the registred member, and if we could set a certain number of post before they can post url...
bao mingguang
Registered User
Posts: 5
Joined: Mon Dec 11, 2006 12:14 am

Post by bao mingguang »

I feel like I've adopted this topic. :)
Melian01 wrote: Would be great if this mod would work with the registred member, and if we could set a certain number of post before they can post url...

Check out my post above:
http://www.phpbb.com/phpBB/viewtopic.ph ... 20#2657120

I've gotten it to work with registered members. My solution is a quick fix though. I'm hoping the author/maintainers will work it in. Basically all that needs to be added is code that adds the $minimum_posts variable into the administration control panel so it's easier to change. Since I don't mind tinkering with the code it works perfectly for me.

And neilbombd, yes, it does stop the whole post from getting through. I would love to see the look on the spammers' faces when they see the message, "Guests are not allowed to post messages with URLs."

Now if you make the modifications I suggested to make it work with registered users, you may encounter the language issue. It was frustrating for me until I found out what was going on. Read about it in my other adopted thread: http://www.phpbb.com/phpBB/viewtopic.ph ... 14#2802214

I've had zero spam on my forum in the last two weeks. I'm starting to look for other things to do with my time.... :wink:
Coyote23
Registered User
Posts: 78
Joined: Thu Oct 05, 2006 8:55 pm
Location: Omaha, Nebraska

Post by Coyote23 »

I just installed this Mod and tested it out. Looks like it is just what I wanted. I have one category on my forum where guests can anonymously post information which the spammers have recently flooded with all kinds of urls.

Thanks for this Mod!
VISIBLETHUNDER
Registered User
Posts: 463
Joined: Fri Mar 02, 2007 8:41 pm
Location: Bolton (UK)
Contact:

Post by VISIBLETHUNDER »

I love this mod but unfortunatly have had a problem using it on my forum,

The problem occurs when i log into the configuration page,
for some reason there is no text and or settings for this mod, just two blank fields, until i press submit, after which the text appears but the settings are blank.(I have to set the properties for this mod every time i want to change a setting)

I have been over the code and am 100% certain that it i have installed correctly, I'm guessing that the problem is being caused by another of my installed mods.

So i would like to ask;

Is there any way to alter this mod so that it doesn't use a config option

I.E when guests post a comment the script checks for banned text directly from the SQL table rather than accesing the board_config_body.tpl file first
**(I dont know if the mod actually works this way i'm just making assumptions. feel free to point out my stupidity.)

Thanks for your help
Scotticus
Registered User
Posts: 248
Joined: Thu Jul 10, 2003 6:25 am
Location: Tacoma, WA
Contact:

Post by Scotticus »

Hi.

I combined bao mingguang and the original mod together with ACP support. I didn't change any of the non-displaying text, so though this claims that it still only works for guests, it works for new users as well:

Code: Select all

##############################################################
## MOD Title: Disallow guests to post URL's
##
## MOD Author: h-o < N/A > (N/A) http://www.phpbb.com/phpBB/profile.php?mode=viewprofile&u=110020
##
## MOD Description: In order to prevent spam by guests, they are not allowed to post messages
##                  with clickable URL's beginning with "[url", "http:" or "www.". The settings
##                  ("on" or "off") as well as the text to identify the URL's are configurable
##                  in the ACP (see the two screenshots in the "contrib" directory).
##
## MOD Version: 1.0.1
##
## Installation Level: (Easy)
## Installation Time: 10 Minutes
##
## Files To Edit: 5
##      admin/admin_board.php
##      includes/functions_post.php,
##      language/lang_english/lang_admin.php
##      language/lang_english/lang_main.php
##      templates/subSilver/admin/board_config_body.tpl
##
## Included Files: (N/A)
## License: http://opensource.org/licenses/gpl-license.php GNU General Public License v2
##############################################################
## For security purposes, please check: http://www.phpbb.com/mods/
## for the latest version of this MOD. Although MODs are checked
## before being allowed in the MODs Database there is no guarantee
## that there are no security problems within the MOD. No support
## will be given for MODs not found within the MODs Database which
## can be found at http://www.phpbb.com/mods/
##############################################################
##
## Author Notes:
##
## After having forums (and guestbooks) opened for guests and trying
## out many MOD's to prevent spam, I realized that the only way to
## block spam is to disallow guests to post URL's, as it is the
## only intention of spammers to post messages with clickable URL's.
##
## The settings are configurable in the ACP:
##
## General Admin -> Configuration -> User and Forum Basic Settings:
##
## -> "Disallow URL postings for guests" ("on" or "off", default "off").
##    Please select "on" and submit in the ACP in order to prevent spam
##    by guests :-)
##
## -> "Text to identify URL's in guest postings" (default: "[url, www.,
##    http:") which can be separated by commas.
##
## This MOD is EasyMod 0.3.0 compliant.
##
##############################################################
##
## MOD History:
##
##   2006-08-17 - Version 1.0.1
##      - install_german.txt for German translation
##      - removed "https:, ftp: and ftps:" from SQL command (disallow_guesturl_text)
##        because only rarely used by spammers
##
##   2006-08-06 - Version 1.0.0
##      - Initial release
##
##############################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
##############################################################

#
#-----[ SQL ]-----------------------------------------------------------
#
INSERT INTO phpbb_config (config_name, config_value) VALUES ('disallow_guesturl', '0');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('disallow_guesturl_posts', '10');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('disallow_guesturl_text','[url, www., http:, <a href');

#
#-----[ OPEN ]----------------------------------------------------------
#
admin/admin_board.php

#
#-----[ FIND ]----------------------------------------------------------
#
$smtp_no = ( !$new['smtp_delivery'] ) ? "checked=\"checked\"" : "";

#
#-----[ AFTER, ADD ]----------------------------------------------------
#

// MOD Start: Disallow guests to post messages with url's
$disallow_guesturl_yes = ( $new['disallow_guesturl'] ) ? "checked=\"checked\"" : "";
$disallow_guesturl_no = ( !$new['disallow_guesturl'] ) ? "checked=\"checked\"" : "";

$disallow_guesturl_text = $new['disallow_guesturl_text'];

$disallow_guesturl_posts = $new['disallow_guesturl_posts'];
// MOD End: Disallow guests to post messages with url's

#
#-----[ FIND ]----------------------------------------------------------
#
	"L_RESET" => $lang['Reset'],

#
#-----[ AFTER, ADD ]----------------------------------------------------
#

	// MOD Start: Disallow guests to post messages with url's
	"L_DISALLOW_GUESTURL" => $lang['Disallow_guesturl'],
	"L_DISALLOW_GUESTURL_EXPLAIN" => $lang['Disallow_guesturl_explain'],
	"L_DISALLOW_GUESTURL_TEXT" => $lang['Disallow_guesturl_text'],
	"L_DISALLOW_GUESTURL_TEXT_EXPLAIN" => $lang['Disallow_guesturl_text_explain'],
	"L_DISALLOW_GUESTURL_TEXT" => $lang['Disallow_guesturl_posts'],
	"L_DISALLOW_GUESTURL_TEXT_EXPLAIN" => $lang['Disallow_guesturl_tposts_explain'],

	"DISALLOW_GUESTURL_YES" => $disallow_guesturl_yes,
	"DISALLOW_GUESTURL_NO" => $disallow_guesturl_no,
	"DISALLOW_GUESTURL_TEXT" => $disallow_guesturl_text,
	"DISALLOW_GUESTURL_POSTS" => $disallow_guesturl_posts, 
	// MOD End: Disallow guests to post messages with url's

#
#-----[ OPEN ]----------------------------------------------------------
#
includes/functions_post.php

#
#-----[ FIND ]----------------------------------------------------------
#
		$error_msg .= (!empty($error_msg)) ? '<br />' . $lang['Empty_subject'] : $lang['Empty_subject'];
	}

#
#-----[ AFTER, ADD ]----------------------------------------------------
#

// MOD Start: Disallow guests to post messages with url's
	$minimum_posts = 3;
	if ($userdata['user_posts'] < $board_config['disallow_guesturl_posts'] || !$userdata['session_logged_in'] && $board_config['disallow_guesturl'])
	{
		$disallow_guesturl_array = explode(',', $board_config['disallow_guesturl_text']);

		// Check if $message contains one of the strings like "http:"...
		for ($i = 0; $i < count($disallow_guesturl_array); $i++)
		{
			// stristr() used instead of eregi() because of searching for "[url" which contains a squared bracket
			if (trim($disallow_guesturl_array[$i]) != '' && stristr($message, trim($disallow_guesturl_array[$i])))
			{
				$error_msg .= (!empty($error_msg)) ? '<br />' . $lang['Disallow_guesturl'] : $lang['Disallow_guesturl'];
				break;
			}
		}
	}
// MOD End: Disallow guests to post messages with url's

#
#-----[ OPEN ]----------------------------------------------------------
#
language/lang_english/lang_admin.php

#
#-----[ FIND ]----------------------------------------------------------
#

//
// That's all Folks!

#
#
#-----[ BEFORE, ADD ]---------------------------------------------------
#

// MOD Start: Disallow guests to post messages with url's
// MOD Start: Disallow guests and new posters to post messages with url's
$lang['Disallow_guesturl'] = 'Disallow URL postings for guests and new users';
$lang['Disallow_guesturl_explain'] = 'Determines whether guests and new users are disallowed to post messages with URLs in order to prevent spam'; 
$lang['Disallow_guesturl_text'] = 'Text to identify URLs in guest/new user postings';
$lang['Disallow_guesturl_text_explain'] = 'Separate with commas, e.g. www., http:';
$lang['Disallow_guesturl_posts'] = 'Minimum number of posts a new user must have to post a URL';
$lang['Disallow_guesturl_posts_explain'] = 'If they have less posts than this, they can\'t post a URL';
// MOD End: Disallow guests to post messages with url's

#
#-----[ OPEN ]----------------------------------------------------------
#
language/lang_english/lang_main.php

#
#-----[ FIND ]----------------------------------------------------------
#

//
// That's all, Folks!

#
#-----[ BEFORE, ADD ]---------------------------------------------------
#

// MOD Start: Disallow guests to post messages with url's
$lang['Disallow_guesturl'] = 'Guests and new users are not allowed to post messages with URLs.';
// MOD End: Disallow guests to post messages with url's

#
#-----[ OPEN ]----------------------------------------------------------
#
templates/subSilver/admin/board_config_body.tpl

#
#-----[ FIND ]----------------------------------------------------------
#
	<tr>
		<td class="row1">{L_MAX_POLL_OPTIONS}</td>
		<td class="row2"><input class="post" type="text" name="max_poll_options" size="4" maxlength="4" value="{MAX_POLL_OPTIONS}" /></td>
	</tr>

#
#-----[ AFTER, ADD ]----------------------------------------------------
#

<!-- MOD Start: Disallow guests to post messages with url's -->
	<tr>
		<td class="row1">{L_DISALLOW_GUESTURL} <br /><span class="gensmall">{L_DISALLOW_GUESTURL_EXPLAIN}</span></td>
		<td class="row2"><input type="radio" name="disallow_guesturl" value="1" {DISALLOW_GUESTURL_YES} /> {L_YES}&nbsp;&nbsp;<input type="radio" name="disallow_guesturl" value="0" {DISALLOW_GUESTURL_NO} /> {L_NO}</td>
	</tr>
	<tr>
		<td class="row1">{L_DISALLOW_GUESTURL_TEXT}<br /><span class="gensmall">{L_DISALLOW_GUESTURL_TEXT_EXPLAIN}</span></td>
		<td class="row2"><input class="post" type="text" size="30" maxlength="255" name="disallow_guesturl_text" value="{DISALLOW_GUESTURL_TEXT}" /></td>
	</tr>
	<tr>
		<td class="row1">{L_DISALLOW_GUESTURL_POSTS}<br /><span class="gensmall">{L_DISALLOW_GUESTURL_POSTS_EXPLAIN}</span></td>
		<td class="row2"><input class="post" type="text" size="4" maxlength="4" name="disallow_guesturl_posts" value="{DISALLOW_GUESTURL_POSTS}" /></td>
	</tr>
<!-- MOD End: Disallow guests to post messages with url's -->

#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM
GaijinPunch
Registered User
Posts: 19
Joined: Wed Apr 07, 2004 2:50 am

Re: Disallow guests to post URL's

Post by GaijinPunch »

EDIT: Found it. Nice looking mod. Can't wait to hook it up.
GaijinPunch
Registered User
Posts: 19
Joined: Wed Apr 07, 2004 2:50 am

Re: Disallow guests to post URL's

Post by GaijinPunch »

This is working whenever I test with a new user, but just last night two (same person?) accounts were registered, and both had links in the message contents. I became these users, did a simple copy & paste, and it allowed me to post the text. When I switched to my test user, I got the normal "no links for new users" error message.
Rocket_Man
Registered User
Posts: 9
Joined: Tue Apr 24, 2007 1:29 pm

Re: Disallow guests to post URL's

Post by Rocket_Man »

Looks good.

I want this to prevent anyone for posting any URLS as live links at all. How do I do this?
VISIBLETHUNDER
Registered User
Posts: 463
Joined: Fri Mar 02, 2007 8:41 pm
Location: Bolton (UK)
Contact:

Re: Disallow guests to post URL's

Post by VISIBLETHUNDER »

I haven't seen any Mods that prevent all active links but as a temporary sollution you could try utilizing the words censor tool on your config panel

I.E. set the words [url and <a href to change to something that would break the link, like the word 'link' perhaps.

the only trouble is that it may annoy your members and look messy

examples:

Link to my forum
Would end up like this
[Link=http://threesixes.co.uk/forum]Link to my forum[/url]

and html code, like this

<link="threesixes.co.uk/forum">Link to my forum</a>
TS Gallery related FAQs, DOWNLOADS and LANG PACKS can be found @ the TS MOD PREVIEW BOARD

Because Version 3 is taking longer than anticipated, I have uploaded a few temporary tools/add-ons to the preview board.
GaijinPunch
Registered User
Posts: 19
Joined: Wed Apr 07, 2004 2:50 am

Re: Disallow guests to post URL's

Post by GaijinPunch »

That's not really an option for me. I post images & links all the time, as do other "real" users. I've had some people report it being broken, but these other people (bots?) are getting by it somehow. Is there any other way to make a post than the traditional way?
VISIBLETHUNDER
Registered User
Posts: 463
Joined: Fri Mar 02, 2007 8:41 pm
Location: Bolton (UK)
Contact:

Re: Disallow guests to post URL's

Post by VISIBLETHUNDER »

That's not really an option for me. I post images & links all the time, as do other "real" users. I've had some people report it being broken, but these other people (bots?) are getting by it somehow. Is there any other way to make a post than the traditional way?


I'm a little confused GanjinPunch,
Are you using the 'Disallow gusts to post URL's' mod and if so is there a problem with it?

I'm guessing that the Bots you mention aren't posting as guests but rather registered members, in which case this MOD is not going to be much help, instead you would need to look into ways of stopping bots from registering. I recommend the Textual Confirmation MOD available on PHPBB.COM
and also keep an eye out for a MOD called SPAM LINK KILLER which removes spam links from your forum, Unfortunatley it is unavailable as yet due to some technical problems with PHPBB's MOD validation service but fingers crossed it will be up online soon.

As for your question about other ways to post. There are none. Atleast none that i am aware of.
TS Gallery related FAQs, DOWNLOADS and LANG PACKS can be found @ the TS MOD PREVIEW BOARD

Because Version 3 is taking longer than anticipated, I have uploaded a few temporary tools/add-ons to the preview board.
GaijinPunch
Registered User
Posts: 19
Joined: Wed Apr 07, 2004 2:50 am

Re: Disallow guests to post URL's

Post by GaijinPunch »

VISIBLETHUNDER wrote: I'm a little confused GanjinPunch,
Are you using the 'Disallow gusts to post URL's' mod and if so is there a problem with it?


Sorry if I wasn't clear. Yes, I'm using the mod shown above posted by Scotticus that should handle guests, as well as registered members w/ a post count < X (10, currently). When I register as a new user, I am unable to post any of my blocked words (http, img, etc. etc.). However, there are new users that can, and I cannot for the life of me figure out how. I have even registered asa new user, and copy/pasted the offending spam, and been blocked. A total head scratcher.
I'm guessing that the Bots you mention aren't posting as guests but rather registered members,


They're not bots. They're people. I have the "I'm a human" mod, the 5-second wait mod, and visual confirmation mod all installed. I get a spam or two every couple of days. I figure I could at least annoy them a little w/ this mod.
As for your question about other ways to post. There are none. Atleast none that i am aware of.


I'm going to put some debug in to see exactly what's going on.
Post Reply

Return to “[2.0.x] MOD Database Releases”