The forum of the forums
Welcome on the Forumotion Support Forum.

To take full advantage of everything offered by our forum, please log in if you are already a member or join our community if you're not yet....



Create a free forum like this one.
Users Tuesday Tips : Add a counter to the quick reply, extended reply, PM's & the signature. By Darren 5 5 1

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

Page 2 of 2 Previous  1, 2

View previous topic View next topic Go down

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

Post by Leeloo on April 12th 2011, 3:25 am

First topic message reminder :


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.

Leeloo
Administrator
Administrator

Female
Posts: 4284
Language: French, English
Points: 4733
Join date: 2007-09-04

Back to top Go down


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

Post by Darren1 on April 20th 2011, 6:01 am

scratch I believe you have understood fine Smile
Could you type something more there please?
Are you using my updated codes?

Darren1
Helper
Helper

Male
Posts: 11520
Age: 20
Language: Australian, English - UK
Location: Mass release of tutorials coming!
Points: 35863
Join date: 2008-07-09

http://testorial.forumotion.com

Back to top Go down

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

Post by bigugly11 on April 20th 2011, 6:25 am

Darren1 wrote: scratch I believe you have understood fine Smile
Could you type something more there please?
Are you using my updated codes?


I will try a new post.....



The only thing that happen was the cursor move more to the right each time I press the space bar. See image above....

I am using the updated codes.

Thanks,
bigugly11

bigugly11
Forumotion Member

Male
Posts: 82
Language: english
Location: Half way up a mountain in the Tennessee National Forrest!
Points: 196
Join date: 2010-05-14

http://easttnforum.forumotion.com/

Back to top Go down

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

Post by Garland on April 20th 2011, 6:41 am

this is what i meant darren(i use the updated codes) and still it dont count.

i guess i will post a pic too when im not bored ._.

Garland
Forumotion Member

Male
Posts: 58
Age: 20
Language: Greek
Location: Greece
Points: 87
Join date: 2009-09-09

Back to top Go down

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

Post by Guest on April 20th 2011, 12:35 pm

I really had no intention of posting here again, but this is ridiculous.

Darren, had you told me what your plans were for this script when you asked me about it two months ago, I would have gladly provided the four lines of code that would let the script work on all four board types. And in addition, installation would simply be adding it to the announcement block as opposed to messing around with several templates.

And here's the script you posted two months ago in a PM to me on Facebook Forum. Note the difference to what is in the first post. Those differences are why the script below will work, and the scripts in the first post will not...

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

Guest
Guest


Back to top Go down

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

Post by Garland on April 20th 2011, 3:42 pm

lol what dion posted is right the counters works fine now.....


thank you

Garland
Forumotion Member

Male
Posts: 58
Age: 20
Language: Greek
Location: Greece
Points: 87
Join date: 2009-09-09

Back to top Go down

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

Post by bigugly11 on April 21st 2011, 3:54 am

Garland wrote:lol what dion posted is right the counters works fine now.....


thank you


To get it to work correctly..I had to use dion's content in place of Darren's content and use Darren's tutorial as a guide to put it in each template as stated in Darren's tutorial....maybe this is because I do not know what dion meant by the statement "adding it to the announcement block".

Oh, I replace the 65,000 with 1000 in the...General > Template / Profile > Profile_edit_signature and it works properly.

My thanks to Darren & dion,
bigugly11

bigugly11
Forumotion Member

Male
Posts: 82
Language: english
Location: Half way up a mountain in the Tennessee National Forrest!
Points: 196
Join date: 2010-05-14

http://easttnforum.forumotion.com/

Back to top Go down

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

Post by Saxaca on April 21st 2011, 3:59 am

Dion's code is darren's first version of the code. What he meant by 'the announcement block' is the scrolling announcements.

Saxaca
Forumotion Member

Male
Posts: 539
Age: 100
Language: Markup.
Points: 2028
Join date: 2010-07-03

Back to top Go down

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

Post by bigugly11 on April 21st 2011, 4:28 am

Saxaca wrote: What he meant by 'the announcement block' is the scrolling announcements.


Thanks for that information.

That was my first thought..but disregarded the thought because it made no sense to me because I would not want a scrolling announcements like that.

Oh well, each to his own.

Thanks
bigugly11


Last edited by bigugly11 on April 23rd 2011, 4:02 am; edited 2 times in total (Reason for editing : add thanks)

bigugly11
Forumotion Member

Male
Posts: 82
Language: english
Location: Half way up a mountain in the Tennessee National Forrest!
Points: 196
Join date: 2010-05-14

http://easttnforum.forumotion.com/

Back to top Go down

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

Post by rhe on May 13th 2011, 3:47 pm

Not working.

rhe
Forumotion Member

Female
Posts: 968
Age: 26
Language: English
Points: 3181
Join date: 2009-11-01

Back to top Go down

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

Post by bigugly11 on May 13th 2011, 4:31 pm

rhe wrote:Not working.


To get it to work correctly..I had to use dion's content in place of Darren's content and use Darren's tutorial as a guide to put it in each template as stated in Darren's tutorial.

Oh, I replace the 65,000 with 1000 in the...General > Template / Profile > Profile_edit_signature and it works properly.

The end result can be seen and tested...@.... http://easttnforum.forumotion.com/post?f=2&mode=newtopic

My thanks to Darren & dion,
bigugly11

bigugly11
Forumotion Member

Male
Posts: 82
Language: english
Location: Half way up a mountain in the Tennessee National Forrest!
Points: 196
Join date: 2010-05-14

http://easttnforum.forumotion.com/

Back to top Go down

Page 2 of 2 Previous  1, 2

View previous topic View next topic Back to top


Permissions in this forum:
You cannot reply to topics in this forum