News:

SMF 2.0.19 has been released! Please update. Read more.

Main Menu

Characters remaining of post

Started by davidhs, July 01, 2013, 09:48:11 AM

Previous topic - Next topic

davidhs

Link to Mod

Characters remaining of post

ABOUT...

Characters remaining of post, 1.0.4
© 2013-2020 by davidhs


This work is licensed under a Creative Commons Attribution 3.0 Unported License.

DESCRIPTION

Shows the maximum number of characters and remaining while writing a post, as in the user signature.

This is shown in:

  • Create/modify post (not WYSIWYG mode only).
  • Create/modify PM (not WYSIWYG mode only).
  • Quick reply.
  • Quick modification of post (does not shown the initial remaining number).


SMF COMPATIBILITY


  • SMF 1.1 to 1.1.21.
  • SMF 2.0 to 2.0.17.

DOWNLOAD

Link to MOD

MANUAL INSTALLATION

See http://wiki.simplemachines.org/smf/Manual_installation_of_mods

SUPPORT AND COMMENTS

In English: http://www.simplemachines.org/community/index.php?topic=506862.0
In Spanish: http://www.simplemachines.org/community/index.php?topic=504643.0

CHANGE LOG

Legend:   ! Fixed   + Added   - Removed   * Changed   @ Note

1.0.4   2014-01-25
------------------
+ SMF compatibility: 2.0.7.

1.0.3   2013-10-24
------------------
+ SMF compatibility: 1.1.19 and 2.0.6.

1.0.2   2013-08-19
------------------
+ SMF compatibility: 2.0.5.

1.0.1   2013-07-07
------------------
! Typo in source code.

1.0     2013-07-01
------------------
@ This work is licensed under a Creative Commons Attribution 3.0 Unported License http://creativecommons.org/licenses/by/3.0/
+ Maximum number of characters and remaining of post.
@ Only works in not WYSIWYG mode.
@ Does not shown the initial remaining number in quick modification of post.
+ SMF compatibility: 1.1 to 1.1.18.
+ SMF compatibility: 2.0 to 2.0.4.


Hristo

Nice mod. Thank you!

I believe there is a small typo. On row 72 in modification-2.0.xml (the 1.0 has it too) there is "<spam class="smalltext">"

For those who use WYSIWYG Quick Reply mod the changes of Display.template.php seems are not needed (?), so you can delete them before installing the mod. It works well for me without them.

davidhs

