News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

Disable shouting

Started by Rudolf, July 18, 2007, 10:57:32 AM

Previous topic - Next topic

Rudolf

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)

shadow82x

Very Nice mod again Rudolf. :)
Colin B
Former Spammer, Customize, & Support Team Member

GC

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?

Rudolf

#3
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.
I will update all my mods in the next few weeks. Thanks for your patience.

SVG-Collapse (you need an SVG compliant browser)


sodmanccc

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.

Rudolf

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)

sodmanccc

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.

Rudolf

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)

LeeOwen

Alright,

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

Cheers
Lee
MillwallOnline.co.uk

michaelnl

#10
Hi,

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

Notice: Uninitialized string offset: -1 in /home/holland/public_html/smf/Sources/Subs.php on line 3611

Line 3611 is:

$pos--;


And that's part of:

//-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

sodmanccc

oh ok, i would be willing to donate a little to help make sure it gets done ... soon..
haha

tsmalmbe

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?

tsmalmbe

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.


//-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?

kamili34

Thanks for another good mod.

tsmalmbe

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?

Gideon

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...

Miyagi

Quote from: michaelnl on August 12, 2007, 02:57:30 PM
Hi,

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

Notice: Uninitialized string offset: -1 in /home/holland/public_html/smf/Sources/Subs.php on line 3611

Line 3611 is:

$pos--;


And that's part of:

//-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

pinoypetfinder

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

H3 Skillz

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?

Advertisement: