Signature Limit Mod

Snitz™ Forums 2000
https://forum.snitz.com/forumTopic/Posts/58931?pagenum=1
05 November 2025, 09:00

Topic


Sonic
Signature Limit Mod
23 July 2005, 12:09


idea from --> http://forum.snitz.com/forum/topic.asp?TOPIC_ID=55547

in this mod you can edit the maximal height from the signature anything that is higher will be hidden

__________________________________________________

to install:

go to admin pannel and add this to the database:

Code:
[INSERT]
CONFIG_NEW
(C_VARIABLE, C_VALUE)#('STRSIGMAXHEIGHT', 65)
[END]

open the config.asp and ad this:
search --> Dim strSignatures, strDSignatures,
replase --> Dim strSignatures, strDSignatures, strSIGMaxHeight, search --> strDSignatures = Application(strCookieURL & "STRDSIGNATURES")
add below --> strSIGMaxHeight = Application(strCookieURL & "STRSIGMAXHEIGHT")
open admin_config_features.asp and ad:
(you may modificate it because i speak german!)
ad after --> Err_Msg = ""

if Request.Form("strSIGMaxHeight") = "" then
Err_Msg = Err_Msg & "max. Signaturhöhe fehlt<br>"
elseif IsNumeric(Request.Form("strSIGMaxHeight")) = False then
Err_Msg = Err_Msg & "max. Signaturhöhe muß eine Nummer sein<br>"
elseif cLng(Request.Form("strSIGMaxHeight")) = 0 then
Err_Msg = Err_Msg & "max. Signaturhöhe darf <FONT class=font4>nicht 0</FONT> sein<br>"
end if

add after the allow signature option (in the middle of the page):
(You may modificate it because i have a other design of the page!)
<TR>
<TD><FONT class="font1">Max. Signaturen Höhe:</FONT></TD>
<TD colspan=2><FONT class="font0"><input type="text" name="strSIGMaxHeight" size="3" maxLength="3" value="<% = chkExistElse(strSIGMaxHeight,65) %>"> Pixel</FONT></TD>
</TR>

and at last open topic.asp:
search --> <font color=""" & strForumFontColor & """ face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """>" & formatStr(Reply_MemberSig) & "</span></font></td>" & vbNewLine & _

replace --> <font color=""" & strForumFontColor & """ face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """><div style=""max-height: " & strSIGMaxHeight & "px; height: expression( this.scrollHeight > " & strSIGMaxHeight & "? '" & strSIGMaxHeight & "px' : 'auto' ); overflow:hidden;""><span class=""spnMessageText"">" & formatStr(Reply_MemberSig) & "</span></div></font></td>" & vbNewLine & _

search --> <font color=""" & strForumFontColor & """ face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """><span class=""spnMessageText"">" & formatStr(Topic_MemberSig) & "</span></div></font></td>" & vbNewLine & _

replace --> <font color=""" & strForumFontColor & """ face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """><div style=""max-height: " & strSIGMaxHeight & "px; height: expression( this.scrollHeight > " & strSIGMaxHeight & "? '" & strSIGMaxHeight & "px' : 'auto' ); overflow:hidden;""><span class=""spnMessageText"">" & formatStr(Topic_MemberSig) & "</span></div></font></td>" & vbNewLine & _

this code work with netscape, mozilla, and with IE :-)
it is a little script... and can be modificated too...<

 

Replies ...


Sonic
24 July 2005, 06:14


update:
this script count the chars in the signatur and limit the textbox
amount of chars can be edit in the admin features page


--> save this script as: count_chars.js
Code:
var ns6=document.getElementById&&!document.all

function restrictinput(maxlength,e,placeholder){
if (window.event&&event.srcElement.value.length>=maxlength)
return false
else if (e.target&&e.target==eval(placeholder)&&e.target.value.length>=maxlength){
var pressedkey=/[a-zA-Z0-9\.\,\/]/ //detect alphanumeric keys
if (pressedkey.test(String.fromCharCode(e.which)))
e.stopPropagation()
}
}

function countlimit(maxlength,e,placeholder){
var theform=eval(placeholder)
var lengthleft=maxlength-theform.value.length
var placeholderobj=document.all? document.all[placeholder] : document.getElementById(placeholder)
if (window.event||e.target&&e.target==eval(placeholder)){
if (lengthleft<0)
theform.value=theform.value.substring(0,maxlength)
placeholderobj.innerHTML=lengthleft
}
}

function displaylimit(theform,thelimit){
var limit_text='<b><span id="'+theform.toString()+'">'+thelimit+'</span></b> Zeichen übrig'
if (document.all||ns6)
document.write(limit_text)
if (document.all){
eval(theform).onkeypress=function(){ return restrictinput(thelimit,event,theform)}
eval(theform).onkeyup=function(){ countlimit(thelimit,event,theform)}
}
else if (ns6){
document.body.addEventListener('keypress', function(event) { restrictinput(thelimit,event,theform) }, true);
document.body.addEventListener('keyup', function(event) { countlimit(thelimit,event,theform) }, true);
}
}

open --> inc_profile.asp add line 1 --> <SCRIPT language=JavaScript src="count_chars.js" type=text/javascript></SCRIPT>
search --> <textarea name=""Sig"" cols=""25"" rows=""4"">" & Trim(cleancode(strTxtSig)) & "</textarea></td>" & vbNewLine & _

replace --> <textarea name=""Sig"" cols=""25"" rows=""4"">" & Trim(cleancode(strTxtSig)) & "</textarea><br><script>displaylimit(""document.Form1.Sig""," & strSIGMaxChars & ")</script></td>" & vbNewLine & _

open admin_config_features.asp
add error messages: (near top)
if Request.Form("strSIGMaxChars") = "" then
Err_Msg = Err_Msg & "max. Zeichenanzahl für die Signatur fehlt<br>"
elseif IsNumeric(Request.Form("strSIGMaxHeight")) = False then
Err_Msg = Err_Msg & "max. Zeichenanzahl für die Signatur muß eine Nummer sein<br>"
elseif cLng(Request.Form("strSIGMaxHeight")) = 0 then
Err_Msg = Err_Msg & "max. Zeichenanzahl für die Signatur darf <FONT class=font4>nicht 0</FONT> sein<br>"
end if

add line to enter the max chars :
<input type="text" name="strSIGMaxChars" size="3" maxLength="3" value="<% = chkExistElse(strSIGMaxChars,200) %>"> Zeichen

and at last open the config.asp add this (red) --> Dim strSignatures, strDSignatures, strSIGMaxHeight, strSIGMaxChars,
and near top this -->
strSIGMaxChars = Application(strCookieURL & "STRSIGMAXCHARS")
oh of corse edit the database:

Code:
[INSERT]
CONFIG_NEW
(C_VARIABLE, C_VALUE)#('STRSIGMAXCHARS', 200)
[END]
<
laser
11 September 2005, 16:58


Can I ask for a few translations ?
max. Signaturhöhe muß eine Nummer sein --> max. signature height must be a number

max. Signaturhöhe darf nicht 0 sein --> max. signature height may not be 0

Max. Signaturen Höhe --> Max. signatures height


OK, I'll add it soon and check it out smile<
MarcelG
12 September 2005, 05:01


Originally posted by laser
Can I ask for a few translations ?
max. Signaturhöhe muß eine Nummer sein --> max. signature height must be a number

max. Signaturhöhe darf nicht 0 sein --> max. signature height may not be 0

Max. Signaturen Höhe --> Max. signatures height


OK, I'll add it soon and check it out smile
Correctly translated!
And sonic ; great mod!!!! This calls for basecode (at least the max sig height mod ; i'm not sure with the max characters mod) bigsmile<
rasure
12 September 2005, 08:16


Been trying to install this to test it and up till now this... value="<% = chkExistElse(strSIGMaxHeight,65) %>">

needs to be
value=""" & chkExistElse(strSIGMaxHeight,65) & """>
and I'm assuming the same will apply to this... value="<% = chkExistElse(strSIGMaxChars,200) %>"><
Sonic
12 September 2005, 10:56


- i convert the whole code to normal html and asp code
- because i won't use the response.write code
--> i often forget any --> " " in the code so i decided to write all code normal.... if you use the current version you may delete my --> <% %> tags and replace them with " "
---------------------------------

2 updates are following:

ad the code in --> pop_previev.asp for the signature line too

Code:
<div style=""max-height: " & strSIGMaxHeight & "px; height: expression( this.scrollHeight > " & strSIGMaxHeight & "? '" & strSIGMaxHeight & "px' : 'auto' ); overflow:hidden;""><span class=""spnMessageText"">" & formatStr(Topic_MemberSig) & "</span></div>

and the last update is following these days: to prevent somebody to "hack" the client side code (html code viewed by user)
where somebody can change the limit of the chars and store more chars at his profile... (this will working on firefox or netscape, with a certain plugin)

----------------------------------------------

the traslation is correct
don't forget to change in the count_chars.js the text
--> span id="'+theform.toString()+'">'+thelimit+'</span></b> Zeichen übrig'
to --> span id="'+theform.toString()+'">'+thelimit+'</span></b> chars left'<
Sonic
12 September 2005, 11:48


2nd update finished:

open --> pop_profile.asp
search 2 times--> if not IsValidURL(trim(Request.Form("Photo_URL"))) then
Err_Msg = Err_Msg & "<li>Photo URL: Invalid URL" & strURLError & "</li>"
end if
(ca. on line 1322 and 1640)

ad after 2 times-->
if strSignatures = "1" and Len(Request.Form("Sig")) > strSIGMaxChars then
Err_Msg = Err_Msg & "<li>Your Signature is too long</li>"
end if

finish smile
these days i make a complete mod in a zip file with doku<
laser
13 September 2005, 09:04


Well, I have installed it and it's working fairly well (renders the same in IE & FF as mentioned smile), but it still takes up the strSIGMaxHeight for everyone with a sig.

Oh well, small price to pay really smile<
MarcelG
13 September 2005, 09:56


Originally posted by laser
... but it still takes up the strSIGMaxHeight for everyone with a sig.
Oh well, small price to pay really smile
Is that so ??? That shouldn't be the case. I've got it running too at oxle, and as you can see here it doesn't take up the maxheight of 110 pixels for every sig.<
laser
13 September 2005, 17:30


hmmmm ... ok, I'll review the code.<
laser
13 September 2005, 17:37


Must have been an optical illusion, or I was looking at the wrong sig's tongue<
laser
14 September 2005, 07:06


sadsadI'm still getting some small (1 liner) sig's taking up WAY too much room. I have strSIGMaxHeight set at 110, which is what I want.<
rasure
14 September 2005, 07:13


Originally posted by laser
sadsadI'm still getting some small (1 liner) sig's taking up WAY too much room. I have strSIGMaxHeight set at 110, which is what I want.
I must admit I'm not having this problem with this mod installed. Nice piece of work btwsmile<
MarcelG
14 September 2005, 08:54


Originally posted by laser
sadsadI'm still getting some small (1 liner) sig's taking up WAY too much room. I have strSIGMaxHeight set at 110, which is what I want.
Can you provide me with a page to look at ? I might be able to help out<
laser
14 September 2005, 09:02


http://www.v8central.com/snitz3403/topic.asp?TOPIC_ID=12292

SETON_FPR5 & tobes have one line sig's

<
MarcelG
14 September 2005, 09:20


aha, I see what the issue is. Tobes has prefixed his sig with a [br], that's 1. But, there's another thing. The 'go to top' icon is in it's own table row.... I fixed that issue at oxle, but by default, it's on a different line as the sig (just as here at Snitz).<
laser
14 September 2005, 10:05


yeah, but there's still something more. I have removed tobes' br, but look at fordlover (bottom of the page), I think it's the DIV but I'll check the code.<
MarcelG
14 September 2005, 10:25


I've tried to show in the screenshot below what I think that's causing it. The darker grey part is the table row used to position the 'go to top' image, and takes up a lot of space. <
laser
14 September 2005, 10:45


I know where you're heading, but try these two things to check that it's the DIV and not the TR with the "top" image in it :

1. Click on the page and press Ctrl-A, the DIV gets highlighted as a block. 2. Place the mouse pointer just to the left of the "top" image (I used the very last post on the page - by fordlover). Then click and drag upwards to the HR that separates the post from the sig. Again, the DIV gets highlighted.
That's why I think it's the DIV. I can see the space the TR is using, but that's only 20 pixels high.<
Sonic
14 September 2005, 13:32


hi laser in your Forum the Signatures are:
Code:
<DIV style="OVERFLOW: hidden; WIDTH: auto; HEIGHT: auto; max-height: 110px; maxHeight: 110px; minmaxWidth: auto; minmaxHeight: auto" minmax_bound="true"><SPAN class=spnMessageText minmax_bound="true"><FONT size=1 minmax_bound="true">SIGNATUR TEXT</FONT></SPAN></DIV>

mine looks like:
Code:
<div style="max-height: 110px; height: expression( this.scrollHeight > 110? '110px' : 'auto' ); overflow:hidden;""><span class="spnMessageText">SIGNATUR TEXT</span></div>

you have many things twice
and some other javascript running --> minmax....
for my script you only need the lines mentioned on the 1st post...<
laser
14 September 2005, 17:24


That fixed it smile
I had removed everything except for the include statement for the minmax javascript file, works fantastically now smilecool<
mra
30 May 2006, 02:34


Any chance someone could show me where the following code goes in admin_config_features?
<TR>
<TD><FONT class="font1">Max. Signaturen Höhe:</FONT></TD>
<TD colspan=2><FONT class="font0"><input type="text" name="strSIGMaxHeight" size="3" maxLength="3" value="<% = chkExistElse(strSIGMaxHeight,65) %>"> Pixel</FONT></TD>
</TR>

cheers,
Matt<
Sonic
11 July 2006, 14:37


"
%>

<TR>
<TD><FONT class="font1">Max. Signaturen Höhe:</FONT></TD>
<TD colspan=2><FONT class="font0"><input type="text" name="strSIGMaxHeight" size="3" maxLength="3" value="<% = chkExistElse(strSIGMaxHeight,65) %>"> Pixel</FONT></TD>
</TR>
<%
Response.Write "
<
maduko
02 October 2006, 08:14


I would like to restrict the signature from showing more than once in a thread. Other boards use this approach and it seems like a good idea.<
laser
04 October 2006, 22:14


Interesting concept maduko, I've never seen it used though.
Do you really mean once per thread, or once per page - where a thread can have multiple pages ?<
© 2000-2021 Snitz™ Communications