Advertisement:

Author Topic: Disable shouting  (Read 20186 times)

Offline Rudolf

  • SMF Hero
  • ******
  • Posts: 1,934
  • Gender: Male
  • iamanoompaloompa
Disable shouting
« on: July 18, 2007, 10:57:32 AM »
Link to Mod

*****************************************************
 Disable shouting - Modification for SMF
 version 1.0
 © 2007, Rudolf Martincsek
*****************************************************
This mod changes text written in upper case letters into lower case letters. Only in the topic disaply page!
You can enable/disable in Admin -> Posts and Topics -> "Disable shouting".
The feature is disabled by default
I will update all my mods in the next few weeks. Thanks for your patience.

SVG-Collapse (you need an SVG compliant browser)

Offline cblaber

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 11,271
  • Gender: Male
    • cmblaber on LinkedIn
Re: Disable shouting
« Reply #1 on: July 18, 2007, 12:05:01 PM »
Very Nice mod again Rudolf. :)
Colin Blaber
Former Customize & Support Team Member

Offline GC

  • Full Member
  • ***
  • Posts: 440
  • GamingEvo.com
    • GamingEvo.com
Re: Disable shouting
« Reply #2 on: July 18, 2007, 01:27:32 PM »
If the text were to be like "Hello", would it display "hello"?

Also, on my board there's a game we discuss about called SOCOM, and yes it's spelt in caps. Would this mod change it to socom or Socom?

Is there a way to stop certain words from being uncapitalized?

Offline Rudolf

  • SMF Hero
  • ******
  • Posts: 1,934
  • Gender: Male
  • iamanoompaloompa
Re: Disable shouting
« Reply #3 on: July 19, 2007, 08:35:21 PM »
I will be adding that feature soon.

Don't worry because the mod doesn't changes the content. The content stored in the database is written by the poster.
You might see it now lowercase, but once the feature included it will turn back normal.
« Last Edit: July 19, 2007, 08:40:51 PM by Rudolf »
I will update all my mods in the next few weeks. Thanks for your patience.

SVG-Collapse (you need an SVG compliant browser)

Offline GC

  • Full Member
  • ***
  • Posts: 440
  • GamingEvo.com
    • GamingEvo.com
Re: Disable shouting
« Reply #4 on: July 20, 2007, 04:22:38 AM »
Sweet :) Sounds gooooood

Offline sodmanccc

  • Jr. Member
  • **
  • Posts: 219
Re: Disable shouting
« Reply #5 on: July 20, 2007, 09:14:56 PM »
this type of mod is really needed at a forum like ours.

however when we install and enable it it does not seam to change it 100%, when posting a shouting or yelling TOPIC subject and message but only the message content is change. once i double click to change the title i add any letter or number and then allow it to change it does change it from yelling to not but then once you refresh its changed back for some reason.

Rudolf you made by far one of the best mods for SMF (the enhanced stats) so i know you are busy but i was hoping i could get a little help on this please pm me if you can assist me. thanks and great work.

Offline Rudolf

  • SMF Hero
  • ******
  • Posts: 1,934
  • Gender: Male
  • iamanoompaloompa
Re: Disable shouting
« Reply #6 on: July 20, 2007, 10:38:17 PM »
Do you have any errors in the error log related to this?
If the install went fine I see no reason why it shouldn't work.
Can you give a link to your forum?
I will update all my mods in the next few weeks. Thanks for your patience.

SVG-Collapse (you need an SVG compliant browser)

Offline sodmanccc

  • Jr. Member
  • **
  • Posts: 219
Re: Disable shouting
« Reply #7 on: July 24, 2007, 01:32:00 AM »
hello

yea it is working partly... only in the Message it self, but when looking at the forums main you still SEE CAPS

i am kind of thinking that it pretty much has to change the topic title from caps to not other wise there is still caps and shouting.


i am going to PM you the site URL thanks.

