[AP] Character Counter

[AP] Character Counter 1.2.1

No permission to download
apathy updated [AP] Character Counter with a new update entry:

1.2.0

  • Remove duplicate permission (double check to make sure "Forum permissions: Can view character / word counter" is correctly set)
  • Count words instead of whitespaces
  • Create "Display counter in the following locations" admin option
  • Create style properties for restyling & relocating the counter within the editor

Read the rest of this update entry...
 

Thank you so much!

Hi, Thank you for the awesome add-on.

seems it is not counting correctly.

I typed 20 words but it is only count 17 !.
View attachment 289598

Thank you so much! I made an attempt, but it didn't turn out as well as yours.

I lack experience in this area. Would you be able to share your CSS code with me, please?

I genuinely appreciate it!
 
Hi, Thank you for the awesome add-on.

seems it is not counting correctly.

I typed 20 words but it is only count 17 !.
Not had the time to investigate just yet (it was a while ago I wrote this update and only got to test it recently), but from what i remember the Froala editor XF uses doesn't actually output a post like

Code:
TEST TEST TEST
TEST TEST TEST

It either looks like (recalling from memory here so maybe I'm wrong):

Code:
TEST TEST TESTTEST TEST TEST

OR

Code:
<p>TEST TEST TEST</p>
<p>TEST TEST TEST</p>

if the way it outputs the text is like the former example then I don't think there's anything I can do, because there's no way for the counter to tell where the line breaks are and count the two words around it separately.
If it's the latter, with <p> tags, then it should be easier to correct.
 
After installed can't type anything into Quick Reply editor box in toggle BB code mode
Have you any other editor-related addons installed? Are there any errors appearing in your browser console (CTRL+Shift+K for firefox, not sure about chrome)
 
After installed can't type anything into Quick Reply editor box in toggle BB code mode
Interesting. I just tested it and I can type in the box but the counter doesn't work in BB code mode.

I'm on Firefox, and I tested two different Firefox browsers. I don't have other editor-related addons.

I have some warnings in CTRL+Shift+K, but no errors.
 
Interesting. I just tested it and I can type in the box but the counter doesn't work in BB code mode.

I'm on Firefox, and I tested two different Firefox browsers. I don't have other editor-related addons.

I have some warnings in CTRL+Shift+K, but no errors.
Indeed, after a quick test with the completely default settings I have the same experience as you - in regular editor mode I can both type & have my characters counted, if I'm in BbCode mode I can still type but the counter will not refresh until I swap back to regular editor mode.
I've not gotten a chance to test the other options but I wonder if (for instance) the word counter option is causing the inability to type at all in BbCode mode.
 
Nice and helpful Plugin!
@apathy : I think I've found a bug: There seems to be an issue with articles:

Articles have a higher character limit than "normal posts", as a standard possibly by factor three:


So instead of i.e. 15.000 characters for a post and article should have like 45.000 characters. I do have articles in my forum with like 24.000 characters and when I tried to edit them after installing your plugin I was not able to add characters to it.

The length seems to be controlled in
Code:
XF/ThreadType/Article.php line 60
according to this post.

As there seems to be no direct setting for it in the backend (though I remembered differently from setting up my forum) I then installed the Article length plugin by @Ozzy47 :


It showed me a max article length of 25.000 characters, so I should have been able to add characters to my example article. I then rised it to 30.000 characters, just to be sure and tried once more to edit the article.

Your plugin still showed a character limit of 15.000, so it does not seem to reflect the setting for articles.

I then disabled your plugin and everything worked as it should again.

Would be great if you could fix the issue as the plugin is very helpful in my opinion.
 
I think I found a bug. Possibly has to do with the recent update?
Remove duplicate permission (double check to make sure "Forum permissions: Can view character / word counter" is correctly set) https://xenforo.com/community/resources/ap-character-counter.8810/updates

The counter is only showing for me when I reply to an existing thread. When I create a new thread it doesn't show.

BTW, I would find it useful to have it work for the title too (I have 300 char titles). But not a big deal. Right now I just type the title in the main box first.
 
I think I found a bug. Possibly has to do with the recent update?


The counter is only showing for me when I reply to an existing thread. When I create a new thread it doesn't show.

BTW, I would find it useful to have it work for the title too (I have 300 char titles). But not a big deal. Right now I just type the title in the main box first.

I'll take a look when I'm home, I know I recently made admin options so you can control what pages the counter appears on, so I'm assuming I never considered a "new thread" over the "quick reply".

As for the thread title, that's unfortunately unlikely to happen - the thread title input is a simple textbox whereas this addon is unlocking Froala's native counter which XF has disabled by default.
In other words, if it's not an instance of the rich-text editor, the counter cannot be enabled (since there's nothing to enable).
 
Nice and helpful Plugin!
@apathy : I think I've found a bug: There seems to be an issue with articles:

Articles have a higher character limit than "normal posts", as a standard possibly by factor three:


So instead of i.e. 15.000 characters for a post and article should have like 45.000 characters. I do have articles in my forum with like 24.000 characters and when I tried to edit them after installing your plugin I was not able to add characters to it.

The length seems to be controlled in
Code:
XF/ThreadType/Article.php line 60
according to this post.

As there seems to be no direct setting for it in the backend (though I remembered differently from setting up my forum) I then installed the Article length plugin by @Ozzy47 :


It showed me a max article length of 25.000 characters, so I should have been able to add characters to my example article. I then rised it to 30.000 characters, just to be sure and tried once more to edit the article.

Your plugin still showed a character limit of 15.000, so it does not seem to reflect the setting for articles.

I then disabled your plugin and everything worked as it should again.

Would be great if you could fix the issue as the plugin is very helpful in my opinion.

Sorry for the late reply, indeed the counter is checking the "maximum message length" option in your admin panel. I'll try get it to work with other content types as well when I have a chance.
 

Similar threads

Top Bottom