vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Requests/Questions (Unpaid) (https://vborg.vbsupport.ru/forumdisplay.php?f=112)
-   -   Preventing all caps in message? (https://vborg.vbsupport.ru/showthread.php?t=37696)

Cold Steel 04-21-2002 11:32 AM

Preventing all caps in message?
 
Has this been done yet? I did a search for "caps" and this didn't turn up.

I have one member who has her caps lock permanently on, and it's annoying.

Is there some way to turn it off, from my end?

Scott MacVicar 04-21-2002 12:36 PM

go to you vBulletin admin panel then into vBulletin Options you need to then click the [Thread display options] options link and turn Stop 'Shouting' in titles to Yes.

Admin 04-21-2002 12:46 PM

And if you want to do that for the whole message, add this code:
Code:

  if ($bbcode == strtoupper($bbcode)) {
    $bbcode = ucwords(strtolower($bbcode));
  }

In functions.php right after this:
Code:

    $dobbcode=$forum[allowbbcode];
  }


Sparkz 04-21-2002 01:07 PM

And to make only the first letter of a sentence uppercase you could change this:
PHP Code:

  if ($bbcode == strtoupper($bbcode)) {
    
$bbcode ucwords(strtolower($bbcode));
  } 

to something like this:
PHP Code:

  if ($bbcode == strtoupper($bbcode)) {
    
$bbarr explode ('.'$bbcode);
    
$bbcode "";
    foreach (
$bbarr as $bbsentence) {
      
$bbcode .= ucwords(strtolower($bbsentence));
    }
  } 

Untested...

Admin 04-21-2002 01:20 PM

Nope, that won't work Sparkz. :) And it will also remove all the "." from it.

Admin 04-21-2002 02:14 PM

BTW you can use ucfirst() instead of ucwords() to get the first character capitalized (in the text, not the first in each sentence).

Cold Steel 04-22-2002 12:40 AM

Thanks FireFly.

Now "ONE TWO THREE" looks like "One Two Three." I'd rather have it all lowercase... is that possible?

Sparkz 04-22-2002 10:43 AM

PHP Code:

if ($bbcode == strtoupper($bbcode)) {
    
$bbarr explode ('.'$bbcode);
    
$bbcode "";
    foreach (
$bbarr as $bbsentence) {
      
$bbcode .= ucfirst(strtolower(ltrim($bbsentence))) . ".";
    }


Try this. You'll lose all whitespace in the beginning of the sentences, ie "THIS IS CAPS. THIS IS CAPS" will become "This is caps.This is caps"

Sparkz 04-22-2002 10:45 AM

Quote:

Originally posted by FireFly
BTW you can use ucfirst() instead of ucwords() to get the first character capitalized (in the text, not the first in each sentence).
lol, I was obviously going to use ucfirst() in my first attempt, but forgot to change it (I copy'n'pasted your code. To lazy to write it out by hand :P )

Cold Steel 04-22-2002 03:54 PM

Thanks Sparkz! I can deal with the lack of whitespace, but the code also adds an extra period at the end. Is there anything that can be done about that?


All times are GMT. The time now is 09:08 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.01042 seconds
  • Memory Usage 1,737KB
  • 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
  • (3)bbcode_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)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