vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 2.x Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=4)
-   -   Remove multiple !!! or ??? from thread titles (https://vborg.vbsupport.ru/showthread.php?t=33979)

Kier 01-09-2002 10:00 PM

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:
Code:

    $username = $HTTP_POST_VARS['username'];
    $password = $HTTP_POST_VARS['password'];

and right after it, add the following code:
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.

Kier 01-10-2002 08:08 AM

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

Quote:

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 "?!?!?!?!?!?!"?


All times are GMT. The time now is 10:30 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.02115 seconds
  • Memory Usage 1,725KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_code_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete