Users Tuesday Tips : Add a counter to the quick reply, extended reply, PM's & the signature. By Darren

Leeloo at 11h25
12
Apr
2011

Notice: This tutorial can only be preformed by Founders, whilst in the Founding account.
After Saving these edits, when an update is released, you will be required to manually add the new template codes in yourself (Otherwise you will have to delete the customizations and re-add them)


This tutorial will provide you the ability to add the counter to the quick reply, extended reply, PM's & the signature.
The counter can only read the non-WYSIWYG Mode.

Forum Version: PunBB

Adding a count in the signature

1) Head to Display > Templates > Profile > Profile_Edit_Signature.
Locate this code: {SIGNATURE_EDIT}
In the line ABOVE it, insert this script.
Code:
<script>jQuery(document).ready(function() {
jQuery('#text_editor_textarea').before('Characters Used: - of 1000; Number of characters left: -;').keyup(function() {
tet = jQuery('#text_editor_textarea').val();
jQuery('#sig_count').html(tet.length);
jQuery('#sig_recoursive').html(1000- tet.length);
});
});</script>


Save & publish the template.
Now you may view your new counter in the signature.


2) Adding a count in the extended reply box.
Templates / Post & Private message.
Locate the code: , which should be 3 lines above: {L_MESSAGE}
and insert this code, in the line ABOVE the first code.
Code:
<script>jQuery(document).ready(function() {
jQuery('#text_editor_textarea').before('Characters Used: - of 65,000; Number of characters left: -;').keyup(function() {
tet = jQuery('#text_editor_textarea').val();
jQuery('#sig_count').html(tet.length);
jQuery('#sig_recoursive').html(65000- tet.length);
});
});</script>



Now save & Publish it.
Now you can see your Counter in the extended reply editor Very Happy
3) Now head to the template called "Posting_body_wysiwyg"
Locate this code: <tr valign="top">
Insert our script in the line ABOVE it

Code:
<script>jQuery(document).ready(function() {
jQuery('#text_editor_textarea').before('Characters Used: - of 65,000; Number of characters left: -;').keyup(function() {
tet = jQuery('#text_editor_textarea').val();
jQuery('#sig_count').html(tet.length);
jQuery('#sig_recoursive').html(65000- tet.length);
});
});</script>


Now save & publish Very Happy

Note: After that last modification, the counter is now in the private messages.
There's no additional mods necessary there Wink
4) In the Quick Reply Box.
Templates / General / Viewtopic_body.
Locate this code: {QUICK_REPLY_FORM}
and in the line ABOVE it, insert this code:
Code:
<script>jQuery(document).ready(function() {
jQuery('#text_editor_textarea').before('Characters Used: - of 65,000; Number of characters left: -;').keyup(function() {
tet = jQuery('#text_editor_textarea').val();
jQuery('#sig_count').html(tet.length);
jQuery('#sig_recoursive').html(65000- tet.length);
});
});</script>


Now, save & publish it.
You can now see it in the Quick reply

Now, that is the end of all the modifications for the character counter in PunBB.

Sit back, and check 'em out Very Happy





Forum Version: PHPBB2
Have I said that PHPBB2 templates are really annoying yet?

1) In the signature
General > Template / Profile > Profile_edit_signature.
Locate the line: {SIGNATURE_EDIT}
and in the line ABOVE it, add this script
Code:
<script>jQuery(document).ready(function() {
jQuery('#text_editor_textarea').before('Characters Used: - of 1000; Number of characters left: -;').keyup(function() {
tet = jQuery('#text_editor_textarea').val();
jQuery('#sig_count').html(tet.length);
jQuery('#sig_recoursive').html(1000- tet.length);
});
});</script>


Save & publish the template.

2) Extended reply box

Templates > Post & Private messages > Posting Body
Locate the code: <!-- BEGIN switch_quote_limit -->
In the line ABOVE it, add the script:
Code:
<script>jQuery(document).ready(function() {
jQuery('#text_editor_textarea').before('Characters Used: - of 65,000; Number of characters left: -;').keyup(function() {
tet = jQuery('#text_editor_textarea').val();
jQuery('#sig_count').html(tet.length);
jQuery('#sig_recoursive').html(65000- tet.length);
});
});</script>


Save & publish.

3) Now were in the same room, but the template posting_body_wysiwyg .
Locate the code: <!-- BEGIN switch_quote_limit -->
and in the line ABOVE it, add the script:
Code:
<script>jQuery(document).ready(function() {
jQuery('#text_editor_textarea').before('Characters Used: - of 65,000; Number of characters left: -;').keyup(function() {
tet = jQuery('#text_editor_textarea').val();
jQuery('#sig_count').html(tet.length);
jQuery('#sig_recoursive').html(65000- tet.length);
});
});</script>


Now, save & publish.

Exclamation In PHPBB2 we need to add a script for the private messages, we will do that now.

4) Same room again, but template privmsg_preview
Locate the line: <td class="row1" colspan="2" valign="top"><div class="postbody">{MESSAGE}</div></td>
Code:
<script>jQuery(document).ready(function() {
jQuery('#text_editor_textarea').before('Characters Used: - of 65,000; Number of characters left: -;').keyup(function() {
tet = jQuery('#text_editor_textarea').val();
jQuery('#sig_count').html(tet.length);
jQuery('#sig_recoursive').html(65000- tet.length);
});
});</script>


Save & publish.



5) In the Quick Reply Box.
Templates / General / Viewtopic_body.
Locate this code: {QUICK_REPLY_FORM}
and in the line ABOVE it, insert this code:
Code:
<script>jQuery(document).ready(function() {
jQuery('#text_editor_textarea').before('Characters Used: - of 65,000; Number of characters left: -;').keyup(function() {
tet = jQuery('#text_editor_textarea').val();
jQuery('#sig_count').html(tet.length);
jQuery('#sig_recoursive').html(65000- tet.length);
});
});</script>



Now, save & publish it.
You can now see it in the Quick reply


I hope you now enjoy your new tool, and remember, if you have any problems, feel free to use the Support Section! Smile


Thanks,
Darren.
1 littlelaurence, on 12/04/2011 at 11h41
Great, but why can't we edit phpbb3 templates? It seems somewhat unfair.
2 hicheel, on 12/04/2011 at 11h43
goood tip
3 Garland, on 12/04/2011 at 18h44
looks like you need to add the locate lines as i dont see any (i speak for PHPBB2)

also i added the quick reply counter but it seems to have one problem... it dont count lol
4 lisa1302, on 12/04/2011 at 19h16
ok, possible dumb question, but what is a counter for? What does it count?
5 Base, on 12/04/2011 at 19h17
lisa1302 wrote:ok, possible dumb question, but what is a counter for? What does it count?


It counts the number of characters in a post. This allows you to see how many characters you've used up in a post. Wink
6 Kiekeboe, on 12/04/2011 at 19h35
Is it possible to program it so that it counts words?
7 lisa1302, on 12/04/2011 at 19h41
Base wrote:
lisa1302 wrote:ok, possible dumb question, but what is a counter for? What does it count?


It counts the number of characters in a post. This allows you to see how many characters you've used up in a post. Wink


ohhhhh sounds fun Laughing
8 MrMario, on 12/04/2011 at 22h34
Half of the locate this code are missing. fufufu
9 Tilum, on 12/04/2011 at 23h14
I thought i was just being stupid.. XD

~ Tilum
10 hoodedwarbler12, on 13/04/2011 at 02h20
I don't see where to put the second two codes!
11 bigugly11, on 13/04/2011 at 16h45
Base wrote:
lisa1302 wrote:ok, possible dumb question, but what is a counter for? What does it count?


It counts the number of characters in a post. This allows you to see how many characters you've used up in a post. Wink


What is the purpose of counting the number of characters in the quick reply, extended reply, PM's & the signature ? scratch

I do not remember any restrictions on number of characters
that can be used in these phpbb2 areas.... Embarassed
12 Base, on 13/04/2011 at 17h07
I believe that the restriction is 65000 characters. Wink
13 Saxaca, on 13/04/2011 at 18h21
It'd be no problem adding these scripts to the Invision & phpBB3 board versions.. I thought you knew that, Darren?
14 sign da tits, on 13/04/2011 at 20h06
they don't work, some of the "Locate this code:" are missing. Fix please!
15 Darren1, on 16/04/2011 at 04h29
Sorry about this guys, somehow it didn't copy/paste over.
I'm passing the corrections over to MrMario right now!

Garland, hit the a/A button, as I stated in the tut, it only works with the WYSIWYG Mode deactive Wink

Sax, I couldn't get the script I wrote for IPB & PHPBB3 to work so I didn't do it.
Sorry guys
16 YoshiGM, on 16/04/2011 at 04h30
Thank You.

This Tutorial is very helpful ;D
17 Garland, on 18/04/2011 at 00h39
sorry to say it darren but at least the quick reply (as there are no codes to others) the counter wont count and yes the WYSIWYG is off
18 bigugly11, on 18/04/2011 at 15h30
Darren1 wrote:Sorry about this guys, somehow it didn't copy/paste over.
I'm passing the corrections over to MrMario right now!


Where is MrMario and the correction?
19 MrMario, on 18/04/2011 at 15h32
I'm right here waiting for the corrections.
20 bigugly11, on 18/04/2011 at 15h57
MrMario wrote:I'm right here waiting for the corrections.


Similar topics
I am a stickler for proper spelling. It would be a good idea to have a spell checker added to the sites so that you can check the spelling of your post before submitting it.
In the Quick reply box I want to add Background with the text of my forum.
How do I make the quick reply thing it's annoying when I have to click "Post Reply" first
12
See also
more_less
Informations

39 Replies For the topic :
"Users Tuesday Tips : Add a counter to the quick reply, extended reply, PM's & the signature. By Darren"

This topic has been viewed 9699 times.

Last message :
12/04/2011 at 11h25 by "Leeloo"