Author |
Topic |
Sonic
New Member
Germany
82 Posts |
Posted - 23 July 2005 : 12:09:06
|
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:
[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...< |
ich finds genial... bei uns ist es ratzekuz dunkel und bei dene alle heller nachmittag |
Edited by - Sonic on 23 July 2005 12:10:31 |
|
Sonic
New Member
Germany
82 Posts |
Posted - 24 July 2005 : 06:14:06
|
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
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:
[INSERT]
CONFIG_NEW
(C_VARIABLE, C_VALUE)#('STRSIGMAXCHARS', 200)
[END] < |
ich finds genial... bei uns ist es ratzekuz dunkel und bei dene alle heller nachmittag |
Edited by - Sonic on 24 July 2005 06:16:21 |
|
|
laser
Advanced Member
Australia
3859 Posts |
Posted - 11 September 2005 : 16:58:13
|
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 < |
|
|
MarcelG
Retired Support Moderator
Netherlands
2625 Posts |
Posted - 12 September 2005 : 05:01:36
|
quote: 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
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) < |
portfolio - linkshrinker - oxle - twitter |
Edited by - MarcelG on 12 September 2005 05:41:09 |
|
|
rasure
Junior Member
289 Posts |
Posted - 12 September 2005 : 08:16:49
|
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) %>">< |
Psychic & Spiritual Development Resources |
Edited by - rasure on 12 September 2005 08:18:39 |
|
|
Sonic
New Member
Germany
82 Posts |
Posted - 12 September 2005 : 10:56:29
|
- 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
<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'< |
ich finds genial... bei uns ist es ratzekuz dunkel und bei dene alle heller nachmittag |
Edited by - Sonic on 12 September 2005 12:31:47 |
|
|
Sonic
New Member
Germany
82 Posts |
Posted - 12 September 2005 : 11:48:44
|
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
these days i make a complete mod in a zip file with doku< |
ich finds genial... bei uns ist es ratzekuz dunkel und bei dene alle heller nachmittag |
Edited by - Sonic on 12 September 2005 12:31:05 |
|
|
laser
Advanced Member
Australia
3859 Posts |
Posted - 13 September 2005 : 09:04:00
|
Well, I have installed it and it's working fairly well (renders the same in IE & FF as mentioned ), but it still takes up the strSIGMaxHeight for everyone with a sig.
Oh well, small price to pay really < |
|
|
MarcelG
Retired Support Moderator
Netherlands
2625 Posts |
Posted - 13 September 2005 : 09:56:01
|
quote: Originally posted by laser
... but it still takes up the strSIGMaxHeight for everyone with a sig. Oh well, small price to pay really
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.< |
portfolio - linkshrinker - oxle - twitter |
|
|
laser
Advanced Member
Australia
3859 Posts |
Posted - 13 September 2005 : 17:30:36
|
hmmmm ... ok, I'll review the code.< |
|
|
laser
Advanced Member
Australia
3859 Posts |
Posted - 13 September 2005 : 17:37:09
|
Must have been an optical illusion, or I was looking at the wrong sig's < |
|
|
laser
Advanced Member
Australia
3859 Posts |
Posted - 14 September 2005 : 07:06:10
|
I'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
Junior Member
289 Posts |
Posted - 14 September 2005 : 07:13:46
|
quote: Originally posted by laser
I'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 btw< |
Psychic & Spiritual Development Resources |
Edited by - rasure on 14 September 2005 07:23:54 |
|
|
MarcelG
Retired Support Moderator
Netherlands
2625 Posts |
Posted - 14 September 2005 : 08:54:47
|
quote: Originally posted by laser
I'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< |
portfolio - linkshrinker - oxle - twitter |
|
|
laser
Advanced Member
Australia
3859 Posts |
|
MarcelG
Retired Support Moderator
Netherlands
2625 Posts |
Posted - 14 September 2005 : 09:20:39
|
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).< |
portfolio - linkshrinker - oxle - twitter |
Edited by - MarcelG on 14 September 2005 09:21:11 |
|
|
Topic |
|