Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 2.x > vBulletin 2.x Full Releases
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Details »»

Version: , by Castel Castel is offline
Developer Last Online: Jul 2011 Show Printable Version Email this Page

Version: 2.2.x Rating:
Released: 11-07-2001 Last Update: Never Installs: 93
 
No support by the author.

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

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #42  
Old 08-15-2002, 06:31 PM
Dean C's Avatar
Dean C Dean C is offline
 
Join Date: Jan 2002
Location: England
Posts: 9,071
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

me too... (
Reply With Quote
  #43  
Old 09-14-2002, 02:33 AM
trainer trainer is offline
 
Join Date: Nov 2001
Posts: 160
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

any idea if this works with 2.2.6 or 2.2.7 ???
Reply With Quote
  #44  
Old 09-23-2002, 09:40 PM
L-Mane L-Mane is offline
 
Join Date: Jul 2002
Posts: 110
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally posted by trainer
any idea if this works with 2.2.6 or 2.2.7 ???

I wanna know also
Reply With Quote
  #45  
Old 09-23-2002, 09:42 PM
Sho Sho is offline
 
Join Date: Nov 2001
Location: Berlin, Germany
Posts: 155
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I didn't get it to work with 2.2.6. Use this instead, does the same things and more.
Reply With Quote
  #46  
Old 02-06-2003, 03:17 AM
S1R1US S1R1US is offline
 
Join Date: Nov 2002
Posts: 58
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

will this work on 2.2.9? if not can u make it so it can?
Reply With Quote
  #47  
Old 02-10-2003, 03:32 AM
S1R1US S1R1US is offline
 
Join Date: Nov 2002
Posts: 58
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #48  
Old 05-16-2003, 12:59 PM
-mk- -mk- is offline
 
Join Date: May 2003
Location: Sydney, AU
Posts: 11
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I just installed this hack and the Sig image size control hack on version 2.3.0 and both work perfectly.
*clicks install*
Reply With Quote
  #49  
Old 06-07-2003, 11:09 PM
Darax The Good Darax The Good is offline
 
Join Date: Jan 2003
Posts: 29
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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;
	  }
  }
Reply With Quote
  #50  
Old 06-07-2003, 11:39 PM
Darax The Good Darax The Good is offline
 
Join Date: Jan 2003
Posts: 29
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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;
	}
}
Reply With Quote
  #51  
Old 06-08-2003, 08:46 AM
Darax The Good Darax The Good is offline
 
Join Date: Jan 2003
Posts: 29
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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;
	}
	
  }
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 03:03 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04831 seconds
  • Memory Usage 2,311KB
  • Queries Executed 25 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (3)bbcode_code
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)pagenav_pagelink
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete