SimplePortal

Support => English Support => Topic started by: PokemonS on January 03, 2015, 05:27:24 PM

Title: Autodown Caps Lock? In Shoutbox.
Post by: PokemonS on January 03, 2015, 05:27:24 PM
SMF 2.0.9
SP 2.3.5

Hi,

For example:
- "THIS IS A SENTENCE" will be capsdowned to "this is a sentence".
- "This is a SENTENCE" is not capsdowned, because it's only contain one word which all-caps.
- Sentence that contain 2 words all-caps, "THIS is a SENTENCE" or "this is A SENTENCE", will be capsdowned.

This apply for new shouts.

Is it possible? Thankies. 'w'
Title: Re: Autodown Caps Lock? In Shoutbox.
Post by: Chen Zhen on January 03, 2015, 07:58:13 PM
PokemonS,

  Due to some security fixes you should uninstall SimplePortal 2.3.5 and then install Simple Portal 2.3.6.
Prior to me showing you an edit, do you use any Simple Portal plugins that already change the behaviour of its shoubox?

Regards.
Title: Re: Autodown Caps Lock? In Shoutbox.
Post by: PokemonS on January 03, 2015, 09:12:06 PM
PokemonS,

  Due to some security fixes you should uninstall SimplePortal 2.3.5 and then install Simple Portal 2.3.6.
Prior to me showing you an edit, do you use any Simple Portal plugins that already change the behaviour of its shoubox?

Regards.

Thanks for your fast answer. 'w'

Thanks for notice me about the new release.
I'll update it later 'cuz lots of files are modified, I'd prefer manual update. 'w'

I am currently using a plugin SP-Shoutbox Permissions v1.2. 'w'
Title: Re: Autodown Caps Lock? In Shoutbox.
Post by: Chen Zhen on January 04, 2015, 05:41:40 AM

PokemonS,

  I have released version 1.3 of the xtra-shoutbox-perms plugin. Uninstall and delete v1.2 and then install the newer version.
You will have to go to your specific shoutbox admin settings (the shoutbox itself - not the block) and edit/save it at least once.
Then you go to the permissions of each membergroup you want filtered shoutbox text for and enable it.

The regex I have thus far does not behave exactly as you asked but it is close to it.
I will have to work on the regex to achieve exactly what you requested although you can attempt to modify it yourself in the shoutbox settings.
I put the default regex at the end of the first post of the plug-ins thread in case you change it and make an error.

Regards. 
Title: Re: Autodown Caps Lock? In Shoutbox.
Post by: PokemonS on January 04, 2015, 04:37:23 PM

PokemonS,

  I have released version 1.3 of the xtra-shoutbox-perms plugin. Uninstall and delete v1.2 and then install the newer version.
You will have to go to your specific shoutbox admin settings (the shoutbox itself - not the block) and edit/save it at least once.
Then you go to the permissions of each membergroup you want filtered shoutbox text for and enable it.

The regex I have thus far does not behave exactly as you asked but it is close to it.
I will have to work on the regex to achieve exactly what you requested although you can attempt to modify it yourself in the shoutbox settings.
I put the default regex at the end of the first post of the plug-ins thread in case you change it and make an error.

Regards.

Thank you very much! It works perfectly! :D

I can manage the regex myself, and I think this is better:

Code: [Select]
(?:[A-Z]{3}[\w+].*)
Every word contain 4 caps in a row will be capsdowned. 'w'
Title: Re: Autodown Caps Lock? In Shoutbox.
Post by: PokemonS on January 05, 2015, 02:27:14 AM
My final regex is:

Code: [Select]
([A-Z^0-9]{4}[\w+]*)|(?:((?<!^)[-1]{0})[A-Z]{1}[\w+].*((\s+[A-Z]{1}[\w+]*)+))
But there's a problem, when member post a link which contain 4 words uppercase in a row, those words will be capsdowned, how to exclude this?

Thankies. 'w'
Title: Re: Autodown Caps Lock? In Shoutbox.
Post by: Chen Zhen on January 05, 2015, 09:28:51 PM
PokemonS,

  This newer pattern you are using no longer comes anywhere close to the original behaviour you requested.
Instead it pretty much puts all words longer than 1 letter to lower case.

Title: Re: Autodown Caps Lock? In Shoutbox.
Post by: PokemonS on January 06, 2015, 06:09:36 AM
PokemonS,

  This newer pattern you are using no longer comes anywhere close to the original behaviour you requested.
Instead it pretty much puts all words longer than 1 letter to lower case.

Simply, I just add this pattern:

Code: [Select]
([A-Z^0-9]{4}[\w+]*)|
To before your original pattern.



But it's still okay, thanks for your help~ 'w'
Title: Re: Autodown Caps Lock? In Shoutbox.
Post by: Chen Zhen on January 06, 2015, 05:07:53 PM
PokemonS,

Yes, Imo that works fairly well whilst using a simple expression.
I am glad to hear you have found a good solution.

Regards.
Title: Re: Autodown Caps Lock? In Shoutbox.
Post by: Chen Zhen on January 07, 2015, 02:05:11 AM
PokemonS,

  You may be interested in version 1.32 of the mod as I have reworked my approach to forcing no shouting.
The default behaviour now renders the entire shout as lowercase less letters that begin a word, sentence or the letter I or O (<- single letter English nouns that are normally capitalized).
 
Imo the behaviour is a lot better now although the new version will let you set it the way you did here.
For your code you posted here to work with v1.32 you will have to disable forced lowercase, enter your regex and the php for it will be:
strtolower($m[0])

There is now a checkbox to reset all regex configuration to the newer default values which differ from how you have currently set it up.

Regards.
SimplePortal 2.3.8 © 2008-2024, SimplePortal