Quote from: Hristo on July 06, 2013, 01:27:30 PM
I believe there is a small typo. On row 72 in modification-2.0.xml (the 1.0 has it too) there is "<spam class="smalltext">"
Yes, is a typo :( I fix this.

Quote from: Hristo on July 06, 2013, 01:27:30 PM
For those who use WYSIWYG Quick Reply mod the changes of Display.template.php seems are not needed (?), so you can delete them before installing the mod. It works well for me without them.
True, in the fields WYSIWIG the MOD does nothing. You can delete or not the code, it is all one.

davidhs

New version:
1.0.1   2013-07-07
------------------
! Typo in source code.

davidhs

New version:
1.0.2   2013-08-19
------------------
+ SMF compatibility: 2.0.5.

davidhs

New version:
1.0.3   2013-10-24
------------------
+ SMF compatibility: 1.1.19 and 2.0.6.

Jade Elizabeth

Hey :D

I'm having trouble getting it to work on my quick reply. Can you help me at all?
Once proud Documentation Writer and Help Squad Leader | Check out my new adult coloring career: Color With Jade/Patreon.

davidhs

Quote from: Jade Elizabeth on November 15, 2013, 12:15:26 AM
Hey :D

I'm having trouble getting it to work on my quick reply. Can you help me at all?
Sorry, I visited your forum but I do not see quick reply button.

Jade Elizabeth

Once proud Documentation Writer and Help Squad Leader | Check out my new adult coloring career: Color With Jade/Patreon.

davidhs

Sorry but... I do not see. (See attach image) ???

(I am a guest on your forum)

Jade Elizabeth

Once proud Documentation Writer and Help Squad Leader | Check out my new adult coloring career: Color With Jade/Patreon.

davidhs

I am login on your forum, I see quick reply button and count of characters works.  ???

See attach image.

Jade Elizabeth

Once proud Documentation Writer and Help Squad Leader | Check out my new adult coloring career: Color With Jade/Patreon.

davidhs

Quote from: Jade Elizabeth on November 18, 2013, 01:47:32 AM
It's not working on Chrome :/.
This may be a javascript problem with Chrome, I do not know. I use Firefox.

Jade Elizabeth

Are you able to look into it? I don't really know your mod so I'm not sure where to begin....maybe test your site on Chrome or something?
Once proud Documentation Writer and Help Squad Leader | Check out my new adult coloring career: Color With Jade/Patreon.

davidhs

Quote from: Jade Elizabeth on November 19, 2013, 03:36:51 AM
Are you able to look into it? I don't really know your mod so I'm not sure where to begin....maybe test your site on Chrome or something?
I installed Chrome and works (my local test site and your forum). I do not know because it does not work with you.

Have you test on other browsers?
Works on other areas? i.e create a PM or post.
Have you text with your browser but login with other account?

Shambles

Quote from: Jade Elizabeth
It's not working on Chrome :/.

I'm not a Chrome user, but just looking into the settings, check:

Settings > Advanced > Privacy > Content Settings > Javascript

Jade Elizabeth

Quote from: davidhs on November 19, 2013, 07:59:18 AM
Quote from: Jade Elizabeth on November 19, 2013, 03:36:51 AM
Are you able to look into it? I don't really know your mod so I'm not sure where to begin....maybe test your site on Chrome or something?
I installed Chrome and works (my local test site and your forum). I do not know because it does not work with you.

Have you test on other browsers?
Works on other areas? i.e create a PM or post.
Have you text with your browser but login with other account?

Hmm. It's working on the post pages, etc. I dunno why it wont on quick reply :(.



Quote from: Shambles on November 19, 2013, 08:17:43 AM
Quote from: Jade Elizabeth
It's not working on Chrome :/.

I'm not a Chrome user, but just looking into the settings, check:

Settings > Advanced > Privacy > Content Settings > Javascript

Of course I have JS on, my site uses it everywhere lol.
Once proud Documentation Writer and Help Squad Leader | Check out my new adult coloring career: Color With Jade/Patreon.

davidhs

New version:
1.0.4   2014-01-25
------------------
+ SMF compatibility: 2.0.7.

Westwegoman

Everything seems to upload fine but I have been getting this error in the error log when I add a picture to my gallery.



http://www.bayoustatefishing.com/community/index.php?action=gallery;sa=add
8: Undefined index: max_sig_characters
File: /community/Themes/default/GenericControls.template.php
Line: 34


Line 34 in that file appears to have been modified by this mod.
<div class="smalltext">', sprintf($txt['max_sig_characters'], $modSettings['max_messageLength']), ' <span id="editorLeft">', $modSettings['max_messageLength'], '</span></div>';

I've tried setting that to "0" to see if it changed anything but it didn't.

Any suggestions?

davidhs

I have not this error in logs of my test forum and my online forum.

What MOD do you use for gallery?
Can you see message Max characters: NNN; characters remaining: MMM bellow of textbox?

Westwegoman

I'm useing SMF Gallery Lite. I never noticed that it doesn't show below the text box. I've attached screen shot.

davidhs

My MOD (Characters remaining of post) does not work on SMF Gallery Lite.

"Characters remaining of post" adds
- a message below text box and
- code for count characters in all pages where this text box is used.

"SMF Gallery Lite" use this text box but, of course, no add code for count characters. And "SMF Gallery Lite" use this text box in many pages (that is, to count character would have to change many things in "SMF Gallery Lite").

It is easiest remove the message when the text box is used by "SMF Gallery Lite".
You can replace (on Themes/default/GenericControls.template.php, line 32)
if (!$editor_context['rich_active'] && !empty($modSettings['max_messageLength']))
by
if (!$editor_context['rich_active'] && !empty($modSettings['max_messageLength']) && isset($txt['max_sig_characters']))
But, if you want uninstall "Characters remaining of post" you must restore this line.





Jade Elizabeth

I'm getting that error too, but on this block of code:
<!-- BEGIN MOD CharsRemainingOfPost -->
' . (!empty($modSettings['max_messageLength']) ? ('<span class="smalltext">' . sprintf($txt['max_sig_characters'], $modSettings['max_messageLength']) . ' <span id="editorLeft2">...</span></span><br />') : '') . '
<!-- END MOD CharsRemainingOfPost -->
Once proud Documentation Writer and Help Squad Leader | Check out my new adult coloring career: Color With Jade/Patreon.

davidhs

Quote from: Jade Elizabeth on February 22, 2014, 05:37:25 AM
I'm getting that error too, but on this block of code:
<!-- BEGIN MOD CharsRemainingOfPost -->
' . (!empty($modSettings['max_messageLength']) ? ('<span class="smalltext">' . sprintf($txt['max_sig_characters'], $modSettings['max_messageLength']) . ' <span id="editorLeft2">...</span></span><br />') : '') . '
<!-- END MOD CharsRemainingOfPost -->

This code is in Display.template.php. Perhaps another mod uses this template?

You try this and tell me if it solves. Replace

' . (!empty($modSettings['max_messageLength']) ? ('<span class="smalltext">' . sprintf($txt['max_sig_characters'], $modSettings['max_messageLength']) . ' <span id="editorLeft2">...</span></span><br />') : '') . '

by

' . (!empty($modSettings['max_messageLength'] && isset($txt['max_sig_characters'])) ? ('<span class="smalltext">' . sprintf($txt['max_sig_characters'], $modSettings['max_messageLength']) . ' <span id="editorLeft2">...</span></span><br />') : '') . '

Jade Elizabeth

Once proud Documentation Writer and Help Squad Leader | Check out my new adult coloring career: Color With Jade/Patreon.

davidhs

Quote from: Jade Elizabeth on February 22, 2014, 07:04:13 AM
There's a syntax error...I can't find it myself :(.
:-[ I am sorry.

...by

' . (!empty($modSettings['max_messageLength']) && isset($txt['max_sig_characters']) ? ('<span class="smalltext">' . sprintf($txt['max_sig_characters'], $modSettings['max_messageLength']) . ' <span id="editorLeft2">...</span></span><br />') : '') . '

Jade Elizabeth

Ha ha no worries, it happens to me all the time. Hell I couldn't even fix it there - there is a lot going on, so please don't feel embarrassed! <3

Thanks heaps for the help :D. :-*
Once proud Documentation Writer and Help Squad Leader | Check out my new adult coloring career: Color With Jade/Patreon.



petejoh222

Thank you for this mod. Just installed it on my new 2.0.9 forum. Love knowing how many characters I have left, and I think most people do too! :)

davidhs

To moderators: Text to move to first post
QuoteSubject:
QuoteCharacters remaining of post, 1.0.4 (SMF 1.1-1.1.21, 2.0-2.0.10)
Body:
Quote
Link to Mod




Characters remaining of post

ABOUT...

Characters remaining of post, 1.0.4
© 2013-2015 by davidhs


This work is licensed under a Creative Commons Attribution 3.0 Unported License.

DESCRIPTION

Shows the maximum number of characters and remaining while writing a post, as in the user signature.

This is shown in:

  • Create/modify post (not WYSIWYG mode only).
  • Create/modify PM (not WYSIWYG mode only).
  • Quick reply.
  • Quick modification of post (does not shown the initial remaining number).


SMF COMPATIBILITY


  • SMF 1.1 to 1.1.21.
  • SMF 2.0 to 2.0.10.

DOWNLOAD

Link to MOD

MANUAL INSTALLATION

See http://wiki.simplemachines.org/smf/Manual_installation_of_mods

SUPPORT AND COMMENTS

In English: http://www.simplemachines.org/community/index.php?topic=506862.0
In Spanish: http://www.simplemachines.org/community/index.php?topic=504643.0

CHANGE LOG

Legend:   ! Fixed   + Added   - Removed   * Changed   @ Note

1.0.4   2014-01-25
------------------
+ SMF compatibility: 2.0.7.

1.0.3   2013-10-24
------------------
+ SMF compatibility: 1.1.19 and 2.0.6.

1.0.2   2013-08-19
------------------
+ SMF compatibility: 2.0.5.

1.0.1   2013-07-07
------------------
! Typo in source code.

1.0     2013-07-01
------------------
@ This work is licensed under a Creative Commons Attribution 3.0 Unported License http://creativecommons.org/licenses/by/3.0/
+ Maximum number of characters and remaining of post.
@ Only works in not WYSIWYG mode.
@ Does not shown the initial remaining number in quick modification of post.
+ SMF compatibility: 1.1 to 1.1.18.
+ SMF compatibility: 2.0 to 2.0.4.





Compatible with SMF 1.1.21 and 2.0.10.




davidhs

Compatible with SMF 2.0.14 and 2.0.15.

davidhs

Compatible with SMF 2.0.16 and 2.0.17.

shadav

this mod doesn't seem to work anymore, installed it and used the parse and checked all edits were done correctly

but it doesn't show up...only shows up on the quick modify, doesn't show up on full edit or when creating a new post....
even on default curve theme....
shame because it's a nice thing to have

davidhs

Quote from: shadav on June 11, 2020, 04:40:11 PM
this mod doesn't seem to work anymore, installed it and used the parse and checked all edits were done correctly

but it doesn't show up...only shows up on the quick modify, doesn't show up on full edit or when creating a new post....
even on default curve theme....
shame because it's a nice thing to have
I test this in my test forum (2.0.17, default theme) and online forum (2.0.17, own theme) and works (create, modify and quick edit post).

Do you have something in error log?
Can you see message Max characters: NNN; characters remaining: MMM bellow of textbox?

shadav

nothing in error logs and no nothing is displayed at all, except on the quick modify
checked all 4 themes i have installed, same issue (curve, greeny, mutant curve, nightbreeze)

davidhs

Quote from: shadav on June 12, 2020, 12:49:06 PM
nothing in error logs and no nothing is displayed at all, except on the quick modify
checked all 4 themes i have installed, same issue (curve, greeny, mutant curve, nightbreeze)
Perhaps you have other mod who modify code and my mod does not work.

Can you attach here these files?

Sources/Display.php
Sources/PersonalMessage.php
Sources/Post.php
Themes/default/Display.template.php
Themes/default/GenericControls.template.php

shadav

Quote from: davidhs on June 12, 2020, 04:38:02 PM
Quote from: shadav on June 12, 2020, 12:49:06 PM
nothing in error logs and no nothing is displayed at all, except on the quick modify
checked all 4 themes i have installed, same issue (curve, greeny, mutant curve, nightbreeze)
Perhaps you have other mod who modify code and my mod does not work.

Can you attach here these files?

Sources/Display.php
Sources/PersonalMessage.php
Sources/Post.php
Themes/default/Display.template.php
Themes/default/GenericControls.template.php

thank you, here's the files

davidhs

I am sorry, I do not see any error in your files, but you have (at least) one mod who add code to textarea of post editor: Tabbed smileys

I installed Tabbed smileys (0.3.7 and 0.3.99d) in my test forum but this not work (I did not see tabs in smileys), and my mod works.

Perhaps another mod?

My mod adds the counter of characters in two files:
- Display.template.php - for quick modify and quick reply (both with not smileys). I am sure both cases work in your forum, correct?
- GenericControls.template.php - for editor with smileys (used in create/modify post and pm). Any of these do not work, correct? Attach here an image of one of these.
(in the other files, on Source, my mod only adds access to language files)

The problem can be another mod who add code in editor with smileys. If you can, try to uninstall some mods (mods related with this).

Warning: I tried adapt my mod to SMF 2.1 but it do not work. Perhaps any of your mod adds code related with SMF 2.1...

shadav

here's the pictures
for some reason now today it seems it's not even working on the quick modify as it had been

yeah I had to edit tabbed smilies to get it to work, don't remember what all I did though, sorry

davidhs

Quote from: shadav on June 13, 2020, 03:09:01 PM
here's the pictures
for some reason now today it seems it's not even working on the quick modify as it had been

yeah I had to edit tabbed smilies to get it to work, don't remember what all I did though, sorry
I think works in your forum but:
- This mod does not work in WYSIWYG mode.
- In quick edit, at beginning counter show "..." instead of a number. When you modify text, number is shown.
Quote from: davidhs on July 01, 2013, 09:48:11 AMThis is shown in:

  • Create/modify post (not WYSIWYG mode only).
  • Create/modify PM (not WYSIWYG mode only).
  • Quick reply.
  • Quick modification of post (does not shown the initial remaining number).

shadav

hm, missed that....searched around found the setting Disable WYSIWYG editor and now it is working
sorry about that  :-[ ... thank you for all of your help and my stupidity
tbh i have no idea what wysiwyg is or does  :laugh:

davidhs

Quote from: shadav on June 13, 2020, 04:46:24 PM
hm, missed that....searched around found the setting Disable WYSIWYG editor and now it is working
sorry about that  :-[ ... thank you for all of your help and my stupidity
tbh i have no idea what wysiwyg is or does  :laugh:
You do not worry :D

About WYSIWYG: https://en.wikipedia.org/wiki/WYSIWYG

Advertisement: