View Full Version : Remove multiple !!! or ??? from thread titles
This is a really simple little hack that was requested on vBulletin.com, but some people might find it useful, especially those of you who run support-type forums.
Basically, it prevents people typing HELP ME!!!!!!!!! or WHAT'S WRONG?????????!!?!?!?! (or other equally annoying things with multiple ? and ! characters) as thread titles.
It couldn't be simpler really - edit newthread.php and find this: $username = $HTTP_POST_VARS['username'];
$password = $HTTP_POST_VARS['password'];and right after it, add the following code:$subject = preg_replace("/([\?\!]+)/e", "substr('\\1',0,1)", $subject);I think this code is PHP 4 only, but who in their right mind runs PHP 3 anymore? ;)
Have fun.
Kier
[edited for ridiculous mistake ;)]
eva2000
01-10-2002, 06:54 AM
:cool:
eva2000
01-10-2002, 06:59 AM
problem it removed !!!!!! from message and not title :(
wrong variable $message ?
is it $subject ??????
Martin CX
01-10-2002, 07:26 AM
Wow, I've been waiting for this! :)
When the problems are resolved I'll have it installed in a flash.
SaintDog
01-10-2002, 07:53 AM
Neither of the below are working for me:
$subject
$message
I have tried adding ", removing spaces (I am not a PHP guru by far).
I am not sure what the problem is, although it would be a nice hack to have if it worked.
LOL oops :o
Edited the code in the original post so that it works now... that'll teach me to not test it in the actual vBulletin code eh? ;)
eva2000
01-10-2002, 08:20 AM
Originally posted by Kier
LOL oops :o
Edited the code in the original post so that it works now... that'll teach me to not test it in the actual vBulletin code eh? ;) my confidence in kier has been shaken j/k off to add the hack :D
eva2000
01-10-2002, 08:24 AM
works fine kier :D
SaintDog
01-10-2002, 08:34 AM
Thanks Kier, working great now.
Admin
01-10-2002, 09:42 AM
Will this also stop things like "?!?!?!?!?!?!"?
Originally posted by FireFly
Will this also stop things like "?!?!?!?!?!?!"? Of course :cool:
It will replace ?!?!?!!!!?!?! with ? and !!!?!?!?!!?!?! with ! (taking the first character of the string) :)
Admin
01-10-2002, 09:54 AM
Ok, cool. :)
I had no idea since I'm bad with regexes... :eek:
Streicher
01-10-2002, 10:16 AM
Thanks. This hack helps me a lot :)
Lesane
01-10-2002, 01:08 PM
Great, Thanks.
nafae
01-10-2002, 07:10 PM
very useful... I installed it and like it ah loht! :)
Shenlong
01-10-2002, 09:41 PM
Awesome! THANK god for this hack, I hated seeing on my board
SOMETHING !!!!!!!!!!!!!
now all i see is SOMETHING!, great hack kier, thanx
works great
Joshua Clinard
01-10-2002, 11:43 PM
Great Hack. Works Great!
Mark Hensler
01-11-2002, 12:18 AM
Originally posted by Kier
I think this code is PHP 4 only, but who in their right mind runs PHP 3 anymore? ;)vBulletin only runs on PHP4... :D
saibal
07-26-2002, 10:31 AM
hi,
it works with 2.2.6 release?
Chris M
07-26-2002, 11:35 AM
It works with all versions, or should do:)
Nice addon:)
Satan
saibal
07-26-2002, 02:47 PM
thanks :)
inetd
07-27-2002, 07:05 PM
good addon
thx!
DrkFusion
07-27-2002, 07:23 PM
Nice work Kier
Thanks man
Drk
Boofo
07-27-2002, 07:25 PM
Excellent, Kier! Great job! :) Thank you.
tobias_t
04-10-2007, 09:38 PM
If anybody still reads this, I could totally use the version of this that works in 3.6.5. Here is hope...
Thanks, Tobias
Dismounted
04-25-2007, 05:00 AM
It's been created. Check my profile. :)
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.