Is there is any way to limit signature length?
Is there is any way to limit signature length?
0
Best Answers
-
422
MVP
You need to identify the var that controls signatures, i dont know it. Im on ipad having a smoko outside lol. @underdog or @peregrine or @x00 can help, they are geniususeseses
There was an error rendering this rich post.
0

Answers
There isn't a way to limit signature length, no.
:-( :-( I thanks @Todd
Surely you could using strlen
eg.
There was an error rendering this rich post.
A quick snippet I found online which you could implement.
<?php function cutAfter($string, $len = 30, $append = '...') { return (strlen($string) > $len) ? substr($string, 0, $len - strlen($append)) . $append : $string; } echo cutAfter('foo bar baz', 2)."\n"; echo cutAfter('foo bar baz', 10)."\n"; echo cutAfter('foo bar baz', 11)."\n"; echo cutAfter('foo bar baz', 6, '!!!')."\n"; ?>Outputs:
foo bar ba...
foo bar...
foo bar baz
foo!!!
There was an error rendering this rich post.
Or optionally: easiest method
There was an error rendering this rich post.
thanks @422 Please can you tell me what file i should edit? I could not find
$string = (strlen($string) > 13) ? substr($string,0,10).'...' : $string;You need to identify the var that controls signatures, i dont know it. Im on ipad having a smoko outside lol. @underdog or @peregrine or @x00 can help, they are geniususeseses
There was an error rendering this rich post.
if you are using the signature plugin and just using straight text.
this will cut the the sig length properly. With tags and images your results may vary.
around line 260 in the signatures.class.plugin.php change - $UserSig = $UserSignatures[$SourceUserID]; if ($HideImages) { to this. (replace the 10 with the number of chars you want). $UserSig = $UserSignatures[$SourceUserID]; $UserSig = substr($UserSig,0, 10); if ($HideImages) {BTW - @fh111 is an expert on truncation now - he can probably give you some tips now.
I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.
But the easiest and probably the best way if you are concerned about the number of lines the signature takes up. just use css and multiply the lines you want by the font-size to se the height.
for a one-line restriction - just change the signature.css in the design folder of the plugin and add a height parameter.
.UserSignature { border-top: 1px solid #595959; padding: 2px 0px; font-size: 11px; margin-top: 10px; height: 14px; }I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.