Offline Rudolf

  • SMF Hero
  • ******
  • Posts: 1,934
  • Gender: Male
  • iamanoompaloompa
Re: Disable shouting
« Reply #8 on: July 24, 2007, 03:26:55 AM »
Removing shouting from any part of the forum is quite easy, but it requires small modifications in numerous files.
I will add this in other places in the next versions.
This was an "emergency" release to handle the topic display area.
I will update all my mods in the next few weeks. Thanks for your patience.

SVG-Collapse (you need an SVG compliant browser)

Offline LeeOwen

  • Newbie
  • *
  • Posts: 6
Re: Disable shouting
« Reply #9 on: July 31, 2007, 09:34:35 AM »
Alright,

Blinding add on, anyway to make it so it alters the same for 'Recent Posts'

Cheers
Lee
MillwallOnline.co.uk

Offline michaelnl

  • Semi-Newbie
  • *
  • Posts: 13
Re: Disable shouting
« Reply #10 on: August 12, 2007, 02:57:30 PM »
Hi,

I think i've found a bug. With sticky topics I get this error:

Code: [Select]
Notice: Uninitialized string offset: -1 in /home/holland/public_html/smf/Sources/Subs.php on line 3611
Line 3611 is:

Code: [Select]
$pos--;

And that's part of:

Code: [Select]
//-Disable shouting MOD- START
function disableShouting($string, $echo = false)
{
global $func, $modSettings;

if (empty($modSettings['disableShouting']))
return $string;

preg_match_all('~[A-Z ]{5,}~',$string, $matches, PREG_OFFSET_CAPTURE);

foreach ($matches[0] as $match)
{
$search = $func['htmltrim']($match[0]);
$pos = $match[1];
do
{
[b]$pos--;[/b]
}while ($pos < 1 && $string[$pos] == ' ');

$replace = strtolower($search);
if ($pos <= 0 || in_array($string[$pos], array('.','!','?')))
$replace = ucfirst($replace);
$string = str_replace($search, $replace, $string);
}

if ($echo)
echo $string;
else
return $string;
}
//Disable shouting MOD- END
« Last Edit: August 13, 2007, 02:27:02 PM by michaelnl »

Offline sodmanccc

  • Jr. Member
  • **
  • Posts: 219
Re: Disable shouting
« Reply #11 on: August 16, 2007, 07:34:39 PM »
oh ok, i would be willing to donate a little to help make sure it gets done ... soon..
haha

Offline tsmalmbe

  • Jr. Member
  • **
  • Posts: 188
  • Gender: Male
    • Kontrollrummet
Re: Disable shouting
« Reply #12 on: October 05, 2007, 01:22:02 PM »
Only the message itself is unshoutified, the subject still is with CAPS.

This mod also modifies Post.php, and adds the disableShouting()-method there. If this only affects viewing, why are you modifying stuff in Post.php?

Nice mod, requires a few fixes still :).
..:: http://www.kontrollrummet.com - Studio och musik ::.. RSS?

Offline tsmalmbe

  • Jr. Member
  • **
  • Posts: 188
  • Gender: Male
    • Kontrollrummet
Re: Disable shouting
« Reply #13 on: October 05, 2007, 04:36:19 PM »
Did some mods to support finnish and swedisch characters. This does not yet cover german umlauts and french wierdnesses (just to mention a few shortcomings). I assume we are using UTF-8 as the forum locale, didnä't know how to pull that  dynamically from the forum.

Code: [Select]
//-Disable shouting MOD- START
function disableShouting($string, $echo = false)
{
global $func, $modSettings;

if (empty($modSettings['disableShouting']))
return $string;

preg_match_all('~[A-Ö ]{5,}~',$string, $matches, PREG_OFFSET_CAPTURE);

foreach ($matches[0] as $match)
{
$search = $func['htmltrim']($match[0]);
$pos = $match[1];
do
{
$pos--;
}while ($pos < 1 && $string[$pos] == ' ');

$replace = mb_strtolower($search, "UTF-8");
if ($pos <= 0 || in_array($string[$pos], array('.','!','?')))
$replace = ucfirst($replace);
$string = str_replace($search, $replace, $string);
}

if ($echo)
echo $string;
else
return $string;
}
//Disable shouting MOD- END
..:: http://www.kontrollrummet.com - Studio och musik ::.. RSS?

