F:\WEBSITES\testbed\zipped\yabb_svn_new\branches\2.5.2\cgi-bin\yabb2\Admin\NewSettings.pl F:\WEBSITES\testbed\zipped\yabb_svn_new\trunk\cgi-bin\yabb2\Admin\NewSettings.pm
############################################################################### ###############################################################################
# NewSettings.pl                                                              # # NewSettings.pm                                                              #
  # $Date: 01.05.16 $                                                           #
############################################################################### ###############################################################################
# YaBB: Yet another Bulletin Board                                            # # YaBB: Yet another Bulletin Board                                            #
# Open-Source Community Software for Webmasters                               # # Open-Source Community Software for Webmasters                               #
# Version:        YaBB 2.5.2                                                  # # Version:        YaBB 2.6.12                                                 #
# Packaged:       October 21, 2012                                            # # Packaged:       January 5, 2016                                             #
# Distributed by: http://www.yabbforum.com                                    # # Distributed by: http://www.yabbforum.com                                    #
# =========================================================================== # # =========================================================================== #
# Copyright (c) 2000-2012 YaBB (www.yabbforum.com) - All Rights Reserved.     # # Copyright (c) 2000-2016 YaBB (www.yabbforum.com) - All Rights Reserved.     #
# Software by:  The YaBB Development Team                                     # # Software by:  The YaBB Development Team                                     #
#               with assistance from the YaBB community.                      # #               with assistance from the YaBB community.                      #
############################################################################### ###############################################################################
  # use strict;
  use CGI::Carp qw(fatalsToBrowser);
  our $VERSION = '2.6.12';
   
$newsettingsplver = 'YaBB 2.5.2 $Revision: 1.5 $'; $newsettingspmver = 'YaBB 2.6.12 $Revision: 1710 $';
if ($action eq 'detailedversion') { return 1; } if ( $action eq 'detailedversion' ) { return 1; }
   
# Figure out what tabset to use, depending on the page= parameter. # Figure out what tabset to use, depending on the page= parameter.
my %settings_dispatch = ( my %settings_dispatch = (
   news => "$admindir/Settings_News.pl",     news        => "$admindir/Settings_News.pm", 
   main => "$admindir/Settings_Main.pl",     main        => "$admindir/Settings_Main.pm", 
   advanced => "$admindir/Settings_Advanced.pl",     advanced    => "$admindir/Settings_Advanced.pm", 
   security => "$admindir/Settings_Security.pl",     security    => "$admindir/Settings_Security.pm", 
   antispam => "$admindir/Settings_Antispam.pl",     antispam    => "$admindir/Settings_Antispam.pm", 
   maintenance => "$admindir/Settings_Maintenance.pl",     maintenance => "$admindir/Settings_Maintenance.pm", 
   
   ### BOARDMOD SETTINGS ANCHOR ###    ### BOARDMOD SETTINGS ANCHOR ###
   ### ADD BEFORE THESE LINES   ###    ### ADD BEFORE THESE LINES   ###
); );
   
my $page = $INFO{'page'}; my $page = $INFO{'page'};
# 'eval' because NewSettings.pl can be called by Sources/TabMenu.pl  
eval{ require $settings_dispatch{$page}; };  
   
sub settings {  # 'eval' because NewSettings.pm can be called by Sources/TabMenu.pm 
   &is_admin_or_gmod;  eval { require $settings_dispatch{$page}; }; 
   
   $yytitle = $page eq 'main' ? $admin_txt{'222'} : ($page eq 'advanced' ? $admin_txt{'223'} : ($page eq 'security' ? $admintxt{'a3_title'} : ($page eq 'antispam' ? $admintxt{'a3_sub4'} : ($page eq 'maintenance' ? $admintxt{'a7_title'} : $admintxt{'a2_sub1'}))));  
   
   my @requireorder; # an array for the correct order of the requirements  sub settings { 
   my %requirements; # an hash that says "Y is required by X"     is_admin_or_gmod(); 
   
   $yymain .= qq~     $yytitle = 
  <a name="top"></a>       $page eq 'main' ? $admin_txt{'222'} 
  <div class="bordercolor" style="padding: 0px; width: 99%; margin-left: 0px; margin-right: auto;">       : ( 
  <table width="100%" cellspacing="1" cellpadding="4">         $page eq 'advanced' ? $admin_txt{'223'} 
    <tr valign="middle">         : ( 
      <td align="left" class="titlebg">             $page eq 'security' ? $admintxt{'a3_title'} 
        <b>$yytitle</b>             : ( 
      </td>                 $page eq 'antispam' ? $admintxt{'a3_sub4'} 
    </tr>                 : ( 
    <tr valign="middle">                       $page eq 'maintenance' ? $admintxt{'a7_title'} 
      <td align="left" class="windowbg2"><br />                     : $admintxt{'a2_sub1'} 
       $admin_txt{'347'}                 ) 
      </td>             ) 
    </tr>         ) 
 </table>       ); 
 </div>  
 <br />     my @requireorder;    # an array for the correct order of the requirements 
 <form action="$adminurl?action=newsettings2;page=$page" onsubmit="undisableAll(this);" method="post">     my %requirements;    # a hash that says "Y is required by X" 
 <ul id="navlist">  
     $yymain .= qq~
     <div class="bordercolor rightboxdiv">
         <table class="border-space pad-cell" style="margin-bottom:.5em">
             <tr>
                 <td class="titlebg"><b>$yytitle</b></td>
             </tr><tr>
                 <td class="windowbg2">
                     <div class="pad-more">$admin_txt{'347'}</div>
                 </td>
             </tr>
         </table>
     </div>
  <form action="$adminurl?action=newsettings2;page=$page" onsubmit="undisableAll(this); savealert()" method="post" enctype="multipart/form-data" accept-charset="$yymycharset">
     <ul id="navlist">
~; ~;
   my $i = 0;    my $i = 0;
   foreach my $tab (@settings) {    foreach my $tab (@settings) {
       $tab->{'name'} =~ s/ /&nbsp;/g;         $tab->{'name'} =~ s/ /&nbsp;/gsm; 
       # The &nbsp;'s are for Konqueror, and also to add a little more padding.  
       $yymain .= qq~    <li id="button_$tab->{'id'}" onclick="changeToTab('$tab->{'id'}'); return false;">&nbsp;<a href="#tab_$tab->{'id'}">$tab->{'name'}</a>&nbsp;</li>         # The &nbsp;'s are for Konqueror, and also to add a little more padding. 
         $yymain .=
  qq~                <li id="button_$tab->{'id'}" onclick="changeToTab('$tab->{'id'}'); return false;">&nbsp;<a href="#tab_$tab->{'id'}">$tab->{'name'}</a>&nbsp;</li>
~; ~;
   }    }
   $yymain .= q~  </ul>~;    $yymain .= q~  </ul>~;
   
   foreach my $tab (@settings) {    foreach my $tab (@settings) {
       $yymain .= qq~        $yymain .= qq~
 <div class="bordercolor" style="padding: 0px; width: 99%; margin-left: 0px; margin-right: auto;">     <div class="bordercolor borderstyle rightboxdiv"> 
   <table width="100%" cellspacing="1" cellpadding="4" class="section" id="tab_$tab->{'id'}">        <table class="section" style="border-collapse:separate; border-spacing: 1px;" id="tab_$tab->{'id'}">
    <tr>             <colgroup> 
      <td style="text-align: left;" class="titlebg" colspan="2">                 <col span="2" style="width: 50%" /> 
        <a name="tab_$tab->{'id'}"></a><img src="$imagesdir/preferences.gif" alt="" border="0" /> <b>$tab->{'name'}</b>             </colgroup> 
        <span style="float: right;" class="js_remove_me"><a href="#top"><b>$settings_txt{'top'}</b></a></span>             <tr> 
                 <td class="titlebg padd-cell" colspan="2">
                     $admin_img{'prefimg'} <b>$tab->{'name'}</b>
          <span style="float: right;" class="js_remove_me"><a href="#"><b>$settings_txt{'top'}</b></a></span>
      </td>       </td>
    </tr>~;     </tr>~;
   
       foreach my $item (@{$tab->{'items'}}) {        foreach my $item ( @{ $tab->{'items'} } ) {
           if($item->{'header'}) {            if ( $item->{'header'} ) {
               $yymain .= qq~                 $yymain .= qq~<tr> 
    <tr>          <td class="catbg padd-cell" colspan="2"><span class="small">$item->{'header'}</span></td> 
      <td style="text-align: left;" class="catbg" colspan="2">  
        <span class="small">$item->{'header'}</span>  
      </td>  
    </tr>~;     </tr>~;
           }            }
           elsif($item->{'two_rows'} && $item->{'input_html'}) {            elsif ( $item->{'two_rows'} && $item->{'input_html'} ) {
               $yymain .= qq~                 $yymain .= qq~<tr> 
    <tr style="text-align: left;">                 <td class="windowbg2 padd-cell" colspan="2">$item->{'description'}</td> 
      <td style="width: 50%;" class="windowbg2" colspan="2">             </tr><tr> 
        $item->{'description'}                 <td class="windowbg2 padd-cell" colspan="2">$item->{'input_html'}</td> 
      </td>  
    </tr>  
    <tr style="text-align: left;">  
      <td style="width: 50%;" class="windowbg2" colspan="2">  
        $item->{'input_html'}  
      </td>  
    </tr>~;     </tr>~;
           }            }
           elsif($item->{'input_html'}) {            elsif ( $item->{'input_html'} ) {
               $yymain .= qq~                 $yymain .= qq~<tr> 
    <tr style="text-align: left;">                 <td class="windowbg2 vtop padd-cell">$item->{'description'}</td> 
      <td style="width: 50%;" class="windowbg2" valign="top">                 <td class="windowbg2 vtop padd-cell">$item->{'input_html'}</td> 
        $item->{'description'}  
      </td>  
      <td style="width: 50%;" class="windowbg2" valign="top">  
        $item->{'input_html'}  
      </td>  
    </tr>~;     </tr>~;
           }            }
   
           # Handle settings that require other settings            # Handle settings that require other settings
           if ($item->{'depends_on'} && $item->{'name'}) {            if ( $item->{'depends_on'} && $item->{'name'} ) {
               foreach my $require (@{$item->{'depends_on'}}) {                foreach my $require ( @{ $item->{'depends_on'} } ) {
                   # This is somewhat messy, but it works well.  
                   # We strip off the possible options: inverse, equal, and not equal  # This is somewhat messy, but it works well. 
                   # Then we attach those to this current option in the detailed string for requirements  # We strip off the possible options: inverse, equal, and not equal 
                   # While this data does not really belong with the value, it transfers nicely.  # Then we attach those to this current option in the detailed string for requirements 
                   # We then remove it and reuse it later.  # While this data does not really belong with the value, it transfers nicely. 
                   my($inverse, $realname, $remainder) = $require =~ m/(\(?\!?)(\w+)(.*)/;  # We then remove it and reuse it later. 
                   push(@requireorder, $realname) unless $requirements{$realname};                     my ( $inverse, $realname, $remainder ) = 
                   push(@{$requirements{$realname}}, $inverse . $item->{'name'} . $remainder);                       $require =~ m{(\(?\!?)(\w+)(.*)}xsm; 
               }                     if ( !$requirements{$realname} ) { 
           }                         push @requireorder, $realname; 
       }                    }
                     push
                       @{ $requirements{$realname} },
                       $inverse . $item->{'name'} . $remainder;
                 }
             }
         }
   
       $yymain .= qq~         $yymain .= q~ 
  </table>   </table>
 </div>~;  </div>~;
   }    }
   
   # The old method isn't quite good enough. # The old method isn't quite good enough.
   # So we build a hash with the Javascript logic needed to determine if this item should be enabled. # So we build a hash with the Javascript logic needed to determine if this item should be enabled.
   # When in doubt, generate some code :) # When in doubt, generate some code :)
   my %requirejs;    my %requirejs;
   
   my $dependicies = '';     my $dependicies = q{}; 
   my $onloadevents;    my $onloadevents;
   foreach my $ritem (@requireorder) {    foreach my $ritem (@requireorder) {
       $dependicies .= qq~        $dependicies .= qq~
   function handleDependent_$ritem() {    function handleDependent_$ritem() {
       var isChecked = document.getElementsByName("$ritem")[0].checked;        var isChecked = document.getElementsByName("$ritem")[0].checked;
       var itemValue = document.getElementsByName("$ritem")[0].value;\n~;        var itemValue = document.getElementsByName("$ritem")[0].value;\n~;
   
       foreach my $require (@{$requirements{$ritem}}) {        foreach my $require ( @{ $requirements{$ritem} } ) {
           # && or ||, ( and )  
           my $AndOr = $require =~ s/\)// ? ')' : '';             # && or ||, ( and ) 
           $AndOr   .= $require =~ s/\|\|// ? ' ||' : ' &&';             my $AndOr = $require =~ s/\)//xsm ? ')' : q{}; 
           my $C     = $require =~ s/\(// ? '(' : '';             $AndOr .= $require =~ s/\|\|//xsm ? ' ||' : ' &&'; 
           # Is false             my $C = $require =~ s/\(//xsm ? '(' : q{}; 
           if ($require =~ s/^\!//) {  
               $requirejs{$require} .= qq~$C\!document.getElementsByName("$ritem")[0].checked$AndOr ~;             # Is false 
           }             if ( $require =~ s/^\!//xsm ) { 
           # Is equal to                 $requirejs{$require} .= 
           elsif ($require =~ s/\=\=(.*)$//) {  qq~$C\!document.getElementsByName("$ritem")[0].checked$AndOr ~; 
               $requirejs{$require} .= qq~$C\document.getElementsByName("$ritem")[0].value == '$1'$AndOr ~;             } 
           }  
           # Is not equal to            # Is equal to
           elsif ($require =~ s/\!\=(.*)$//) {            elsif ( $require =~ s/\=\=(.*)$//xsm ) {
               $requirejs{$require} .= qq~$C\document.getElementsByName("$ritem")[0].value != '$1'$AndOr ~;                 $requirejs{$require} .= 
           }  qq~$C\document.getElementsByName("$ritem")[0].value == '$1'$AndOr ~; 
           # Is true             } 
           else {  
               $requirejs{$require} .= qq~$C\document.getElementsByName("$ritem")[0].checked$AndOr ~;             # Is not equal to 
           }             elsif ( $require =~ s/\!\=(.*)$//xsm ) { 
           $dependicies .= qq~        checkDependent("$require");\n~;                 $requirejs{$require} .= 
       }  qq~$C\document.getElementsByName("$ritem")[0].value != '$1'$AndOr ~; 
       $dependicies .= qq~    };             } 
   document.getElementsByName("$ritem")[0].onclick = handleDependent_$ritem;  
   document.getElementsByName("$ritem")[0].onkeyup = handleDependent_$ritem;             # Is true 
             else {
                 $requirejs{$require} .=
                   qq~$C\document.getElementsByName("$ritem")[0].checked$AndOr ~;
             }
             $dependicies .= qq~        checkDependent("$require");\n~;
         }
         $dependicies .= qq~ }
     document.getElementsByName("$ritem")[0].onclick = handleDependent_$ritem;
     document.getElementsByName("$ritem")[0].onkeyup = handleDependent_$ritem;
~; ~;
       $onloadevents .= qq~handleDependent_$ritem(); ~;        $onloadevents .= qq~handleDependent_$ritem(); ~;
   }    }
   
   # Hidden "feature": jump directly to a tab by default via the URL bar.    # Hidden "feature": jump directly to a tab by default via the URL bar.
   $INFO{'tab'} =~ s/\W//g;     $INFO{'tab'} =~ s/\W//gxsm; 
   $default_tab = $INFO{'tab'} || $settings[0]->{'id'};    $default_tab = $INFO{'tab'} || $settings[0]->{'id'};
   $yymain .= qq~    $yymain .= qq~
 <div class="bordercolor" style="padding: 0px; width: 99%; margin-top: 1em; margin-left: 0px; margin-right: auto;">  <div class="bordercolor rightboxdiv" style="margin: .5em auto 0 0"> 
  <table width="100%" cellspacing="1" cellpadding="4">     <table class="border-space pad-cell"> 
    <tr valign="middle">         <tr> 
      <td align="left" class="titlebg" colspan="2">             <td class="titlebg">$admin_img{'prefimg'} <b>$admin_txt{'10'}</b></td> 
        <img src="$imagesdir/preferences.gif" alt="" border="0" /> <b>$admin_txt{'10'}</b>         </tr><tr> 
      </td>             <td class="catbg center"> 
    </tr>                 <input class="button" type="submit" value="$admin_txt{'10'}" /> 
    <tr align="center" valign="middle">             </td> 
      <td align="center" class="catbg" colspan="2">         </tr> 
        <input class="button" type="submit" value="$admin_txt{'10'}" />  
      </td>  
    </tr>  
  </table>   </table>
 </div>  </div>
 </form>  </form>
 <script type="text/javascript">  <script type="text/javascript">
 <!--     function getElementsByClass(searchClass,node,tag) { 
   function getElementsByClass(searchClass,node,tag) {         var classElements = new Array(); 
       var classElements = new Array();         if ( node === null || node === undefined ) 
       if ( node == null )             node = document; 
           node = document;         if ( tag === null || tag === undefined ) 
       if ( tag == null )             tag = '*'; 
           tag = '*';         var els = node.getElementsByTagName(tag); 
       var els = node.getElementsByTagName(tag);         var elsLen = els.length; 
       var elsLen = els.length;         var pattern = new RegExp('(^|\\s)'+searchClass+'(\\s|\$)'); 
       var pattern = new RegExp('(^|\\s)'+searchClass+'(\\s|\$)');         for (i = 0, j = 0; i < elsLen; i++) { 
       for (i = 0, j = 0; i < elsLen; i++) {            if ( pattern.test(els[i].className) ) {
           if ( pattern.test(els[i].className) ) {                 classElements[j] = els[i]; 
               classElements[j] = els[i];                 j++; 
               j++;             } 
           }        }
       }         return classElements; 
       return classElements;     } 
   }     function changeToTab(tab) { 
   function changeToTab(tab) {         var elements = getElementsByClass('section'); 
       var elements = getElementsByClass('section');         var i; 
       var i;         for(i = 0; i < elements.length; i++) { 
       for(i = 0; i < elements.length; i++) {            if(elements[i].id == 'tab_' + tab) {
           if(elements[i].id == 'tab_' + tab) {                 elements[i].style.display = ''; 
               elements[i].style.display = '';             } 
           }             else { 
           else {                 elements[i].style.display = 'none'; 
               elements[i].style.display = 'none';             } 
           }        }
       }         var elm = getElementsByClass('curtab')[0]; 
       var elm = getElementsByClass('curtab')[0];         if(elm) { 
       if(elm) {             elm.className = ''; 
           elm.className = '';         } 
       }         document.getElementById('button_' + tab).className = 'curtab'; 
       document.getElementById('button_' + tab).className = 'curtab';     } 
   }     var removables = getElementsByClass('js_remove_me'); 
   var removables = getElementsByClass('js_remove_me');     var i; 
   var i;     for(i = 0; i < removables.length; i++) { 
   for(i = 0; i < removables.length; i++) {         removables[i].innerHTML = ''; 
       removables[i].innerHTML = '';     } 
   }     changeToTab('$default_tab'); // Focus default tab 
   changeToTab('$default_tab'); // Focus default tab     function checkDependent(eid) { 
   function checkDependent(eid) {         var elm = document.getElementsByName(eid)[0];\n~; 
       var elm = document.getElementsByName(eid)[0];\n~;  
     # Loop through each item that depends on something else
       # Loop through each item that depends on something else     foreach my $name ( keys %requirejs ) { 
       foreach my $name (keys(%requirejs)) {         my $logic = $requirejs{$name}; 
           my $logic = $requirejs{$name};         $logic =~ s/ (&&|\|\|) $//sm; 
           $logic    =~ s/ (&&|\|\|) $//;         $yymain .= qq~ 
           $yymain .= qq~         if (eid == "$name" && ($logic)) { 
       if (eid == "$name" && ($logic)) {             elm.disabled = false; 
           elm.disabled = false;         } else if (eid == "$name") { 
       } else if (eid == "$name") {             elm.disabled = true; 
           elm.disabled = true;         }\n~; 
       }\n~;     } 
       }  
   
   $yymain.= qq~    $yymain .= qq~
   }    }
$dependicies $dependicies
   window.onload = function(){ $onloadevents};    window.onload = function(){ $onloadevents};
   function undisableAll(node) {    function undisableAll(node) {
       var elements = document.getElementsByTagName("input");        var elements = document.getElementsByTagName("input");
       for(var i = 0; i < elements.length; i++) {        for(var i = 0; i < elements.length; i++) {
           elements[i].disabled = false;            elements[i].disabled = false;
       }        }
       var elements = document.getElementsByTagName("textarea");        elements = document.getElementsByTagName("textarea");
       for(var i = 0; i < elements.length; i++) {        for( i = 0; i < elements.length; i++) {
           elements[i].disabled = false;            elements[i].disabled = false;
       }        }
       var elements = document.getElementsByTagName("select");        elements = document.getElementsByTagName("select");
       for(var i = 0; i < elements.length; i++) {        for( i = 0; i < elements.length; i++) {
           elements[i].disabled = false;            elements[i].disabled = false;
       }        }
   }    }
 // -->  
 </script>~;  </script>~;
   
   $action_area = "newsettings;page=$page";    $action_area = "newsettings;page=$page";
   &AdminTemplate;     AdminTemplate(); 
     return;
} }
   
sub ischecked { sub ischecked {
   # Return a ref so we can be used like ${ischecked($var)} inside a string     my ($inp) = @_; 
   return \' checked="checked"' if $_[0];  
   return \'';     # Return a ref so we can be used like ${ischecked($var)} inside a string 
     return \' checked="checked"' if $inp;
     return \q{};
} }
   
sub isselected { sub isselected {
   # Return a ref so we can be used like ${isselected($var)} inside a string     my ($inp) = @_; 
   return \' selected="selected"' if $_[0];  
   return \'';     # Return a ref so we can be used like ${isselected($var)} inside a string 
     return \' selected="selected"' if $inp;
     return \q{};
} }
   
# Regexes. Will be used like this: $var =~ /^(?:$regexes{'a'}|$regexes{'b'}|$regexes{'c'})$/ || die; # Regexes. Will be used like this: $var =~ /^(?:$regexes{'a'}|$regexes{'b'}|$regexes{'c'})$/ || die;
my %regexes = ( my %regexes = (
boolean     => '.*', # anything. True is not 0 and defined, false is 0/undefined     boolean => 
number      => '\d+', # just numbers       q{.*},    # anything. True is not 0 and defined, false is 0/undefined 
fullnumber  => '(?:\+|\-|)[\d\.]+', # optional sign, plus numbers and decimal     number     => '\d+',               # just numbers 
hexadecimal => '#?[0-9a-fA-F]+', # optional "#" (for hex color codes), plus hex characters     fullnumber => '(?:\+|\-|)[\d\.]+', # optional sign, plus numbers and decimal 
alpha       => '[a-zA-Z]+', # Letters     hexadecimal => '#?[0-9a-fA-F]+', 
text        => '[^\n\r]+', # Anything but newlines  
fulltext    => '(?s).+', # Anything, including newlines     # optional "#" (for hex color codes), plus hex characters 
null        => '', # Use this if something can be false, in addition to the normal valid characters (not needed for boolean)     alpha    => '[a-zA-Z]+',           # Letters 
     text     => '[^\n\r]+',            # Anything but newlines
     fulltext => '(?s).+',              # Anything, including newlines
     null     => q{},
   
  # Use this if something can be false, in addition to the normal valid characters (not needed for boolean)
); );
   
# Preserve the traditional "2" name as well as the nicer SaveSettings. # Preserve the traditional "2" name as well as the nicer SaveSettings.
sub settings2 { sub settings2 {
   &is_admin_or_gmod;     is_admin_or_gmod(); 
   
   # Load/Verify the settings    # Load/Verify the settings
   foreach my $tab (@settings) {    foreach my $tab (@settings) {
       foreach my $item (@{$tab->{'items'}}) {        foreach my $item ( @{ $tab->{'items'} } ) {
           # Get the value  
           my $name = $item->{'name'} || next; # Skip non-items             # Get the value 
           $settings{$name} = $FORM{$name};             my $name = $item->{'name'} || next;    # Skip non-items 
           $settings{$name} = '' unless defined $settings{$name};             $settings{$name} = $FORM{$name}; 
             if ( !defined $settings{$name} ) { $settings{$name} = q{}; }
           $settings{$name} =~ s/^\s+//;  
           $settings{$name} =~ s/\s+$//;             $settings{$name} =~ s/^\s+//xsm; 
             $settings{$name} =~ s/\s+$//xsm;
           # Validate it  
           if ($item->{'validate'}) {             # Validate it 
               # Handle numbers/nulls better (empty string is 0)             if ( $item->{'validate'} ) { 
               if ($item->{'validate'} =~ /null/ && $item->{'validate'} =~ /number/) {  
                   $settings{$name} ||= 0;                 # Handle numbers/nulls better (empty string is 0) 
               }                 if (   $item->{'validate'} =~ /null/sm 
                     && $item->{'validate'} =~ /number/sm )
               # Handle text/nulls better (empty string is empty string :)                 { 
               if ($item->{'validate'} =~ /null/ && $item->{'validate'} =~ /text/) {                     $settings{$name} ||= 0; 
                   $settings{$name} ||= '';                 } 
               }  
                 # Handle text/nulls better (empty string is empty string :)
               # Piece together the patterns. It only needs to validate 1 pattern, but the pattern must be the whole string.                 if (   $item->{'validate'} =~ /null/sm 
               my $pattern = '^(?:' . join('|', @regexes{split(/,/, $item->{'validate'})}) . ')$';                     && $item->{'validate'} =~ /text/sm ) 
               &admin_fatal_error('invalid_value', qq~$name ($item->{'description'})~) unless $settings{$name} =~ /$pattern/;                 { 
                     $settings{$name} ||= q{};
               # Set numeric options to 0 if they are null                 } 
               if ($item->{'validate'} eq 'boolean') {  
                   $settings{$name} = $settings{$name} ? 1 : 0;  # Piece together the patterns. It only needs to validate 1 pattern, but the pattern must be the whole string. 
               }                 my $pattern = '^(?:' 
           }                   . join( q{|}, @regexes{ split /,/xsm, $item->{'validate'} } ) 
       }                   . ')$'; 
   }                 if ( $settings{$name} !~ /$pattern/sm ) { 
                     fatal_error( 'invalid_value',
   # Save them, as according to this type of settings                         qq~$name ($item->{'description'})~ ); 
   # This subroutine resides in the file that is loaded in the hash at the top of the file.                 } 
   &SaveSettings(%settings);  
                 # Set numeric options to 0 if they are null
   # Redirect.                 if ( $item->{'validate'} eq 'boolean' ) { 
   $yySetLocation = "$adminurl?action=newsettings;page=$page";                     $settings{$name} = $settings{$name} ? 1 : 0; 
   &redirectexit;                 } 
             }
         }
     }
   
  # Save them, as according to this type of settings
  # This subroutine resides in the file that is loaded in the hash at the top of the file.
     SaveSettings(%settings);
     $yySetLocation = "$adminurl?action=newsettings;page=$page";
     redirectexit();
     return;
} }
   
# Subroutine for saving to Settings.pl  # Subroutine for saving to Settings.pm 
sub SaveSettingsTo { sub SaveSettingsTo {
   my $file     = shift;    my $file     = shift;
   my %settings = @_;    my %settings = @_;
   
   # This is why we should use hashes for options to begin with.     # these cannot be reversed per Perl Critic. 
   foreach my $key (keys(%settings)) {  
       $$key = delete($settings{$key});  
       # Sanitize the input using \Q...\E later.  
   }  
   
   if ($codemaxchars > 15) { $codemaxchars = 15; }  
   
   my $setfile;  
   if ($file eq 'Settings.pl') {  
       if ($settings_file_version ne $YaBBversion) { # START upgrade codes  
           # The following is for upgrades from YaBB versions < 2.3 START  
           if ($enable_notifications eq '') { $enable_notifications = $enable_notification ? 3 : 0; }  
           $fix_avatar_img_size ||= 0;  
           $fix_post_img_size ||= 0;  
           $fix_signat_img_size ||= 0;  
           $fix_attach_img_size ||= 0;  
           # The following is for upgrades from YaBB versions < 2.3 END  
   
           # The following is for upgrades from YaBB versions < 2.4 START  
           if (-e "$vardir/membergroups.txt") { require "$vardir/membergroups.txt"; }  
           if (!@nopostorder && -e "$vardir/nopostorder.txt") {  
               fopen(NPORDER, "$vardir/nopostorder.txt");  
               @nopostorder = <NPORDER>;  
               fclose(NPORDER);  
               chomp(@nopostorder);  
           }  
   
           if (-e "$vardir/advsettings.txt") { require "$vardir/advsettings.txt"; }  
           if (-e "$vardir/secsettings.txt") { require "$vardir/secsettings.txt"; }  
   
           if (-e "$vardir/Smilies.txt") {  
               require "$vardir/Smilies.txt";  
               $popback =~ s/[^a-f0-9]//ig;  
               $poptext =~ s/[^a-f0-9]//ig;  
           }  
   
           if (-e "$vardir/template.cfg") { require "$vardir/template.cfg"; }  
           elsif (!%templateset) { # only for upgrade from very old versions  
               opendir(TMPLDIR, "$templatesdir"); my @configs = readdir(TMPLDIR); closedir(TMPLDIR);  
               foreach (@configs) { if (-e "$templatesdir/$_/$_.cfg") { require "$admindir/ManageTemplates.pl"; &UpdateTemplates($_, "new"); } }  
           }  
   
           if (-e "$vardir/Guardian.banned") { require "$vardir/Guardian.banned"; }  
           if (-e "$vardir/Guardian.settings") { require "$vardir/Guardian.settings"; }  
   
           if (-e "$vardir/ban.txt") {  
               fopen(BAN, "$vardir/ban.txt");  
               foreach (<BAN>) {  
                   my ($type, $bannedlist) = split(/\|/, $_, 2);  
                   chomp($bannedlist);  
                   $ip_banlist = $bannedlist if $type =~ /I/i;  
                   $email_banlist = $bannedlist if $type =~ /E/i;  
                   $user_banlist = $bannedlist if $type =~ /U/i;  
               }  
               fclose(BAN);  
           }  
   
           if (-e "$vardir/HelpSettings.txt") { require "$vardir/HelpSettings.txt"; }  
           if (-e "$vardir/BackupSettings.cgi") { require "$vardir/BackupSettings.cgi"; @backup_paths = @paths; }  
   
           if (-e "$vardir/extended_profiles_order.txt") {  
               fopen(EXT_FILE, "$vardir/extended_profiles_order.txt");  
               @ext_prof_order = <EXT_FILE>;  
               fclose(EXT_FILE);  
               chomp(@ext_prof_order);  
           }  
           if (-e "$vardir/extended_profiles_fields.txt") {  
               fopen(EXT_FILE, "$vardir/extended_profiles_fields.txt");  
               @ext_prof_fields = <EXT_FILE>;  
               fclose(EXT_FILE);  
               chomp(@ext_prof_fields);  
           }  
   
           if (-e "$vardir/palette.def") {  
               fopen(DEFPAL, "$vardir/palette.def"); @pallist = <DEFPAL>; fclose(DEFPAL); chomp(@pallist);  
           }  
   
           if (!@AdvancedTabs) {  
               if (-e "$vardir/taborder.txt") {  
                   fopen(TABFILE, "$vardir/taborder.txt");  
                   @AdvancedTabs = <TABFILE>;  
                   fclose(TABFILE);  
                   chomp(@AdvancedTabs);  
               } else { @AdvancedTabs = qw (home help search ml admin revalidatesession login register guestpm mycenter logout); }  
   
               if (fopen(EXTTAB, "$vardir/tabs_ext.def")) {  
                   my %exttabs = map /(.*)\t(.*)/, <EXTTAB>;  
                   fclose(EXTTAB);  
                   for (my $i = 0; $i < @AdvancedTabs; $i++) {  
                       if ($exttabs{$AdvancedTabs[$i]}) {  
                           $exttabs{$AdvancedTabs[$i]} =~ s/"//g;  
                           $AdvancedTabs[$i] .= "|$exttabs{$AdvancedTabs[$i]}";  
                       }  
                   }  
                   chomp(@AdvancedTabs);  
               }  
           }  
           # The following is for upgrades from YaBB versions < 2.4 END  
   
           # The following is for upgrades from YaBB versions < 2.3 START  
           if (-e "$vardir/upgrade_secsettings.txt") { require "$vardir/upgrade_secsettings.txt"; }  
           if (-e "$vardir/upgrade_advsettings.txt") { require "$vardir/upgrade_advsettings.txt"; }  
           if (-e "$vardir/upgrade_Settings.pl") { require "$vardir/upgrade_Settings.pl"; }  
           # The following is for upgrades from YaBB versions < 2.3 END  
       } # END upgrade codes  
   
       # Since these are normally in a hash, fix that here  
       $fadertext       ||= $color{'fadertext'};  
       $faderbackground ||= $color{'faderbg'};  
   
       my $templateset = join('', map { qq~'$_' => "$templateset{$_}",\n~; } keys(%templateset));  
   
       my $ext_prof_order = '"' . join('","', @ext_prof_order) . '"' if @ext_prof_order;  
       my $ext_prof_fields = '"' . join(qq~",\n"~, @ext_prof_fields) . '"' if @ext_prof_fields;  
   
       my $member_groups = "# Static Member Groups\n";  
       foreach (keys %Group)  { $member_groups .= qq~\$Group{'$_'} = '$Group{$_}';\n~; }  
       $member_groups .= "\n# Post independent Member Groups\n";  
       foreach (keys %NoPost) { $member_groups .= qq~\$NoPost{'$_'} = '$NoPost{$_}';\n~; }  
       $member_groups .= "\n# Post dependent Member Groups\n";  
       foreach (keys %Post)   { $member_groups .= qq~\$Post{'$_'} = '$Post{$_}';\n~; }  
   
       my $pallist = '"' . join('","', @pallist) . '"' if @pallist;  
   
       if ($INFO{'page'} eq 'main') {  
           if (!$enable_notifications_N && !$enable_notifications_PM) {  
               $enable_notifications = 0;  
           } elsif ($enable_notifications_N && !$enable_notifications_PM) {  
               $enable_notifications = 1;  
           } elsif (!$enable_notifications_N && $enable_notifications_PM) {  
               $enable_notifications = 2;  
           } elsif ($enable_notifications_N && $enable_notifications_PM) {  
               $enable_notifications = 3;  
           }  
       }  
   
       my $AdvancedTabs = '"' . join('","', @AdvancedTabs) . '"';  
   
       my $SmilieURL = '"' . join('","', @SmilieURL) . '"' if @SmilieURL;  
       my $SmilieCode = '"' . join('","', @SmilieCode) . '"' if @SmilieCode;  
       my $SmilieDescription = '"' . join('","', @SmilieDescription) . '"' if @SmilieDescription;  
       my $SmilieLinebreak = '"' . join('","', @SmilieLinebreak) . '"' if @SmilieLinebreak;  
   
       my $backup_paths = join(' ', @backup_paths);     # This is why we should use hashes for options to begin with. 
     foreach my $key ( keys %settings ) {
         ${$key} = delete $settings{$key};
     }
   
     if ( $codemaxchars > 15 ) { $codemaxchars = 15; }
     my $setfile;
     if ( $file eq 'Settings.pm' ) {
         $fadertext       ||= $color{'fadertext'};
         $faderbackground ||= $color{'faderbg'};
   
         my $templateset = join q{},
           map { qq~'$_' => "$templateset{$_}",\n~; } keys %templateset;
   
         if (@ext_prof_order) {
             $ext_prof_order = q{"} . join( q{","}, @ext_prof_order ) . q{"};
         }
         if (@ext_prof_fields) {
             $ext_prof_fields =
               q{"} . join( qq~",\n"~, @ext_prof_fields ) . q{"};
         }
   
         my $member_groups = "# Static Member Groups\n";
         foreach ( keys %Group ) {
             $member_groups .= qq~\$Group{'$_'} = '$Group{$_}';\n~;
         }
         $member_groups .= "\n# Post independent Member Groups\n";
         foreach ( keys %NoPost ) {
             $member_groups .= qq~\$NoPost{'$_'} = '$NoPost{$_}';\n~;
         }
         $member_groups .= "\n# Post dependent Member Groups\n";
         foreach ( keys %Post ) {
             $member_groups .= qq~\$Post{'$_'} = '$Post{$_}';\n~;
         }
   
         if (@pallist) { $pallist = q{"} . join( q{","}, @pallist ) . q{"}; }
   
         if ( $INFO{'page'} eq 'main' ) {
             if ( !$enable_notifications_N ) {
                 if ( !$enable_notifications_PM ) {
                     $enable_notifications = 0;
                 }
                 elsif ($enable_notifications_PM) {
                     $enable_notifications = 2;
                 }
             }
             elsif ($enable_notifications_N) {
                 if ( !$enable_notifications_PM ) {
                     $enable_notifications = 1;
                 }
                 elsif ($enable_notifications_PM) {
                     $enable_notifications = 3;
                 }
             }
         }
   
         my $AdvancedTabs = q{"} . join( q{","}, @AdvancedTabs ) . q{"};
   
         if (@SmilieURL) {
             $SmilieURL = q{"} . join( q{","}, @SmilieURL ) . q{"};
         }
         if (@SmilieCode) {
             $SmilieCode = q{"} . join( q{","}, @SmilieCode ) . q{"};
         }
         if (@SmilieDescription) {
             $SmilieDescription =
               q{"} . join( q{","}, @SmilieDescription ) . q{"};
         }
         if (@SmilieLinebreak) {
             $SmilieLinebreak = q{"} . join( q{","}, @SmilieLinebreak ) . q{"};
         }
   
       $smtp_server =~ s/^\s+|\s+$//g;         my $backup_paths = join q{ }, @backup_paths; 
   
       $setfile = << "EOF";         $smtp_server =~ s/^\s+|\s+$//gxsm; 
   
         $setfile = << "EOF";
############################################################################### ###############################################################################
# Settings.pl                                                                 # # Settings.pm                                                                 #
############################################################################### ###############################################################################
# YaBB: Yet another Bulletin Board                                            # # YaBB: Yet another Bulletin Board                                            #
# Open-Source Community Software for Webmasters                               # # Open-Source Community Software for Webmasters                               #
# Version:        YaBB 2.5.2                                                  # # Version:        YaBB 2.6.12                                                 #
# Packaged:       October 21, 2012                                            # # Packaged:       January 5, 2016                                             #
# Distributed by: http://www.yabbforum.com                                    # # Distributed by: http://www.yabbforum.com                                    #
# =========================================================================== # # =========================================================================== #
# Copyright (c) 2000-2012  YaBB (www.yabbforum.com) - All Rights Reserved.    # # Copyright (c) 2000-2016  YaBB (www.yabbforum.com) - All Rights Reserved.    #
# Software by:  The YaBB Development Team                                     # # Software by:  The YaBB Development Team                                     #
#               with assistance from the YaBB community.                      # #               with assistance from the YaBB community.                      #
############################################################################### ###############################################################################
   
########## Board Info ########## ########## Board Info ##########
# Note: these settings must be properly changed for YaBB to work # Note: these settings must be properly changed for YaBB to work
   
\$settings_file_version = "$YaBBversion";        # If not equal actual YaBBversion then the updating process is run through  \$settings_file_version = "$YaBBversion"; 
  # If not equal actual YaBBversion then the updating process is run through
\%templateset = (  \$yymycharset = '$yymycharset';                 # character encoding (usually ISO-8859-1 for older forums) 
$templateset);                        # Forum templates settings                                             # or 'UTF-8'; 
   
  \%templateset = ($templateset);             # Forum templates settings
   
  \$maintenance = $maintenance;               # Set to 1 to enable Maintenance mode
  \$rememberbackup = $rememberbackup;         # seconds past since last backup until alert is displayed
  \$maintenancetext = "\Q$maintenancetext\E"; # Admin-defined text for Maintenance mode
   
  \$guestaccess = $guestaccess;               # Set to 0 to disallow guests from doing anything but login or register
   
  \$mbname = "\Q$mbname\E";                   # The name of your YaBB forum
  \$forumstart = "\Q$forumstart\E";           # The start date of your YaBB Forum
  \$Cookie_Length = $Cookie_Length;           # Default minutes to set login cookies to stay for
  \$cookieusername = "\Q$cookieusername\E";   # Name of the username cookie
  \$cookiepassword = "\Q$cookiepassword\E";   # Name of the password cookie
  \$cookiesession_name = "\Q$cookiesession_name\E";   # Name of the Session cookie
  \$cookietsort = "\Q$cookietsort\E";   # Name of the message Index sort cookie
  \$cookieview = "\Q$cookieview\E";           # Name of the Guest Message Limit cookie
  \$cookieviewtime = $cookieviewtime;         # life time for Guest Message Limit cookie
  \$screenlogin = $screenlogin;                # allow members to login using their screen name.
   
  \$regtype = $regtype;                       # 0 = registration closed (only admin can register), 1 = pre registration with admin approval,
                                     # 2 = pre registration and email activation, 3 = open registration
  \$RegAgree = $RegAgree;                     # 0 = Don't show registration agreement, 1 = Show registration agreement before registration form, 2 = Show registration agreement on registration form
  \$imp_email_check = $imp_email_check;    # Set to 1 to enable improved e-mail check
  \$RegReasonSymbols = $RegReasonSymbols;         # Maximum allowed symbols in User reason(s) for registering
  \$preregspan = $preregspan;                 # Time span in hours for users to account activation before cleanup
  \$pwstrengthmeter_scores = "\Q$pwstrengthmeter_scores\E";   # Password-Strength-Meter Scores
  \$pwstrengthmeter_common = "\Q$pwstrengthmeter_common\E";   # Password-Strength-Meter common words
  \$pwstrengthmeter_minchar = $pwstrengthmeter_minchar;   # Password-Strength-Meter minimum characters
  \$emailpassword = $emailpassword;           # 0 - instant registration. 1 - password emailed to new members
  \$emailnewpass = $emailnewpass;             # Set to 1 to email a new password to members if they change their email address
  \$emailwelcome = $emailwelcome;             # Set to 1 to email a welcome message to users even when you have mail password turned off
  \$name_cannot_be_userid = $name_cannot_be_userid;   # Set to 1 to require users to have different usernames and display names
  \$birthday_on_reg = $birthday_on_reg;       # Set to 0: don't ask for birthday on registration
                                             # 1: ask for the birthday, no input required
                                             # 2: ask for the birthday, input required
   
  \$gender_on_reg = $gender_on_reg;           # 0: don't ask for gender on registration
                                             # 1: ask for gender, no input required
                                             # 2: ask for gender, input required
  \$nomailspammer = $nomailspammer;           # 1: send deleted account email
  \$lang = "\Q$lang\E";                       # Default Forum Language
  \$default_template = "\Q$default_template\E";   # Default Forum Template
   
  \$mailprog = "\Q$mailprog\E";               # Location of your sendmail program
  \$smtp_server = "\Q$smtp_server\E";         # Address of your SMTP-Server (for Net::SMTP::TLS, specify the port number with a ":<portnumber>" at the end)
  \$smtp_auth_required = $smtp_auth_required; # Set to 1 if the SMTP server requires Authorisation
  \$authuser = "\Q$authuser\E";               # Username for SMTP authorisation
  \$authpass = "\Q$authpass\E";               # Password for SMTP authorisation
  \$webmaster_email = "\Q$webmaster_email\E"; # Your email address. (eg: \$webmaster_email = q^admin\@host.com^;)
  \$mailtype = $mailtype;                     # Mail program to use: 0 = sendmail, 1 = SMTP, 2 = Net::SMTP, 3 = Net::SMTP::TLS
   
\$maintenance = $maintenance;                # Set to 1 to enable Maintenance mode  \$UseHelp_Perms = $UseHelp_Perms;           # Help Center: 1 == use permissions, 0 == don't use permissions 
\$rememberbackup = $rememberbackup;            # seconds past since last backup until alert is displayed  
\$maintenancetext = "\Q$maintenancetext\E";        # Admin-defined text for Maintenance mode  
   
\$guestaccess = $guestaccess;                # Set to 0 to disallow guests from doing anything but login or register  
   
\$mbname = "\Q$mbname\E";                # The name of your YaBB forum  
\$forumstart = "\Q$forumstart\E";            # The start date of your YaBB Forum  
\$Cookie_Length = $Cookie_Length;            # Default minutes to set login cookies to stay for  
\$cookieusername = "\Q$cookieusername\E";        # Name of the username cookie  
\$cookiepassword = "\Q$cookiepassword\E";        # Name of the password cookie  
\$cookiesession_name = "\Q$cookiesession_name\E";    # Name of the Session cookie  
   
\$regtype = $regtype;                    # 0 = registration closed (only admin can register), 1 = pre registration with admin approval,  
                           # 2 = pre registration and email activation, 3 = open registration  
\$RegAgree = $RegAgree;                    # Set to 1 to display the registration agreement when registering  
\$RegReasonSymbols = $RegReasonSymbols;            # Maximum allowed symbols in User reason(s) for registering  
\$preregspan = $preregspan;                # Time span in hours for users to account activation before cleanup  
\$pwstrengthmeter_scores = "\Q$pwstrengthmeter_scores\E";    # Password-Strength-Meter Scores  
\$pwstrengthmeter_common = "\Q$pwstrengthmeter_common\E";    # Password-Strength-Meter common words  
\$pwstrengthmeter_minchar = $pwstrengthmeter_minchar;    # Password-Strength-Meter minimum characters  
\$emailpassword = $emailpassword;            # 0 - instant registration. 1 - password emailed to new members  
\$emailnewpass = $emailnewpass;                # Set to 1 to email a new password to members if they change their email address  
\$emailwelcome = $emailwelcome;                # Set to 1 to email a welcome message to users even when you have mail password turned off  
\$name_cannot_be_userid = $name_cannot_be_userid;    # Set to 1 to require users to have different usernames and display names  
\$birthday_on_reg = $birthday_on_reg;            # Set to 0: don't ask for birthday on registration  
                           # 1: ask for the birthday, no input required  
                           # 2: ask for the birthday, input required  
   
\$gender_on_reg = $gender_on_reg;            # 0: don't ask for gender on registration  
                           # 1: ask for gender, no input required  
                           # 2: ask for gender, input required  
\$nomailspammer = $nomailspammer;         # 1: send deleted account email  
\$lang = "\Q$lang\E";                    # Default Forum Language  
\$default_template = "\Q$default_template\E";        # Default Forum Template  
   
\$mailprog = "\Q$mailprog\E";                # Location of your sendmail program  
\$smtp_server = "\Q$smtp_server\E";            # Address of your SMTP-Server (for Net::SMTP::TLS, specify the port number with a ":<portnumber>" at the end)  
\$smtp_auth_required = $smtp_auth_required;        # Set to 1 if the SMTP server requires Authorisation  
\$authuser = "\Q$authuser\E";                # Username for SMTP authorisation  
\$authpass = "\Q$authpass\E";                # Password for SMTP authorisation  
\$webmaster_email = "\Q$webmaster_email\E";        # Your email address. (eg: \$webmaster_email = q^admin\@host.com^;)  
\$mailtype = $mailtype;                    # Mail program to use: 0 = sendmail, 1 = SMTP, 2 = Net::SMTP, 3 = Net::SMTP::TLS  
   
\$UseHelp_Perms = $UseHelp_Perms;            # Help Center: 1 == use permissions, 0 == don't use permissions  
   
########## MemberGroups ########## ########## MemberGroups ##########
   
$member_groups $member_groups
\@nopostorder = qw(@nopostorder);            # Order how "Post independent Member Groups" are displayed \@nopostorder = qw(@nopostorder);           # Order how "Post independent Member Groups" are displayed
   
########## Layout ########## ########## Layout ##########
   
\$MenuType = $MenuType;                    # 1 for text menu or anything else for images menu \$MenuType = $MenuType;                     # 1 for text menu or anything else for images menu
\$profilebutton = $profilebutton;            # 1 to show view profile button under post, or 0 for blank \$profilebutton = $profilebutton;           # 1 to show view profile button under post, or 0 for blank
\$usertools = $usertools;                # Allow admin to hide the list of tools that show when clicking a userlink  \$threadtools = $threadtools;               # Enable dropdown for post actions 
\$allow_hide_email = $allow_hide_email;            # Allow users to hide their email from public. Set 0 to disable  \$posttools = $posttools;                   # Enable dropdown for post actions 
\$buddyListEnabled = $buddyListEnabled;            # Enable Buddy List  \$usertools = $usertools;                   # Allow admin to hide the list of tools that show when clicking a userlink 
\$addmemgroup_enabled = $addmemgroup_enabled;        # Enable Users choose additional MemberGroups  \$allow_hide_email = $allow_hide_email;     # Allow users to hide their email from public. Set 0 to disable 
\$showlatestmember = $showlatestmember;            # Set to 1 to display "Welcome Newest Member" on the Board Index  \$user_hide_avatars = $user_hide_avatars;       # Allow users to hide Avatars in threads. Set 0 to disable 
\$shownewsfader = $shownewsfader;            # 1 to allow or 0 to disallow NewsFader javascript  \$user_hide_user_text = $user_hide_user_text;       # Allow users to hide User Text in threads. Set 0 to disable 
\$Show_RecentBar = $Show_RecentBar;            # Set to 1 to display the Recent Post on Board Index  \$user_hide_img = $user_hide_img;       # Allow users to hide Images in threads. Set 0 to disable 
\$showmodify = $showmodify;                # Set to 1 to display "Last modified: Realname - Date" under each message  \$user_hide_attach_img = $user_hide_attach_img;     # Allow users to hide Attached Images in threads. Set 0 to disable 
\$ShowBDescrip = $ShowBDescrip;                # Set to 1 to display board descriptions on the topic (message) index for each board  \$user_hide_signat = $user_hide_signat;         # Allow users to hide User Signatures in threads. Set 0 to disable 
\$showuserpic = $showuserpic;                # Set to 1 to display each member's picture in the message view (by the ICQ.. etc.)  \$user_hide_smilies_row = $user_hide_smilies_row;   # Allow users to hide Smilies row below the Post Message-inputarea. Set 0 to disable 
\$showusertext = $showusertext;                # Set to 1 to display each member's personal text in the message view (by the ICQ.. etc.)  \$editGenderLimit = $editGenderLimit;       # Set a limit on the amount of times that member's can edit their gender 
\$showtopicviewers = $showtopicviewers;            # Set to 1 to display members viewing a topic  \$editAgeLimit = $editAgeLimit;             # Set a limit on the amount of times that member's can edit their birthdate 
\$showtopicrepliers = $showtopicrepliers;        # Set to 1 to display members replying to a topic  \$buddyListEnabled = $buddyListEnabled;     # Enable Buddy List 
\$showgenderimage = $showgenderimage;            # Set to 1 to display each member's gender in the message view (by the ICQ.. etc.)  \$addmemgroup_enabled = $addmemgroup_enabled;   # Enable Users choose additional MemberGroups 
\$showyabbcbutt = $showyabbcbutt;            # Set to 1 to display the yabbc buttons on Posting and IM Send Pages  \$showlatestmember = $showlatestmember;     # Set to 1 to display "Welcome Newest Member" on the Board Index 
\$nestedquotes = $nestedquotes;                # Set to 1 to allow quotes within quotes (0 will filter out quotes within a quoted message)  \$shownewsfader = $shownewsfader;           # 1 to allow or 0 to disallow NewsFader javascript 
\$parseflash = $parseflash;                # Set to 1 to parse the flash tag  \$Show_RecentBar = $Show_RecentBar;         # Set to 1 to display the Recent Post on Board Index 
\$enableclicklog = $enableclicklog;            # Set to 1 to track stats in Clicklog (this may slow your board down)  \$showmodify = $showmodify;                 # Set to 1 to display "Last modified: Realname - Date" under each message 
\$showimageinquote = $showimageinquote;            # Set to 1 to shows images in quotes, 0 displays a link to the image  \$ShowBDescrip = $ShowBDescrip;             # Set to 1 to display board descriptions on the topic (message) index for each board 
  \$showuserpic = $showuserpic;               # Set to 1 to display each member's avatar in the message view (by the ICQ.. etc.)
  \$showusertext = $showusertext;             # Set to 1 to display each member's personal text in the message view (by the ICQ.. etc.)
  \$showtopicviewers = $showtopicviewers;     # Set to 1 to display members viewing a topic
  \$showtopicrepliers = $showtopicrepliers;   # Set to 1 to display members replying to a topic
  \$hide_signat_for_guests = $hide_signat_for_guests; # Set to 1 to hide all signatures for Guests (only Members can see them).
  \$showgenderimage = $showgenderimage;       # Set to 1 to display each member's gender in the message view (by the ICQ.. etc.)
  \$showzodiac = $showzodiac;                     # Set to 1 to display each member's zodiac sign in view profile and message view
  \$showuserage = $showuserage;               # Set to 1 to display each member's age in the message view
  \$showage =