[REQUEST] Block Posting Topic with Repeative Signs in Title

Looking for a MOD? Have a MOD request? Post here for help. (Note: This forum is community supported; phpBB does not have official MOD authors)
Anti-Spam Guide
MaLeKo
Registered User
Posts: 210
Joined: Tue May 06, 2008 3:32 am

[REQUEST] Block Posting Topic with Repeative Signs in Title

Post by MaLeKo »

As the title, could you write a simple mod that will block a user from posting a topic which has repeative exlamation or question marks in the title? Such as Heeei!!!!!!!!!!!!!!!!!!!!!! or Who can write this mod?????????????
Last edited by MaLeKo on Sun Mar 29, 2009 11:04 pm, edited 1 time in total.
User avatar
katib
Registered User
Posts: 562
Joined: Thu Jun 26, 2008 12:27 pm

Re: Block Posting Topic with Repeative Signs in Title

Post by katib »

I also need such feature, to fight against topic's titles like this:
blabla.......................
(too many dots :( )
Last edited by katib on Sat Mar 28, 2009 12:09 pm, edited 1 time in total.
MaLeKo
Registered User
Posts: 210
Joined: Tue May 06, 2008 3:32 am

Re: Block Posting Topic with Repeative Signs in Title

Post by MaLeKo »

BUMP!
User avatar
globetrotting
Registered User
Posts: 217
Joined: Thu Jan 15, 2004 8:14 pm
Location: globetrotting
Contact:

Re: Block Posting Topic with Repeative Signs in Title

Post by globetrotting »

Yep, I spend quite some time removing them manually, would appreciate to see this done automatically.
Das Sein ändert das Bewußtsein
User avatar
Chabbal
Registered User
Posts: 189
Joined: Wed Mar 18, 2009 6:17 pm

Re: Block Posting Topic with Repeative Signs in Title

Post by Chabbal »

PM me if some mod like this is available...

it would be highly appreciated...

Thanks!
MaLeKo
Registered User
Posts: 210
Joined: Tue May 06, 2008 3:32 am

Re: Block Posting Topic with Repeative Signs in Title

Post by MaLeKo »

Hi..Could anyone please write this little mod?
User avatar
Chabbal
Registered User
Posts: 189
Joined: Wed Mar 18, 2009 6:17 pm

Re: Block Posting Topic with Repeative Signs in Title

Post by Chabbal »

again...
Chabbal wrote:PM me if some mod like this is available...

it would be highly appreciated...

Thanks!
User avatar
Chabbal
Registered User
Posts: 189
Joined: Wed Mar 18, 2009 6:17 pm

Re: Block Posting Topic with Repeative Signs in Title

Post by Chabbal »

Chabbal wrote:again...
Chabbal wrote:PM me if some mod like this is available...

it would be highly appreciated...

Thanks!
mtrs
Registered User
Posts: 2049
Joined: Sat Sep 22, 2007 2:39 pm

Re: [REQUEST] Block Posting Topic with Repeative Signs in Title

Post by mtrs »

In a short way, you can filter some repetitive chars with str_replace

Open
posting.php
Find

Code: Select all

	$post_data['post_subject']		= utf8_normalize_nfc(request_var('subject', '', true));
Add after

Code: Select all

	$post_data['post_subject'] 	= str_replace(array('..',',,','??','!!'), array('','','',''), $post_data['post_subject']);
This code replace even number of repetitive signs, ??? => ? , ?? =>
I abandoned all of my mods.
MaLeKo
Registered User
Posts: 210
Joined: Tue May 06, 2008 3:32 am

Re: [REQUEST] Block Posting Topic with Repeative Signs in Title

Post by MaLeKo »

How about detect if a post contains those repeative signs in title on submitting. if it does, block submitting and return an error message
mtrs
Registered User
Posts: 2049
Joined: Sat Sep 22, 2007 2:39 pm

Re: [REQUEST] Block Posting Topic with Repeative Signs in Title

Post by mtrs »

MaLeKo wrote:How about detect if a post contains those repeative signs in title on submitting. if it does, block submitting and return an error message
This is not a good detecting but, can detect the title containing repetitive "??", "..", "!!",",,"

Open
posting.php
Find

Code: Select all

       $post_data['post_subject']      = utf8_normalize_nfc(request_var('subject', '', true));
Add after

Code: Select all

	if (str_replace(array('..',',,','??','!!'), array('','','',''), $post_data['post_subject']) != $post_data['post_subject'])
	{
		$error[] = "Please do not use repetitive characters in your title.";
	}
For a better detection preg_match_all() can be used, but I am not familiar with it.
I abandoned all of my mods.
MaLeKo
Registered User
Posts: 210
Joined: Tue May 06, 2008 3:32 am

Re: [REQUEST] Block Posting Topic with Repeative Signs in Title

Post by MaLeKo »

Oh thanks. Im going to try that now.
MaLeKo
Registered User
Posts: 210
Joined: Tue May 06, 2008 3:32 am

Re: [REQUEST] Block Posting Topic with Repeative Signs in Title

Post by MaLeKo »

Nice it works thanks so much.

It would be great if someone could turn this idea into a proper mod
mtrs
Registered User
Posts: 2049
Joined: Sat Sep 22, 2007 2:39 pm

Re: [REQUEST] Block Posting Topic with Repeative Signs in Title

Post by mtrs »

I have a mod to correct all uppercase posting, I intend to add this anti-repetitive chars option when I update it.
I abandoned all of my mods.
User avatar
katib
Registered User
Posts: 562
Joined: Thu Jun 26, 2008 12:27 pm

Re: [REQUEST] Block Posting Topic with Repeative Signs in Title

Post by katib »

Thanks a lot mtrs
Will get rid of those meaningless typos wirt nervous habits ;) !!!!
Locked

Return to “[3.0.x] MOD Requests”