Offline kamili34

  • Jr. Member
  • **
  • Posts: 232
  • Gender: Male
  • noob
    • pilarki.org
Re: Disable shouting
« Reply #14 on: October 05, 2007, 05:06:34 PM »
Thanks for another good mod.

Offline tsmalmbe

  • Jr. Member
  • **
  • Posts: 188
  • Gender: Male
    • Kontrollrummet
Re: Disable shouting
« Reply #15 on: October 06, 2007, 05:34:23 AM »
Another big or should I say BIG issue is that it breaks links. I have not verfiied yet that it breaks internal, although that too was reported.

but: http://www.foobar.com/the_EBCDIC_keyboard_layout.pdf cannot be linked to, because this mod modifies the link.
..:: http://www.kontrollrummet.com - Studio och musik ::.. RSS?

Offline Gideon

  • Semi-Newbie
  • *
  • Posts: 16
Re: Disable shouting
« Reply #16 on: October 17, 2007, 04:37:56 PM »
Great mod, thanks...one problem I found is that if anyone links a photo in an [img] tag which is in caps it changes it, and the photo is not visible...

Offline Miyagi

  • Semi-Newbie
  • *
  • Posts: 49
  • Gender: Male
Re: Disable shouting
« Reply #17 on: October 28, 2007, 12:29:27 AM »
Hi,

I think i've found a bug. With sticky topics I get this error:

Code: [Select]
Notice: Uninitialized string offset: -1 in /home/holland/public_html/smf/Sources/Subs.php on line 3611
Line 3611 is:

Code: [Select]
$pos--;

And that's part of:

Code: [Select]
//-Disable shouting MOD- START
function disableShouting($string, $echo = false)
{
global $func, $modSettings;

if (empty($modSettings['disableShouting']))
return $string;

preg_match_all('~[A-Z ]{5,}~',$string, $matches, PREG_OFFSET_CAPTURE);

foreach ($matches[0] as $match)
{
$search = $func['htmltrim']($match[0]);
$pos = $match[1];
do
{
[b]$pos--;[/b]
}while ($pos < 1 && $string[$pos] == ' ');

$replace = strtolower($search);
if ($pos <= 0 || in_array($string[$pos], array('.','!','?')))
$replace = ucfirst($replace);
$string = str_replace($search, $replace, $string);
}

if ($echo)
echo $string;
else
return $string;
}
//Disable shouting MOD- END

I am having this error also!

Rudolf... please help! :)

Thx,
Miyagi
FordXR5Turbo.com - Dedicated to the Ford Focus & Mondeo XR5 Turbo in Australia
FordXR4.com - Dedicated to the Ford Fiesta XR4 in Australia

Offline pinoypetfinder

  • Jr. Member
  • **
  • Posts: 188
    • Pinoy Pet Finder
Re: Disable shouting
« Reply #18 on: December 03, 2007, 01:07:11 AM »
i need help on installing this theme on my custom made template..
i need to manually install the script on

Admin.template.php  and languages/Admin.english.php .. but what script and where should i place that?

package parser not working :(

Offline H3 Skillz

  • Semi-Newbie
  • *
  • Posts: 28
Re: Disable shouting
« Reply #19 on: January 23, 2008, 06:51:55 PM »
Could someone tell me how to edit the instalation files (or just the post.php document itself) to allow this just in topic titles?  I really love this mod but I don't like the fact that it does it in the actual post as well as the topic title.  I'm sure this is pretty simple to do but I'm just missing something, could someone help me out with this?