Prime Censor Block

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

NOTICE: This forum is only for the announcement of new releases and/or updates of MODs. Any MOD support should be obtained through the Customisations Database in the support area designated for each MOD.

A direct link to support for each MOD is in the first post of the respective topic.
Extensions Robot
Extensions Robot
Extensions Robot
Posts: 28011
Joined: Sat Aug 16, 2003 7:36 am

Prime Censor Block

Post by Extensions Robot » Sun May 10, 2009 4:26 am

Modification name: Prime Censor Block
Author: primehalo
Modification description: Prevents the submission of a form when a post, private message, username, e-mail address, signature, or custom profile field contains text that would ordinarily be censored.
Modification version: 1.0.3
Tested on phpBB version: 3.0.8

Download file: Prime Censor Block.zip
File size: 41.4 KiB

Modification overview page: View

The phpBB Team is not responsible nor required to provide support for this modification. By installing this MOD, you acknowledge that the phpBB Support Team or phpBB Extensions Team may not be able to provide support.

-->Modification support<--
Last edited by Extensions Robot on Mon Mar 27, 2017 3:09 pm, edited 12 times in total.
(this is a non-active account manager for the phpBB Extension Customisations Team)

User avatar
DavidIQ
Customisations Team Leader
Customisations Team Leader
Posts: 17069
Joined: Thu Jan 06, 2005 1:30 pm
Location: Fishkill, NY
Name: David Colón
Contact:

Prime Censor Block

Post by DavidIQ » Sun May 10, 2009 4:26 am

Modification validated/released

Notes:
Apply to become a Jr. Extension Validator
My extensions | In need of phpBB services? | Was I helpful today?
No unsolicited PMs unless you're planning on asking for paid help.

User avatar
primehalo
Former Team Member
Posts: 2848
Joined: Fri May 06, 2005 5:58 pm
Location: Redding, CA
Contact:

Prime Censor Block

Post by primehalo » Sun May 10, 2009 4:26 am

This post has been reserved for the MOD author.
Ken F. Innes IV
My Extensions | My MODs | My Topics | My Site: Absolute Anime
Experience the wonder of Japanese Animation!

User avatar
austin881
Registered User
Posts: 284
Joined: Wed Jan 30, 2008 9:58 pm
Location: Boise, Idaho, USA
Name: Austin Maddox
Contact:

Re: Prime Censor Block

Post by austin881 » Sun May 17, 2009 3:19 pm

Ken,
I found a problem with using Custom Profile Fields at registration.
Registration screen
Registration screen
screenshot.jpg (84.77 KiB) Viewed 4697 times
The 'Gender' field I'm using is not set as a required field so it shouldn't be throwing this error.
Admin Control Panel
Admin Control Panel
acp_screenshot.jpg (120.49 KiB) Viewed 4697 times
Can you confirm this is a bug and not just an error on my part installing this Mod? I've double checked all my code edits in relation to this Mod so I'm pretty sure it is a bug.
Available for paid phpBB help! PM me.

My Extensions/MODS: 475 Narius Categorized Smilies for phpBB3, Simplified & Compacted All-Members page, Flash Animated Cumulus Tag Cloud, "Hello" Name Tag of Newest User, AWS S3
phpBB portfolio: chevy truck forum, chevy astro van forum

User avatar
primehalo
Former Team Member
Posts: 2848
Joined: Fri May 06, 2005 5:58 pm
Location: Redding, CA
Contact:

Re: Prime Censor Block

Post by primehalo » Mon May 18, 2009 7:38 am

Confirmed, and fixed in version 1.0.1, which can be found on my website.
Ken F. Innes IV
My Extensions | My MODs | My Topics | My Site: Absolute Anime
Experience the wonder of Japanese Animation!

User avatar
austin881
Registered User
Posts: 284
Joined: Wed Jan 30, 2008 9:58 pm
Location: Boise, Idaho, USA
Name: Austin Maddox
Contact:

Re: Prime Censor Block

Post by austin881 » Tue May 19, 2009 9:11 pm

Thanks Ken. That fixed it.

Another thing to note, did you know that this Mod blocks smilies if they have a forbidden word in their title. For example: A smiley called :lmao: with the title of "Laughing My Ass Off" when "Ass" is a forbidden/word censor word.

Just something I noticed. I'm not sure if I'll continue using this Mod because it seems more hassle than it is worth, but I can appreciate the concept. I suppose it is silly of me to put forbidden words in smiley titles so this really shouldn't be an issue for anyone else, but it was for me.
Thanks again.
Available for paid phpBB help! PM me.

My Extensions/MODS: 475 Narius Categorized Smilies for phpBB3, Simplified & Compacted All-Members page, Flash Animated Cumulus Tag Cloud, "Hello" Name Tag of Newest User, AWS S3
phpBB portfolio: chevy truck forum, chevy astro van forum

User avatar
DavidIQ
Customisations Team Leader
Customisations Team Leader
Posts: 17069
Joined: Thu Jan 06, 2005 1:30 pm
Location: Fishkill, NY
Name: David Colón
Contact:

Prime Censor Block

Post by DavidIQ » Mon Jun 08, 2009 4:41 am

MOD Updated to version 1.0.1
See first post for Download Link
Apply to become a Jr. Extension Validator
My extensions | In need of phpBB services? | Was I helpful today?
No unsolicited PMs unless you're planning on asking for paid help.

User avatar
PinoyEngine™
Registered User
Posts: 244
Joined: Fri Apr 24, 2009 7:12 am

Re: Prime Censor Block

Post by PinoyEngine™ » Tue Jun 09, 2009 2:32 pm

Thanks for this mod, this will really save my time banning those pervert one by one. :D

User avatar
davidgid
Registered User
Posts: 21
Joined: Wed Sep 12, 2007 1:56 pm

Re: Prime Censor Block

Post by davidgid » Wed Jun 10, 2009 2:22 pm

This mod was just what I was looking for. I will install and check it out!
I am using 3.0.4 on the babywearing forum. We also run a shop were we sell baby slings and other baby carriers.

User avatar
davidgid
Registered User
Posts: 21
Joined: Wed Sep 12, 2007 1:56 pm

Re: Prime Censor Block

Post by davidgid » Wed Jun 10, 2009 3:28 pm

I am adding this mod and under the file: includes/ucp/ucp_pm_compose.php

Under the "To Find" sections is says to find this:

Code: Select all

unset($message_text);
The thing is the unset($message_text); appears twice in that document. Should I add the code below in both places?

Code: Select all

//-- mod: Prime Censor Block ------------------------------------------------//
		$prime_censor_block->set_error($error);
//-- end: Prime Censor Block ------------------------------------------------//
I am using 3.0.4 on the babywearing forum. We also run a shop were we sell baby slings and other baby carriers.

User avatar
davidgid
Registered User
Posts: 21
Joined: Wed Sep 12, 2007 1:56 pm

Re: Prime Censor Block

Post by davidgid » Wed Jun 10, 2009 3:40 pm

I tested it out and it looks to be the first occurrence! From what I've tested so far the MOD looks great! Thank you.
I am using 3.0.4 on the babywearing forum. We also run a shop were we sell baby slings and other baby carriers.

User avatar
ChekoSlovakia
Registered User
Posts: 168
Joined: Thu Aug 27, 2009 12:35 pm
Location: ZELONKA

Re: Prime Censor Block

Post by ChekoSlovakia » Tue Sep 01, 2009 3:32 am

it does not work in bb code, for example if we give a link like this
or a link which contains image with link like this: Image
is there any way that it also work there and censor links from there too?

User avatar
primehalo
Former Team Member
Posts: 2848
Joined: Fri May 06, 2005 5:58 pm
Location: Redding, CA
Contact:

Re: Prime Censor Block

Post by primehalo » Thu Sep 03, 2009 8:08 pm

It seemed like it worked for me, except that with BBCodes the highlighted words could find themselves inside of an HTML tag, which is a problem since they are highlighted using HTML tags. I have just updated to version 1.0.2, which will display the BBCodes in the preview instead of parsing them, so that the above mentioned problem won't happen.

Note, the updated version is found on my site, and has not yet been approved by the phpbb team.
Ken F. Innes IV
My Extensions | My MODs | My Topics | My Site: Absolute Anime
Experience the wonder of Japanese Animation!

User avatar
ChekoSlovakia
Registered User
Posts: 168
Joined: Thu Aug 27, 2009 12:35 pm
Location: ZELONKA

Re: Prime Censor Block

Post by ChekoSlovakia » Fri Sep 04, 2009 10:50 am

primehalo wrote:It seemed like it worked for me, except that with BBCodes the highlighted words could find themselves inside of an HTML tag, which is a problem since they are highlighted using HTML tags. I have just updated to version 1.0.2, which will display the BBCodes in the preview instead of parsing them, so that the above mentioned problem won't happen.

Note, the updated version is found on my site, and has not yet been approved by the phpbb team.
thanks but i already have this mod installed, do i need to uninstall it first before using your again?

User avatar
ChekoSlovakia
Registered User
Posts: 168
Joined: Thu Aug 27, 2009 12:35 pm
Location: ZELONKA

Re: Prime Censor Block

Post by ChekoSlovakia » Fri Sep 04, 2009 11:39 am

Pyrrho.Ts wrote: thanks but i already have this mod installed, do i need to uninstall it first before using your again?
i installed
and got this error:
Parse error: syntax error, unexpected T_GLOBAL, expecting ';' or '{' in /home/site/public_html/includes/functions_profile_fields.php on line 268
some code from line 268

Code: Select all

		global $phpbb_root_path, $phpEx;
		include($phpbb_root_path . 'includes/prime_censor_block.' . $phpEx);
//-- end: Prime Censor Block ------------------------------------------------//
	
	{
		global $auth, $db, $user;

		$sql_where = '';
		switch ($mode)
		{
			case 'register':
				// If the field is required we show it on the registration page and do not show hidden fields
				$sql_where .= ' AND f.field_show_on_reg = 1 AND f.field_no_view = 0';
			break;

			case 'profile':
				// Show hidden fields to moderators/admins
				if (!$auth->acl_gets('a_', 'm_') && !$auth->acl_getf_global('m_'))
				{
					$sql_where .= ' AND f.field_show_profile = 1';
				}
			break;

			default:
				trigger_error('Wrong profile mode specified', E_USER_ERROR);
			break;
		}

		$sql = 'SELECT l.*, f.*
			FROM ' . PROFILE_LANG_TABLE . ' l, ' . PROFILE_FIELDS_TABLE . " f
			WHERE l.lang_id = $lang_id
				AND f.field_active = 1
				$sql_where
				AND l.field_id = f.field_id
			ORDER BY f.field_order";
		$result = $db->sql_query($sql);

		while ($row = $db->sql_fetchrow($result))
		{
			$cp_data['pf_' . $row['field_ident']] = $this->get_profile_field($row);
			$check_value = $cp_data['pf_' . $row['field_ident']];

			if (($cp_result = $this->validate_profile_field($row['field_type'], $check_value, $row)) !== false)
			{
				// If not and only showing common error messages, use this one
				$error = '';
				switch ($cp_result)
				{
					case 'FIELD_INVALID_DATE':
					case 'FIELD_REQUIRED':
						$error = sprintf($user->lang[$cp_result], $row['lang_name']);
					break;

					case 'FIELD_TOO_SHORT':
					case 'FIELD_TOO_SMALL':
						$error = sprintf($user->lang[$cp_result], $row['lang_name'], $row['field_minlen']);
					break;

					case 'FIELD_TOO_LONG':
					case 'FIELD_TOO_LARGE':
						$error = sprintf($user->lang[$cp_result], $row['lang_name'], $row['field_maxlen']);
					break;

					case 'FIELD_INVALID_CHARS':
						switch ($row['field_validation'])
						{
							case '[0-9]+':
								$error = sprintf($user->lang[$cp_result . '_NUMBERS_ONLY'], $row['lang_name']);
							break;

							case '[\w]+':
								$error = sprintf($user->lang[$cp_result . '_ALPHA_ONLY'], $row['lang_name']);
							break;

							case '[\w_\+\. \-\[\]]+':
								$error = sprintf($user->lang[$cp_result . '_SPACERS_ONLY'], $row['lang_name']);
							break;
						}
					break;
				}

				if ($error != '')
				{
					$cp_error[] = $error;
				}
			}

//-- mod: Prime Censor Block ------------------------------------------------//
// If one or more custom profile fields contain forbidden text then display an error.
			$prime_censor_block->check_custom_profile_fields($check_value, $row['lang_name'], $cp_error);
//-- end: Prime Censor Block ------------------------------------------------//

//----------------------------------------------------------------------
// Censor Block - Begin Code Alteration
//
			global $cenblock;
			if( is_object($cenblock) )
			{
				$cenblock->check_cp_field($cp_error, $row['field_type'], $check_value, $row['lang_name']);
			}
//
// Censor Block - End Code Alteration
//----------------------------------------------------------------------

		}
		$db->sql_freeresult($result);
	}

Locked

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