[2.0.18] Signature Length Checker

All new MODs released in our MOD Database will be announced in here. All support for released MODs needs to take place in here. No new MODs will be accepted into the MOD Database for phpBB2
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

On February 1, 2009 this forum will be set to read only as part of retiring of phpBB2.
Post Reply

Rating:

Excellent!
1
50%
Very Good
0
No votes
Good
0
No votes
Fair
0
No votes
Poor
1
50%
 
Total votes: 2

Extensions Robot
Extensions Robot
Extensions Robot
Posts: 27954
Joined: Sat Aug 16, 2003 7:36 am

[2.0.18] Signature Length Checker

Post by Extensions Robot » Mon Nov 07, 2005 12:16 am

MOD Name: Signature Length Checker
Author: pentapenguin
MOD Description: This MOD will check the signature length in the Profile page.


MOD Version: 1.0.0

Download File: signature_length_checker_1.0.0.zip
mods overview page: View
File Size: 3358 Bytes

Security Score: 0

Support for this MOD needs to be asked within this topic. The phpBB Teams are not responsible or required to give anyone support for this MOD. By installing this MOD, the phpBB Support Team or phpBB MODifications Team may not be able to provide support.

This MOD has only been tested by the phpBB MOD Team with the phpBB version in the topic title. It may not work in any other versions of phpBB.
Last edited by Extensions Robot on Mon Apr 30, 2007 12:26 am, edited 1 time in total.
(this is a non-active account manager for the phpBB Extension Customisations Team)

User avatar
webmacster87
Former Team Member
Posts: 3758
Joined: Fri Jun 11, 2004 2:30 am
Location: San Mateo, CA
Name: Douglas Bell
Contact:

Post by webmacster87 » Wed Nov 16, 2005 5:00 am

MOD Validated/Released

Notes:
Adds a counter to the Edit Profile page which will count how many characters long your signature is as you type.

User avatar
pentapenguin
Former Team Member
Posts: 11030
Joined: Thu Jul 01, 2004 4:15 am
Location: GA, USA

Post by pentapenguin » Wed Nov 16, 2005 6:42 am

Thanks a lot Fountain of Apples and the MOD Team for validating this! :D

Beta version link for historical purposes only:
[2.0.18] Signature Length Checker

This MOD will allow the user to check their signature length in the edit profile page. There are up to four ways this MOD can be configured. You can set the message to be shown as "You have used 100 of 150 characters in your signature." or as "You have 25 characters remaining." You can also have the message shown directly below the signature box or in the browser's status bar. Just look at the instructions in the profile_add_body.tpl file for complete directions or feel free to ask.

Screenshots
"You have used 30 of 100 characters in your signature." type message:
Image

Alert when the maximum signature length has been reached:
Image

"You have 70 characters remaining." type message:
Image

Message displayed in the status bar:
Image

Code: Select all

##############################################################
## MOD Title: Signature Length Checker
## MOD Author: pentapenguin < pentapenguin #@at don't spam me@# bluebottle.com > (Jeremy Conley) http://www.pentapenguin.com
## MOD Description: This MOD will check the signature length in the Profile page.
## MOD Version: 1.0.0
## Installation Level: Easy
## Installation Time:  5 Minutes
## Files To Edit: 3
## includes/usercp_register.php
## language/lang_english/lang_main.php
## templates/subSilver/profile_add_body.tpl
##
## Included Files: n/a
##
## License: http://opensource.org/licenses/gpl-license.php GNU General Public License v2
##############################################################
## For security purposes, please check: http://www.phpbb.com/mods/
## for the latest version of this MOD. Although MODs are checked
## before being allowed in the MODs Database there is no guarantee
## that there are no security problems within the MOD. No support
## will be given for MODs not found within the MODs Database which
## can be found at http://www.phpbb.com/mods/
##############################################################
## Author Notes:
## Instructions for use: go to your profile and underneath the signature box will be a new line with how many characters are remaining.
## Be sure to look at the configuration options you can set in profile_add_body.tpl
## You can customize this MOD to your liking by just changing two short lines.
## Please do ask if you have any questions on the two config options.
##
## This MOD is EasyMOD friendly! (http://area51.phpbb.com/phpBB/viewforum.php?sid=&f=17)
##
## For additional language and style downloads, please visit http://www.pentapenguin.com/forum/viewtopic.php?t=1439
##
## Optional step: if you have CyberAlien's eXtreme Styles MOD (http://www.phpbb.com/phpBB/viewtopic.php?t=125251),
## you can copy the file in contrib/admin/xs_signature_length_checker.cfg to admin/xs_signature_length_checker.cfg and you will
## be automatically notified if there's an update available when you use the "check for updates" function. 
##############################################################
## MOD History:
##   2005-11-06 - Version 1.0.0
##      - Initial Release
##
##############################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
##############################################################
Please ask if you have any questions!
Enjoy! :mrgreen:
Support Resources: Support Request Template
If you need professional assistance with your board, please contact me for my reasonable rates.

User avatar
3Di
Former Team Member
Posts: 14065
Joined: Mon Apr 04, 2005 11:09 pm
Location: Milan (IT) Frankfurt (DE)
Name: Marco
Contact:

Post by 3Di » Wed Nov 16, 2005 8:31 pm

does that mod have a signature preview?
Please PM me only to request paid works. Thx.
Want to compensate me for my interest? Donate
My development's activity º PhpStorm's proud user
Extensions, Scripts, MOD porting, Update/Upgrades
👨‍🏫 | Take a tour to | The Studio | 👨‍🏫

User avatar
pentapenguin
Former Team Member
Posts: 11030
Joined: Thu Jul 01, 2004 4:15 am
Location: GA, USA

Post by pentapenguin » Wed Nov 16, 2005 8:49 pm

3Di wrote: does that mod have a signature preview?

Hi.
No it doesn't.
This MOD just says how many characters you have left in your signature.
However markus_petrux has a MOD for that: [BETA] Async & Dynamic Post/Signature Preview with DHTML
Support Resources: Support Request Template
If you need professional assistance with your board, please contact me for my reasonable rates.

User avatar
3Di
Former Team Member
Posts: 14065
Joined: Mon Apr 04, 2005 11:09 pm
Location: Milan (IT) Frankfurt (DE)
Name: Marco
Contact:

Post by 3Di » Wed Nov 16, 2005 9:46 pm

thank you.. :)
Please PM me only to request paid works. Thx.
Want to compensate me for my interest? Donate
My development's activity º PhpStorm's proud user
Extensions, Scripts, MOD porting, Update/Upgrades
👨‍🏫 | Take a tour to | The Studio | 👨‍🏫

User avatar
pentapenguin
Former Team Member
Posts: 11030
Joined: Thu Jul 01, 2004 4:15 am
Location: GA, USA

Post by pentapenguin » Fri Nov 18, 2005 10:33 pm

No problem. ;)
Support Resources: Support Request Template
If you need professional assistance with your board, please contact me for my reasonable rates.

indiebandradio
Registered User
Posts: 60
Joined: Fri Jun 24, 2005 5:15 am

Post by indiebandradio » Sun Dec 04, 2005 2:59 am

Whenever I go to type anything into the box I get an "Object expected" JS error... I installed by hand, not sure what's up. Any ideas?

edit: fixed

User avatar
drumstix42
Registered User
Posts: 1100
Joined: Tue Sep 24, 2002 11:01 pm
Location: NJ
Contact:

Post by drumstix42 » Sun Dec 04, 2005 5:05 am

Nice mod, works great :)
Need a phpBB update or mod installed? PM me for any questions and pricing!
HostMonster.com (Unlimited Space, Unlimited Transfer, Unlimited Domains, $6.95/month )

User avatar
pentapenguin
Former Team Member
Posts: 11030
Joined: Thu Jul 01, 2004 4:15 am
Location: GA, USA

Post by pentapenguin » Fri Dec 09, 2005 4:21 pm

indiebandradio wrote: Whenever I go to type anything into the box I get an "Object expected" JS error... I installed by hand, not sure what's up. Any ideas?

edit: fixed

Hi.
Was it something on my end or your end?
Support Resources: Support Request Template
If you need professional assistance with your board, please contact me for my reasonable rates.

djdadevil
Registered User
Posts: 56
Joined: Thu Mar 23, 2006 8:37 pm
Location: Maastricht/ Holland
Contact:

Post by djdadevil » Tue Mar 28, 2006 5:33 pm

Can this mod be implemented within the Profile Control Panel Mod? If so? How-To???

In wait of answer I remain!

Your sincerrely,

djdadevil
Don't Stop That Body Rock, Don't Stop That Party!

User avatar
drumstix42
Registered User
Posts: 1100
Joined: Tue Sep 24, 2002 11:01 pm
Location: NJ
Contact:

Post by drumstix42 » Thu Mar 30, 2006 12:19 am

djdadevil wrote: Can this mod be implemented within the Profile Control Panel Mod? If so? How-To???

In wait of answer I remain!

Your sincerrely,

djdadevil


Just figured this out as I went...

=================================

Open: language/lang_english/lang_extend_pcp_addons.php

Find:

Code: Select all

?>
Before, Add:

Code: Select all

// Start Signature Length Checker MOD
$lang['Sig_x_of_y_chars_used'] = 'You have used %d1 of %d2 characters in your signature.'; // e.g. You have used 10 of 100 characters in your signature.
$lang['Sig_x_chars_remaining'] = 'You have %d1 characters remaining.'; // e.g. You have 10 characters remaining.
$lang['Sig_no_chars_left'] = 'You have no characters left for your signature.';
// End Signature Length Checker MOD

=================================


Open: profilcp/profilcp_profil_signature.php

Find:

Code: Select all

		'L_BBCODE_CLOSE_TAGS'	=> $lang['Close_Tags'],
		'L_STYLES_TIP'			=> $lang['Styles_tip'],
After, Add:

Code: Select all

		// Start Signature Length Checker MOD
		'L_SIG_X_OF_Y_CHARS_USED' => $lang['Sig_x_of_y_chars_used'],
		'L_SIG_X_CHARS_REMAINING' => $lang['Sig_x_chars_remaining'],
		'L_SIG_NO_CHARS_LEFT' => $lang['Sig_no_chars_left'],
		'MAX_SIG_CHARS' => $board_config['max_sig_chars'],
		// End Signature Length Checker MOD

=================================


Open: templates/subSilver/profilcp/profil_signature_body.tpl

Find:

Code: Select all

<table cellpadding="0" cellspacing="10" border="0" width="100%">
After, Add: (note: mod autor; this Javascript code differs from the code for the vanilla profile.tpl)

Code: Select all

<script language="JavaScript" type="text/javascript">
<!--
// Begin Configuration Section
// Set the number below to 1 for a "You have used 100 of 150 characters in your signature." type message.
// Set to 2 for a "You have 25 characters remaining." type message.
var message_text = 1;

// Set the number below to 1 for the message to show underneath the signature box (recommended).
// Set to 2 for the message to show in the status bar of the browser.
var message_type = 1;

// End Configuration Section

var max_sig_chars = {MAX_SIG_CHARS};
var l_sig_x_of_y_chars_used = "{L_SIG_X_OF_Y_CHARS_USED}";
var l_sig_x_chars_remaining = "{L_SIG_X_CHARS_REMAINING}";
var l_sig_no_chars_left = "{L_SIG_NO_CHARS_LEFT}";
var l_message = "";

onload = function()
{
	var chars_used = window.document.post.message.value.length;
	var chars_remaining = max_sig_chars - chars_used;

	if ( message_text == 1 )
	{
		l_message = l_sig_x_of_y_chars_used;
		l_message = l_message.replace('%d1', chars_used);
		l_message = l_message.replace('%d2', max_sig_chars);
	}

	else if ( message_text == 2 )
	{
		l_message = l_sig_x_chars_remaining;
		l_message = l_message.replace('%d1', chars_remaining);
	}

	else
	{
		l_message = l_sig_x_of_y_chars_used;
		l_message = l_message.replace('%d1', chars_used);
		l_message = l_message.replace('%d2', max_sig_chars);
	}
	
	if ( message_type == 1 )
	{
		window.document.post.characters_left.value = l_message;
	}
	
	else if ( message_type == 2 )
	{
		window.status = l_message;
	}
	
	else
	{
		window.document.post.characters_left.value = l_message;
	}
}

function remaining_characters()
{
	var chars_used = window.document.post.message.value.length;
	var chars_remaining = max_sig_chars - chars_used;
	var message = window.document.post.message.value;
	
	if ( chars_used > max_sig_chars )
	{
		window.document.post.message.value = message.substring(0, max_sig_chars);
		chars_remaining = 0;
		chars_used = max_sig_chars;
		alert(l_sig_no_chars_left);
	}
	
	if ( message_text == 1 )
	{
		l_message = l_sig_x_of_y_chars_used;
		l_message = l_message.replace('%d1', chars_used);
		l_message = l_message.replace('%d2', max_sig_chars);
	}

	else if ( message_text == 2 )
	{
		l_message = l_sig_x_chars_remaining;
		l_message = l_message.replace('%d1', chars_remaining);
	}

	else
	{
		l_message = l_sig_x_of_y_chars_used;
		l_message = l_message.replace('%d1', chars_used);
		l_message = l_message.replace('%d2', max_sig_chars);
	}
	
	if ( message_type == 1 )
	{
		window.document.post.characters_left.value = l_message;
	}
	
	else if ( message_type == 2 )
	{
		window.status = l_message;
	}
	
	else
	{
		window.document.post.characters_left.value = l_message;
	}
}
//-->
</script>
Find:

Code: Select all

<textarea name="message" rows="15" cols="35" wrap="virtual" style="width:600px" tabindex="3" class="post" onselect="storeCaret(this);" onclick="storeCaret(this);" onkeyup="storeCaret(this);">{MESSAGE}</textarea>
REPLACE WITH:

Code: Select all

<textarea name="message" rows="15" cols="35" wrap="virtual" style="width:600px" tabindex="3" class="post" onkeydown="remaining_characters();" onselect="storeCaret(this);" onclick="storeCaret(this);" onkeyup="storeCaret(this); remaining_characters();">{MESSAGE}</textarea>
After, Add: (New Line)

Code: Select all

		<script language="JavaScript" type="text/javascript">
		<!--
		if ( message_type == 1 )
		{
			window.document.write('<br><input type="text" name="characters_left" value="" readonly="readonly" size="45" maxlength="100" style="width: 450px; font-size: 10px;" class="helpline" /><br />');
		}
		//-->
		</script>

=================================


And there you have it. Should work great.
Need a phpBB update or mod installed? PM me for any questions and pricing!
HostMonster.com (Unlimited Space, Unlimited Transfer, Unlimited Domains, $6.95/month )

rAdic
Registered User
Posts: 426
Joined: Mon Apr 25, 2005 11:32 pm
Contact:

Post by rAdic » Thu Mar 30, 2006 7:51 am

this sounds like a great idea for a mod, will be sure to try this in the future, thanks!.
The Australian Forums - Australia Discussion Forum - Discuss Australia topics or generally anything

djdadevil
Registered User
Posts: 56
Joined: Thu Mar 23, 2006 8:37 pm
Location: Maastricht/ Holland
Contact:

Post by djdadevil » Thu Mar 30, 2006 11:52 am

drumstix42: THANK YOU VERY MUCH!!! WORKED LIKE A CHARM!!!!

btw: it's not

Code: Select all

templates/subSilver/profilcp/profil_signature_body.tpl 
But;

Code: Select all

profilcp/profil_signature_body.tpl
;)

But many thanks again, its very usefull for people who don't understand that there signature can't be longer at a certain amount of characters, cause it isn't displayed, but now it is!!! many thanks again!

Your sincerely,

djdadevil
from The Netherlands.
Don't Stop That Body Rock, Don't Stop That Party!

User avatar
drumstix42
Registered User
Posts: 1100
Joined: Tue Sep 24, 2002 11:01 pm
Location: NJ
Contact:

Post by drumstix42 » Sat Apr 01, 2006 12:06 am

Uhhh. it should be templates/subSilver/profilcp/profil_signature_body.tpl
But whatever worked for ya mate ;)
Need a phpBB update or mod installed? PM me for any questions and pricing!
HostMonster.com (Unlimited Space, Unlimited Transfer, Unlimited Domains, $6.95/month )

Post Reply

Return to “[2.0.x] MOD Database Releases”