Characters remaining of post

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

Previous topic - Next topic

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.




Westwegoman


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

Advertisement: