View Full Version : Signature Limit Control (Lines & Images)
Castel
11-07-2001, 10:00 PM
Yes, another signature limit hack. But with a little twist :). After installing PPN's excellent Sig Editor (https://vborg.vbsupport.ru/showthread.php?s=&threadid=32086) hack, I felt the "suspended" signature option needed to have an enforcer of some sort. I know from experience that when I edited signatures in the past (mostly for being rediculously long) the user just turns around and puts the old sig back up.
I search the board and one of the old signature limits hacks has been removed by the author and others were outdated, so here we go.
This hack will limit the line breaks in the signature but also splits the image limit setting in 2, so you can have different image limits for posts and signatures. So the smilie limit in posts doesn't have to suffer if you are trying to curb signature image abuse :), and I believe it has been requested here as well in the past.
Both settings can be configured in the Admin Control Panel. Don't forget to back up all the goods before installing:D
Castel
11-07-2001, 11:54 PM
Screenshot of the settings in the admin control panel
DarkReaper
11-08-2001, 01:14 AM
Is there any way to do a size-check on the images they have in their signature, and limit the size?
Frank-kun
11-08-2001, 02:14 PM
Hmm...a bit odd...I installed the hack and it seemed to work all right, but when I tried to edit my profile and push the sig limit, it gave me a blank template - i.e. there was no fetching of the template text to put in. I've attached a screenshot (I cropped it just to show the kind of screen I'm getting).
Any idea on what I might have done wrong? As far as I know I think I did everything correctly.
EDIT: Well, I fixed the problem temporarily by making the function to fetch the template point to the "toomanyimages" template, which I know works. This makes me think I did something wrong when making my templates, but I can't figure out what. I'm all working now, but if someone could give me insight on what I may have done wrong with creating these new templates, that would be great.
BTW, great hack ^_^
Castel
11-09-2001, 09:19 PM
Maybe you made a typo in the name of the template when you created it?
Kumaro
11-09-2001, 11:32 PM
This hack installed and worked perfectly! Great Hack! Thanx
White Chocobo
11-11-2001, 01:23 AM
I accidently installed this twice. So now there's 2 extra rows for the settings. Is there a way to fix this? Like uninstall or something?
Kathy
11-11-2001, 01:32 AM
This worked great! I installed this and managed to get the templates created and everything working. Thanks!
I've needed a way to limit the signatures and images. I appreciate this hack alot!
Castel
11-11-2001, 10:39 AM
Originally posted by White Chocobo
I accidently installed this twice. So now there's 2 extra rows for the settings. Is there a way to fix this? Like uninstall or something?
Easiest way woudl probably to remove the duplicates from the setting table using phpMyAdmin
Brian Cruz
11-17-2001, 06:59 PM
Great hack! I got it working perfectly on my forums.
I have a question though... is there a way to put a character limit on each line in the signature? I'm afraid that people will try to get around the line limit by having hundreds of characters on each line.
Castel
11-18-2001, 07:20 AM
It is perfectly possible to count characters of course, but the problem is that this will count characters in image URLs as well. Let's say you would put a 60 character limit per line and the user has 3 smilies on that line for example, that would be the limit of that line.
It would be very unpractical to first exclude all smilies URLs from the string in order to count characters.
black
11-19-2001, 04:06 AM
i installed the hack and it works great but is there a way I can update all the threads to make the Hack take control cause after installing it, i still seen alot of members with long signatures
Radon3k
11-19-2001, 06:56 AM
Great job man! :)
Castel
11-21-2001, 04:27 PM
Originally posted by black
i installed the hack and it works great but is there a way I can update all the threads to make the Hack take control cause after installing it, i still seen alot of members with long signatures
I suggest you use PPN's sig editor hack so all your mods can reset signatures on the fly. My board is fairly busy (I have a bout 25 moderators) and in a matter of 2-3 days pretty much every signature was within the line/image limit.
Definately beats going into the admin control panel and resetting users's sig one by one.
Could I install this hack in conjunction with Signature-Editor (http://vbulletin.org/forum/showthread.php?s=&threadid=12282) hack?
Castel
12-05-2001, 06:15 AM
If you are talking about PPN's hack, yes. As I mentioned I have both installed.
Not PPN's hack, the other is Signature Preview for users by Fryzid, it has lines limited too so I'm wondering if it'd work with yours.
Sadie Frost
12-14-2001, 01:46 PM
Great hack! :)
Would there be any way to limit the signature by total height (ie in pixels)? Because if I allow, say, 4 rows, the user could still use 4 huge banners. I'd much rather be able to give them a certain amount of space that they could use whichever way they want.
:)
Andrus
01-04-2002, 11:01 AM
Originally posted by Sadie Frost
Great hack! :)
Would there be any way to limit the signature by total height (ie in pixels)? Because if I allow, say, 4 rows, the user could still use 4 huge banners. I'd much rather be able to give them a certain amount of space that they could use whichever way they want.
:)
Yes, and more importantly for me would be to restrict the file weights of the images. Some of these people upload img files that are 100K+ and put them into their signatures. Not good for load speed or bandwidth.
Great Hack, BTW.
Psychdrone
01-08-2002, 10:41 PM
I also would be intrested in the limiting of the banner in peoples sig!
Joshua Clinard
01-22-2002, 06:56 AM
I have a question. If you allow people to use HTML in their sigs, does this limit the number of lines of source code, or lines of text that the source code produce? I want to limit the lines of text, but sometimes it takes multiple lines to achieve a certain affect, i.e., glowing text. Also, do you have any updates to the previous questions?
I really would appreciate a check of the size (in bytes) for alle images (together) and if any of the images is above a defined size (in pixels).
I already put something together to read the size in pixels but I have no idea how to apply it to the images in the signature.
Joshua Clinard
01-25-2002, 05:47 AM
Can someone answer my questions?
TurboFC3S
01-30-2002, 05:01 PM
I'd love to have a check for sig filesize also ...
Castel
02-18-2002, 10:05 PM
Originally posted by Joshua Clinard
I have a question. If you allow people to use HTML in their sigs, does this limit the number of lines of source code, or lines of text that the source code produce? I want to limit the lines of text, but sometimes it takes multiple lines to achieve a certain affect, i.e., glowing text. Also, do you have any updates to the previous questions?
It would count the line breaks in the source code and make this hack pretty much useless as you could use a bunch of <br> tags on one line of code to create as many lines of output as you want.
Castel
02-18-2002, 10:08 PM
Originally posted by Nam
Not PPN's hack, the other is Signature Preview for users by Fryzid, it has lines limited too so I'm wondering if it'd work with yours.
I'm not familiar with that hack, so I have no idea.
Castel
02-18-2002, 10:11 PM
To all the people asking about image checks/limits. I don't allow images in sigs on my forum so I have never looked into the possiblity of limiting that in any shape or form. But if somebody wants to tackle that issue and modify this hack, be my guest.
Tech_Koss
02-19-2002, 04:18 AM
thanks alot :)
MarkB
02-28-2002, 10:09 PM
This doesn't work on 2.2.2 for me. I set a limit, and it's just ignored when people change their sigs...
MarkB
02-28-2002, 10:14 PM
Wait, scratch that... *cough*uploads files*cough*
:D
freehtml
03-26-2002, 02:30 PM
Using it now to limit the signature to only 5 lines.
omniweapon
06-05-2002, 10:26 PM
It's not working for me either. I have it set to 3 images, but someone still manages to use 4.
omniweapon
06-06-2002, 04:31 AM
Ok I found out why.
This hack has a flaw in it. If someone uses the [img] VB code or the <img> HTML it works. If someone uses <IMG> with capital letters, it doesn't work. :(
Takara
06-10-2002, 05:51 AM
Hum, doesnt work on 2.5.5/6 either, just ignores it all together. This would have really been usefull.
Giorgioggwt
06-14-2002, 11:53 AM
Originally posted by Frank-kun
Hmm...a bit odd...I installed the hack and it seemed to work all right, but when I tried to edit my profile and push the sig limit, it gave me a blank template - i.e. there was no fetching of the template text to put in. I've attached a screenshot (I cropped it just to show the kind of screen I'm getting).
Any idea on what I might have done wrong? As far as I know I think I did everything correctly.
EDIT: Well, I fixed the problem temporarily by making the function to fetch the template point to the "toomanyimages" template, which I know works. This makes me think I did something wrong when making my templates, but I can't figure out what. I'm all working now, but if someone could give me insight on what I may have done wrong with creating these new templates, that would be great.
BTW, great hack ^_^
I've got the same problem......any suggest?
stark
06-23-2002, 06:05 AM
Working for me, now I'm wondering if it's possible to limit the physical dimensions...I would love to stop my users from using anything bigger than 100H by 500W.
Anyone? Beuller?
Darren Evans
06-23-2002, 03:44 PM
I too am getting complaints about some users on my site using large sig pics. A size limit addition to this would be great.
marc_t
08-06-2002, 10:42 AM
Sorry, am using Version 2.2.4 and after installing the hack and modifying the .php Files the logout and login function of my board doesnt work anymore
marc
Hm ... I want this for 2.2.6 ...
Dean C
08-15-2002, 06:31 PM
me too... (
trainer
09-14-2002, 02:33 AM
any idea if this works with 2.2.6 or 2.2.7 ???
L-Mane
09-23-2002, 09:40 PM
Originally posted by trainer
any idea if this works with 2.2.6 or 2.2.7 ???
I wanna know also
I didn't get it to work with 2.2.6. Use this (https://vborg.vbsupport.ru/showthread.php?s=&threadid=40402&highlight=signature) instead, does the same things and more.
S1R1US
02-06-2003, 03:17 AM
will this work on 2.2.9? if not can u make it so it can?
S1R1US
02-10-2003, 03:32 AM
I've tried to install this hack but it doesn't work. Some people it impliments the restrictions and some it doesn't. How can i uninstall this hack and remove changed the hack.php did to it.
I just installed this hack and the Sig image size control (http://www.vbulletin.org/hacks/index.php?s=&action=showhack&hackid=446) hack on version 2.3.0 and both work perfectly. :cool:
*clicks install*
Darax The Good
06-07-2003, 11:09 PM
I installed this and it is working fine on 2.3.0. I changed the code a bit to take into account the number of characters. Our board uses~70 characters per line. The logic isn't perfect, but it works.
if ($maxlinessig!=0) {
$linessig = explode("\n", $signature);
if (count($linessig)>$maxlinessig) {
eval("standarderror(\"".gettemplate("error_sigtoolong")."\");");
exit;
}
//
//The intended logic here is for each line feed we must add 70 to our count, however this
//is a little overkill if the person for some reason actually presses enter here and there.
//a little slack is given
//'
if( (strlen($signature)+(count($linessig)*35)) > ($maxlinessig * 70)){
eval("standarderror(\"".gettemplate("error_sigtoolong")."\");");
exit;
}
}
Darax The Good
06-07-2003, 11:39 PM
I apologize, that code was really lame.... Here is some better code:
(I've read that some versions of PHP don't null terminate strings-if that is the case and $signature is not null terminated this code will run right off the buffer, so be sure to test this before deploying.)
if ($maxlinessig!=0) {
// check signature lines
$a = 1;
$counter =0;
$linecount =0;
$maxcounter = 50;
while($signature[$a] <> ""){
$counter++;
if($signature[$a]==" "){
$maxcounter=67;
}
if($signature[$a] == "\n" or $counter > $maxcounter)
{
$linecount++;
$counter = 0;
$maxcounter=50;
}
$a++;
}
if($linecount>=$maxlinessig){
eval("standarderror(\"".gettemplate("error_sigtoolong")."\");");
exit;
}
}
Darax The Good
06-08-2003, 08:46 AM
Okay, this is OUT OF CONTROL! One of our moderators tested this and noticed that the [size] tag could get around this and make a nasty sig. So I went a replaced Size=n with size=0. Unfortunately we agreed that this wasn't cool because some people wa nt to have a big size=6 signature and keep it down to a line or two. I came up with a solution but I really dislike it. Surely there is something more elegant
if ($maxlinessig!=0) {
// check signature lines
$a = 0;
$counter =0;
$linecount =0;
$maxcounter = 50;
$lastsize = 1;
//
//Handle the size field
//
$SizeMeanings=array("0"=>.5, "1"=> .5, "2"=> 1, "3" => 1.5, "4" => 2, "5" => 3, "6"=>4, "7"=>6, "8"=>6, "9"=>6 );
while($signature[$a] <> ""){
$checkforsizetag = substr($signature,$a,6);
if(strtolower($checkforsizetag)=="[size="){
//
//Found a size tag. This throws everything off
//First see how many digits are in the size of field
$SizeOfIndex = 0;
//
//scan for the ]
while($signature[$a+6+$SizeOfIndex] <> "]" and $signature[$a+6+$SizeOfIndex] <>""){
$SizeOfIndex++;
}
if($signature[$a+6+$SizeOfIndex]=="]"){
if($SizeOfIndex != 1)
{
//
//In this case there are more than 2 characters in the size field
//Just fill them in with 0's I guess
//
while($SizeOfIndex != 0){
$SizeOfIndex--;
$signature[$a+6+$SizeOfIndex] = '0';
}
}else{
$lastsize = $SizeMeanings[$signature[$a+6]];
if($lastsize==""){
$lastsize=$maxlinessig;
}
}
}
}
$counter++;
if($signature[$a]==" "){
$maxcounter=67;
}
if($signature[$a] == "\n" or $counter > $maxcounter)
{
$linecount+=$lastsize;
$counter = 0;
$maxcounter=50;
}
$a++;
}
if($linecount>=$maxlinessig){
eval("standarderror(\"".gettemplate("error_sigtoolong")."\");");
exit;
}
}
enzo81
07-11-2003, 11:42 AM
is there anyway to remove this hack?
Swedie
10-14-2003, 07:43 PM
this script surely does not work with v2.3.0 unless modified.. and I have not.. come one... what is the trick to make it work???
Noel 4 DMB
11-07-2003, 01:10 PM
Worked great for me. Thanks a lot!
X-Sector
11-19-2003, 03:10 PM
Does it work for 2.3.3?
SnitchSeeker
10-14-2004, 01:41 PM
Is there any way to do a size-check on the images they have in their signature, and limit the size?
This is exactly what I need!
I need to be able to limit the size of images in siggies. Kb and pixels size.
Any chance?
(Nice hack btw!) :)
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.