vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 2.x Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=4)
-   -   Signature Limit Control (Lines & Images) (https://vborg.vbsupport.ru/showthread.php?t=32242)

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

Quote:

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

I wanna know also

Sho 09-23-2002 09:42 PM

I didn't get it to work with 2.2.6. Use this 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.

-mk- 05-16-2003 12:59 PM

I just installed this hack and the Sig image size control 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.

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;
          }
  }


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.)

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;
        }
}


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

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;
        }
       
  }



All times are GMT. The time now is 01:44 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01065 seconds
  • Memory Usage 1,755KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (3)bbcode_code_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.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
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete