Resource icon

vBulletin Thread/Post Title Characters 2.0

No permission to download

MarkFL

La Villa Strangiato
Joined
Jul 3, 2017
Messages
1,251
MarkFL submitted a new resource:

Thread/Post Title Characters - Allows you to define what chracters will be permitted in thread/post titles using regex.

Overview:

This simple product allows you to define what chracters will be permitted in thread/post titles using regex. You may elect to use HTML5 form validation when the user's browser supports it, but if you choose not to use this method, or the user's browser doesn't support it, then a message will be displayed above the editor block advising the user that they have illegal characters in their thread/post title if applicable. They will not be allowed to submit...

Read more about this resource...
 

djbaxter

Tazmanian Veteran
Joined
Jun 6, 2006
Messages
10,473
Could this be used to disallow smilies in thread titles?
 

djbaxter

Tazmanian Veteran
Joined
Jun 6, 2006
Messages
10,473
I tried

Code:
[a-zA-Z0-9:.,!?&%@$#-+="';>< ]

but that starts to get somewhat clumsy and might not disallow all smilies anyway, not to mention it may disallow characters you want to allow.
 

Pete

Flavours of Forums Forever
Joined
Sep 9, 2013
Messages
1,729
That also has the side effect of disallowing all accented letters, which may or may not be a problem for you. As well as the 'smart quotes' from Word etc.
 
  • Thread starter
  • Moderator
  • #6

MarkFL

La Villa Strangiato
Joined
Jul 3, 2017
Messages
1,251
I tried

Code:
[a-zA-Z0-9:.,!?&%@$#-+="';>< ]

but that starts to get somewhat clumsy and might not disallow all smilies anyway, not to mention it may disallow characters you want to allow.

Try creating a plugin hooked at "newpost_process" with the following code:

PHP:
$censored_arr = array(':D', ':)', ':|');

foreach ($censored_arr AS $token)
{
   if (stristr($post['title'], $token) !== FALSE)
   {
       $errors[] = 'Thread/post title includes illegal string "' . $token . '"!';
       break;
   }
}

Edit the "$censored_arr" to contain any strings you don't want in thread/post titles.

edit: You can remove the break statement so that if a user posts multiple censored strings in their title, they will all be pointed out at one time.
 
Last edited:

djbaxter

Tazmanian Veteran
Joined
Jun 6, 2006
Messages
10,473
In the end, it's probably simpler just to edit thread titles you don't like.
 
Top