D:\my docs\My Received Files\Yabb\Yabb\YaBB_2.5_AEB\cgi-bin\yabb2_old\Admin\AdminEdit.pl D:\WEBSITES\testbed\cgi-bin\yabb252\Admin\AdminEdit.pl
############################################################################### ###############################################################################
# AdminEdit.pl                                                                # # AdminEdit.pl                                                                #
############################################################################### ###############################################################################
# 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 Anniversary Edition                                # # Version:        YaBB 2.5.2                                                  #
# Packaged:       July 04, 2010                                               # # Packaged:       September 30, 2012                                          #
# Distributed by: http://www.yabbforum.com                                    # # Distributed by: http://www.yabbforum.com                                    #
# =========================================================================== # # =========================================================================== #
# Copyright (c) 2000-2010 YaBB (www.yabbforum.com) - All Rights Reserved.     # # Copyright (c) 2000-2012 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.                      #
# Sponsored by: Xnull Internet Media, Inc. - http://www.ximinc.com            #    
#               Your source for web hosting, web design, and domains.         #    
############################################################################### ###############################################################################
   
$admineditplver = 'YaBB 2.5 AE $Revision: 1.38 $'; $admineditplver = 'YaBB 2.5.2 $Revision: 1.0 $';
if ($action eq 'detailedversion') { return 1; } if ($action eq 'detailedversion') { return 1; }
   
&LoadLanguage('Register'); &LoadLanguage('Register');
   
sub GmodSettings { sub GmodSettings {
   &is_admin;    &is_admin;
   
   &LoadLanguage('GModPrivileges');    &LoadLanguage('GModPrivileges');
   
   if (!-e ("$vardir/gmodsettings.txt")) { &GmodSettings2; }    if (!-e ("$vardir/gmodsettings.txt")) { &GmodSettings2; }
   
   require "$vardir/gmodsettings.txt";    require "$vardir/gmodsettings.txt";
   
   if ($gmod_newfile eq '') { &GmodSettings2; }    if ($gmod_newfile eq '') { &GmodSettings2; }
   
   fopen(MODACCESS, "$vardir/gmodsettings.txt");    fopen(MODACCESS, "$vardir/gmodsettings.txt");
   @scriptlines = <MODACCESS>;    @scriptlines = <MODACCESS>;
   fclose(MODACCESS);    fclose(MODACCESS);
   
   $startread = 0;    $startread = 0;
   $counter   = 0;    $counter   = 0;
   foreach $scriptline (@scriptlines) {    foreach $scriptline (@scriptlines) {
       chomp $scriptline;        chomp $scriptline;
       if (substr($scriptline, 0, 1) eq "'") {        if (substr($scriptline, 0, 1) eq "'") {
           $scriptline =~ s/newsettings\;page\=//;            $scriptline =~ s/newsettings\;page\=//;
           $scriptline =~ /\"(.*?)\"/;            $scriptline =~ /\"(.*?)\"/;
           $allow = $1;            $allow = $1;
           $scriptline =~ /\'(.*?)\'/;            $scriptline =~ /\'(.*?)\'/;
           $actionfound = $1;            $actionfound = $1;
           push(@actfound, $actionfound);            push(@actfound, $actionfound);
           push(@allowed,  $allow);            push(@allowed,  $allow);
           $counter++;            $counter++;
       }        }
   }    }
   $column  = int($counter / 2);    $column  = int($counter / 2);
   $counter = 0;    $counter = 0;
   $a       = 0;    $a       = 0;
   foreach $actfound (@actfound) {    foreach $actfound (@actfound) {
       $checked = '';        $checked = '';
       if ($allowed[$a] eq 'on') { $checked = ' checked="checked"'; }        if ($allowed[$a] eq 'on') { $checked = ' checked="checked"'; }
       $dismenu .= qq~\n<input type="checkbox" name="$actfound" id="$actfound"$checked />&nbsp;<label for="$actfound"><img src="$imagesdir/question.gif" align="middle" alt="$reftxt{'1a'} $gmodprivexpl_txt{$actfound}" title="$reftxt{'1a'} $gmodprivexpl_txt{$actfound}" border="0" /> $actfound</label><br />~;        $dismenu .= qq~\n<input type="checkbox" name="$actfound" id="$actfound"$checked />&nbsp;<label for="$actfound"><img src="$imagesdir/question.gif" align="middle" alt="$reftxt{'1a'} $gmodprivexpl_txt{$actfound}" title="$reftxt{'1a'} $gmodprivexpl_txt{$actfound}" border="0" /> $actfound</label><br />~;
       $counter++;        $counter++;
       $a++;        $a++;
       if ($counter > $column + 1) {        if ($counter > $column + 1) {
           $dismenu .= qq~</td><td align="left" class="windowbg2" valign="top" width="50%">~;            $dismenu .= qq~</td><td align="left" class="windowbg2" valign="top" width="50%">~;
           $counter = 0;            $counter = 0;
       }        }
   }    }
   
   if ($allow_gmod_admin) { $gmod_selected_a = ' checked="checked"'; }    if ($allow_gmod_admin) { $gmod_selected_a = ' checked="checked"'; }
   if ($allow_gmod_profile) {      if ($allow_gmod_profile) {  
       $gmod_selected_p = ' checked="checked"';        $gmod_selected_p = ' checked="checked"';
       if ($allow_gmod_aprofile) { $gmod_selected_ap = ' checked="checked"'; }        if ($allow_gmod_aprofile) { $gmod_selected_ap = ' checked="checked"'; }
   } else {    } else {
       $gmod_selected_ap = ' disabled="disabled"';        $gmod_selected_ap = ' disabled="disabled"';
   }    }
   
   $yymain .= qq~    $yymain .= qq~
<form action="$adminurl?action=gmodsettings2" method="post" enctype="application/x-www-form-urlencoded"> <form action="$adminurl?action=gmodsettings2" method="post" enctype="application/x-www-form-urlencoded">
<div class="bordercolor" style="padding: 0px; width: 99%; margin-left: 0px; margin-right: auto;"> <div class="bordercolor" style="padding: 0px; width: 99%; margin-left: 0px; margin-right: auto;">
  <table width="100%" cellspacing="1" cellpadding="4">   <table width="100%" cellspacing="1" cellpadding="4">
    <tr valign="middle">     <tr valign="middle">
      <td align="left" class="titlebg" colspan="2"><img src="$imagesdir/preferences.gif" alt="" border="0" /><b>$gmod_settings{'1'}</b></td>       <td align="left" class="titlebg" colspan="2"><img src="$imagesdir/preferences.gif" alt="" border="0" /><b>$gmod_settings{'1'}</b></td>
    </tr>     </tr>
    <tr valign="middle">     <tr valign="middle">
      <td align="left" class="windowbg2" colspan="2"><br />       <td align="left" class="windowbg2" colspan="2"><br />
<input type="checkbox" id="allow_gmod_admin" name="allow_gmod_admin"$gmod_selected_a /> <label for="allow_gmod_admin">$gmod_settings{'2'}</label><br /> <input type="checkbox" id="allow_gmod_admin" name="allow_gmod_admin"$gmod_selected_a /> <label for="allow_gmod_admin">$gmod_settings{'2'}</label><br />
<input type="checkbox" id="allow_gmod_profile" name="allow_gmod_profile"$gmod_selected_p onclick="depend(this.checked);" /> <label for="allow_gmod_profile">$gmod_settings{'3'}</label><br /> <input type="checkbox" id="allow_gmod_profile" name="allow_gmod_profile"$gmod_selected_p onclick="depend(this.checked);" /> <label for="allow_gmod_profile">$gmod_settings{'3'}</label><br />
<input type="checkbox" id="allow_gmod_aprofile" name="allow_gmod_aprofile"$gmod_selected_ap /> <label for="allow_gmod_aprofile">$gmod_settings{'3a'}</label><br /> <input type="checkbox" id="allow_gmod_aprofile" name="allow_gmod_aprofile"$gmod_selected_ap /> <label for="allow_gmod_aprofile">$gmod_settings{'3a'}</label><br />
<br /> <br />
      </td>       </td>
    </tr>     </tr>
    <tr valign="middle">     <tr valign="middle">
      <td align="left" class="catbg" colspan="2"><span class="small">$gmod_settings{'4'}</span></td>       <td align="left" class="catbg" colspan="2"><span class="small">$gmod_settings{'4'}</span></td>
    </tr>     </tr>
    <tr valign="middle">     <tr valign="middle">
      <td align="left" class="windowbg2" valign="top" width="50%">$dismenu</td>       <td align="left" class="windowbg2" valign="top" width="50%">$dismenu</td>
    </tr>     </tr>
    <tr valign="middle">     <tr valign="middle">
      <td align="center" class="catbg" colspan="2"><input type="submit" value="$reftxt{'4'}" class="button" /></td>       <td align="center" class="catbg" colspan="2"><input type="submit" value="$reftxt{'4'}" class="button" /></td>
    </tr>     </tr>
  </table>   </table>
</div> </div>
</form> </form>
   
<script type="text/javascript"> <script type="text/javascript">
<!-- <!--
function depend(value) { function depend(value) {
     if (value) {      if (value) {
       document.getElementById('allow_gmod_aprofile').disabled = false;        document.getElementById('allow_gmod_aprofile').disabled = false;
     } else {      } else {
         document.getElementById('allow_gmod_aprofile').checked = false;          document.getElementById('allow_gmod_aprofile').checked = false;
       document.getElementById('allow_gmod_aprofile').disabled = true;        document.getElementById('allow_gmod_aprofile').disabled = true;
     }      }
} }
//--> //-->
</script> </script>
   
~; ~;
   $yytitle     = "$gmod_settings{'1'}";    $yytitle     = "$gmod_settings{'1'}";
   $action_area = "gmodaccess";    $action_area = "gmodaccess";
   &AdminTemplate;    &AdminTemplate;
} }
   
sub EditBots { sub EditBots {
   &is_admin_or_gmod;    &is_admin_or_gmod;
   my ($line);    my ($line);
   $yymain .= qq~    $yymain .= qq~
<form action="$adminurl?action=editbots2" method="post" enctype="application/x-www-form-urlencoded"> <form action="$adminurl?action=editbots2" method="post" enctype="application/x-www-form-urlencoded">
<div class="bordercolor" style="padding: 0px; width: 99%; margin-left: 0px; margin-right: auto;"> <div class="bordercolor" style="padding: 0px; width: 99%; margin-left: 0px; margin-right: auto;">
  <table width="100%" cellspacing="1" cellpadding="4">   <table width="100%" cellspacing="1" cellpadding="4">
    <tr valign="middle">     <tr valign="middle">
      <td align="left" class="titlebg"><img src="$imagesdir/xx.gif" alt="" border="0" /><b>$admin_txt{'18'}</b></td>       <td align="left" class="titlebg"><img src="$imagesdir/xx.gif" alt="" border="0" /><b>$admin_txt{'18'}</b></td>
    </tr>     </tr>
    <tr valign="middle">     <tr valign="middle">
      <td align="left" class="windowbg2"><br />       <td align="left" class="windowbg2"><br />
   <span class="small">    <span class="small">
   $admin_txt{'19'}    $admin_txt{'19'}
   </span><br /><br />    </span><br /><br />
      </td>       </td>
    </tr>     </tr>
    <tr valign="middle">     <tr valign="middle">
      <td align="center" class="windowbg2"><br />       <td align="center" class="windowbg2"><br />
   <textarea cols="70" rows="35" name="bots" style="width:98%">~;    <textarea cols="70" rows="35" name="bots" style="width:98%">~;
   fopen(BOTS, "$vardir/bots.hosts");    fopen(BOTS, "$vardir/bots.hosts");
   while ($line = <BOTS>) { chomp $line; $yymain .= qq~$line\n~; }    while ($line = <BOTS>) { chomp $line; $yymain .= qq~$line\n~; }
   fclose(BOTS);    fclose(BOTS);
   $yymain .= qq~</textarea>    $yymain .= qq~</textarea>
   <br /><br />    <br /><br />
      </td>       </td>
    </tr>     </tr>
    <tr valign="middle">     <tr valign="middle">
      <td align="center" class="catbg"><input type="submit" value="$admin_txt{'10'}" class="button" /></td>       <td align="center" class="catbg"><input type="submit" value="$admin_txt{'10'}" class="button" /></td>
    </tr>     </tr>
  </table>   </table>
</div> </div>
</form> </form>
~; ~;
   $yytitle     = "$admin_txt{'18'}";    $yytitle     = "$admin_txt{'18'}";
   $action_area = "editbots";    $action_area = "editbots";
   &AdminTemplate;    &AdminTemplate;
} }
   
sub EditBots2 { sub EditBots2 {
   &is_admin_or_gmod;    &is_admin_or_gmod;
   
   fopen(BOTS, ">$vardir/bots.hosts", 1);    fopen(BOTS, ">$vardir/bots.hosts", 1);
   print BOTS map { "$_\n"; } sort { (split(/\|/, $a))[1] cmp (split(/\|/, $b))[1] } split(/[\n\r]+/, $FORM{'bots'});    print BOTS map { "$_\n"; } sort { (split(/\|/, $a))[1] cmp (split(/\|/, $b))[1] } split(/[\n\r]+/, $FORM{'bots'});
   fclose(BOTS);    fclose(BOTS);
   
   $yySetLocation = qq~$adminurl?action=editbots~;    $yySetLocation = qq~$adminurl?action=editbots~;
   &redirectexit;    &redirectexit;
} }
   
sub SetCensor { sub SetCensor {
   &is_admin_or_gmod;    &is_admin_or_gmod;
   my ($censorlanguage, $line);    my ($censorlanguage, $line);
   if ($FORM{'censorlanguage'}) { $censorlanguage = $FORM{'censorlanguage'} }    if ($FORM{'censorlanguage'}) { $censorlanguage = $FORM{'censorlanguage'} }
   else { $censorlanguage = $lang; }    else { $censorlanguage = $lang; }
   opendir(LNGDIR, $langdir);    opendir(LNGDIR, $langdir);
   my @lfilesanddirs = readdir(LNGDIR);    my @lfilesanddirs = readdir(LNGDIR);
   close(LNGDIR);    close(LNGDIR);
   
   foreach my $fld (sort {lc($a) cmp lc($b)} @lfilesanddirs) {    foreach my $fld (sort {lc($a) cmp lc($b)} @lfilesanddirs) {
       if (-d "$langdir/$fld" && $fld =~ m^\A[0-9a-zA-Z_\#\%\-\:\+\?\$\&\~\,\@/]+\Z^ && -e "$langdir/$fld/Main.lng") {        if (-d "$langdir/$fld" && $fld =~ m^\A[0-9a-zA-Z_\#\%\-\:\+\?\$\&\~\,\@/]+\Z^ && -e "$langdir/$fld/Main.lng") {
           if ($censorlanguage eq $fld) { $drawnldirs .= qq~<option value="$fld" selected="selected">$fld</option>~; }            if ($censorlanguage eq $fld) { $drawnldirs .= qq~<option value="$fld" selected="selected">$fld</option>~; }
           else { $drawnldirs .= qq~<option value="$fld">$fld</option>~; }            else { $drawnldirs .= qq~<option value="$fld">$fld</option>~; }
       }        }
   }    }
   
   my (@censored, $i);    my (@censored, $i);
   fopen(CENSOR, "$langdir/$censorlanguage/censor.txt");    fopen(CENSOR, "$langdir/$censorlanguage/censor.txt");
   @censored = <CENSOR>;    @censored = <CENSOR>;
   fclose(CENSOR);    fclose(CENSOR);
   foreach $i (@censored) {    foreach $i (@censored) {
       $i =~ tr/\r//d;        $i =~ tr/\r//d;
       $i =~ tr/\n//d;        $i =~ tr/\n//d;
   }    }
   $yymain .= qq~    $yymain .= qq~
<div class="bordercolor" style="padding: 0px; width: 99%; margin-left: 0px; margin-right: auto;"> <div class="bordercolor" style="padding: 0px; width: 99%; margin-left: 0px; margin-right: auto;">
  <table width="100%" cellspacing="1" cellpadding="4">   <table width="100%" cellspacing="1" cellpadding="4">
    <tr valign="middle">     <tr valign="middle">
      <td align="left" class="titlebg">       <td align="left" class="titlebg">
        <img src="$imagesdir/ban.gif" alt="" border="0" /><span class="legend"><b>$admin_txt{'135'}</b></span>         <img src="$imagesdir/ban.gif" alt="" border="0" /><span class="legend"><b>$admin_txt{'135'}</b></span>
      </td>       </td>
    </tr>     </tr>
    <tr align="center" valign="middle">     <tr align="center" valign="middle">
      <td align="left" class="windowbg2">       <td align="left" class="windowbg2">
   <form action="$adminurl?action=setcensor" method="post" enctype="application/x-www-form-urlencoded">    <form action="$adminurl?action=setcensor" method="post" enctype="application/x-www-form-urlencoded">
   $templs{'7'}    $templs{'7'}
   <select name="censorlanguage" id="censorlanguage" size="1">    <select name="censorlanguage" id="censorlanguage" size="1">
       $drawnldirs        $drawnldirs
   </select>    </select>
   <input type="submit" value="$admin_txt{'462'}" class="button" />    <input type="submit" value="$admin_txt{'462'}" class="button" />
   </form>    </form>
      </td>       </td>
    </tr>     </tr>
  </table>   </table>
</div> </div>
<br /> <br />
<div class="bordercolor" style="padding: 0px; width: 99%; margin-left: 0px; margin-right: auto;"> <div class="bordercolor" style="padding: 0px; width: 99%; margin-left: 0px; margin-right: auto;">
  <!-- Split for XHTML Validation purposes -->   <!-- Split for XHTML Validation purposes -->
  <form action="$adminurl?action=setcensor2" method="post" enctype="application/x-www-form-urlencoded">   <form action="$adminurl?action=setcensor2" method="post" enctype="application/x-www-form-urlencoded">
  <table width="100%" cellspacing="1" cellpadding="4">   <table width="100%" cellspacing="1" cellpadding="4">
    <tr valign="middle">     <tr valign="middle">
      <td align="left" class="windowbg2"><br />       <td align="left" class="windowbg2"><br />
        <label for="censored">$admin_txt{'136'}</label><br /><br />         <label for="censored">$admin_txt{'136'}</label><br /><br />
      </td>       </td>
    </tr>     </tr>
    <tr valign="middle">     <tr valign="middle">
      <td align="center" class="windowbg2"><br />       <td align="center" class="windowbg2"><br />
   <input type="hidden" name="censorlanguage" value="$censorlanguage" />    <input type="hidden" name="censorlanguage" value="$censorlanguage" />
   <textarea rows="35" cols="15" name="censored" id="censored" style="width:90%">~;    <textarea rows="35" cols="15" name="censored" id="censored" style="width:90%">~;
   foreach $i (@censored) {    foreach $i (@censored) {
       unless ($i && $i =~ m/.+[\=~].+/) { next; }        unless ($i && $i =~ m/.+[\=~].+/) { next; }
       $yymain .= "$i\n";        $yymain .= "$i\n";
   }    }
   $yymain .= qq~</textarea>    $yymain .= qq~</textarea>
       <br /><br />        <br /><br />
     </td>      </td>
    </tr>     </tr>
    <tr valign="middle">     <tr valign="middle">
      <td align="center" class="catbg">       <td align="center" class="catbg">
<input type="submit" value="$admin_txt{'10'} $censorlanguage" class="button" /> <input type="submit" value="$admin_txt{'10'} $censorlanguage" class="button" />
      </td>       </td>
    </tr>     </tr>
  </table>   </table>
  </form>   </form>
</div> </div>
~; ~;
   $yytitle     = "$admin_txt{'135'}";    $yytitle     = "$admin_txt{'135'}";
   $action_area = "setcensor";    $action_area = "setcensor";
   &AdminTemplate;    &AdminTemplate;
} }
   
sub SetCensor2 { # don't use &FromChars() here!!! sub SetCensor2 { # don't use &FromChars() here!!!
   &is_admin_or_gmod;    &is_admin_or_gmod;
   $FORM{'censored'} =~ tr/\r//d;    $FORM{'censored'} =~ tr/\r//d;
   $FORM{'censored'} =~ s~\A[\s\n]+~~;    $FORM{'censored'} =~ s~\A[\s\n]+~~;
   $FORM{'censored'} =~ s~[\s\n]+\Z~~;    $FORM{'censored'} =~ s~[\s\n]+\Z~~;
   $FORM{'censored'} =~ s~\n\s*\n~\n~g;    $FORM{'censored'} =~ s~\n\s*\n~\n~g;
   if ($FORM{'censorlanguage'}) { $censorlanguage = $FORM{'censorlanguage'}; }    if ($FORM{'censorlanguage'}) { $censorlanguage = $FORM{'censorlanguage'}; }
   else { $censorlanguage = $lang; }    else { $censorlanguage = $lang; }
   my @lines = split(/\n/, $FORM{'censored'});    my @lines = split(/\n/, $FORM{'censored'});
   fopen(CENSOR, ">$langdir/$censorlanguage/censor.txt", 1);    fopen(CENSOR, ">$langdir/$censorlanguage/censor.txt", 1);
   
   foreach my $i (@lines) {    foreach my $i (@lines) {
       $i =~ tr/\n//d;        $i =~ tr/\n//d;
       unless ($i && $i =~ m/.+[\=~].+/) { next; }        unless ($i && $i =~ m/.+[\=~].+/) { next; }
       print CENSOR "$i\n";        print CENSOR "$i\n";
   }    }
   fclose(CENSOR);    fclose(CENSOR);
   $yySetLocation = qq~$adminurl~;    $yySetLocation = qq~$adminurl~;
   &redirectexit;    &redirectexit;
} }
   
sub SetReserve { sub SetReserve {
   my (@reserved, @reservecfg, $i);    my (@reserved, @reservecfg, $i);
   &is_admin_or_gmod;    &is_admin_or_gmod;
   fopen(RESERVE, "$vardir/reserve.txt");    fopen(RESERVE, "$vardir/reserve.txt");
   @reserved = <RESERVE>;    @reserved = <RESERVE>;
   fclose(RESERVE);    fclose(RESERVE);
   fopen(RESERVECFG, "$vardir/reservecfg.txt");    fopen(RESERVECFG, "$vardir/reservecfg.txt");
   @reservecfg = <RESERVECFG>;    @reservecfg = <RESERVECFG>;
   fclose(RESERVECFG);    fclose(RESERVECFG);
   for (my $i = 0; $i < @reservecfg; $i++) {    for (my $i = 0; $i < @reservecfg; $i++) {
       chomp $reservecfg[$i];        chomp $reservecfg[$i];
       if($reservecfg[$i]) { $reservecheck[$i] = qq~ checked="checked"~; }        if($reservecfg[$i]) { $reservecheck[$i] = qq~ checked="checked"~; }
   }    }
   $yymain .= qq~    $yymain .= qq~
<form action="$adminurl?action=setreserve2" method="post" enctype="application/x-www-form-urlencoded"> <form action="$adminurl?action=setreserve2" method="post" enctype="application/x-www-form-urlencoded">
<div class="bordercolor" style="padding: 0px; width: 99%; margin-left: 0px; margin-right: auto;"> <div class="bordercolor" style="padding: 0px; width: 99%; margin-left: 0px; margin-right: auto;">
  <table width="100%" cellspacing="1" cellpadding="4">   <table width="100%" cellspacing="1" cellpadding="4">
    <tr valign="middle">     <tr valign="middle">
      <td align="left" class="titlebg"><img src="$imagesdir/profile.gif" alt="" border="0" /><b>$admin_txt{'341'}</b></td>       <td align="left" class="titlebg"><img src="$imagesdir/profile.gif" alt="" border="0" /><b>$admin_txt{'341'}</b></td>
    </tr>     </tr>
    <tr valign="middle">     <tr valign="middle">
      <td align="left" class="windowbg2"><br />       <td align="left" class="windowbg2"><br />
        $admin_txt{'699'}<br /><br />         $admin_txt{'699'}<br /><br />
      </td>       </td>
    </tr>     </tr>
    <tr valign="middle">     <tr valign="middle">
      <td align="left" class="windowbg2"><br />       <td align="left" class="windowbg2"><br />
       $admin_txt{'342'}<br /><br />        $admin_txt{'342'}<br /><br />
           <center><textarea cols="40" rows="35" name="reserved" style="width:95%">~;            <center><textarea cols="40" rows="35" name="reserved" style="width:95%">~;
   foreach $i (@reserved) {    foreach $i (@reserved) {
       chomp $i;        chomp $i;
       $i =~ s~\t~~g;        $i =~ s~\t~~g;
       if ($i !~ m~\A[\S|\s]*[\n\r]*\Z~) { next; }        if ($i !~ m~\A[\S|\s]*[\n\r]*\Z~) { next; }
       $yymain .= "$i\n";        $yymain .= "$i\n";
   }    }
   $yymain .= qq~</textarea>    $yymain .= qq~</textarea>
   </center>    </center>
<br /><br /> <br /><br />
   <input type="checkbox" name="matchword" id="matchword" value="checked"$reservecheck[0] />    <input type="checkbox" name="matchword" id="matchword" value="checked"$reservecheck[0] />
   <label for="matchword">$admin_txt{'726'}</label><br />    <label for="matchword">$admin_txt{'726'}</label><br />
   <input type="checkbox" name="matchcase" id="matchcase" value="checked"$reservecheck[1] />    <input type="checkbox" name="matchcase" id="matchcase" value="checked"$reservecheck[1] />
   <label for="matchcase">$admin_txt{'727'}</label><br />    <label for="matchcase">$admin_txt{'727'}</label><br />
   <input type="checkbox" name="matchuser" id="matchuser" value="checked"$reservecheck[2] />    <input type="checkbox" name="matchuser" id="matchuser" value="checked"$reservecheck[2] />
   <label for="matchuser">$admin_txt{'728'}</label><br />    <label for="matchuser">$admin_txt{'728'}</label><br />
   <input type="checkbox" name="matchname" id="matchname" value="checked"$reservecheck[3] />    <input type="checkbox" name="matchname" id="matchname" value="checked"$reservecheck[3] />
   <label for="matchname">$admin_txt{'729'}</label><br />    <label for="matchname">$admin_txt{'729'}</label><br />
      </td>       </td>
    </tr>     </tr>
    <tr valign="middle">     <tr valign="middle">
      <td align="center" class="catbg"><input type="submit" value="$admin_txt{'10'}" class="button" /></td>       <td align="center" class="catbg"><input type="submit" value="$admin_txt{'10'}" class="button" /></td>
    </tr>     </tr>
  </table>   </table>
</div> </div>
</form> </form>
~; ~;
   $yytitle     = "$admin_txt{'341'}";    $yytitle     = "$admin_txt{'341'}";
   $action_area = "setreserve";    $action_area = "setreserve";
   &AdminTemplate;    &AdminTemplate;
} }
   
sub SetReserve2 { sub SetReserve2 {
   &is_admin_or_gmod;    &is_admin_or_gmod;
   $FORM{'reserved'} =~ tr/\r//d;    $FORM{'reserved'} =~ tr/\r//d;
   $FORM{'reserved'} =~ s~\A[\s\n]+~~;    $FORM{'reserved'} =~ s~\A[\s\n]+~~;
   $FORM{'reserved'} =~ s~[\s\n]+\Z~~;    $FORM{'reserved'} =~ s~[\s\n]+\Z~~;
   $FORM{'reserved'} =~ s~\n\s*\n~\n~g;    $FORM{'reserved'} =~ s~\n\s*\n~\n~g;
   fopen(RESERVE, ">$vardir/reserve.txt", 1);    fopen(RESERVE, ">$vardir/reserve.txt", 1);
   my $matchword = $FORM{'matchword'} eq 'checked' ? 'checked' : '';    my $matchword = $FORM{'matchword'} eq 'checked' ? 'checked' : '';
   my $matchcase = $FORM{'matchcase'} eq 'checked' ? 'checked' : '';    my $matchcase = $FORM{'matchcase'} eq 'checked' ? 'checked' : '';
   my $matchuser = $FORM{'matchuser'} eq 'checked' ? 'checked' : '';    my $matchuser = $FORM{'matchuser'} eq 'checked' ? 'checked' : '';
   my $matchname = $FORM{'matchname'} eq 'checked' ? 'checked' : '';    my $matchname = $FORM{'matchname'} eq 'checked' ? 'checked' : '';
   print RESERVE $FORM{'reserved'};    print RESERVE $FORM{'reserved'};
   fclose(RESERVE);    fclose(RESERVE);
   fopen(RESERVECFG, "+>$vardir/reservecfg.txt");    fopen(RESERVECFG, "+>$vardir/reservecfg.txt");
   print RESERVECFG "$matchword\n";    print RESERVECFG "$matchword\n";
   print RESERVECFG "$matchcase\n";    print RESERVECFG "$matchcase\n";
   print RESERVECFG "$matchuser\n";    print RESERVECFG "$matchuser\n";
   print RESERVECFG "$matchname\n";    print RESERVECFG "$matchname\n";
   fclose(RESERVECFG);    fclose(RESERVECFG);
   $yySetLocation = qq~$adminurl~;    $yySetLocation = qq~$adminurl~;
   &redirectexit;    &redirectexit;
} }
   
sub ModifyAgreement { sub ModifyAgreement {
   &is_admin_or_gmod;    &is_admin_or_gmod;
   
   opendir(LNGDIR, $langdir);    opendir(LNGDIR, $langdir);
   my @lfilesanddirs = readdir(LNGDIR);    my @lfilesanddirs = readdir(LNGDIR);
   close(LNGDIR);    close(LNGDIR);
   
   my $agreementlanguage = $FORM{'agreementlanguage'} || $INFO{'agreementlanguage'} || $lang;    my $agreementlanguage = $FORM{'agreementlanguage'} || $INFO{'agreementlanguage'} || $lang;
   foreach my $fld (sort {lc($a) cmp lc($b)} @lfilesanddirs) {    foreach my $fld (sort {lc($a) cmp lc($b)} @lfilesanddirs) {
       if (-d "$langdir/$fld" && $fld =~ m^\A[0-9a-zA-Z_\#\%\-\:\+\?\$\&\~\,\@/]+\Z^ && -e "$langdir/$fld/Main.lng") {        if (-d "$langdir/$fld" && $fld =~ m^\A[0-9a-zA-Z_\#\%\-\:\+\?\$\&\~\,\@/]+\Z^ && -e "$langdir/$fld/Main.lng") {
           if ($agreementlanguage eq $fld) { $drawnldirs .= qq~<option value="$fld" selected="selected">$fld</option>~; }            if ($agreementlanguage eq $fld) { $drawnldirs .= qq~<option value="$fld" selected="selected">$fld</option>~; }
           else { $drawnldirs .= qq~<option value="$fld">$fld</option>~; }            else { $drawnldirs .= qq~<option value="$fld">$fld</option>~; }
       }        }
   }    }
   
   my ($fullagreement, $line);    my ($fullagreement, $line);
   fopen(AGREE, "$langdir/$agreementlanguage/agreement.txt");    fopen(AGREE, "$langdir/$agreementlanguage/agreement.txt");
   while ($line = <AGREE>) {    while ($line = <AGREE>) {
       $line =~ tr/[\r\n]//d;        $line =~ tr/[\r\n]//d;
       &FromHTML($line);        &FromHTML($line);
       $fullagreement .= qq~$line\n~;        $fullagreement .= qq~$line\n~;
   }    }
   fclose(AGREE);    fclose(AGREE);
   $yymain .= qq~    $yymain .= qq~
   
<div class="bordercolor" style="padding: 0px; width: 99%; margin-left: 0px; margin-right: auto;"> <div class="bordercolor" style="padding: 0px; width: 99%; margin-left: 0px; margin-right: auto;">
  <table width="100%" cellspacing="1" cellpadding="4">   <table width="100%" cellspacing="1" cellpadding="4">
    <tr valign="middle">     <tr valign="middle">
      <td align="left" class="titlebg"><img src="$imagesdir/xx.gif" alt="" border="0" /><b>$admin_txt{'764'}</b></td>       <td align="left" class="titlebg"><img src="$imagesdir/xx.gif" alt="" border="0" /><b>$admin_txt{'764'}</b></td>
    </tr>     </tr>
    <tr valign="middle">     <tr valign="middle">
      <td align="left" class="windowbg2"><br />       <td align="left" class="windowbg2"><br />
       <label for="agreement">$admin_txt{'765'}</label><br /><br />        <label for="agreement">$admin_txt{'765'}</label><br /><br />
      </td>       </td>
    </tr>     </tr>
    <tr valign="middle">     <tr valign="middle">
      <td align="left" class="windowbg2"><br />       <td align="left" class="windowbg2"><br />
   <form action="$adminurl?action=modagreement" method="post" enctype="application/x-www-form-urlencoded">    <form action="$adminurl?action=modagreement" method="post" enctype="application/x-www-form-urlencoded">
   $templs{'8'}    $templs{'8'}
   <select name="agreementlanguage" id="agreementlanguage" size="1">    <select name="agreementlanguage" id="agreementlanguage" size="1">
       $drawnldirs        $drawnldirs
   </select>    </select>
   <input type="submit" value="$admin_txt{'462'}" class="button" />    <input type="submit" value="$admin_txt{'462'}" class="button" />
   </form>    </form>
      </td>       </td>
    </tr>     </tr>
    <tr valign="middle">     <tr valign="middle">
      <td align="center" class="windowbg2"><br />       <td align="center" class="windowbg2"><br />
   <form action="$adminurl?action=modagreement2" method="post" enctype="application/x-www-form-urlencoded">    <form action="$adminurl?action=modagreement2" method="post" enctype="application/x-www-form-urlencoded">
   <input type="hidden" name="destination" value="$INFO{'destination'}" />    <input type="hidden" name="destination" value="$INFO{'destination'}" />
   <input type="hidden" name="agreementlanguage" value="$agreementlanguage" />    <input type="hidden" name="agreementlanguage" value="$agreementlanguage" />
   <textarea rows="35" cols="95" name="agreement" id="agreement" style="width:95%">$fullagreement</textarea><br /><br />    <textarea rows="35" cols="95" name="agreement" id="agreement" style="width:95%">$fullagreement</textarea><br /><br />
      </td>       </td>
    </tr>     </tr>
    <tr valign="middle">     <tr valign="middle">
      <td align="center" class="catbg"><input type="submit" value="$admin_txt{'10'} $agreementlanguage" class="button" /></td>       <td align="center" class="catbg"><input type="submit" value="$admin_txt{'10'} $agreementlanguage" class="button" /></td>
    </tr>     </tr>
   </form>    </form>
  </table>   </table>
</div> </div>
~; ~;
   $yytitle     = "$admin_txt{'764'}";    $yytitle     = "$admin_txt{'764'}";
   $action_area = "modagreement";    $action_area = "modagreement";
   &AdminTemplate;    &AdminTemplate;
} }
   
sub ModifyAgreement2 { sub ModifyAgreement2 {
   &is_admin_or_gmod;    &is_admin_or_gmod;
   
   if ($FORM{'agreementlanguage'}) { $agreementlanguage = $FORM{'agreementlanguage'}; }    if ($FORM{'agreementlanguage'}) { $agreementlanguage = $FORM{'agreementlanguage'}; }
   else { $agreementlanguage = $lang; }    else { $agreementlanguage = $lang; }
   $FORM{'agreement'} =~ tr/\r//d;    $FORM{'agreement'} =~ tr/\r//d;
   $FORM{'agreement'} =~ s~\A\n+~~;    $FORM{'agreement'} =~ s~\A\n+~~;
   $FORM{'agreement'} =~ s~\n+\Z~~;    $FORM{'agreement'} =~ s~\n+\Z~~;
   fopen(AGREE, ">$langdir/$agreementlanguage/agreement.txt");    fopen(AGREE, ">$langdir/$agreementlanguage/agreement.txt");
   print AGREE $FORM{'agreement'};    print AGREE $FORM{'agreement'};
   fclose(AGREE);    fclose(AGREE);
   
   $FORM{'agreement'} =~ s/\n/<br \/>\n/g;    $FORM{'agreement'} =~ s/\n/<br \/>\n/g;
   fopen(HELPAGREE, ">$helpfile/$agreementlanguage/User/user00_agreement.help");    fopen(HELPAGREE, ">$helpfile/$agreementlanguage/User/user00_agreement.help");
   print HELPAGREE qq^\$SectionName = "$register_txt{'764a'}";    print HELPAGREE qq^\$SectionName = "$register_txt{'764a'}";
   
### Section 1 ### Section 1
############################################# #############################################
\$SectionSub1 = "$register_txt{'764a'}"; \$SectionSub1 = "$register_txt{'764a'}";
\$SectionBody1 = qq~<p>$FORM{'agreement'}</p>~; \$SectionBody1 = qq~<p>$FORM{'agreement'}</p>~;
############################################# #############################################
   
   
1;^; 1;^;
   fclose(HELPAGREE);    fclose(HELPAGREE);
   
   $yySetLocation = $FORM{'destination'} ? qq~$adminurl?action=$FORM{'destination'}~ : qq~$adminurl?action=modagreement;agreementlanguage=$FORM{'agreementlanguage'}~;    $yySetLocation = $FORM{'destination'} ? qq~$adminurl?action=$FORM{'destination'}~ : qq~$adminurl?action=modagreement;agreementlanguage=$FORM{'agreementlanguage'}~;
   &redirectexit;    &redirectexit;
} }
   
sub GmodSettings2 { sub GmodSettings2 {
   &is_admin;    &is_admin;
   
   # modstyle is set the same as modcss as modcss is useless without it.    # modstyle is set the same as modcss as modcss is useless without it.
   $mynewsettings = $FORM{'main'} || $FORM{'advanced'} || $FORM{'news'} || $FORM{'security'}|| $FORM{'antispam'};    $mynewsettings = $FORM{'main'} || $FORM{'advanced'} || $FORM{'news'} || $FORM{'security'}|| $FORM{'antispam'};
   
   $FORM{'viewmembers'} = "on" if $FORM{'deletemultimembers'} eq 'on' || $FORM{'addmember'} eq 'on';    $FORM{'viewmembers'} = "on" if $FORM{'deletemultimembers'} eq 'on' || $FORM{'addmember'} eq 'on';
   
   my $filler  = q~                                                                               ~;    my $filler  = q~                                                                               ~;
   my $setfile = << "EOF";    my $setfile = << "EOF";
### Gmod Related Setttings ### ### Gmod Related Setttings ###
   
\$allow_gmod_admin = "$FORM{'allow_gmod_admin'}"; # \$allow_gmod_admin = "$FORM{'allow_gmod_admin'}"; #
\$allow_gmod_profile = "$FORM{'allow_gmod_profile'}"; # \$allow_gmod_profile = "$FORM{'allow_gmod_profile'}"; #
\$allow_gmod_aprofile = "$FORM{'allow_gmod_aprofile'}"; # \$allow_gmod_aprofile = "$FORM{'allow_gmod_aprofile'}"; #
\$gmod_newfile = "on"; # \$gmod_newfile = "on"; #
   
### Areas Gmods can Access ### ### Areas Gmods can Access ###
   
%gmod_access = ( %gmod_access = (
'ext_admin',"$FORM{'ext_admin'}", 'ext_admin',"$FORM{'ext_admin'}",
   
'newsettings;page=main',"$FORM{'main'}", 'newsettings;page=main',"$FORM{'main'}",
'newsettings;page=advanced', "$FORM{'advanced'}", 'newsettings;page=advanced', "$FORM{'advanced'}",
'editbots',"$FORM{'editbots'}", 'editbots',"$FORM{'editbots'}",
   
'newsettings;page=news',"$FORM{'news'}", 'newsettings;page=news',"$FORM{'news'}",
'smilies',"$FORM{'smilies'}", 'smilies',"$FORM{'smilies'}",
'setcensor',"$FORM{'setcensor'}", 'setcensor',"$FORM{'setcensor'}",
'modagreement',"$FORM{'modagreement'}", 'modagreement',"$FORM{'modagreement'}",
   
'referer_control',"$FORM{'referer_control'}", 'referer_control',"$FORM{'referer_control'}",
'newsettings;page=security',"$FORM{'security'}", 'newsettings;page=security',"$FORM{'security'}",
'setup_guardian',"$FORM{'setup_guardian'}", 'setup_guardian',"$FORM{'setup_guardian'}",
'newsettings;page=antispam',"$FORM{'antispam'}", 'newsettings;page=antispam',"$FORM{'antispam'}",
   
'managecats',"$FORM{'managecats'}", 'managecats',"$FORM{'managecats'}",
'manageboards',"$FORM{'manageboards'}", 'manageboards',"$FORM{'manageboards'}",
'helpadmin',"$FORM{'helpadmin'}", 'helpadmin',"$FORM{'helpadmin'}",
'editemailtemplates',"$FORM{'editemailtemplates'}", 'editemailtemplates',"$FORM{'editemailtemplates'}",
   
'addmember',"$FORM{'addmember'}", 'addmember',"$FORM{'addmember'}",
'viewmembers',"$FORM{'viewmembers'}", 'viewmembers',"$FORM{'viewmembers'}",
'deletemultimembers',"$FORM{'deletemultimembers'}", 'deletemultimembers',"$FORM{'deletemultimembers'}",
'modmemgr',"$FORM{'modmemgr'}", 'modmemgr',"$FORM{'modmemgr'}",
'mailing',"$FORM{'mailing'}", 'mailing',"$FORM{'mailing'}",
'ipban',"$FORM{'ipban'}", 'ipban',"$FORM{'ipban'}",
'setreserve',"$FORM{'setreserve'}", 'setreserve',"$FORM{'setreserve'}",
   
'modskin',"$FORM{'modskin'}", 'modskin',"$FORM{'modskin'}",
'modcss',"$FORM{'modcss'}", 'modcss',"$FORM{'modcss'}",
'modtemp',"$FORM{'modtemp'}", 'modtemp',"$FORM{'modtemp'}",
   
'clean_log',"$FORM{'clean_log'}", 'clean_log',"$FORM{'clean_log'}",
'boardrecount',"$FORM{'boardrecount'}", 'boardrecount',"$FORM{'boardrecount'}",
'rebuildmesindex',"$FORM{'rebuildmesindex'}", 'rebuildmesindex',"$FORM{'rebuildmesindex'}",
'membershiprecount',"$FORM{'membershiprecount'}", 'membershiprecount',"$FORM{'membershiprecount'}",
'rebuildmemlist',"$FORM{'rebuildmemlist'}", 'rebuildmemlist',"$FORM{'rebuildmemlist'}",
'rebuildmemhist',"$FORM{'rebuildmemhist'}", 'rebuildmemhist',"$FORM{'rebuildmemhist'}",
'rebuildnotifications',"$FORM{'rebuildnotifications'}", 'rebuildnotifications',"$FORM{'rebuildnotifications'}",
'deleteoldthreads',"$FORM{'deleteoldthreads'}", 'deleteoldthreads',"$FORM{'deleteoldthreads'}",
'manageattachments',"$FORM{'manageattachments'}", 'manageattachments',"$FORM{'manageattachments'}",
   
'detailedversion',"$FORM{'detailedversion'}", 'detailedversion',"$FORM{'detailedversion'}",
'stats',"$FORM{'stats'}", 'stats',"$FORM{'stats'}",
'showclicks',"$FORM{'showclicks'}", 'showclicks',"$FORM{'showclicks'}",
'errorlog',"$FORM{'errorlog'}", 'errorlog',"$FORM{'errorlog'}",
   
'view_reglog',"$FORM{'view_reglog'}", 'view_reglog',"$FORM{'view_reglog'}",
   
'modlist',"$FORM{'modlist'}", 'modlist',"$FORM{'modlist'}",
); );
   
%gmod_access2 = ( %gmod_access2 = (
admin => "$FORM{'allow_gmod_admin'}", admin => "$FORM{'allow_gmod_admin'}",
   
newsettings => "$mynewsettings", newsettings => "$mynewsettings",
newsettings2 => "$mynewsettings", newsettings2 => "$mynewsettings",
   
deleteattachment => "$FORM{'manageattachments'}", deleteattachment => "$FORM{'manageattachments'}",
manageattachments2 => "$FORM{'manageattachments'}", manageattachments2 => "$FORM{'manageattachments'}",
removeoldattachments => "$FORM{'manageattachments'}", removeoldattachments => "$FORM{'manageattachments'}",
removebigattachments => "$FORM{'manageattachments'}", removebigattachments => "$FORM{'manageattachments'}",
rebuildattach => "$FORM{'manageattachments'}", rebuildattach => "$FORM{'manageattachments'}",
remghostattach => "$FORM{'manageattachments'}", remghostattach => "$FORM{'manageattachments'}",
   
profile => "$FORM{'allow_gmod_profile'}", profile => "$FORM{'allow_gmod_profile'}",
profile2 => "$FORM{'allow_gmod_profile'}", profile2 => "$FORM{'allow_gmod_profile'}",
profileAdmin => "$FORM{'allow_gmod_aprofile'}", profileAdmin => "$FORM{'allow_gmod_aprofile'}",
profileAdmin2 => "$FORM{'allow_gmod_aprofile'}", profileAdmin2 => "$FORM{'allow_gmod_aprofile'}",
profileContacts => "$FORM{'allow_gmod_profile'}", profileContacts => "$FORM{'allow_gmod_profile'}",
profileContacts2 => "$FORM{'allow_gmod_profile'}", profileContacts2 => "$FORM{'allow_gmod_profile'}",
profileIM => "$FORM{'allow_gmod_profile'}", profileIM => "$FORM{'allow_gmod_profile'}",
profileIM2 => "$FORM{'allow_gmod_profile'}", profileIM2 => "$FORM{'allow_gmod_profile'}",
profileOptions => "$FORM{'allow_gmod_profile'}", profileOptions => "$FORM{'allow_gmod_profile'}",
profileOptions2 => "$FORM{'allow_gmod_profile'}", profileOptions2 => "$FORM{'allow_gmod_profile'}",
   
ext_edit => "$FORM{'ext_admin'}", ext_edit => "$FORM{'ext_admin'}",
ext_edit2 => "$FORM{'ext_admin'}", ext_edit2 => "$FORM{'ext_admin'}",
ext_create => "$FORM{'ext_admin'}", ext_create => "$FORM{'ext_admin'}",
ext_reorder => "$FORM{'ext_admin'}", ext_reorder => "$FORM{'ext_admin'}",
ext_convert => "$FORM{'ext_admin'}", ext_convert => "$FORM{'ext_admin'}",
   
myprofileAdmin => "$FORM{'allow_gmod_aprofile'}", myprofileAdmin => "$FORM{'allow_gmod_aprofile'}",
myprofileAdmin2 => "$FORM{'allow_gmod_aprofile'}", myprofileAdmin2 => "$FORM{'allow_gmod_aprofile'}",
   
delgroup => "$FORM{'modmemgr'}", delgroup => "$FORM{'modmemgr'}",
editgroup => "$FORM{'modmemgr'}", editgroup => "$FORM{'modmemgr'}",
editAddGroup2 => "$FORM{'modmemgr'}", editAddGroup2 => "$FORM{'modmemgr'}",
modmemgr2 => "$FORM{'modmemgr'}", modmemgr2 => "$FORM{'modmemgr'}",
assigned => "$FORM{'modmemgr'}", assigned => "$FORM{'modmemgr'}",
assigned2 => "$FORM{'modmemgr'}", assigned2 => "$FORM{'modmemgr'}",
   
reordercats => "$FORM{'managecats'}", reordercats => "$FORM{'managecats'}",
reordercats2 => "$FORM{'managecats'}", reordercats2 => "$FORM{'managecats'}",
modifycatorder => "$FORM{'managecats'}", modifycatorder => "$FORM{'managecats'}",
modifycat => "$FORM{'managecats'}", modifycat => "$FORM{'managecats'}",
createcat => "$FORM{'managecats'}", createcat => "$FORM{'managecats'}",
catscreen => "$FORM{'managecats'}", catscreen => "$FORM{'managecats'}",
addcat => "$FORM{'managecats'}", addcat => "$FORM{'managecats'}",
addcat2 => "$FORM{'managecats'}", addcat2 => "$FORM{'managecats'}",
   
modskin => "$FORM{'modskin'}", modskin => "$FORM{'modskin'}",
modskin2 => "$FORM{'modskin'}", modskin2 => "$FORM{'modskin'}",
modcss => "$FORM{'modcss'}", modcss => "$FORM{'modcss'}",
modcss2 => "$FORM{'modcss'}", modcss2 => "$FORM{'modcss'}",
modstyle => "$FORM{'modcss'}", modstyle => "$FORM{'modcss'}",
modstyle2 => "$FORM{'modcss'}", modstyle2 => "$FORM{'modcss'}",
modtemplate2 => "$FORM{'modtemp'}", modtemplate2 => "$FORM{'modtemp'}",
modtemp2 => "$FORM{'modtemp'}", modtemp2 => "$FORM{'modtemp'}",
   
modifyboard => "$FORM{'manageboards'}", modifyboard => "$FORM{'manageboards'}",
addboard => "$FORM{'manageboards'}", addboard => "$FORM{'manageboards'}",
addboard2 => "$FORM{'manageboards'}", addboard2 => "$FORM{'manageboards'}",
reorderboards => "$FORM{'manageboards'}", reorderboards => "$FORM{'manageboards'}",
reorderboards2 => "$FORM{'manageboards'}", reorderboards2 => "$FORM{'manageboards'}",
boardscreen => "$FORM{'manageboards'}", boardscreen => "$FORM{'manageboards'}",
   
smilieput => "$FORM{'smilies'}", smilieput => "$FORM{'smilies'}",
smilieindex => "$FORM{'smilies'}", smilieindex => "$FORM{'smilies'}",
smiliemove => "$FORM{'smilies'}", smiliemove => "$FORM{'smilies'}",
addsmilies => "$FORM{'smilies'}", addsmilies => "$FORM{'smilies'}",
   
addmember => "$FORM{'addmember'}", addmember => "$FORM{'addmember'}",
addmember2 => "$FORM{'addmember'}", addmember2 => "$FORM{'addmember'}",
ml => "$FORM{'viewmembers'}", ml => "$FORM{'viewmembers'}",
deletemultimembers => "$FORM{'deletemultimembers'}", deletemultimembers => "$FORM{'deletemultimembers'}",
   
mailmultimembers => "$FORM{'mailing'}", mailmultimembers => "$FORM{'mailing'}",
mailing2 => "$FORM{'mailing'}", mailing2 => "$FORM{'mailing'}",
   
activate => "$FORM{'view_reglog'}", activate => "$FORM{'view_reglog'}",
admin_descision => "$FORM{'view_reglog'}", admin_descision => "$FORM{'view_reglog'}",
apr_regentry => "$FORM{'view_reglog'}", apr_regentry => "$FORM{'view_reglog'}",
del_regentry => "$FORM{'view_reglog'}", del_regentry => "$FORM{'view_reglog'}",
rej_regentry => "$FORM{'view_reglog'}", rej_regentry => "$FORM{'view_reglog'}",
view_regentry => "$FORM{'view_reglog'}", view_regentry => "$FORM{'view_reglog'}",
clean_reglog => "$FORM{'view_reglog'}", clean_reglog => "$FORM{'view_reglog'}",
   
cleanerrorlog => "$FORM{'errorlog'}", cleanerrorlog => "$FORM{'errorlog'}",
deleteerror => "$FORM{'errorlog'}", deleteerror => "$FORM{'errorlog'}",
   
modagreement2 => "$FORM{'modagreement'}", modagreement2 => "$FORM{'modagreement'}",
advsettings2 => "$FORM{'advsettings'}", advsettings2 => "$FORM{'advsettings'}",
referer_control2 => "$FORM{'referer_control'}", referer_control2 => "$FORM{'referer_control'}",
removeoldthreads => "$FORM{'deleteoldthreads'}", removeoldthreads => "$FORM{'deleteoldthreads'}",
ipban2 => "$FORM{'ipban'}", ipban2 => "$FORM{'ipban'}",
ipban3 => "$FORM{'ipban'}", ipban3 => "$FORM{'ipban'}",
setcensor2 => "$FORM{'setcensor'}", setcensor2 => "$FORM{'setcensor'}",
setreserve2 => "$FORM{'setreserve'}", setreserve2 => "$FORM{'setreserve'}",
   
editbots2 => "$FORM{'editbots'}", editbots2 => "$FORM{'editbots'}",
); );
   
1; 1;
EOF EOF
   
   $setfile =~ s~(.+\;)\s+(\#.+$)~$1 . substr( $filler, 0, (70-(length $1)) ) . $2 ~gem;    $setfile =~ s~(.+\;)\s+(\#.+$)~$1 . substr( $filler, 0, (70-(length $1)) ) . $2 ~gem;
   $setfile =~ s~(.{64,}\;)\s+(\#.+$)~$1 . "\n   " . $2~gem;    $setfile =~ s~(.{64,}\;)\s+(\#.+$)~$1 . "\n   " . $2~gem;
   $setfile =~ s~^\s\s\s+(\#.+$)~substr( $filler, 0, 70 ) . $1~gem;    $setfile =~ s~^\s\s\s+(\#.+$)~substr( $filler, 0, 70 ) . $1~gem;
   
   fopen(MODACCESS, ">$vardir/gmodsettings.txt");    fopen(MODACCESS, ">$vardir/gmodsettings.txt");
   print MODACCESS $setfile;    print MODACCESS $setfile;
   fclose(MODACCESS);    fclose(MODACCESS);
   
   $yySetLocation = qq~$adminurl~;    $yySetLocation = qq~$adminurl~;
   &redirectexit;    &redirectexit;
} }
   
sub EditPaths { sub EditPaths {
   # Simple output of env variables, for troubleshooting    # Simple output of env variables, for troubleshooting
   if ($ENV{'SCRIPT_FILENAME'} ne "") {    if ($ENV{'SCRIPT_FILENAME'} ne "") {
       $support_env_path = $ENV{'SCRIPT_FILENAME'};        $support_env_path = $ENV{'SCRIPT_FILENAME'};
   
       # replace \'s with /'s for Windows Servers        # replace \'s with /'s for Windows Servers
       $support_env_path =~ s~\\~/~g;        $support_env_path =~ s~\\~/~g;
   
       # Remove Setupl.pl and cgi - and also nph- for buggy IIS.        # Remove Setupl.pl and cgi - and also nph- for buggy IIS.
       $support_env_path =~ s~(nph-)?AdminIndex.(pl|cgi)~~ig;        $support_env_path =~ s~(nph-)?AdminIndex.(pl|cgi)~~ig;
   } elsif ($ENV{'PATH_TRANSLATED'} ne "") {    } elsif ($ENV{'PATH_TRANSLATED'} ne "") {
       $support_env_path = $ENV{'PATH_TRANSLATED'};        $support_env_path = $ENV{'PATH_TRANSLATED'};
   
       # replace \'s with /'s for Windows Servers        # replace \'s with /'s for Windows Servers
       $support_env_path =~ s~\\~/~g;        $support_env_path =~ s~\\~/~g;
   
       # Remove Setupl.pl and cgi - and also nph- for buggy IIS.        # Remove Setupl.pl and cgi - and also nph- for buggy IIS.
       $support_env_path =~ s~(nph-)?AdminIndex.(pl|cgi)~~ig;        $support_env_path =~ s~(nph-)?AdminIndex.(pl|cgi)~~ig;
   }    }
   
   $yymain .= qq~    $yymain .= qq~
<div class="bordercolor" style="padding: 0px; width: 99%; margin-left: 0px; margin-right: auto;"> <div class="bordercolor" style="padding: 0px; width: 99%; margin-left: 0px; margin-right: auto;">
  <table width="100%" cellspacing="1" cellpadding="4">   <table width="100%" cellspacing="1" cellpadding="4">
    <tr valign="middle">     <tr valign="middle">
      <td align="left" class="titlebg"><b>$edit_paths_txt{'33'}</b></td>       <td align="left" class="titlebg"><b>$edit_paths_txt{'33'}</b></td>
    </tr>     </tr>
    <tr align="center" valign="middle">     <tr align="center" valign="middle">
      <td align="left" class="catbg"><span class="small">$edit_paths_txt{'34'}</span></td>       <td align="left" class="catbg"><span class="small">$edit_paths_txt{'34'}</span></td>
    </tr>     </tr>
    <tr valign="middle">     <tr valign="middle">
      <td align="left" class="windowbg2">       <td align="left" class="windowbg2">
           <br />            <br />
           $support_env_path            $support_env_path
           <br />            <br />
           <br />            <br />
      </td>       </td>
    </tr>     </tr>
  </table>   </table>
</div> </div>
   
<br /> <br />
<br /> <br />
   
<form action="$adminurl?action=editpaths2" method="post" enctype="application/x-www-form-urlencoded"> <form action="$adminurl?action=editpaths2" method="post" enctype="application/x-www-form-urlencoded">
<div class="bordercolor" style="padding: 0px; width: 99%; margin-left: 0px; margin-right: auto;"> <div class="bordercolor" style="padding: 0px; width: 99%; margin-left: 0px; margin-right: auto;">
  <table width="100%" cellspacing="1" cellpadding="4">   <table width="100%" cellspacing="1" cellpadding="4">
    <tr valign="middle">     <tr valign="middle">
      <td align="left" class="titlebg">       <td align="left" class="titlebg">
       <img src="$imagesdir/preferences.gif" alt="" border="0" />        <img src="$imagesdir/preferences.gif" alt="" border="0" />
&nbsp;<b>$edit_paths_txt{'1'}</b> &nbsp;<b>$edit_paths_txt{'1'}</b>
      </td>       </td>
    </tr>     </tr>
    <tr align="center" valign="middle">     <tr align="center" valign="middle">
      <td align="left" class="catbg"><span class="small">$edit_paths_txt{'2'}</span></td>       <td align="left" class="catbg"><span class="small">$edit_paths_txt{'2'}</span></td>
    </tr>     </tr>
    <tr valign="middle">     <tr valign="middle">
      <td align="left" class="windowbg2">       <td align="left" class="windowbg2">
       <div class="setting_cell">        <div class="setting_cell">
           <label for="boarddir">$edit_paths_txt{'4'}</label>            <label for="boarddir">$edit_paths_txt{'4'}</label>
       </div>        </div>
       <div class="setting_cell2">        <div class="setting_cell2">
           <input type="text" name="boarddir" id="boarddir" size="50" value="$boarddir" />            <input type="text" name="boarddir" id="boarddir" size="50" value="$boarddir" />
       </div>        </div>
       <br />        <br />
       <div class="setting_cell">        <div class="setting_cell">
           <label for="admindir">$edit_paths_txt{'9'}</label>            <label for="admindir">$edit_paths_txt{'9'}</label>
       </div>        </div>
       <div class="setting_cell2">        <div class="setting_cell2">
           <input type="text" name="admindir" id="admindir" size="50" value="$admindir" />            <input type="text" name="admindir" id="admindir" size="50" value="$admindir" />
       </div>        </div>
       <br />        <br />
       <div class="setting_cell">        <div class="setting_cell">
           <label for="boardsdir">$edit_paths_txt{'5'}</label>            <label for="boardsdir">$edit_paths_txt{'5'}</label>
       </div>        </div>
       <div class="setting_cell2">        <div class="setting_cell2">
           <input type="text" name="boardsdir" id="boardsdir" size="50" value="$boardsdir" />            <input type="text" name="boardsdir" id="boardsdir" size="50" value="$boardsdir" />
       </div>        </div>
       <br />        <br />
       <div class="setting_cell">        <div class="setting_cell">
           <label for="helpfile">$edit_paths_txt{'12'}</label>            <label for="helpfile">$edit_paths_txt{'12'}</label>
       </div>        </div>
       <div class="setting_cell2">        <div class="setting_cell2">
           <input type="text" name="helpfile" id="helpfile" size="50" value="$helpfile" />            <input type="text" name="helpfile" id="helpfile" size="50" value="$helpfile" />
       </div>        </div>
       <br />        <br />
       <div class="setting_cell">        <div class="setting_cell">
           <label for="langdir">$edit_paths_txt{'11'}</label>            <label for="langdir">$edit_paths_txt{'11'}</label>
       </div>        </div>
       <div class="setting_cell2">        <div class="setting_cell2">
           <input type="text" name="langdir" id="langdir" size="50" value="$langdir" />            <input type="text" name="langdir" id="langdir" size="50" value="$langdir" />
       </div>        </div>
       <br />        <br />
       <div class="setting_cell">        <div class="setting_cell">
           <label for="memberdir">$edit_paths_txt{'7'}</label>            <label for="memberdir">$edit_paths_txt{'7'}</label>
       </div>        </div>
       <div class="setting_cell2">        <div class="setting_cell2">
           <input type="text" name="memberdir" id="memberdir" size="50" value="$memberdir" />            <input type="text" name="memberdir" id="memberdir" size="50" value="$memberdir" />
       </div>        </div>
       <br />        <br />
       <div class="setting_cell">        <div class="setting_cell">
           <label for="datadir">$edit_paths_txt{'6'}</label>            <label for="datadir">$edit_paths_txt{'6'}</label>
       </div>        </div>
       <div class="setting_cell2">        <div class="setting_cell2">
           <input type="text" name="datadir" id="datadir" size="50" value="$datadir" />            <input type="text" name="datadir" id="datadir" size="50" value="$datadir" />
       </div>        </div>
       <br />        <br />
       <div class="setting_cell">        <div class="setting_cell">
           <label for="sourcedir">$edit_paths_txt{'8'}</label>            <label for="sourcedir">$edit_paths_txt{'8'}</label>
       </div>        </div>
       <div class="setting_cell2">        <div class="setting_cell2">
           <input type="text" name="sourcedir" id="sourcedir" size="50" value="$sourcedir" />            <input type="text" name="sourcedir" id="sourcedir" size="50" value="$sourcedir" />
       </div>        </div>
       <br />        <br />
       <div class="setting_cell">        <div class="setting_cell">
           <label for="templatesdir">$edit_paths_txt{'13'}</label>            <label for="templatesdir">$edit_paths_txt{'13'}</label>
       </div>        </div>
       <div class="setting_cell2">        <div class="setting_cell2">
           <input type="text" name="templatesdir" id="templatesdir" size="50" value="$templatesdir" />            <input type="text" name="templatesdir" id="templatesdir" size="50" value="$templatesdir" />
       </div>        </div>
       <br />        <br />
       <div class="setting_cell">        <div class="setting_cell">
           <label for="vardir">$edit_paths_txt{'10'}</label>            <label for="vardir">$edit_paths_txt{'10'}</label>
       </div>        </div>
       <div class="setting_cell2">        <div class="setting_cell2">
           <input type="text" name="vardir" id="vardir" size="50" value="$vardir" />            <input type="text" name="vardir" id="vardir" size="50" value="$vardir" />
       </div>        </div>
       <br />        <br />
   <!--    <div class="setting_cell">    <!--    <div class="setting_cell">
           <label for="forumstylesdir">$edit_paths_txt{'14'}</label>            <label for="forumstylesdir">$edit_paths_txt{'14'}</label>
       </div>        </div>
       <div class="setting_cell2">        <div class="setting_cell2">
           <input type="text" name="forumstylesdir" id="forumstylesdir" size="50" value="$forumstylesdir" />            <input type="text" name="forumstylesdir" id="forumstylesdir" size="50" value="$forumstylesdir" />
       </div>        </div>
       <br />        <br />
       <div class="setting_cell">        <div class="setting_cell">
           <label for="adminstylesdir">$edit_paths_txt{'15'}</label>            <label for="adminstylesdir">$edit_paths_txt{'15'}</label>
       </div>        </div>
       <div class="setting_cell2">        <div class="setting_cell2">
           <input type="text" name="adminstylesdir" id="adminstylesdir" size="50" value="$adminstylesdir" />            <input type="text" name="adminstylesdir" id="adminstylesdir" size="50" value="$adminstylesdir" />
       </div>        </div>
       <br />        <br />
   -->    <div>&nbsp;</div>    -->    <div>&nbsp;</div>
       <div class="setting_cell">        <div class="setting_cell">
           <label for="htmldir">$edit_paths_txt{'16'}</label>            <label for="htmldir">$edit_paths_txt{'16'}</label>
       </div>        </div>
       <div class="setting_cell2">        <div class="setting_cell2">
           <input type="text" name="htmldir" id="htmldir" size="50" value="$htmldir" />            <input type="text" name="htmldir" id="htmldir" size="50" value="$htmldir" />
       </div>        </div>
       <br />        <br />
   <!--    <div class="setting_cell">    <!--    <div class="setting_cell">
           <label for="smiliesdir">$edit_paths_txt{'18'}</label>            <label for="smiliesdir">$edit_paths_txt{'18'}</label>
       </div>        </div>
       <div class="setting_cell2">        <div class="setting_cell2">
           <input type="text" name="smiliesdir" id="smiliesdir" size="50" value="$smiliesdir" />            <input type="text" name="smiliesdir" id="smiliesdir" size="50" value="$smiliesdir" />
       </div>        </div>
       <br />        <br />
       <div class="setting_cell">        <div class="setting_cell">
           <label for="modimgdir">$edit_paths_txt{'19'}</label>            <label for="modimgdir">$edit_paths_txt{'19'}</label>
       </div>        </div>
       <div class="setting_cell2">        <div class="setting_cell2">
           <input type="text" name="modimgdir" id="modimgdir" size="50" value="$modimgdir" />            <input type="text" name="modimgdir" id="modimgdir" size="50" value="$modimgdir" />
       </div>        </div>
       <br />        <br />
   -->    <div class="setting_cell">    -->    <div class="setting_cell">
           <label for="uploaddir">$edit_paths_txt{'20'}</label>            <label for="uploaddir">$edit_paths_txt{'20'}</label>
       </div>        </div>
       <div class="setting_cell2">        <div class="setting_cell2">
           <input type="text" name="uploaddir" id="uploaddir" size="50" value="$uploaddir" />            <input type="text" name="uploaddir" id="uploaddir" size="50" value="$uploaddir" />
       </div>        </div>
       <br />        <br />
       <div class="setting_cell">        <div class="setting_cell">
           <label for="facesdir">$edit_paths_txt{'17'}</label>            <label for="facesdir">$edit_paths_txt{'17'}</label>
       </div>        </div>
       <div class="setting_cell2">        <div class="setting_cell2">
           <input type="text" name="facesdir" id="facesdir" size="50" value="$facesdir" />            <input type="text" name="facesdir" id="facesdir" size="50" value="$facesdir" />
       </div>        </div>
      </td>       </td>
    </tr>     </tr>
    <tr align="center" valign="middle">     <tr align="center" valign="middle">
      <td align="left" class="catbg"><span class="small">$edit_paths_txt{'21'}</span></td>       <td align="left" class="catbg"><span class="small">$edit_paths_txt{'21'}</span></td>
    </tr>     </tr>
    <tr valign="middle">     <tr valign="middle">
      <td align="left" class="windowbg2">       <td align="left" class="windowbg2">
       <div class="setting_cell">        <div class="setting_cell">
           <label for="boardurl">$edit_paths_txt{'3'}</label>            <label for="boardurl">$edit_paths_txt{'3'}</label>
       </div>        </div>
       <div class="setting_cell2">        <div class="setting_cell2">
           <input type="text" name="boardurl" id="boardurl" size="50" value="$boardurl" />            <input type="text" name="boardurl" id="boardurl" size="50" value="$boardurl" />
       </div>        </div>
       <div>&nbsp;</div>        <div>&nbsp;</div>
   <!--    <div class="setting_cell">    <!--    <div class="setting_cell">
           <label for="forumstylesurl">$edit_paths_txt{'22'}</label>            <label for="forumstylesurl">$edit_paths_txt{'22'}</label>
       </div>        </div>
       <div class="setting_cell2">        <div class="setting_cell2">
           <input type="text" name="forumstylesurl" id="forumstylesurl" size="50" value="$forumstylesurl" />            <input type="text" name="forumstylesurl" id="forumstylesurl" size="50" value="$forumstylesurl" />
       </div>        </div>
       <br />        <br />
       <div class="setting_cell">        <div class="setting_cell">
           <label for="adminstylesurl">$edit_paths_txt{'23'}</label>            <label for="adminstylesurl">$edit_paths_txt{'23'}</label>
       </div>        </div>
       <div class="setting_cell2">        <div class="setting_cell2">
           <input type="text" name="adminstylesurl" id="adminstylesurl" size="50" value="$adminstylesurl" />            <input type="text" name="adminstylesurl" id="adminstylesurl" size="50" value="$adminstylesurl" />
       </div>        </div>
       <br />        <br />
   -->    <div class="setting_cell">    -->    <div class="setting_cell">
           <label for="yyhtml_root">$edit_paths_txt{'28'}</label>            <label for="yyhtml_root">$edit_paths_txt{'28'}</label>
       </div>        </div>
       <div class="setting_cell2">        <div class="setting_cell2">
           <input type="text" name="yyhtml_root" id="yyhtml_root" size="50" value="$yyhtml_root" />            <input type="text" name="yyhtml_root" id="yyhtml_root" size="50" value="$yyhtml_root" />
       </div>        </div>
       <br />        <br />
   <!--    <div class="setting_cell">    <!--    <div class="setting_cell">
           <label for="smiliesurl">$edit_paths_txt{'30'}</label>            <label for="smiliesurl">$edit_paths_txt{'30'}</label>
       </div>        </div>
       <div class="setting_cell2">        <div class="setting_cell2">
           <input type="text" name="smiliesurl" id="smiliesurl" size="50" value="$smiliesurl" />            <input type="text" name="smiliesurl" id="smiliesurl" size="50" value="$smiliesurl" />
       </div>        </div>
       <br />        <br />
       <div class="setting_cell">        <div class="setting_cell">
           <label for="modimgurl">$edit_paths_txt{'31'}</label>            <label for="modimgurl">$edit_paths_txt{'31'}</label>
       </div>        </div>
       <div class="setting_cell2">        <div class="setting_cell2">
           <input type="text" name="modimgurl" id="modimgurl" size="50" value="$modimgurl" />            <input type="text" name="modimgurl" id="modimgurl" size="50" value="$modimgurl" />
       </div>        </div>
       <br />        <br />
   -->    <div class="setting_cell">    -->    <div class="setting_cell">
           <label for="uploadurl">$edit_paths_txt{'32'}</label>            <label for="uploadurl">$edit_paths_txt{'32'}</label>
       </div>        </div>
       <div class="setting_cell2">        <div class="setting_cell2">
           <input type="text" name="uploadurl" id="uploadurl" size="50" value="$uploadurl" />            <input type="text" name="uploadurl" id="uploadurl" size="50" value="$uploadurl" />
       </div>        </div>
       <br />        <br />
       <div class="setting_cell">        <div class="setting_cell">
           <label for="facesurl">$edit_paths_txt{'29'}</label>            <label for="facesurl">$edit_paths_txt{'29'}</label>
       </div>        </div>
       <div class="setting_cell2">        <div class="setting_cell2">
           <input type="text" name="facesurl" id="facesurl" size="50" value="$facesurl" />            <input type="text" name="facesurl" id="facesurl" size="50" value="$facesurl" />
       </div>        </div>
      </td>       </td>
    </tr>     </tr>
    <tr valign="middle">     <tr valign="middle">
      <td align="center" class="catbg">       <td align="center" class="catbg">
        <input type="hidden" name="lastsaved" value="${$uid.$username}{'realname'}" />         <input type="hidden" name="lastsaved" value="${$uid.$username}{'realname'}" />
        <input type="hidden" name="lastdate" value="$date" />         <input type="hidden" name="lastdate" value="$date" />
        <input type="submit" value="$admin_txt{'10'}" class="button" />         <input type="submit" value="$admin_txt{'10'}" class="button" />
      </td>       </td>
    </tr>     </tr>
  </table>   </table>
</div> </div>
</form> </form>
~; ~;
   $yytitle     = "$edit_paths_txt{'1'}";    $yytitle     = "$edit_paths_txt{'1'}";
   $action_area = "editpaths";    $action_area = "editpaths";
   &AdminTemplate;    &AdminTemplate;
} }
   
sub EditPaths2 { sub EditPaths2 {
   &LoadCookie;          # Load the user's cookie (or set to guest)    &LoadCookie;          # Load the user's cookie (or set to guest)
   &LoadUserSettings;    &LoadUserSettings;
   if (!$iamadmin) { &admin_fatal_error("no_access"); }    if (!$iamadmin) { &admin_fatal_error("no_access"); }
   
   $lastsaved      = $FORM{'lastsaved'};    $lastsaved      = $FORM{'lastsaved'};
   $lastdate       = $FORM{'lastdate'};    $lastdate       = $FORM{'lastdate'};
   $boardurl       = $FORM{'boardurl'};    $boardurl       = $FORM{'boardurl'};
   $boarddir       = $FORM{'boarddir'};    $boarddir       = $FORM{'boarddir'};
   $htmldir        = $FORM{'htmldir'};    $htmldir        = $FORM{'htmldir'};
   $uploaddir      = $FORM{'uploaddir'};    $uploaddir      = $FORM{'uploaddir'};
   $uploadurl      = $FORM{'uploadurl'};    $uploadurl      = $FORM{'uploadurl'};
   $yyhtml_root    = $FORM{'yyhtml_root'};    $yyhtml_root    = $FORM{'yyhtml_root'};
   $datadir        = $FORM{'datadir'};    $datadir        = $FORM{'datadir'};
   $boardsdir      = $FORM{'boardsdir'};    $boardsdir      = $FORM{'boardsdir'};
   $memberdir      = $FORM{'memberdir'};    $memberdir      = $FORM{'memberdir'};
   $sourcedir      = $FORM{'sourcedir'};    $sourcedir      = $FORM{'sourcedir'};
   $admindir       = $FORM{'admindir'};    $admindir       = $FORM{'admindir'};
   $vardir         = $FORM{'vardir'};    $vardir         = $FORM{'vardir'};
   $langdir        = $FORM{'langdir'};    $langdir        = $FORM{'langdir'};
   $helpfile       = $FORM{'helpfile'};    $helpfile       = $FORM{'helpfile'};
   $templatesdir   = $FORM{'templatesdir'};    $templatesdir   = $FORM{'templatesdir'};
   #$forumstylesdir = $FORM{'forumstylesdir'};    #$forumstylesdir = $FORM{'forumstylesdir'};
   #$forumstylesurl = $FORM{'forumstylesurl'};    #$forumstylesurl = $FORM{'forumstylesurl'};
   #$adminstylesdir = $FORM{'adminstylesdir'};    #$adminstylesdir = $FORM{'adminstylesdir'};
   #$adminstylesurl = $FORM{'adminstylesurl'};    #$adminstylesurl = $FORM{'adminstylesurl'};
   $facesdir       = $FORM{'facesdir'};    $facesdir       = $FORM{'facesdir'};
   $facesurl       = $FORM{'facesurl'};    $facesurl       = $FORM{'facesurl'};
   #$smiliesdir     = $FORM{'smiliesdir'};    #$smiliesdir     = $FORM{'smiliesdir'};
   #$smiliesurl     = $FORM{'smiliesurl'};    #$smiliesurl     = $FORM{'smiliesurl'};
   #$modimgdir      = $FORM{'modimgdir'};    #$modimgdir      = $FORM{'modimgdir'};
   #$modimgurl      = $FORM{'modimgurl'};    #$modimgurl      = $FORM{'modimgurl'};
   
   my $filler  = q~                                                                               ~;    my $filler  = q~                                                                               ~;
   my $setfile = << "EOF";    my $setfile = << "EOF";
############################################################################### ###############################################################################
# Paths.pl                                                                    # # Paths.pl                                                                    #
############################################################################### ###############################################################################
# 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 Anniversary Edition                                # # Version:        YaBB 2.5.2                                                  #
# Packaged:       July 04, 2010                                               # # Packaged:       September 30, 2012                                          #
# Distributed by: http://www.yabbforum.com                                    # # Distributed by: http://www.yabbforum.com                                    #
# =========================================================================== # # =========================================================================== #
# Copyright (c) 2000-2010 YaBB (www.yabbforum.com) - All Rights Reserved.     # # Copyright (c) 2000-2012 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.                      #
# Sponsored by: Xnull Internet Media, Inc. - http://www.ximinc.com            #    
#               Your source for web hosting, web design, and domains.         #    
############################################################################### ###############################################################################
   
\$lastsaved = "$lastsaved"; \$lastsaved = "$lastsaved";
\$lastdate = "$lastdate"; \$lastdate = "$lastdate";
   
########## Directories ########## ########## Directories ##########
   
\$boardurl = "$boardurl";                # URL of your board's folder (without trailing '/') \$boardurl = "$boardurl";                # URL of your board's folder (without trailing '/')
\$boarddir = "$boarddir";                # The server path to the board's folder (usually can be left as '.') \$boarddir = "$boarddir";                # The server path to the board's folder (usually can be left as '.')
\$boardsdir = "$boardsdir";                # Directory with board data files \$boardsdir = "$boardsdir";                # Directory with board data files
\$datadir = "$datadir";                    # Directory with messages \$datadir = "$datadir";                    # Directory with messages
\$memberdir = "$memberdir";                # Directory with member files \$memberdir = "$memberdir";                # Directory with member files
\$sourcedir = "$sourcedir";                # Directory with YaBB source files \$sourcedir = "$sourcedir";                # Directory with YaBB source files
\$admindir = "$admindir";                # Directory with YaBB admin source files \$admindir = "$admindir";                # Directory with YaBB admin source files
\$vardir = "$vardir";                    # Directory with variable files \$vardir = "$vardir";                    # Directory with variable files
\$langdir = "$langdir";                    # Directory with Language files and folders \$langdir = "$langdir";                    # Directory with Language files and folders
\$helpfile = "$helpfile";                # Directory with Help files and folders \$helpfile = "$helpfile";                # Directory with Help files and folders
\$templatesdir = "$templatesdir";            # Directory with template files and folders \$templatesdir = "$templatesdir";            # Directory with template files and folders
\$htmldir = "$htmldir";                    # Base Path for all public-html files and folders \$htmldir = "$htmldir";                    # Base Path for all public-html files and folders
\$facesdir = "$facesdir";                # Base Path for all avatar files \$facesdir = "$facesdir";                # Base Path for all avatar files
\$uploaddir = "$uploaddir";                # Base Path for all attachment files \$uploaddir = "$uploaddir";                # Base Path for all attachment files
   
########## URL's ########## ########## URL's ##########
   
\$yyhtml_root = "$yyhtml_root";                # Base URL for all html/css files and folders \$yyhtml_root = "$yyhtml_root";                # Base URL for all html/css files and folders
\$facesurl = "$facesurl";                # Base URL for all avatar files \$facesurl = "$facesurl";                # Base URL for all avatar files
\$uploadurl = "$uploadurl";                # Base URL for all attachment files \$uploadurl = "$uploadurl";                # Base URL for all attachment files
   
########## Old Path Settings ########## ########## Old Path Settings ##########
########## The following variables are deprecated! ########## ########## The following variables are deprecated! ##########
########## Don't use them for new code! ########## ########## Don't use them for new code! ##########
   
\$forumstylesdir = \$htmldir . "/Templates/Forum";    # Directory with forum style files and folders \$forumstylesdir = \$htmldir . "/Templates/Forum";    # Directory with forum style files and folders
\$adminstylesdir = \$htmldir . "/Templates/Admin";    # Directory with admin style files and folders \$adminstylesdir = \$htmldir . "/Templates/Admin";    # Directory with admin style files and folders
\$smiliesdir = \$htmldir . "/Smilies";            # Base Path for all smilie files \$smiliesdir = \$htmldir . "/Smilies";            # Base Path for all smilie files
\$modimgdir = \$htmldir . "/ModImages";            # Base Path for all mod images \$modimgdir = \$htmldir . "/ModImages";            # Base Path for all mod images
   
\$forumstylesurl = \$yyhtml_root . "/Templates/Forum";    # Default Forum Style Directory \$forumstylesurl = \$yyhtml_root . "/Templates/Forum";    # Default Forum Style Directory
\$adminstylesurl = \$yyhtml_root . "/Templates/Admin";    # Default Admin Style Directory \$adminstylesurl = \$yyhtml_root . "/Templates/Admin";    # Default Admin Style Directory
\$smiliesurl = \$yyhtml_root . "/Smilies";        # Base URL for all smilie files \$smiliesurl = \$yyhtml_root . "/Smilies";        # Base URL for all smilie files
\$modimgurl = \$yyhtml_root . "/ModImages";        # Base URL for all mod images \$modimgurl = \$yyhtml_root . "/ModImages";        # Base URL for all mod images
   
1; 1;
EOF EOF
   
   $setfile =~ s~(.+\;)\s+(\#.+$)~$1 . substr( $filler, 0, (70-(length $1)) ) . $2 ~gem;    $setfile =~ s~(.+\;)\s+(\#.+$)~$1 . substr( $filler, 0, (70-(length $1)) ) . $2 ~gem;
   $setfile =~ s~(.{64,}\;)\s+(\#.+$)~$1 . "\n   " . $2~gem;    $setfile =~ s~(.{64,}\;)\s+(\#.+$)~$1 . "\n   " . $2~gem;
   $setfile =~ s~^\s\s\s+(\#.+$)~substr( $filler, 0, 70 ) . $1~gem;    $setfile =~ s~^\s\s\s+(\#.+$)~substr( $filler, 0, 70 ) . $1~gem;
   
   fopen(FILE, ">Paths.pl");    fopen(FILE, ">Paths.pl");
   print FILE $setfile;    print FILE $setfile;
   fclose(FILE);    fclose(FILE);
   
   $yySetLocation = qq~$adminurl~;    $yySetLocation = qq~$adminurl~;
   &redirectexit;    &redirectexit;
} }
   
1; 1;