News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

Disable shouting

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

Previous topic - Next topic

Rudolf

In Display.php
Code (Find and delete) Select
$message['subject'] = disableShouting($message['subject']); //-Disable shouting MOD-

In Post.php
Code (Find and delete) Select
$context['message']['body'] = disableShouting($context['message']['body']);
I will update all my mods in the next few weeks. Thanks for your patience.

SVG-Collapse (you need an SVG compliant browser)

H3 Skillz

#21
Thank you!

Edit: Wait are you sure?  The first one you told me to delete was the subject part, if I wanted to disable shouting in the subject but not the body, wouldn't you delete the body part instead?  I'm not that good at HTML or PHP or anything but I'm pretty sure you have to delete the body part.  Anyway, even when I tried it your way it still didn't seem to work and when I try it my way, it works inside the message (when you view the message) but not when you are viewing it in the forum (like when you see the subjects of all the posted threads in that forum).

Rudolf

yes, it was supposed to be the body part. I copied the wrong line.
I don't understand the problem on the forum index.
I will update all my mods in the next few weeks. Thanks for your patience.

SVG-Collapse (you need an SVG compliant browser)

H3 Skillz

What is the file that displays the forum index?  Maybe I could just figure it out by searching that file for disableshouting and deleting that line of code.

Rudolf

I will update all my mods in the next few weeks. Thanks for your patience.

SVG-Collapse (you need an SVG compliant browser)

H3 Skillz

Hum, that's wierd cuz that page doesn't even have anything about the disable shouting.  When you instal the mod, it doesn't even do anything to that page.  You know, I'm using 1.1.4 and this mod is made for 1.1.3 and it works perfectly when I don't try to modify it so maybe my SMF version has something to do with it.

Goad

bump to see this continue to be developed....i really need this mod but i'd rather live without for broken links (img or url)

m1ss1nnocent

Another bump for continued Dev on this mod.

Is there any way to configure it so that it only un-capitalises when more than say 4 or 5 letters are capital? At present it allows things like MK1 (where only 2 letters are capitals) but as soon as you do 3 or more capitals (FORD for example) it sends it to lower case. Anyone know where the code is to change it from the trigger being 3 letters or more to start converting?

Rudolf

Quote from: m1ss1nnocent on August 18, 2008, 05:43:16 PM
Another bump for continued Dev on this mod.

Is there any way to configure it so that it only un-capitalises when more than say 4 or 5 letters are capital? At present it allows things like MK1 (where only 2 letters are capitals) but as soon as you do 3 or more capitals (FORD for example) it sends it to lower case. Anyone know where the code is to change it from the trigger being 3 letters or more to start converting?

The minimum length of a word lowercased is 5 letters. It shouldn't lowercase FORD.

to change the length find in Subs.php
preg_match_all('~[A-Z ]{5,}~',$string, $matches, PREG_OFFSET_CAPTURE);
and replace the number 5, with the minimum length you want.
I will update all my mods in the next few weeks. Thanks for your patience.

SVG-Collapse (you need an SVG compliant browser)

DarkflameQ

A shame this hasn't been updated to v2.0 RC3

cyberdyne

I have this installed with a custom theme on v.1.1.13. I had to install it manually as the auto install didn't work.
The function works, but I get 2 small errors in the forum logs:

QuoteApply Filter: Only show the errors with the same message
8: Undefined variable: context
File: /home/server/public_html/forum/Sources/Post.php
Line: 2396
Refers to line:
$context['message']['subject'] = disableShouting($context['message']['subject']);



Quote8: Uninitialized string offset: -1
File: /home/server/public_html/forum/Sources/Subs.php
Line: 3692
Refers to line:
}while ($pos < 1 && $string[$pos] == ' ');

Would appreciate any help.
Many thanks
Using:
v.1.1.16
Custom theme (modified SMF Default Theme - Core)
AND
v.2.0.1
Custom theme (modified Bright Forest)

cyberdyne

Rudolf, any ideas please? These errors are filling up my logs! :)
Thanks
Using:
v.1.1.16
Custom theme (modified SMF Default Theme - Core)
AND
v.2.0.1
Custom theme (modified Bright Forest)

kyjeeper

Any shot at this being updated for 2.0.2? I had and loved this mod through 1.1.16, but recently upgraded the forum to 2.0.2 and it is not available.

Thanks!

Advertisement: