View Full Version : [RELEASE] Sig Length Limit
Trying to keep this simple, as I need it for my site now (some guy posted a 34 line, 7kb sig). Set $siglimit to the number of lines you want to be.
This is not particularly efficient, but it will limit sigs already in place. So... :p
showthread.php, find:
$signature= "\n__________________\n$userinfo[signature]";
Replace with:
$signature= "\n__________________\n";
$splitsig = explode("\n", $userinfo[signature]);
$siglimit = 6;
if (count($splitsig)>$siglimit) {
for ($i=0;$i<$siglimit;$i++) {
$signature .= "$splitsig[$i]\n";
}
} else {
$signature .= "$userinfo[signature]";
}
Tada! Remember to set $siglimit to what you want!
very nice, and simple too!
oh what a dilemma now :( my members have long sigs and they will roast me for implementing this hack :D
is there a way in the member profile and on sign up to let them know there is a sig line limit ?
couldn't you just add a line in your templates that says on the top that there is a sig limit
No - that wasn't the point of the hack. :p
Originally posted by Ed Sullivan
No - that wasn't the point of the hack. :p
yeah, that too!
its their problem
Originally posted by Ed Sullivan
No - that wasn't the point of the hack. :p ooooh ... i see :D
Hello Ed,
Thank you sooooo much. :)
Thanks Ed! Simple, yet effective. Took all of 30 seconds to "install" (if that's even the word for it) and works like a charm :)
just curious what sig line number did everyone use ? 10, 15, 20 lines ?
Personally, I was going to use 6. Although I'll have to see what my "advisors" say :) The whole reason this spawned was because of the ASCII art fad at my forums. Since I have a ... tag, my users have been making some nifty little ASCII art people. (They'd use periods and null characters to make blanks) Some were quite good, some sucked; some were big, some were small.
Well, this one guy decided to make a 34 line dragon, which I have to say was really cool. BUT, in 1024x768 it takes up the whole screen! He took it down, and replaced it with a 15 line thingy. Some other user has a big sword (10 lines) and a 5 line quote. Another one, whom I've let slide for too long, has a 15 line poem.
So, I would suggest 6, with 8 as a max.
I have 5...enough for an email, name, a couple of sites and a quote. :)
Basically what this change does is print a defineable error message if the user's signature exceeds the maximum amount of specified lines. So instead of just limiting the amount of lines, it totally removes offending signature and puts your error message in its place.
All I really did was add another variable ($sigerror), and eliminated the for() loop.
If you have Ed's hack installed already, just replace his code with:
$signature= "\n__________________\n";
$splitsig = explode("\n", $userinfo[signature]);
$siglimit = 6;
$sigerror = "Signature Too Long";
if (count($splitsig)>$siglimit) {
$signature .= "$sigerror";
} else {
$signature .= "$userinfo[signature]";
}
You can change $sigerror to be anything you want it to be; or in Ed's case, as MEAN as you want it to be ;).
-jim
*loves the tiny, yet very useful hacks*
[Edited by JimF on 09-17-2000 at 03:12 AM]
Sorry, OT here.
or in Ed's case, as MEAN as you want it to beYou realize like 1/4 of the people on my boards dislike me? :) But that's because they're complete idiots (ie, YELLING, huge sigs, cross-posting). Oh well, they deserve it. LOL
Originally posted by Ed Sullivan
Sorry, OT here.
or in Ed's case, as MEAN as you want it to beYou realize like 1/4 of the people on my boards dislike me? :) But that's because they're complete idiots (ie, YELLING, huge sigs, cross-posting). Oh well, they deserve it. LOL yikes :eek: makes admin/moderating fun i bet :)
hm...wel it gives you something to let steam loose on :)
Originally posted by Menno
hm...wel it gives you something to let steam loose on :) I do - that's why they don't like me. :)
Could a user circumvent the hack (if HTML was enabled) and used <br>'s instead? Also, if they let it wrap around there might not be any \n's to look for either, so they could enter in 30,000 characters and be ok. Perhaps a character limit could be enforced as well?
mrogish, you are absolutely correct. If the user just has one long sentence, it would circumvent the hack. Well, the original one. The change I made eliminates the entire signature.
I was fudging around and decided to try making a character limit, a total lines limit, as well as an image size limit for sigs, controllable from the Control Panel. I guess something would have to be added to make it look for <br>'s as well - might as well make it totally functional. :)
For some reason, I get more excited about tiny little hacks like this than I do for huge PM and Poll hacks and such ;).
-jim
mrogish-
Yes, you are completely correct. Keep in mind that the only reason I actually did this hack was to stop the ASCII art fad at my boards. And there you NEED to stick \n's in. A long quote would get around it though.
i think i've come across other boards with a signature limit too, but they do it by limiting the amount of characters (not by limiting the max characters in the form text box html, but instead checked by the script on submission)
do'able?
Im using 2.0.3 and I cant find what im spose to replace it with, Its not in showethread.php can anyone help?
Dakota
08-14-2001, 09:36 PM
It is most likely in admin/functions.php
As for the sig hack, I think its great. I have found a small work around for the sig image size. I just created a new BB code and the html specifies the dimensions of the image. the only thing about that is, if the image is a different size than whats specified, it stretches the image to the size specified.
TurboFC3S
08-17-2001, 12:12 PM
Originally posted by JimF
I was fudging around and decided to try making a character limit, a total lines limit, as well as an image size limit for sigs, controllable from the Control Panel. I guess something would have to be added to make it look for <br>'s as well - might as well make it totally functional. :)
Jim, that's perfect! Could you please keep us updated on progress with this?
Thanks,
Ryan
TurboFC3S
08-26-2001, 03:52 AM
Anybody?
Overgrow
09-07-2001, 08:08 PM
Good stuff.. I like the little simple stuff like this. Just installed (?) it today.
TurboFC3S
09-13-2001, 01:32 AM
I'm still hoping for JimF or someone to make it able to limit the size of images in sigs also ... that would make my life much easier!
Alienswede
09-21-2001, 02:00 PM
Like atrl I'm also looking for where to apply this to 2.0.3. It's not in showthread.php and not in admin/functions.php. Has the code changed for the signatures in 2.0.3?
If so, where would I apply this hack? My users have awfully long, pointless sigs that needs chopping... When the sigs are longer than the posts themselves you know it's getting out of hand.
Tom Dooley
09-23-2001, 02:58 PM
Hi,
it would be great if anybody know how to use this in 2.03
Wayne Luke
09-23-2001, 03:01 PM
Originally posted by Tom Dooley
Hi,
it would be great if anybody know how to use this in 2.03
There is a hack that does this same thing in the 2.X release forum.
Tom Dooley
09-23-2001, 03:16 PM
mybe i´m stupid but i cuold not find it, only one which is removed
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.