The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
Details »» | |||||||||||||||||||||||||
Yes, another signature limit hack. But with a little twist . After installing PPN's excellent Sig Editor 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 Show Your Support
|
Comments |
#42
|
||||
|
||||
me too... (
|
#43
|
|||
|
|||
any idea if this works with 2.2.6 or 2.2.7 ???
|
#44
|
|||
|
|||
Quote:
I wanna know also |
#46
|
|||
|
|||
will this work on 2.2.9? if not can u make it so it can?
|
#47
|
|||
|
|||
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.
|
#48
|
|||
|
|||
I just installed this hack and the Sig image size control hack on version 2.3.0 and both work perfectly.
*clicks install* |
#49
|
|||
|
|||
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.
Code:
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; } } |
#50
|
|||
|
|||
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.) Code:
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;
}
}
|
#51
|
|||
|
|||
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
Code:
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;
}
}
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|