Characters counter

Looking for an Extension? Have an Extension request? Post your request here for help. (Note: This forum is community supported; while there is an Extensions Development Team, said team does not dedicate itself to handling requests in this forum)
Suggested Hosts
User avatar
mrgoldy
Development Team Member
Development Team Member
Posts: 1392
Joined: Tue Oct 06, 2009 7:34 pm
Location: The Netherlands
Name: Gijs
Contact:

Re: Characters counter

Post by mrgoldy »

It's used by phpBB btw:
https://github.com/phpbb/phpbb/blob/mas ... s.php#L115

That's phpBB's utr8_strlen().

Code: Select all

/**
* Return the length (in characters) of a UTF-8 string
* @ignore
*/
function utf8_strlen($text)
{
	return mb_strlen($text, 'utf-8');
}
My main question would be: Do you want to include BBCodes in the character count?
So, should [b]hello[/b] be: 5 or 12?
And should the count be available during posting below/besides the textarea, or only after the post was submitted?
phpBB Studio / Member of the Studio

Contributing: You can do it too! Including testing Pull Requests (PR).
phpBB Development and Testing made easy.
User avatar
thevisionisdivine
Registered User
Posts: 141
Joined: Tue Mar 10, 2015 3:36 pm
Name: Bruno Bianco

Re: Characters counter

Post by thevisionisdivine »

3Di wrote:
Wed Apr 11, 2018 7:35 pm
ViolaF wrote:
Wed Apr 11, 2018 7:32 pm
of course mb ;)
That's slower/intensive than the others, you should really find a compromise, maybe coding a sort of function instead.
EDIT.
Last edited by thevisionisdivine on Tue Apr 17, 2018 3:42 pm, edited 1 time in total.
* * * All To Be The Master Of The Wind * * *
User avatar
thevisionisdivine
Registered User
Posts: 141
Joined: Tue Mar 10, 2015 3:36 pm
Name: Bruno Bianco

Re: Characters counter

Post by thevisionisdivine »

posey wrote:
Fri Apr 13, 2018 7:31 am
My main question would be: Do you want to include BBCodes in the character count?
So, should [b]hello[/b] be: 5 or 12?
-> 5
posey wrote:
Fri Apr 13, 2018 7:31 am
And should the count be available during posting below/besides the textarea, or only after the post was submitted?
-> Both.
During, so any player can see the post length he/she's posting.
After, so I will use it to compute post accuracy to assign points. <--- the value should be visible, under the post, only to administrators.
* * * All To Be The Master Of The Wind * * *
Post Reply

Return to “Extension Requests”