Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.0 > vBulletin 3.0 Full Releases
Stop SHOUTING and Posts With Annoying UPdown Text Like This Details »»
Stop SHOUTING and Posts With Annoying UPdown Text Like This
Version: 1.00, by Reynaldovb Reynaldovb is offline
Developer Last Online: Aug 2014 Show Printable Version Email this Page

Version: 3.0.7 Rating:
Released: 06-26-2005 Last Update: Never Installs: 4
 
No support by the author.

After searching the forum and not finding any mod to stop users from SHOUTING and from Using "Jumpy" Text, i decided to give it a try and I came up with this modification. I'm not an expert coder, so if you find a better way to do it, please feel free to suggest it.

VB3 already has an option to stop shouting but it only works if ALL the text is in caps and even a little formatting can shut off the option.

What this mod does is:

1) Switch SHOUTING from the body text and from title into "normal" text.

2) Switch "Jumpy" text from both the body and title into a more readable form. Example of "Jumpy" text is the following sentence:

Quote:
"This Sentence Is A Example Of 'Jumping' Text. The Reason Why Some Users Like To Write Sentences In This Way Eludes Me. I Just Know That After A Few Lines, It Becomes Difficult To Read"
Other rules can be easily added, if a few people find this mod interesting and ask for it, I may add a few more rules later (for example to convert text LiKe ThIs InTo SoMeThInG NoRmAl).

STEP 1
open file includes/functions_newpost.php
SEARCH FOR: (end of file)
PHP Code:
|| ####################################################################
\*======================================================================*/
?> 
REPLACE WITH:
PHP Code:
####################################################################
\*======================================================================*/


//=======================================
function myRemoveShouting($string)
{
    
//$string = strtolower($string);
    
$string html_entity_decode(strtolower(htmlentities($string)));
    
$string preg_replace("/\s\s+/"" "$string);
    
$string preg_replace("/\.\s([a-z]{1})/e""'. ' . strtoupper('\\1')"$string);
    
$string ucfirst($string);
    return(
$string);
}
//=======================================
?> 

STEP 2:
Open file: newreply.php

SEARCH FOR:
PHP Code:
    build_new_post('reply'$foruminfo$threadinfo$_POST['postid'], $newpost$errors);

    if (
sizeof($errors) > 0)
    {
        
// ### POST HAS ERRORS ###
        
$postpreview construct_errors($errors); // this will take the preview's place 
ABOVE THAT ADD:
PHP Code:
//==================================

    
    
if ($newpost['message'] == strtoupper($newpost['message'])) 
    {
        
$newpost['message'] = myRemoveShouting($newpost['message']);
    }

    elseif (
preg_match("/([a-z]+\s)([A-Z]+)([a-z]+\s)([A-Z]+)([a-z]+\s)([A-Z]+)([a-z]+\s)([A-Z]+)([a-z]+)/"$newpost['message']))
    {
        
$newpost['message'] = myRemoveShouting($newpost['message']);
    }



    if (
$newpost['title'] == strtoupper($newpost['title'])) 
    {
        
$newpost['title'] = myRemoveShouting($newpost['title']);
    }

    elseif (
preg_match("/([a-z]+\s)([A-Z]+)([a-z]+\s)([A-Z]+)([a-z]+\s)([A-Z]+)([a-z]+\s)([A-Z]+)([a-z]+)/"$newpost['message']))
    {
        
$newpost['title'] = myRemoveShouting($newpost['title']);
    }

//================================== 
STEP 3:
Open file: newthread.php
SEARCH FOR:
PHP Code:
    build_new_post('thread'$foruminfo, array(), 0$newpost$errors);

    if (
sizeof($errors) > 0)
    {
        
// ### POST HAS ERRORS ###
        
$postpreview construct_errors($errors); // this will take the preview's place
        
construct_checkboxes($newpost);
        
$_REQUEST['do'] = 'newthread'
ABOVE THAT ADD:
PHP Code:
//==================================

    
    
if ($newpost['message'] == strtoupper($newpost['message'])) 
    {
        
$newpost['message'] = myRemoveShouting($newpost['message']);
    }

    elseif (
preg_match("/([a-z]+\s)([A-Z]+)([a-z]+\s)([A-Z]+)([a-z]+\s)([A-Z]+)([a-z]+\s)([A-Z]+)([a-z]+)/"$newpost['message']))
    {
        
$newpost['message'] = myRemoveShouting($newpost['message']);
    }



    if (
$newpost['title'] == strtoupper($newpost['title'])) 
    {
        
$newpost['title'] = myRemoveShouting($newpost['title']);
    }

    elseif (
preg_match("/([a-z]+\s)([A-Z]+)([a-z]+\s)([A-Z]+)([a-z]+\s)([A-Z]+)([a-z]+\s)([A-Z]+)([a-z]+)/"$newpost['message']))
    {
        
$newpost['title'] = myRemoveShouting($newpost['title']);
    }



//================================== 
Save the files or upload them and test if everything is working right. Go to one of you test forums and make a few threads and posts using SHOUTING text and "Jumpy" text.
This mod has been working nicely on my site for about a week.

The second line of function myRemoveShouting() is slower than the (commented) first one, but it makes the function compatible with forums with international characters like "?????".

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #2  
Old 06-27-2005, 09:20 PM
Reynaldovb Reynaldovb is offline
 
Join Date: Dec 2004
Posts: 47
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

- Place holder -
Reply With Quote
  #3  
Old 06-27-2005, 09:26 PM
Marco van Herwaarden Marco van Herwaarden is offline
 
Join Date: Jul 2004
Posts: 25,415
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thansk for sharing, could you please also upload as a (zipped) textfile.
Reply With Quote
  #4  
Old 06-27-2005, 10:27 PM
Jenta Jenta is offline
 
Join Date: Dec 2004
Posts: 377
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

hehe, i hate people that type like that myself
Reply With Quote
  #5  
Old 06-30-2005, 07:45 PM
sv1cec sv1cec is offline
 
Join Date: May 2004
Location: Athens, Greece
Posts: 2,091
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I installed that, and it works OK for all upper-case messages, but not with the Jumpy text. Any ideas of what I did wrong (although I am sure I didn't do anything wrong!) LoL.
Reply With Quote
  #6  
Old 08-19-2005, 09:25 PM
Gutspiller's Avatar
Gutspiller Gutspiller is offline
 
Join Date: Dec 2001
Posts: 1,046
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Confirmed, fixing jumpy text doesn't work, but all caps does. (v3.0.7)
Reply With Quote
  #7  
Old 09-16-2005, 03:47 AM
redspider's Avatar
redspider redspider is offline
 
Join Date: Jul 2005
Posts: 225
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

any way to fix edit.php so that way anything new they enter dont come out as shouting if they try to go around this hack?
Reply With Quote
  #8  
Old 11-18-2005, 04:24 AM
dknelson dknelson is offline
 
Join Date: Oct 2004
Posts: 412
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Does anybody know if this works for 3.51? I know that prevent shouting is built in but does this prevent shouting even if "quote" is used in reply? Does it prevent shouting if not the works are caps?
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 12:18 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.04159 seconds
  • Memory Usage 2,295KB
  • Queries Executed 21 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (6)bbcode_php
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (8)post_thanks_box
  • (8)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (8)post_thanks_postbit_info
  • (7)postbit
  • (8)postbit_onlinestatus
  • (8)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete