F:\WEBSITES\testbed\zipped\yabb_svn_new\branches\2.5.2\cgi-bin\yabb2\Admin\Admin.pl F:\WEBSITES\testbed\zipped\yabb_svn_new\trunk\cgi-bin\yabb2\Admin\Admin.pm
############################################################################### ###############################################################################
# Admin.pl                                                                    # # Admin.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 CGI::Carp qw(fatalsToBrowser);
  use CGI qw(:standard);
  use English qw(-no_match_vars);
  use Time::Local;
  our $VERSION = '2.6.12';
   
$adminplver  = 'YaBB 2.5.2 $Revision: 1.1 $'; $adminpmver = 'YaBB 2.6.12 $Revision: 1676 $';
  LoadLanguage('Credits');
   
sub Admin {  get_template('AdminCentre'); 
   &is_admin_or_gmod;  
   
   $yymain .= qq~  sub Admin { 
<div class="bordercolor" style="padding: 0px; width: 99%; margin-left: 0px; margin-right: auto;">     is_admin_or_gmod(); 
  <table width="100%" cellspacing="1" cellpadding="4">  
    <tr valign="middle">  
      <td align="left" class="titlebg" colspan="2">  
       <b>$admintxt{'1'}</b>  
     </td>  
    </tr>  
    <tr valign="middle">  
      <td align="left" class="windowbg2">  
       <img alt="Admin Centre Logo" src="$defaultimagesdir/aarea.jpg" />  
      </td>  
      <td align="left" class="windowbg2">  
       $admintxt{'2'}  
     </td>  
    </tr>  
  </table>  
</div>  
   
<br />  
   
<div style="float: left; width: 49%; text-align: left;">  
   
<div class="bordercolor" style="padding: 0px; width: 95%; margin-left: 0px; margin-right: auto;">  
  <table width="100%" cellspacing="1" cellpadding="4">  
    <tr valign="middle">  
      <td align="left" class="titlebg">  
       <b>$admintxt{'6'}</b>  
     </td>  
    </tr>  
    <tr align="center" valign="middle">  
      <td align="left" class="catbg">  
       <span class="small">YaBB 2</span>  
      </td>  
    </tr>  
    <tr valign="middle">  
      <td align="left" class="windowbg2"><br />  
Ron Hartendorp, Andrew Aitken, Carsten Dalgaard, Ryan Farrington, Zoltan Kovacs, Tim Ceuppens, Shoeb Omar, Torsten Mrotz, Brian Schaefer, Juvenall Wilson, Corey Chapman, Christer Jenson, Adrian Kreher, Steve Brereton, Jeffrey Man, Boris Tjuvanov, Detlef Pilzecker, Calvin Goodman<br /><br />  
     </td>  
    </tr>  
    <tr align="center" valign="middle">  
      <td align="left" class="catbg">  
       <span class="small">YaBB 2.5.2</span>  
      </td>  
    </tr>  
    <tr valign="middle">  
      <td align="left" class="windowbg2"><br />  
Jon Baker, Derek Barnstorm, Carsten Dalgaard, John G.D. McCabe, D.A. Rorabaugh.<br />Included Mods in YaBB 2.5.2 written by Derek Barnstorm, Carsten Dalgaard, and D.A. Rorabaugh.<br /><br />  
Dedicated to the memory of Ron Hartendorp, AKA Spikecity. He left us too soon. <br /><br />  
     </td>  
    </tr>  
    <tr align="center" valign="middle">  
      <td align="left" class="catbg">  
       <span class="small">$yabbThanks</span>  
      </td>  
    </tr>  
    <tr valign="middle">  
      <td align="left" class="windowbg2"><br />  
Dave Baughman, Bjoern Berg, Corey Chapman, Peter Crouch, ejdmoo, Dave G, Christian Land, Jeff Lewis, Gunther Meyer, Darya Misse, Parham Mofidi, AstroPilot, Torsten Mrotz, Carey P, Popeye, Michael Prager, Matt Siegman, Jay Silverman, StarSaber, Marco van Veelen, Myhailo Danylenko, $yabb2Credits<br /><br />  
$noBytesHarmed<br /><br />  
     </td>  
    </tr>  
  </table>  
</div>  
   
<br />  
   
<div class="bordercolor" style="padding: 0px; width: 95%; margin-left: 0px; margin-right: auto;">  
 <script language="javascript" src="http://www.yabbforum.com/update/versioncheck.js" type="text/javascript"></script>  
 <script language="JavaScript" type="text/javascript">  
 <!-- //hide from dinosaurs  
   document.write('<table width="100%" cellspacing="1" cellpadding="4">');  
   document.write('<tr><td colspan="2" class="titlebg"><b>$admintxt{'3'}</b></td></tr>');  
   document.write('<tr><td class="windowbg2">$versiontxt{'4'}</td><td class="windowbg2"><b>$YaBBversion</b></td></tr>');  
   if (!STABLE) {  
       document.write('<tr><td colspan="2" class="titlebg">$rna</b></td></tr>');  
   } else {  
       document.write('<tr><td class="windowbg2">$versiontxt{'5'}</td><td class="windowbg2"><b>'+STABLE+'</b></td></tr>');  
       document.write('<tr><td class="windowbg2">$versiontxt{'7'}</td><td class="windowbg2"><b>'+BETA+'</b></td></tr>');  
       document.write('<tr><td class="windowbg2">$versiontxt{'8'}</td><td class="windowbg2"><b>'+ALPHA+'</b></td></tr>');  
       if (STABLE == "$YaBBversion") {  
           document.write('<tr><td colspan="2" valign="middle" class="windowbg2"><br />$versiontxt{'6'}<br /><br /></td></tr>');  
       } else {  
           document.write('<tr><td colspan="2" valign="middle" class="windowbg2"><br />$versiontxt{'2'}'+STABLE+'$versiontxt{'3'}<br /><br /></td></tr>');  
       }  
   }  
   document.write('</table>');  
 // -->  
 </script>  
 <noscript>$versiontxt{'1'}</noscript>  
</div>  
   
</div>     $my_lastlogin = GetLastLogins(); 
<div style="float: left; width: 50%; text-align: right;">  
   
<div class="bordercolor" style="padding: 0px; width: 100%; margin-left: auto; margin-right: 0px;">     $yymain .= $front_page; 
  <table width="100%" cellspacing="1" cellpadding="4">     $yymain =~ s/{yabb iFrameSupport}/$iFrameSupport/sm; 
    <tr valign="middle">     $yymain =~ s/{yabb YaBBversion}/$YaBBversion/gsm; 
      <td align="left" class="titlebg">     $yymain =~ s/{yabb lastlogins}/$my_lastlogin/sm; 
       <b>$admintxt{'4'}</b>  
     </td>  
    </tr>  
    <tr valign="middle">  
      <td align="left" class="windowbg2">  
       <iframe src="http://www.yabbforum.com/update/" frameborder="0" width="100%" height="293">$iFrameSupport</iframe>  
     </td>  
    </tr>  
  </table>  
</div>  
   
<br />  
   
<div class="bordercolor" style="padding: 0px; width: 100%; margin-left: auto; margin-right: 0px;">  
  <table width="100%" cellspacing="1" cellpadding="4">  
    <tr valign="middle">  
      <td align="left" class="titlebg">  
       <b>$admintxt{'5'}</b>  
     </td>  
    </tr>  
    <tr valign="middle">  
      <td align="left" class="windowbg2">~;  
   
   &GetLastLogins;  
   
   $yymain .= qq~  
     </td>  
    </tr>  
  </table>  
</div>~;  
   
   if (-d "./Convert") {  
       $yymain .= qq~  
<br />  
<div class="bordercolor" style="padding: 0px; width: 100%; margin-left: auto; margin-right: 0px;">  
<form name="backdelete" action="$adminurl?action=convdelete" method="post">  
<table width="100%" cellspacing="1" cellpadding="4">  
   <tr valign="middle">  
   <td align="left" class="titlebg">  
       <b>$admintxt{'7'}</b>  
   </td>  
   </tr>  
   <tr valign="middle">  
   <td align="left" class="windowbg2"><br />  
       $admintxt{'8'}<br /><br />  
   </td>  
   </tr>  
   <tr valign="middle">  
   <td align="center" class="catbg">  
       <input type="submit" value="$admintxt{'9'}" class="button" />  
   </td>  
   </tr>  
</table>  
</form>  
</div>~;  
   }  
   
   $yymain .= qq~     if ( -d './Convert' ) { 
</div>~;        $yymain .= $convert_box; 
     }
   
   require "$admindir/ModuleChecker.pl";     $yymain .= $last_div; 
   
   $yymain .= qq~     require Admin::ModuleChecker; 
<div style="float: left; padding: 0px; width: 99%; margin-left: 0px; margin-right: auto; height: 100px;">&nbsp;</div>  
~;  
   
   $yytitle = "$admin_txt{'208'}";    $yytitle = "$admin_txt{'208'}";
   &AdminTemplate;     AdminTemplate(); 
     return;
} }
   
sub DeleteConverterFiles { sub DeleteConverterFiles {
   my @convertdir = qw~Boards Members Messages Variables~;    my @convertdir = qw~Boards Members Messages Variables~;
   
   foreach $cnvdir (@convertdir) {    foreach my $cnvdir (@convertdir) {
       $convdir = "./Convert/$cnvdir";        $convdir = "./Convert/$cnvdir";
       if (-d "$convdir") {        if ( -d "$convdir" ) {
           opendir("CNVDIR", $convdir) || &admin_fatal_error("cannot_open_dir","$convdir");             opendir 'CNVDIR', $convdir 
           @convlist = readdir("CNVDIR");               || fatal_error( 'cannot_open_dir', "$convdir" ); 
           closedir("CNVDIR");             @convlist = readdir 'CNVDIR'; 
           foreach $file (@convlist) {             closedir 'CNVDIR'; 
               unlink "$convdir/$file" || &admin_fatal_error("cannot_open_dir","$convdir/$file");             foreach my $file (@convlist) { 
           }                 unlink "$convdir/$file" 
           rmdir("$convdir");                   || fatal_error( 'cannot_open_dir', "$convdir/$file" ); 
       }            }
   }             rmdir "$convdir"; 
   $convdir = "./Convert";         } 
   if (-d "$convdir") {     } 
       opendir("CNVDIR", $convdir) || &admin_fatal_error("cannot_open_dir","$convdir");     $convdir = './Convert'; 
       @convlist = readdir("CNVDIR");     if ( -d "$convdir" ) { 
       closedir("CNVDIR");         opendir 'CNVDIR', $convdir 
       foreach $file (@convlist) {           || fatal_error( 'cannot_open_dir', "$convdir" ); 
           unlink "$convdir/$file";         @convlist = readdir 'CNVDIR'; 
       }         closedir 'CNVDIR'; 
       rmdir("$convdir");         foreach my $file (@convlist) { 
   }             unlink "$convdir/$file"; 
   if (-e "./Setup.pl") { unlink("./Setup.pl"); }        }
         rmdir "$convdir";
   $yymain .= qq~<b>$admintxt{'10'}</b>~;     } 
   $yytitle = "$admintxt{'10'}";     if ( -e './Setup.pl' )        { unlink './Setup.pl'; } 
   &AdminTemplate;     if ( -e './Convert.pl' )      { unlink './Convert.pl'; } 
     if ( -e './Convert2x.pl' )    { unlink './Convert2x.pl'; }
     if ( -e './BoardConvert.pl' ) { unlink './BoardConvert.pl'; }
     if ( -e "$htmldir/Templates/Forum/setup.css" ) {
         unlink "$htmldir/Templates/Forum/setup.css";
     }
     if ( -e './Variables/ConvSettings.txt' ) {
         unlink './Variables/ConvSettings.txt';
     }
   
     $yymain .= qq~<b>$admintxt{'10'}</b>~;
     $yytitle = "$admintxt{'10'}";
     AdminTemplate();
     return;
} }
   
sub GetLastLogins { sub GetLastLogins {
   fopen(ADMINLOG, "$vardir/adminlog.txt");     fopen( ADMINLOG, "$vardir/adminlog_new.txt" ); 
   @adminlog = <ADMINLOG>;    @adminlog = <ADMINLOG>;
   fclose(ADMINLOG);    fclose(ADMINLOG);
     @adminlog = reverse sort @adminlog;
   foreach $line (@adminlog) {  
       chomp $line;     foreach my $line (@adminlog) { 
       @element = split(/\|/, $line);         chomp $line; 
       if (!${$uid.$element[0]}{'realname'}) { &LoadUser($element[0]); }    # If user is not in memory, s/he must be loaded.         @element = split /\|/xsm, $line; 
       $element[2] = &timeformat($element[2]);         if ( !${ $uid . $element[1] }{'realname'} ) { 
       $yymain .= qq~             LoadUser( $element[1] ); 
       <a href="$scripturl?action=viewprofile;username=$useraccount{$element[0]}">${$uid.$element[0]}{'realname'}</a> <span class="small">($element[1]) - $element[2]</span><br />         }    # If user is not in memory, s/he must be loaded. 
       ~;         $element[0] = timeformat( $element[0] ); 
   }         my $lookupIP = 
           ($ipLookup)
           ? qq~<a href="$scripturl?action=iplookup;ip=$element[2]">$element[2]</a>~
           : qq~$element[1]~;
         $loginadmin .= qq~
                 <a href="$scripturl?action=viewprofile;username=$useraccount{$element[1]}">${$uid.$element[1]}{'realname'}</a> <span class="small">($lookupIP) - $element[0]</span><br />
                 ~;
     }
     return $loginadmin;
} }
   
sub FullStats { sub FullStats {
   &is_admin_or_gmod;     is_admin_or_gmod(); 
   my ($numcats, $numboards, $threadcount, $messagecount, $maxdays, $totalt, $totalm, $avgt, $avgm);     my ( $numcats, $numboards, $maxdays, $totalt, $totalm, $avgm ); 
   my ($memcount, $latestmember) = &MembershipGet;     my ( $memcount, $latestmember ) = MembershipGet(); 
   &LoadUser($latestmember);     LoadUser($latestmember); 
   $thelatestmember = qq~<a href="$scripturl?action=viewprofile;username=$useraccount{$latestmember}">${$uid.$latestmember}{'realname'}</a>~;     $thelatestmember = 
   $memcount ||= 1;  qq~<a href="$scripturl?action=viewprofile;username=$useraccount{$latestmember}">${$uid.$latestmember}{'realname'}</a>~; 
     $memcount ||= 1;
   $numcats = 0;  
     $numcats = 0;
   unless ($mloaded == 1) { require "$boardsdir/forum.master"; }  
   foreach $catid (@categoryorder) {     get_forum_master(); 
       $boardlist = $cat{$catid};     foreach my $catid (@categoryorder) { 
       $numcats++;         $boardlist = $cat{$catid}; 
       (@bdlist) = split(/\,/, $boardlist);         $numcats++; 
       ($catname, $catperms, $catallowcol) = split(/\|/, $catinfo{"$catid"});         @bdlist = split /\,/xsm, $boardlist; 
         my ( $catname, $catperms, $catallowcol ) =
       foreach $curboard (@bdlist) {           split /\|/xsm, $catinfo{$catid}; 
           chomp $curboard;  
           $numboards++;         foreach my $curboard (@bdlist) { 
           push(@loadboards, $curboard);             chomp $curboard; 
       }             $numboards++; 
   }             push @loadboards, $curboard; 
         }
   &BoardTotals("load", @loadboards);     } 
   foreach $curboard (@loadboards) {  
       $totalm += ${$uid.$curboard}{'messagecount'};     BoardTotals( 'load', @loadboards ); 
       $totalt += ${$uid.$curboard}{'threadcount'};     foreach my $curboard (@loadboards) { 
   }         $totalm += ${ $uid . $curboard }{'messagecount'}; 
         $totalt += ${ $uid . $curboard }{'threadcount'};
   $avgm = int($totalm / $memcount);     } 
   &LoadAdmins;  
     $avgm = int( $totalm / $memcount );
   if ($enableclicklog) {     LoadAdmins(); 
       my (@log);  
       fopen(LOG, "$vardir/clicklog.txt");     if ($enableclicklog) { 
       @log = <LOG>;         my (@log); 
       fclose(LOG);         fopen( LOG, "<$vardir/clicklog.txt" ); 
       $yyclicks    = @log;         @log = <LOG>; 
       $yyclicks = &NumberFormat($yyclicks);         fclose(LOG); 
       $yyclicktext = $admin_txt{'692'};         $yyclicks    = @log; 
       $yyclicklink = qq~&nbsp;(<a href="$adminurl?action=showclicks">$admin_txt{'693'}</a>)~;         $yyclicks    = NumberFormat($yyclicks); 
   } else {         $yyclicktext = $admin_txt{'692'}; 
       $yyclicktext = $admin_txt{'692a'};         $yyclicklink = 
       $yyclicklink = "";  qq~&nbsp;(<a href="$adminurl?action=showclicks">$admin_txt{'693'}</a>)~; 
   }    }
   my (@elog);     else { 
   fopen(ELOG, "$vardir/errorlog.txt");         $yyclicktext = $admin_txt{'692a'}; 
   @elog = <ELOG>;         $yyclicklink = q{}; 
   fclose(ELOG);     } 
   $errorslog = @elog;     my (@elog); 
   $memcount = &NumberFormat($memcount);     fopen( ELOG, "$vardir/errorlog.txt" ); 
   $totalt = &NumberFormat($totalt);     @elog = <ELOG>; 
   $totalm = &NumberFormat($totalm);     fclose(ELOG); 
   $avgm = &NumberFormat($avgm);     $errorslog = @elog; 
   $errorslog = &NumberFormat($errorslog);     $memcount  = NumberFormat($memcount); 
     $totalt    = NumberFormat($totalt);
   $yymain .= qq~     $totalm    = NumberFormat($totalm); 
<div class="bordercolor" style="padding: 0px; width: 99%; margin-left: 0px; margin-right: auto;">     $avgm      = NumberFormat($avgm); 
  <table width="100%" cellspacing="1" cellpadding="4">     $errorslog = NumberFormat($errorslog); 
    <tr valign="middle">  
     <td align="left" class="titlebg">     $yymain .= qq~ 
       <img src="$imagesdir/info.gif" alt="" border="0" /> <b>$admintxt{'28'}</b>  <div class="bordercolor rightboxdiv"> 
     </td>     <table class="border-space pad-cell" style="margin-bottom: .5em;"> 
    </tr>         <tr> 
    <tr valign="middle">             <td class="titlebg"> 
     <td align="left" class="catbg">                 $admin_img{'infoimg'} <b>$admintxt{'28'}</b> 
      <i>$admin_txt{'94'}</i>             </td> 
     </td>         </tr><tr> 
    </tr>             <td class="catbg"> 
    <tr valign="middle">                 <i>$admin_txt{'94'}</i> 
     <td align="left" class="windowbg2"><br />             </td> 
      <div style="float: left; clear: left; width: 35%; text-align: left; padding-top: 2px; padding-bottom: 2px;">$admin_txt{'488'}</div>         </tr><tr> 
      <div style="float: left; width: 10%; text-align: right; padding-top: 2px; padding-bottom: 2px;">$memcount</div>             <td class="windowbg2"> 
      <br />                 <div class="pad-more"> 
      <div style="float: left; clear: left; width: 35%; text-align: left; padding-top: 2px; padding-bottom: 2px;">$admin_txt{'490'}</div>                     <div class="admin-total-left">$admin_txt{'488'}</div> 
      <div style="float: left; width: 10%; text-align: right; padding-top: 2px; padding-bottom: 2px;">$totalt</div>                     <div class="admin-total-right">$memcount</div> 
      <br />                    <br />
      <div style="float: left; clear: left; width: 35%; text-align: left; padding-top: 2px; padding-bottom: 2px;">$admin_txt{'489'}</div>                     <div class="admin-total-left">$admin_txt{'490'}</div> 
      <div style="float: left; width: 10%; text-align: right; padding-top: 2px; padding-bottom: 2px;">$totalm</div>                     <div class="admin-total-right">$totalt</div> 
      <br />                    <br />
      <div style="float: left; clear: left; width: 35%; text-align: left; padding-top: 2px; padding-bottom: 2px;">$admintxt{'39'}</div>                     <div class="admin-total-left">$admin_txt{'489'}</div> 
      <div style="float: left; width: 10%; text-align: right; padding-top: 2px; padding-bottom: 2px;">$avgm</div>                     <div class="admin-total-right">$totalm</div> 
      <br />                    <br />
      <div style="float: left; clear: left; width: 35%; text-align: left; padding-top: 2px; padding-bottom: 2px;">$admin_txt{'658'}</div>                     <div class="admin-total-left">$admintxt{'39'}</div> 
      <div style="float: left; width: 10%; text-align: right; padding-top: 2px; padding-bottom: 2px;">$numcats</div>                     <div class="admin-total-right">$avgm</div> 
      <br />                    <br />
      <div style="float: left; clear: left; width: 35%; text-align: left; padding-top: 2px; padding-bottom: 2px;">$admin_txt{'665'}</div>                     <div class="admin-total-left">$admin_txt{'658'}</div> 
      <div style="float: left; width: 10%; text-align: right; padding-top: 2px; padding-bottom: 2px;">$numboards</div>                     <div class="admin-total-right">$numcats</div> 
      <br />                    <br />
      <div style="float: left; clear: left; width: 35%; text-align: left; padding-top: 2px; padding-bottom: 2px;">$errorlog{'3'}</div>                     <div class="admin-total-left">$admin_txt{'665'}</div> 
      <div style="float: left; width: 10%; text-align: right; padding-top: 2px; padding-bottom: 2px;">$errorslog</div>                     <div class="admin-total-right">$numboards</div> 
      <br />                    <br />
      <div style="float: left; clear: left; width: 35%; text-align: left; padding-top: 2px; padding-bottom: 2px;">$admin_txt{'691'}&nbsp;<span class="small">($yyclicktext)</span></div>                     <div class="admin-total-left">$errorlog{'3'}</div> 
      <div style="float: left; width: 10%; text-align: right; padding-top: 2px; padding-bottom: 2px;">$yyclicks</div>                     <div class="admin-total-right">$errorslog</div> 
      <div style="float: left; width: 55%; text-align: left; padding-top: 2px; padding-bottom: 2px;">$yyclicklink</div>                     <br /> 
      <br />&nbsp;<br />                     <div class="admin-total-left">$admin_txt{'691'}&nbsp;<span class="small">($yyclicktext)</span></div> 
     </td>                     <div class="admin-total-right">$yyclicks</div> 
    </tr>                     <div class="admin-total-left" style="width:55%">$yyclicklink</div> 
    <tr valign="middle">                 </div> 
      <td align="left" class="catbg">             </td> 
       <i>$admin_txt{'657'}</i>         </tr><tr> 
     </td>             <td class="catbg"> 
    </tr>                 <i>$admin_txt{'657'}</i> 
    <tr valign="middle">             </td> 
      <td align="left" class="windowbg2"><br />         </tr><tr> 
       <div style="float: left; clear: left; width: 35%; text-align: left; padding-top: 2px; padding-bottom: 2px;">$admin_txt{'656'}</div>             <td class="windowbg2"> 
       <div style="float: left; width: 65%; text-align: left; padding-top: 2px; padding-bottom: 2px;">$thelatestmember</div>                 <div class="pad-more"> 
       <br />                     <div class="admin-total-left">$admin_txt{'656'}</div> 
       <div style="float: left; clear: left; width: 35%; text-align: left; padding-top: 2px; padding-bottom: 2px;">$admin_txt{'659'}</div>                     <div class="admin-total-mid">$thelatestmember</div> 
       <div style="float: left; width: 65%; text-align: left; padding-top: 2px; padding-bottom: 2px;">                     <br /> 
       ~;                     <div class="admin-total-left">$admin_txt{'659'}</div> 
                     <div class="admin-total-mid">~;
   # Sorts the threads to find the most recent post  
   # No need to check for board access here because only admins have access to this page  # Sorts the threads to find the most recent post 
   unless ($mloaded == 1) { require "$boardsdir/forum.master"; }  # No need to check for board access here because only admins have access to this page 
   foreach $catid (@categoryorder) {     get_forum_master(); 
       $boardlist = $cat{$catid};     foreach my $catid (@categoryorder) { 
       (@bdlist) = split(/\,/, $boardlist);         $boardlist = $cat{$catid}; 
       foreach $curboard (@bdlist) {         @bdlist = split /\,/xsm, $boardlist; 
           push(@goodboards, $curboard);         foreach my $curboard (@bdlist) { 
       }             push @goodboards, $curboard; 
   }        }
     }
   &BoardTotals("load", @goodboards);  
   # &getlog; not used here !!?     BoardTotals( 'load', @goodboards ); 
   foreach $curboard (@goodboards) {  
       chomp $curboard;     # &getlog; not used here !!? 
       $lastposttime = ${$uid.$curboard}{'lastposttime'};     foreach my $curboard (@goodboards) { 
       $lastposttime{$curboard} = &timeformat(${$uid.$curboard}{'lastposttime'});         chomp $curboard; 
       ${$uid.$curboard}{'lastposttime'} = ${$uid.$curboard}{'lastposttime'} eq 'N/A' || !${$uid.$curboard}{'lastposttime'} ? $boardindex_txt{'470'} : ${$uid.$curboard}{'lastposttime'};         $lastposttime = ${ $uid . $curboard }{'lastposttime'}; 
       $lastpostrealtime{$curboard} = ${$uid.$curboard}{'lastposttime'} eq 'N/A' || !${$uid.$curboard}{'lastposttime'} ? '' : ${$uid.$curboard}{'lastposttime'};         if ( $lastposttime =~ /^[0-9]+$/sm ) { 
       if (${$uid.$curboard}{'lastposter'} =~ m~\AGuest-(.*)~) {             $lastposttime{$curboard} = 
           ${$uid.$curboard}{'lastposter'} = $1;                 timeformat( $lastposttime ); 
           $lastposterguest{$curboard} = 1;         } 
       }         ${ $uid . $curboard }{'lastposttime'} = 
       ${$uid.$curboard}{'lastposter'} = ${$uid.$curboard}{'lastposter'} eq 'N/A' || !${$uid.$curboard}{'lastposter'} ? $boardindex_txt{'470'} : ${$uid.$curboard}{'lastposter'};           ${ $uid . $curboard }{'lastposttime'} eq 'N/A' 
       ${$uid.$curboard}{'messagecount'} = ${$uid.$curboard}{'messagecount'} || 0;           || !${ $uid . $curboard }{'lastposttime'} 
       ${$uid.$curboard}{'threadcount'} = ${$uid.$curboard}{'threadcount'} || 0;           ? $boardindex_txt{'470'} 
       $totalm += ${$uid.$curboard}{'messagecount'};           : ${ $uid . $curboard }{'lastposttime'}; 
       $totalt += ${$uid.$curboard}{'threadcount'};         $lastpostrealtime{$curboard} = 
           ${ $uid . $curboard }{'lastposttime'} eq 'N/A' 
       # determine the true last post on all the boards a user has access to           || !${ $uid . $curboard }{'lastposttime'} 
       if ($lastposttime > $lastthreadtime) {           ? q{} 
           $lsdatetime = &timeformat($lastposttime);           : ${ $uid . $curboard }{'lastposttime'}; 
           $lsposter = ${$uid.$curboard}{'lastposter'};         if ( ${ $uid . $curboard }{'lastposter'} =~ m{\AGuest-(.*)}xsm ) { 
           $lssub = ${$uid.$curboard}{'lastsubject'};             ${ $uid . $curboard }{'lastposter'} = $1; 
           $lspostid = ${$uid.$curboard}{'lastpostid'};             $lastposterguest{$curboard} = 1; 
           $lsreply = ${$uid.$curboard}{'lastreply'};         } 
           $lastthreadtime = $lastposttime;         ${ $uid . $curboard }{'lastposter'} = 
       }           ${ $uid . $curboard }{'lastposter'} eq 'N/A' 
   }           || !${ $uid . $curboard }{'lastposter'} 
   ($lssub, undef) = &Split_Splice_Move($lssub,0);           ? $boardindex_txt{'470'} 
   &ToChars($lssub);           : ${ $uid . $curboard }{'lastposter'}; 
   $yymain .= qq~<a href="$scripturl?num=$lspostid/$lsreply#$lsreply">$lssub</a> ($lsdatetime)</div>         ${ $uid . $curboard }{'messagecount'} = 
       <br />           ${ $uid . $curboard }{'messagecount'} || 0; 
       <div style="float: left; clear: left; width: 35%; text-align: left; padding-top: 2px; padding-bottom: 2px;">$admin_txt{'684'}</div>         ${ $uid . $curboard }{'threadcount'} = 
       <div style="float: left; width: 65%; text-align: left; padding-top: 2px; padding-bottom: 2px;">$administrators</div>           ${ $uid . $curboard }{'threadcount'} || 0; 
       <br />         $totalm += ${ $uid . $curboard }{'messagecount'}; 
       <div style="float: left; clear: left; width: 35%; text-align: left; padding-top: 2px; padding-bottom: 2px;">$admin_txt{'684a'}</div>         $totalt += ${ $uid . $curboard }{'threadcount'}; 
       <div style="float: left; width: 65%; text-align: left; padding-top: 2px; padding-bottom: 2px;">$gmods</div>  
       <br />         # determine the true last post on all the boards a user has access to 
       <div style="float: left; clear: left; width: 35%; text-align: left; padding-top: 2px; padding-bottom: 2px;">$admin_txt{'425'}</div>         if ( $lastposttime > $lastthreadtime ) { 
       <div style="float: left; width: 65%; text-align: left; padding-top: 2px; padding-bottom: 2px;">             $lsdatetime     = timeformat($lastposttime); 
       <script language="javascript" src="http://www.yabbforum.com/update/versioncheck.js" type="text/javascript"></script>             $lsposter       = ${ $uid . $curboard }{'lastposter'}; 
       <script language="JavaScript" type="text/javascript">             $lssub          = ${ $uid . $curboard }{'lastsubject'}; 
        <!-- //hide from dinosaurs             $lspostid       = ${ $uid . $curboard }{'lastpostid'}; 
         document.write("$versiontxt{'4'} <b>$YaBBversion</b> - $versiontxt{'5'} <b>"+STABLE+"</b> <p>");             $lsreply        = ${ $uid . $curboard }{'lastreply'}; 
        // -->             $lastthreadtime = $lastposttime; 
       </script>         } 
       <noscript>$versiontxt{'1'} <img src="http://www.yabbforum.com/images/version/versioncheck.gif" alt="" /></noscript>     } 
       </div>     ( $lssub, undef ) = Split_Splice_Move( $lssub, 0 ); 
       <br />&nbsp;<br />     ToChars($lssub); 
     </td>     $yymain .= 
    </tr>  qq~<a href="$scripturl?num=$lspostid/$lsreply#$lsreply">$lssub</a> ($lsdatetime)</div> 
  </table>                     <br /> 
</div>~;                     <div class="admin-total-left">$admin_txt{'684'}</div> 
                     <div class="admin-total-mid">$administrators</div>
                     <br />
                     <div class="admin-total-left">$admin_txt{'684a'}</div>
                     <div class="admin-total-mid">$gmods</div>
                     <br />
                     <div class="admin-total-left">$admin_txt{'425'}</div>
                     <div class="admin-total-mid">
                         <script src="$versionchk" type="text/javascript"></script>
                         <script type="text/javascript">
                             if (typeof STABLE === "undefined" || STABLE === null ) {
                                 document.write("$versiontxt{'4'} <b>$YaBBversion</b> - $versiontxt{'5'} <b>$rna</b> <p>");
                             } else {
                                 document.write("$versiontxt{'4'} <b>$YaBBversion</b> - $versiontxt{'5'} <b>"+STABLE+"</b> <p>");
                             }
                         </script>
                     </div>
                 </div>
             </td>
         </tr>
     </table>
  </div>~;
   
   $yytitle = $admintxt{'28'};    $yytitle     = $admintxt{'28'};
   $action_area = "stats";     $action_area = 'stats'; 
   &AdminTemplate;     AdminTemplate(); 
     return;
} }
   
sub LoadAdmins { sub LoadAdmins {
   &is_admin_or_gmod;     is_admin_or_gmod(); 
   my (@members, $curentry, $memdata);     my ($curentry); 
   $administrators = "";     $administrators = q{}; 
   $gmods          = "";     $gmods          = q{}; 
   &ManageMemberinfo("load");     ManageMemberinfo('load'); 
   while (($membername, $value) = each(%memberinf)) {    while ( ( $membername, $value ) = each %memberinf ) {
       ($memberrealname, undef, $memposition, $memposts) = split(/\|/, $value);         ( $memberrealname, undef, $memposition, $memposts ) = 
       if($do_scramble_id){$membernameCloaked = &cloak($membername); } else { $membernameCloaked = $membername; }           split /\|/xsm, $value; 
       if ($memposition eq "Administrator") {         if   ($do_scramble_id) { $membernameCloaked = cloak($membername); } 
           $administrators .= qq~ <a href="$scripturl?action=viewprofile;username=$membernameCloaked">$memberrealname</a><span class="small">,</span> \n~;         else                   { $membernameCloaked = $membername; } 
       }         if ( $memposition eq 'Administrator' ) { 
       if ($memposition eq "Global Moderator") {             $administrators .= 
           $gmods .= qq~ <a href="$scripturl?action=viewprofile;username=$membernameCloaked">$memberrealname</a><span class="small">,</span> \n~; qq~ <a href="$scripturl?action=viewprofile;username=$membernameCloaked">$memberrealname</a><span class="small">,</span> \n~;
       }        }
   }         if ( $memposition eq 'Global Moderator' ) { 
   $administrators =~ s~<span class="small">,</span> \n\Z~~;             $gmods .= 
   $gmods          =~ s~<span class="small">,</span> \n\Z~~;  qq~ <a href="$scripturl?action=viewprofile;username=$membernameCloaked">$memberrealname</a><span class="small">,</span> \n~; 
   if ($gmods eq "") { $gmods = qq~&nbsp;~; }        }
   undef %memberinf;     } 
     $administrators =~ s/<span class="small">,<\/span> \n\Z//sm;
     $gmods =~ s/<span class="small">,<\/span> \n\Z//sm;
     if ( $gmods eq q{} ) { $gmods = q~&nbsp;~; }
     undef %memberinf;
     return;
} }
   
sub ShowClickLog { sub ShowClickLog {
   &is_admin_or_gmod;     is_admin_or_gmod(); 
   
   if ($enableclicklog) { $logtimetext = $admin_txt{'698'}; }    if   ($enableclicklog) { $logtimetext = $admin_txt{'698'}; }
   else { $logtimetext = $admin_txt{'698a'}; }    else                   { $logtimetext = $admin_txt{'698a'}; }
   
   my ($totalip, $totalclick, $totalbrow, $totalos, @log, @iplist, $date, @to, @from, @info, @os, @browser, @newiplist, @newbrowser, @newoslist, @newtolist, @newfromlist, $i, $curentry);     fopen( LOG, "<$vardir/clicklog.txt" ); 
   fopen(LOG, "$vardir/clicklog.txt");     @log = <LOG>; 
   @log = <LOG>;     fclose(LOG); 
   fclose(LOG);     chomp @log; 
   
   $i = 0;     for my $i (0 .. $#log) { 
   foreach $curentry (@log) {         $log[$i]  =~ s/chr(32)//gxms; 
       ($iplist[$i], $date, $to[$i], $from[$i], $info[$i]) = split(/\|/, $curentry);         $log[$i]  =~ s/\s+//gsm; 
       $i++;         $log[$i] =~ s/^[x21-\x7E]+$//gsm; 
   }         @newlog = split /[|]/xsm, $log[$i]; 
   $i = 0;         if ($#newlog != 5 ) { next;} 
   foreach $curentry (@info) {        else {
       if ($curentry !~ /\s\(Win/i || $curentry !~ /\s\(mac/) { $curentry =~ s/\s\((compatible;\s)*/ - /ig; }             $iplist[$i] = $newlog[0]; 
       else { $curentry =~ s/(\S)*\(/; /g; }             $date = $newlog[1]; 
       if ($curentry =~ /\s-\sWin/i) { $curentry =~ s/\s-\sWin/; win/ig; }             $to[$i] = $newlog[2]; 
       if ($curentry =~ /\s-\sMac/i) { $curentry =~ s/\s-\sMac/; mac/ig; }             $from[$i] = $newlog[3]; 
       ($browser[$i], $os[$i]) = split(/\;\s/, $curentry);             $info[$i] = $newlog[4]; 
       if ($os[$i] =~ /\)\s\S/) { ($os[$i], $browser[$i]) = split(/\)\s/, $os[$i]); }             $ip[$i] = $newlog[5]; 
       $os[$i] =~ s/\)//g;         } 
       $i++;     } 
   }  
     for my $i ( 0 .. $#iplist ) {
   for ($i = 0; $i < @iplist; $i++) { $iplist{ $iplist[$i] }++; }         $iplist{ $iplist[$i] }++; 
   $i = 0;     } 
   while (($key, $val) = each(%iplist)) {  
       $newiplist[$i] = [$key, $val];     $i = 0; 
       $i++;     while ( ( $key, $val ) = each %iplist ) { 
   }         $newiplist[$i] = [ $key, $val ]; 
   $totalclick = @iplist;         $i++; 
   $totalip    = @newiplist;     } 
   for ($i = 0; $i < @newiplist; $i++) {    for my $k ( 0 .. $#iplist ) {
         for $j ( 0 .. $#newiplist ) {
       if ($newiplist[$i]->[0] =~ /\S+/ && $newiplist[$i]->[0] =~ /\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}/) {            if ( $newiplist[$j]->[0] eq $iplist[$k] ) {
           $guestiplist .= qq~$newiplist[$i]->[0]&nbsp;<span style="color: #FF0000;">(<i>$newiplist[$i]->[1]</i>)</span><br />~;                 push @{$newiplist[$j]}, $ip[$k], $iplist[$i] ; 
       } else {             } 
           &LoadUser($newiplist[$i]->[0]);         } 
           if($do_scramble_id){$cloakedUserName = &cloak($newiplist[$i]->[0]); } else {$cloakedUserName = $newiplist[$i]->[0]; }     } 
           my $displayUserName = $newiplist[$i]->[0];     $totalclick = @iplist; 
           if(${$uid.$displayUserName}{'realname'} && (${$uid.$displayUserName}{'realname'} ne $newiplist[$i]->[0]))     {     $totalip    = @newiplist; 
               $displayUserName = ${$uid.$displayUserName}{'realname'};}     for my $i ( 0 .. $#newiplist ) { 
           $useriplist .= qq~<a href="$scripturl?action=viewprofile;username=$cloakedUserName">$displayUserName</a>&nbsp;<span style="color: #FF0000;">(<i>$newiplist[$i]->[1]</i>)</span><br />~;         my $lookupIP = 
       }           ($ipLookup) 
   }           ? qq~<a href="$scripturl?action=iplookup;ip=$newiplist[$i]->[2]">$newiplist[$i]->[2]</a>~ 
           : qq~$newiplist[$i]->[2]~;
   for ($i = 0; $i < @browser; $i++) { $browser{ $browser[$i] }++; }         my $lstuser = $newiplist[$i]->[0]; 
   $i = 0;         if ( $lstuser ne $newiplist[$i]->[2] && -e "$memberdir/$lstuser.vars" ) { 
   while (($key, $val) = each(%browser)) {             LoadUser( $lstuser, 'vars' ); 
       $newbrowser[$i] = [$key, $val];             if ($do_scramble_id) { 
       $i++;                 $cloakedUserName = cloak( $lstuser ); 
   }            }
   $totalbrow = @newbrowser;             else { $cloakedUserName = $lstuser; } 
   for ($i = 0; $i < @newbrowser; $i++) {             my $displayUserName = $lstuser; 
       if ($newbrowser[$i]->[0] =~ /\S+/) {             if ( 
           $browserlist .= qq~$newbrowser[$i]->[0] &nbsp;<span style="color: #FF0000;">(<i>$newbrowser[$i]->[1]</i>)</span><br />~;                 ${ $uid . $displayUserName }{'realname'} 
       }                 && ( ${ $uid . $displayUserName }{'realname'} ne $lstuser ) 
   }             ) 
             {
   for ($i = 0; $i < @os; $i++) { $os{ $os[$i] }++; }                 $displayUserName = ${ $uid . $displayUserName }{'realname'}; 
   $i = 0;             } 
   while (($key, $val) = each(%os)) {             $useriplist .= 
       $newoslist[$i] = [$key, $val];  qq~<a href="$scripturl?action=viewprofile;username=$cloakedUserName">$displayUserName</a>&nbsp;<span class="important">(<i>$newiplist[$i]->[1]</i>)</span> ($lookupIP)<br />~; 
       $i++;             } 
   }         elsif ( $newiplist[$i]->[2] ) { 
   $totalos = @newoslist;             $guestiplist .= 
   for ($i = 0; $i < @newoslist; $i++) {  qq~$lookupIP&nbsp;<span class="important">(<i>$newiplist[$i]->[1]</i>)</span><br />~; 
       if ($newoslist[$i]->[0] =~ /\S+/) {         } 
           $oslist .= qq~$newoslist[$i]->[0] &nbsp;<span style="color: #FF0000;">(<i>$newoslist[$i]->[1]</i>)</span><br />~;     } 
       }  
   }     foreach my $curentry (@info) { 
         if ( $curentry !~ /\s\(Win/ism || $curentry !~ /\s\(mac/sm ) {
   for ($i = 0; $i < @to; $i++) { $to{ $to[$i] }++; }             $curentry =~ s/\s\((compatible;\s)*/ - /igsm; 
   $i = 0;         } 
   while (($key, $val) = each(%to)) {         else { $curentry =~ s/(\S)*\(/; /gsm; } 
       $newtolist[$i] = [$key, $val];         if ( $curentry =~ /\s-\sWin/ism ) { 
       $i++;             $curentry =~ s/\s-\sWin/; win/igsm; 
   }        }
   for ($i = 0; $i < @newtolist; $i++) {        if ( $curentry =~ /\s-\sMac/ism ) {
       if ($newtolist[$i]->[0] =~ /\S+/) {             $curentry =~ s/\s-\sMac/; mac/igsm; 
           $scriptcalls .= qq~<a href="$newtolist[$i]->[0]" target="_blank">$newtolist[$i]->[0]</a>&nbsp;<span style="color: #FF0000;">(<i>$newtolist[$i]->[1]</i>)</span><br />~;         } 
       }         ( $browser[$i], $os[$i] ) = split /\;\s/xsm, $curentry; 
   }         if ( $os[$i] =~ /\)\s\S/sm ) { 
             ( $os[$i], $browser[$i] ) = split /\)\s/xsm, $os[$i];
   for ($i = 0; $i < @from; $i++) { $from{ $from[$i] }++; }        }
   $i = 0;         $os[$i] =~ s/\)//gxsm; 
   while (($key, $val) = each(%from)) {         $i++; 
       $newfromlist[$i] = [$key, $val];     } 
       $i++;  
   }    for my $i ( 0 .. $#browser ) { $browser{ $browser[$i] }++; }
   for ($i = 0; $i < @newfromlist; $i++) {     $i = 0; 
       if ($newfromlist[$i]->[0] =~ /\S+/ && $newfromlist[$i]->[0] !~ m~$boardurl~i) {    while ( ( $key, $val ) = each %browser ) {
       $message = qq~<a href="$newfromlist[$i]->[0]" target="_blank">$newfromlist[$i]->[0]</a>~;         $newbrowser[$i] = [ $key, $val ]; 
       #   &wrap;         $i++; 
       #   if (!$yyYaBBCloaded) { require "$sourcedir/YaBBC.pl"; }    }
       #   &DoUBBC;     $totalbrow = @newbrowser; 
           &wrap2;     for my $i ( 0 .. $#newbrowser ) { 
           $referlist .= qq~$message&nbsp;<span style="color: #FF0000;">(<i>$newfromlist[$i]->[1]</i>)</span><br />~;         if ( $newbrowser[$i]->[0] =~ /\S+/xsm ) { 
       }             $browserlist .= 
   }  qq~$newbrowser[$i]->[0] &nbsp;<span class="important">(<i>$newbrowser[$i]->[1]</i>)</span><br />~; 
         }
   $yymain .= qq~     } 
   
<div class="bordercolor" style="padding: 0px; width: 99%; margin-left: 0px; margin-right: auto;">     for my $i ( 0 .. $#os ) { $os{ $os[$i] }++; } 
  <table width="100%" cellspacing="1" cellpadding="4">     $i = 0; 
    <tr valign="middle">     while ( ( $key, $val ) = each %os ) { 
     <td align="left" class="titlebg">         $newoslist[$i] = [ $key, $val ]; 
      <img src="$imagesdir/info.gif" alt="" border="0" /> <b>$admin_txt{'693'}</b>         $i++; 
     </td>     } 
    </tr>     $totalos = @newoslist; 
    <tr valign="middle">     for my $i ( 0 .. $#newoslist ) { 
     <td align="left" class="windowbg2"><br />         if ( $newoslist[$i]->[0] =~ /\S+/xsm ) { 
      $admin_txt{'697'}$logtimetext<br /><br />             $oslist .= 
     </td>  qq~$newoslist[$i]->[0] &nbsp;<span class="important">(<i>$newoslist[$i]->[1]</i>)</span><br />~; 
    </tr>         } 
  </table>     } 
   
     for my $i ( 0 .. $#to ) { $to{ $to[$i] }++; }
     $i = 0;
     while ( ( $key, $val ) = each %to ) {
         $newtolist[$i] = [ $key, $val ];
         $i++;
     }
     for my $i ( 0 ..  $#newtolist ) {
         if ( $newtolist[$i]->[0] =~ /\S+/xsm ) {
             $scriptcalls .=
  qq~<a href="$newtolist[$i]->[0]" target="_blank">$newtolist[$i]->[0]</a>&nbsp;<span class="important">(<i>$newtolist[$i]->[1]</i>)</span><br />~;
         }
     }
   
     for my $i ( 0 .. $#from ) { $from{ $from[$i] }++; }
     $i = 0;
     while ( ( $key, $val ) = each %from ) {
         $newfromlist[$i] = [ $key, $val ];
         $i++;
     }
     for my $i ( 0 .. $#newfromlist ) {
         if (   $newfromlist[$i]->[0] =~ /\S+/xsm
             && $newfromlist[$i]->[0] !~ m{$boardurl}ism )
         {
             $message =
  qq~<a href="$newfromlist[$i]->[0]" target="_blank">$newfromlist[$i]->[0]</a>~;
   
             wrap2();
             $referlist .=
  qq~$message&nbsp;<span class="important">(<i>$newfromlist[$i]->[1]</i>)</span><br />~;
         }
     }
   
     $yymain .= qq~
  <div class="bordercolor rightboxdiv">
     <table class="border-space pad-cell" style="margin-bottom: .5em;">
         <tr>
             <td class="titlebg">
                 $admin_img{'infoimg'} <b>$admin_txt{'693'}</b>
             </td>
         </tr><tr>
             <td class="windowbg2">
                 <div class="pad-more">$admin_txt{'697'}$logtimetext</div>
             </td>
         </tr>
     </table>
</div>~; </div>~;
   
   if ($enableclicklog) {    if ($enableclicklog) {
       $yymain .= qq~        $yymain .= qq~
  <div class="bordercolor rightboxdiv">
<br />     <table class="border-space pad-cell" style="margin-bottom: .5em;"> 
         <colgroup>
<div class="bordercolor" style="padding: 0px; width: 99%; margin-left: 0px; margin-right: auto;">             <col span="2" style="width: 50%" /> 
  <table width="100%" cellspacing="1" cellpadding="4">         </colgroup> 
   <tr valign="middle">         <tr> 
    <td align="left" class="titlebg" colspan="2">            <td class="titlebg" colspan="2">
     <img src="$imagesdir/cat.gif" alt="" border="0" /> <b>$admin_txt{'694'}</b>                $admin_img{'cat_img'} <b>$admin_txt{'694'}</b>
    </td>            </td>
   </tr>         </tr><tr> 
   <tr valign="middle">             <td class="windowbg2" colspan="2"><br /> 
    <td align="left" class="windowbg2" colspan="2"><br />                $admin_txt{'691'}: $totalclick<br />
     $admin_txt{'691'}: $totalclick<br />                $admin_txt{'743'}: $totalip<br /><br />
     $admin_txt{'743'}: $totalip<br /><br />             </td> 
    </td>         </tr><tr> 
   </tr>             <td class="catbg center"> 
   <tr valign="middle">                 <b>$clicklog_txt{'users'}</b> 
    <td align="center" class="catbg" width="50%">             </td> 
     <b>$clicklog_txt{'users'}</b>             <td class="catbg center"> 
    </td>                 <b>$clicklog_txt{'guests'}</b> 
    <td align="center" class="catbg" width="50%">             </td> 
     <b>$clicklog_txt{'guests'}</b>         </tr><tr> 
    </td>             <td class="windowbg2 vtop"><br /> 
   </tr>                 $useriplist<br /> 
   <tr valign="middle">             </td> 
    <td align="left" class="windowbg2" valign="top" width="50%"><br />            <td class="windowbg2 vtop"><br />
     $useriplist<br />                $guestiplist<br />
    </td>            </td>
    <td align="left" class="windowbg2" valign="top" width="50%"><br />         </tr> 
     $guestiplist<br />     </table> 
    </td>  </div> 
   </tr>  <div class="bordercolor rightboxdiv"> 
  </table>     <table class="border-space pad-cell" style="margin-bottom: .5em;"> 
</div>         <tr> 
             <td class="titlebg">
<br />                 $admin_img{'cat_img'} <b>$admin_txt{'695'}</b> 
             </td>
<div class="bordercolor" style="padding: 0px; width: 99%; margin-left: 0px; margin-right: auto;">         </tr><tr> 
  <table width="100%" cellspacing="1" cellpadding="4">             <td class="catbg"> 
   <tr valign="middle">                 <i>$admin_txt{'744'}: $totalbrow</i> 
    <td align="left" class="titlebg">             </td> 
     <img src="$imagesdir/cat.gif" alt="" border="0" /> <b>$admin_txt{'695'}</b>         </tr><tr> 
    </td>             <td class="windowbg2"> 
   </tr>                 <div class="pad-more">$browserlist</div> 
   <tr valign="middle">             </td> 
    <td align="left" class="catbg">         </tr> 
     <i>$admin_txt{'744'}: $totalbrow</i>     </table> 
    </td>  </div> 
   </tr>  <div class="bordercolor rightboxdiv"> 
   <tr valign="middle">     <table class="border-space pad-cell" style="margin-bottom: .5em;"> 
    <td align="left" class="windowbg2"><br />         <tr> 
     $browserlist<br />             <td class="titlebg"> 
    </td>                 $admin_img{'cat_img'} <b>$admin_txt{'696'}</b> 
   </tr>             </td> 
  </table>         </tr><tr> 
</div>             <td class="catbg"> 
                 <i>$admin_txt{'745'}: $totalos</i>
<br />             </td> 
         </tr><tr>
<div class="bordercolor" style="padding: 0px; width: 99%; margin-left: 0px; margin-right: auto;">             <td class="windowbg2"> 
  <table width="100%" cellspacing="1" cellpadding="4">                 <div class="pad-more">$oslist</div> 
   <tr valign="middle">            </td> 
    <td align="left" class="titlebg">        </tr> 
     <img src="$imagesdir/cat.gif" alt="" border="0" /> <b>$admin_txt{'696'}</b>     </table> 
    </td>  </div> 
   </tr>  <div class="bordercolor rightboxdiv"> 
   <tr valign="middle">     <table class="border-space pad-cell" style="margin-bottom: .5em;"> 
    <td align="left" class="catbg">         <tr> 
     <i>$admin_txt{'745'}: $totalos</i>             <td class="titlebg"> 
    </td>                 $admin_img{'cat_img'} <b>$admin_txt{'696a'}</b> 
   </tr>             </td> 
   <tr valign="middle">         </tr><tr> 
    <td align="left" class="windowbg2"><br />             <td class="windowbg2"> 
     $oslist<br />                 <div class="pad-more">$scriptcalls</div> 
    </td>            </td>
   </tr>        </tr>
  </table>    </table>
</div> </div>
  <div class="bordercolor rightboxdiv">
<br />     <table class="border-space pad-cell" style="margin-bottom: .5em;"> 
         <tr>
<div class="bordercolor" style="padding: 0px; width: 99%; margin-left: 0px; margin-right: auto;">             <td class="titlebg"> 
  <table width="100%" cellspacing="1" cellpadding="4">                 $admin_img{'cat_img'} <b>$admin_txt{'838'}</b> 
   <tr valign="middle">             </td> 
    <td align="left" class="titlebg">         </tr><tr> 
     <img src="$imagesdir/cat.gif" alt="" border="0" /> <b>$admin_txt{'696a'}</b>             <td class="windowbg2"> 
    </td>                 <div class="pad-more">$referlist</div> 
   </tr>             </td> 
   <tr valign="middle">         </tr> 
    <td align="left" class="windowbg2"><br />     </table> 
     $scriptcalls<br />  </div>
    </td>  
   </tr>  
  </table>  
</div>  
   
<br />  
   
<div class="bordercolor" style="padding: 0px; width: 99%; margin-left: 0px; margin-right: auto;">  
  <table width="100%" cellspacing="1" cellpadding="4">  
   <tr valign="middle">  
    <td align="left" class="titlebg">  
     <img src="$imagesdir/cat.gif" alt="" border="0" /> <b>$admin_txt{'838'}</b>  
    </td>  
   </tr>  
   <tr valign="middle">  
    <td align="left" class="windowbg2"><br />  
     $referlist<br />  
    </td>  
   </tr>  
  </table>  
</div>  
~; ~;
   }    }
   
   $yytitle     = $admin_txt{'693'};    $yytitle     = $admin_txt{'693'};
   $action_area = "showclicks";     $action_area = 'showclicks'; 
   &AdminTemplate;     AdminTemplate(); 
     return;
} }
   
sub DeleteOldMessages { sub DeleteOldMessages {
   &is_admin_or_gmod;     is_admin_or_gmod(); 
   
   fopen(DELETEOLDMESSAGE, "$vardir/oldestmes.txt");     fopen( DELETEOLDMESSAGE, "$vardir/oldestmes.txt" ); 
   $maxdays = <DELETEOLDMESSAGE>;    $maxdays = <DELETEOLDMESSAGE>;
   fclose(DELETEOLDMESSAGE);    fclose(DELETEOLDMESSAGE);
   
   $yytitle = "$aduptxt{'04'}";    $yytitle = "$aduptxt{'04'}";
   $yymain .= qq~    $yymain .= qq~
<form action="$adminurl?action=removeoldthreads" method="post"> <form action="$adminurl?action=removeoldthreads" method="post">
<div class="bordercolor" style="padding: 0px; width: 99%; margin-left: 0px; margin-right: auto;">  <div class="bordercolor rightboxdiv"> 
  <table width="100%" cellspacing="1" cellpadding="4">     <table class="border-space pad-cell" style="margin-bottom: .5em;"> 
   <tr valign="middle">         <tr> 
    <td align="left" class="titlebg">            <td class="titlebg">
     <img src="$imagesdir/ban.gif" alt="" border="0" /> <b>$aduptxt{'04'}</b>                $admin_img{'banimg'} <b>$aduptxt{'04'}</b>
    </td>            </td>
   </tr>         </tr><tr> 
   <tr valign="middle">             <td class="windowbg2"> 
    <td align="left" class="windowbg2"><br />                 <div class="pad-more">$aduptxt{'05'}</div> 
     $aduptxt{'05'}<br /><br />             </td> 
    </td>         </tr><tr> 
   </tr>             <td class="windowbg2"> 
   <tr valign="middle">                 <div class="pad-more"> 
    <td align="left" class="windowbg2"><br />                    <label for="keep_them">$admin_txt{'4'}</label> <input type="checkbox" name="keep_them" id="keep_them" value="1" /><br />
     <label for="keep_them">$admin_txt{'4'}</label> <input type="checkbox" name="keep_them" id="keep_them" value="1" /><br />                     <label for="maxdays">$admin_txt{'124'} <input type="text" name="maxdays" id="maxdays" size="4" value="$maxdays" /> $admin_txt{'579'} $admin_txt{'2'}:</label> 
     <label for="maxdays">$admin_txt{'124'} <input type=text name="maxdays" id="maxdays" size="4" value="$maxdays" /> $admin_txt{'579'} $admin_txt{'2'}:</label><br /><br />                     <div style="margin-left: 25px; margin-right: auto; text-align: left;">~; 
     <div align="left" style="margin-left: 25px; margin-right: auto;">~;  
     get_forum_master();
   unless ($mloaded == 1) { require "$boardsdir/forum.master"; }  
     foreach my $catid (@categoryorder) {
   foreach $catid (@categoryorder) {         $boardlist = $cat{$catid}; 
       $boardlist = $cat{$catid};         @bdlist = split /\,/xsm, $boardlist; 
       (@bdlist) = split(/\,/, $boardlist);         ( $catname, $catperms ) = split /\|/xsm, $catinfo{$catid}; 
       ($catname, $catperms) = split(/\|/, $catinfo{"$catid"});  
         foreach my $curboard (@bdlist) {
       foreach $curboard (@bdlist) {             ( $boardname, $boardperms, $boardview ) = 
           ($boardname, $boardperms, $boardview) = split(/\|/, $board{"$curboard"});               split /\|/xsm, $board{$curboard}; 
             if ( $boardname !~ m/[ht|f]tp[s]{0,1}:\/\//sm ) {
           $selectname = $curboard . 'check';                $selectname = $curboard . 'check';
           $yymain .= qq~                $yymain .= qq~
       <input type="checkbox" name="$selectname" id="$selectname" value="1" />&nbsp;<label for="$selectname">$boardname</label><br />~;                    <input type="checkbox" name="$selectname" id="$selectname" value="1" />&nbsp;<label for="$selectname">$boardname</label><br />~;
       }                 if ( $subboard{$curboard} ) { 
   }                     my @childboards = split /\|/xsm, $subboard{$curboard}; 
   $yymain .= qq~                     foreach my $childbd (@childboards) { 
     </div><br />                         my ( $chldboardname, $chldboardperms, $chldboardview ) 
    </td>                           = split /\|/xsm, $board{$childbd}; 
   </tr>                         if ( $chldboardname !~ m/[ht|f]tp[s]{0,1}:\/\//sm ) { 
   <tr valign="middle">                             $selectname = $childbd . 'check'; 
    <td align="center" class="catbg">                             $yymain .= qq~ 
     <input type="submit" value="$admin_txt{'31'}" class="button" />                         &nbsp; &nbsp; &nbsp; &nbsp;<input type="checkbox" name="$selectname" id="$selectname" value="1" />&nbsp;<label for="$selectname">$chldboardname</label><br />~; 
    </td>                         } 
   </tr>                     } 
  </table>                 } 
</div>             } 
         }
     }
     $yymain .= qq~
                     </div>
                 </div>
             </td>
         </tr>
     </table>
  </div>
  <div class="bordercolor rightboxdiv">
     <table class="border-space pad-cell" style="margin-bottom: .5em;">
         <tr>
             <th class="titlebg">$admin_img{'prefimg'} $admin_txt{'31'}</th>
         </tr><tr>
             <td class="catbg center">
                 <input type="submit" value="$admin_txt{'31'}" class="button" />
             </td>
         </tr>
     </table>
  </div>
</form>~; </form>~;
   
   $action_area = "deleteoldthreads";     $action_area = 'deleteoldthreads'; 
   &AdminTemplate;     AdminTemplate(); 
     return;
} }
   
sub DeleteMultiMembers { sub DeleteMultiMembers {
   &is_admin_or_gmod;     is_admin_or_gmod(); 
   
   &automaintenance("on");     automaintenance('on'); 
   
   my ($count, $currentmem, $start, $sortmode, $sortorder, $deadusers, @userslist);     my @userslist = (); 
   chomp $FORM{'button'};    chomp $FORM{'button'};
   chomp $FORM{'emailsubject'};    chomp $FORM{'emailsubject'};
   chomp $FORM{'emailtext'};    chomp $FORM{'emailtext'};
   $tmpemailsubject = $FORM{'emailsubject'};    $tmpemailsubject = $FORM{'emailsubject'};
   $tmpemailtext = $FORM{'emailtext'};    $tmpemailtext    = $FORM{'emailtext'};
   if ($FORM{'button'} != 1 && $FORM{'button'} != 2) { &admin_fatal_error('no_access'); }     if ( $FORM{'button'} != 1 && $FORM{'button'} != 2 ) { 
         fatal_error('no_access');
   if ($FORM{'del_mail'} || $FORM{'emailtext'} ne '') { require "$sourcedir/Mailer.pl"; }    }
   
   fopen(FILE, "$memberdir/memberlist.txt");     if ( $FORM{'del_mail'} || $FORM{'emailtext'} ne q{} ) { 
   @memnum = <FILE>;         require Sources::Mailer; 
   fclose(FILE);     } 
   $count = 0;  
     fopen( FILE, "$memberdir/memberlist.txt" );
   if ($FORM{'button'} == 1 && $FORM{'emailtext'} ne "") {     @memnum = <FILE>; 
       $FORM{'emailsubject'} =~ s~\|~&#124~g;     fclose(FILE); 
       $FORM{'emailtext'}    =~ s~\|~&#124~g;     my $count = 0; 
       $FORM{'emailtext'} =~ s/\r(?=\n*)//g;  
       $mailline = qq~$date|$FORM{'emailsubject'}|$FORM{'emailtext'}|$username~;     if ( $FORM{'button'} == 1 && $FORM{'emailtext'} ne q{} ) { 
       &MailList($mailline);         $FORM{'emailsubject'} =~ s/\|/&verbar;/gsm; 
   }         $FORM{'emailtext'} =~ s/\|/&verbar;/gsm; 
         $FORM{'emailtext'} =~ s/\r(?=\n*)//gxsm;
   my $templanguage = $language;         $mailline = 
           qq~$date|$FORM{'emailsubject'}|$FORM{'emailtext'}|$username~;
   while (@memnum >= $count) {         MailList($mailline); 
       $currentmem = $FORM{"member$count"};     } 
       if (exists $FORM{"member$count"}) {  
           if (-e "$memberdir/$currentmem.vars") { # Bypass dead entries.     my $templanguage = $language; 
               &LoadUser($currentmem);  
               if ($FORM{'emailtext'} ne '') {    while ( @memnum >= $count ) {
                   $emailsubject = $FORM{'emailsubject'};         my $currentmem = $FORM{"member$count"}; 
                   $emailtext = $FORM{'emailtext'};         if ( exists $FORM{"member$count"} ) { 
                   $emailsubject =~ s~\[name\]~${$uid.$currentmem}{'realname'}~ig;             if ( -e "$memberdir/$currentmem.vars" ) {    # Bypass dead entries. 
                   $emailsubject =~ s~\[username\]~$currentmem~ig;                 LoadUser($currentmem); 
                   $emailtext =~ s~\[name\]~${$uid.$currentmem}{'realname'}~ig;                 if ( $FORM{'emailtext'} ne q{} ) { 
                   $emailtext =~ s~\[username\]~$currentmem~ig;                     $emailsubject = $FORM{'emailsubject'}; 
                   &sendmail(${$uid.$currentmem}{'email'}, $emailsubject, $emailtext);                     $emailtext    = $FORM{'emailtext'}; 
               } elsif ($FORM{'del_mail'}) {                     $emailsubject =~ 
                   $language = ${$uid.$currentmem}{'language'};                       s/\[name\]/${$uid.$currentmem}{'realname'}/igsm; 
                   &LoadLanguage('Email');                     $emailsubject =~ s/\[username\]/$currentmem/igsm; 
                   my $message = &template_email($deleteduseremail, {'displayname' => ${$uid.$currentmem}{'realname'}});                     $emailtext =~ 
                   &sendmail(${$uid.$currentmem}{'email'}, "$deletedusersybject $mbname", $message, '', $emailcharset);                       s/\[name\]/${$uid.$currentmem}{'realname'}/igsm; 
               }                     $emailtext =~ s/\[username\]/$currentmem/igsm; 
               undef %{$uid.$currentmem} if $currentmem ne $username;                     sendmail( ${ $uid . $currentmem }{'email'}, 
           }                         $emailsubject, $emailtext ); 
           if ($FORM{'button'} == 2) {                 } 
               unlink("$memberdir/$currentmem.dat");                 elsif ( $FORM{'del_mail'} ) { 
               unlink("$memberdir/$currentmem.vars");                     $language = ${ $uid . $currentmem }{'language'}; 
               unlink("$memberdir/$currentmem.ims");                     LoadLanguage('Email'); 
               unlink("$memberdir/$currentmem.msg");                     my $message = template_email( 
               unlink("$memberdir/$currentmem.log");                         $deleteduseremail, 
               unlink("$memberdir/$currentmem.rlog");                         { 
               unlink("$memberdir/$currentmem.outbox");                             'displayname' => ${ $uid . $currentmem }{'realname'} 
               unlink("$memberdir/$currentmem.imstore");                         } 
               unlink("$memberdir/$currentmem.imdraft");                     ); 
               # save name up                     sendmail( 
               push (@userslist, $currentmem);                         ${ $uid . $currentmem }{'email'}, 
               # For security, remove username from mod position                         "$deletedusersybject $mbname", 
               &KillModerator($currentmem);                         $message, q{}, $emailcharset 
           }                     ); 
       }                }
       $count++;                 if ( $currentmem ne $username ) { 
   }                     undef %{ $uid . $currentmem }; 
   if (@userslist) { &MemberIndex("remove", join(',', @userslist)); }                }
             }
   &automaintenance("off");             if ( $FORM{'button'} == 2 ) { 
                 unlink "$memberdir/$currentmem.dat";
   $language = $templanguage;                 unlink "$memberdir/$currentmem.vars"; 
   if ($FORM{'button'} == 1) {                 unlink "$memberdir/$currentmem.ims"; 
       $yySetLocation = qq~$adminurl?action=mailing;sort=$INFO{'sort'}~;                 unlink "$memberdir/$currentmem.msg"; 
   } else {                 unlink "$memberdir/$currentmem.log"; 
       $yySetLocation = qq~$adminurl?action=viewmembers;start=$INFO{'start'};sort=$INFO{'sort'};reversed=$INFO{'reversed'}~;                 unlink "$memberdir/$currentmem.rlog"; 
   }                 unlink "$memberdir/$currentmem.outbox"; 
   &redirectexit;                 unlink "$memberdir/$currentmem.imstore"; 
}                 unlink "$memberdir/$currentmem.imdraft"; 
   
sub ipban {                 # save name up 
   &is_admin_or_gmod;                 push @userslist, $currentmem; 
   
   my ($eban, $iban, $uban) = ($email_banlist, $ip_banlist, $user_banlist);                 # For security, remove username from mod position 
   $iban =~ s/,/\n/g;                 KillModerator($currentmem); 
   $eban =~ s/,/\n/g;             } 
   $uban =~ s/,/\n/g;         } 
         $count++;
   $yymain .= qq~     } 
<form action="$adminurl?action=ipban2" method="post">     if (@userslist) { MemberIndex( 'remove', join q{,}, @userslist ); } 
<div class="bordercolor" style="padding: 0px; width: 99%; margin-left: 0px; margin-right: auto;">  
  <table width="100%" cellspacing="1" cellpadding="4">     automaintenance('off'); 
   <tr valign="middle">  
    <td align="left" class="titlebg">     $language = $templanguage; 
     <img src="$imagesdir/ban.gif" alt="" border="0" /><b>$admin_txt{'340'}</b>     if ( $FORM{'button'} == 1 ) { 
    </td>         $yySetLocation = qq~$adminurl?action=mailing;sort=$INFO{'sort'}~; 
   </tr>     } 
   <tr valign="middle">     else { 
    <td align="left" class="catbg">         $yySetLocation = 
     <label for="ban"><span class="small">$admin_txt{'724'}</span></label>  qq~$adminurl?action=viewmembers;start=$INFO{'start'};sort=$INFO{'sort'};reversed=$INFO{'reversed'}~; 
    </td>     } 
   </tr>     redirectexit(); 
   <tr valign="middle">     return; 
    <td align="center" class="windowbg2"><br />  
     <textarea cols="60" rows="10" name="ban" id="ban" style="width: 95%">$iban</textarea><br /><br />  
    </td>  
   </tr>  
   <tr valign="middle">  
    <td align="left" class="catbg">  
     <label for="ban_email"><span class="small">$admin_txt{'725'}</span></label>  
    </td>  
   </tr>  
   <tr valign="middle">  
    <td align="center" class="windowbg2"><br />  
     <textarea cols="60" rows="10" name="ban_email" id="ban_email" style="width: 95%">$eban</textarea><br /><br />  
    </td>  
   </tr>  
   <tr valign="middle">  
    <td align="left" class="catbg">  
     <label for="ban_memname"><span class="small">$admin_txt{'725a'}</span></label>  
    </td>  
   </tr>  
   <tr valign="middle">  
    <td align="center" class="windowbg2"><br />  
     <textarea cols="60" rows="10" name="ban_memname" id="ban_memname" style="width: 95%">$uban</textarea><br /><br />  
    </td>  
   </tr>  
   <tr valign="middle">  
    <td align="center" class="catbg">  
     <input type="submit" value="$admin_txt{'10'}" class="button" />  
    </td>  
   </tr>  
  </table>  
</div>  
</form>~;  
   
   $yytitle     = "$admin_txt{'340'}";  
   $action_area = "ipban";  
   &AdminTemplate;  
}  
   
sub ipban2 {  
   &is_admin_or_gmod;  
   
   $FORM{'ban'} =~ tr/\r//d;  
   $FORM{'ban'} =~ s/\A[\s\n]+| |[\s\n]+\Z//g;  
   $FORM{'ban'} =~ s~\n\s*\n~\n~g;  
   $FORM{'ban'} =~ s/\n/,/g;  
   $FORM{'ban_email'} =~ tr/\r//d;  
   $FORM{'ban_email'} =~ s/\A[\s\n]+| |[\s\n]+\Z//g;  
   $FORM{'ban_email'} =~ s~\n\s*\n~\n~g;  
   $FORM{'ban_email'} =~ s/\n/,/g;  
   $FORM{'ban_memname'} =~ tr/\r//d;  
   $FORM{'ban_memname'} =~ s/\A[\s\n]+| |[\s\n]+\Z//g;  
   $FORM{'ban_memname'} =~ s~\n\s*\n~\n~g;  
   $FORM{'ban_memname'} =~ s/\n/,/g;  
   
   ($email_banlist, $ip_banlist, $user_banlist) = ($FORM{'ban_email'}, $FORM{'ban'}, $FORM{'ban_memname'});  
   
   require "$admindir/NewSettings.pl";  
   &SaveSettingsTo('Settings.pl');  
   
   $yySetLocation = $adminurl;  
   &redirectexit;  
}  
   
sub ipban_update {  
   # This is for quick updating for banning + unbanning  
   &is_admin_or_gmod;  
   
   my ($ban_details, @banlist);  
   if ($INFO{'ban'}) {  
       foreach (split(/,/, $ip_banlist)) {  
           if ($_ ne $INFO{'ban'}) { push(@banlist, $_); }  
       }  
       push(@banlist, $INFO{'ban'}) unless $INFO{'unban'};  
       $ip_banlist = join(',', @banlist);  
   
   } elsif ($INFO{'ban_email'}) {  
       foreach (split(/,/, $email_banlist)) {  
           if ($_ ne $INFO{'ban_email'}) { push(@banlist, $_); }  
       }  
       push(@banlist, $INFO{'ban_email'}) unless $INFO{'unban'};  
       $email_banlist = join(',', @banlist);  
   
   } elsif ($INFO{'ban_memname'}) {  
       $INFO{'ban_memname'} = $do_scramble_id ? &decloak($INFO{'ban_memname'}) : $INFO{'ban_memname'};  
       foreach (split(/,/, $user_banlist)) {  
           if ($_ ne $INFO{'ban_memname'}) { push(@banlist, $_); }  
       }  
       push(@banlist, $INFO{'ban_memname'}) unless $INFO{'unban'};  
       $user_banlist = join(',', @banlist);  
   }  
   
   require "$admindir/NewSettings.pl";  
   &SaveSettingsTo('Settings.pl');  
   
   $yySetLocation = qq~$scripturl?action=viewprofile;username=$INFO{'username'}~;  
   &redirectexit;  
} }
   
sub ver_detail { sub ver_detail {
   &is_admin_or_gmod;     is_admin_or_gmod(); 
     if ($maintenance) {
   require "$boarddir/$yyexec.$yyext";         $yyadmin_alert .= 
   $adminindexplver =~ s/\$Revision\: (.*?) \$/Build $1/ig;  qq~<br /><span style="font-size: 12px; background-color: #FFFF33;"><b>$load_txt{'616a'}</b></span><br /><br />~; 
   $YaBBplver =~ s/\$Revision\: (.*?) \$/Build $1/ig;     } 
     if ( $iamadmin && $rememberbackup ) {
   $yymain .= qq~         if ( $lastbackup && $date > $rememberbackup + $lastbackup ) { 
   <div class="bordercolor" style="padding: 0px; width: 99%; margin-left: 0px; margin-right: auto;">             require Sources::DateTime; 
   <table width="100%" cellspacing="1" cellpadding="4">             $yyadmin_alert .= 
   <tr valign="middle">  qq~<br /><span style="font-size: 12px; background-color: #FFFF33;"><b>$load_txt{'617'} ~ 
           <td align="left" class="titlebg" colspan="3"><img src="$imagesdir/info.gif" alt="" border="0" /><b>$admin_txt{'429'}</b></td>               . timeformat($lastbackup) 
    </tr>               . q~</b></span>~; 
   <tr valign="middle">         } 
       <td align="left" class="windowbg2" colspan="3">     } 
       <script language="javascript" src="http://www.yabbforum.com/update/versioncheck.js" type="text/javascript"></script>  
       $versiontxt{'4'} <b>$YaBBversion</b><br />     require "$boarddir/$yyexec.$yyext"; 
       <script language="JavaScript" type="text/javascript">     $adminindexplver =~ s/\$Revision\: (.*?) \$/Build $1/igsm; 
       <!-- //hide from dinosaurs     $yabbplver =~ s/\$Revision\: (.*?) \$/Build $1/igsm; 
           document.write("$versiontxt{'5'} <b>"+STABLE+"</b><br />$versiontxt{'7'} <b>"+BETA+"</b>");  
       // -->     $yymain .= qq~ 
       </script>         <div class="bordercolor rightboxdiv"> 
       <noscript>$versiontxt{'1'} <img src="http://www.yabbforum.com/images/version/versioncheck.gif" alt="" /></noscript>         <table class="border-space pad-cell"> 
   </td>             <colgroup> 
   </tr>                 <col span="2" style="width: 50%" /> 
   <tr valign="middle">             </colgroup> 
       <td align="center" class="catbg" width="40%"><b>$admin_txt{'495'}</b><br /></td>             <tr> 
       <td align="center" class="catbg" width="60%"><b>$admin_txt{'494'}</b><br /></td>                 <td class="titlebg" colspan="2">$admin_img{'infoimg'} <b>$admin_txt{'429'}</b></td> 
   </tr>             </tr><tr> 
   <tr>                 <td class="windowbg2" colspan="2"> 
       <td class="windowbg2" align="left">$admin_txt{'496'}</td>                     <script src="$versionchk" type="text/javascript"></script> 
       <td class="windowbg2" align="left"><i>$YaBBversion</i></td>                     $versiontxt{'4'} <b>$YaBBversion</b><br /> 
   </tr><tr>                     <script type="text/javascript"> 
       <td class="windowbg2" align="left">$yyexec.$yyext</td>                         if (typeof STABLE === "undefined" || STABLE === null) { 
       <td class="windowbg2" align="left"><i>$YaBBplver</i></td>                             document.write("$versiontxt{'5'} <b>$rna</b><br />$versiontxt{'7'} <b>$rna</b>"); 
   </tr><tr>                         } else { 
       <td class="windowbg2" align="left">AdminIndex.pl</td>                             document.write("$versiontxt{'5'} <b>"+STABLE+"</b><br />$versiontxt{'7'} <b>"+BETA+"</b>"); 
       <td class="windowbg2" align="left"><i>$adminindexplver</i></td>                         } 
   </tr>~;                     </script> 
                 </td>
   opendir(LNGDIR, $langdir);             </tr><tr> 
   my @lfilesanddirs = readdir(LNGDIR);                 <td class="catbg center"><b>$admin_txt{'495'}</b><br /></td> 
   close(LNGDIR);                 <td class="catbg center"><b>$admin_txt{'494'}</b><br /></td> 
   foreach $fld (@lfilesanddirs) {             </tr><tr> 
       if (-d "$langdir/$fld" && $fld =~ m^\A[0-9a-zA-Z_\#\%\-\:\+\?\$\&\~\,\@/]+\Z^ && -e "$langdir/$fld/Main.lng") {                 <td class="windowbg2">$admin_txt{'496'}</td> 
           fopen(FILE, "$langdir/$fld/version.txt");                 <td class="windowbg2"><i>$YaBBversion</i></td> 
           my @ver = <FILE>;             </tr><tr> 
           fclose(FILE);                 <td class="windowbg2">$yyexec.$yyext</td> 
           $yymain .= qq~                 <td class="windowbg2"><i>$yabbplver</i></td> 
   <tr>             </tr><tr> 
       <td width="30%" class="windowbg2" align="left">$fld Language Pack</td>                 <td class="windowbg2">AdminIndex.pl</td> 
       <td width="35%" class="windowbg2" align="left"><i>$ver[0]</i></td>                 <td class="windowbg2"><i>$adminindexplver</i></td> 
   </tr>~;            </tr>~;
       }  
   }     opendir LNGDIR, $langdir; 
   $yymain .= qq~     my @lfilesanddirs = readdir LNGDIR; 
   <tr valign="middle">     closedir LNGDIR; 
       <td align="left" class="titlebg" colspan="3"><b>$admin_txt{'430'}</b></td>     foreach my $fld (@lfilesanddirs) { 
   </tr>~;         if (   -d "$langdir/$fld" 
             && $fld =~ m{\A[0-9a-zA-Z_\#\%\-\:\+\?\$\&\~\,\@/]+\Z}sm
   opendir(DIR, $admindir);             && -e "$langdir/$fld/Main.lng" ) 
   my @adminDIR = readdir(DIR);         { 
   close(DIR);             fopen( FILE, "$langdir/$fld/version.txt" ); 
   @adminDIR = sort (@adminDIR);             my @ver = <FILE>; 
   foreach my $fileinDIR (@adminDIR) {             fclose(FILE); 
       chomp $fileinDIR;             $yymain .= qq~<tr> 
       if ($fileinDIR =~ m/\.pl\Z/) {                 <td class="windowbg2">$fld Language Pack</td> 
           require "$admindir/$fileinDIR";                 <td class="windowbg2"><i>$ver[0]</i></td> 
           my $txtrevision = lc $fileinDIR;             </tr>~; 
           $txtrevision =~ s/\.pl/plver/ig;         } 
           $$txtrevision =~ s/\$Revision\: (.*?) \$/Build $1/ig;     } 
           $yymain .= qq~     $yymain .= qq~<tr> 
   <tr>                 <td class="titlebg" colspan="2"><b>$admin_txt{'430'}</b></td> 
       <td class="windowbg2" align="left">$fileinDIR</td>             </tr>~; 
       <td class="windowbg2" align="left"><i>$$txtrevision</i></td>  
   </tr>~;     opendir DIR, $admindir; 
       }     my @adminDIR = readdir DIR; 
   }     closedir DIR; 
   $yymain .= qq~     @adminDIR = sort @adminDIR; 
   <tr valign="middle">     foreach my $fileinDIR (@adminDIR) { 
       <td align="left" class="titlebg" colspan="3"><b>$admin_txt{'431'}</b></td>         chomp $fileinDIR; 
   </tr>~;         if ( $fileinDIR =~ m/\.pl\Z/xsm ) { 
             require "$admindir/$fileinDIR";
   opendir(DIR, $sourcedir);             my $txtrevision = lc $fileinDIR; 
   my @sourceDIR = readdir(DIR);             $txtrevision =~ s/\.pl/plver/igsm; 
   close(DIR);             ${$txtrevision} =~ s/\$Revision\: (.*?) \$/Build $1/igsm; 
   @sourceDIR = sort (@sourceDIR);             $yymain .= qq~<tr> 
   foreach my $fileinDIR (@sourceDIR) {                 <td class="windowbg2">$fileinDIR</td> 
       chomp $fileinDIR;                 <td class="windowbg2"><i>${$txtrevision}</i></td> 
       if ($fileinDIR =~ m/\.pl\Z/) {             </tr>~; 
           require "$sourcedir/$fileinDIR";         } 
           my $txtrevision = lc $fileinDIR;         elsif ( $fileinDIR =~ m/\.pm\Z/xsm ) { 
           $txtrevision =~ s/\.pl/plver/ig;             require "$admindir/$fileinDIR"; 
           $$txtrevision =~ s/\$Revision\: (.*?) \$/Build $1/ig;             my $txtrevision = lc $fileinDIR; 
           $yymain .= qq~             $txtrevision =~ s/\.pm/pmver/igsm; 
           <tr>             ${$txtrevision} =~ s/\$Revision\: (.*?) \$/Build $1/igsm; 
               <td class="windowbg2" align="left">$fileinDIR</td>             $yymain .= qq~<tr> 
               <td class="windowbg2" align="left"><i>$$txtrevision</i></td>                 <td class="windowbg2">$fileinDIR</td> 
           </tr>~;                 <td class="windowbg2"><i>${$txtrevision}</i></td> 
       }             </tr>~; 
   }        }
     }
   $yymain .= qq~     $yymain .= qq~<tr> 
   </table>                 <td class="titlebg" colspan="2"><b>$admin_txt{'431'}</b></td> 
   </div>~;         </tr>~; 
   
   $yytitle = $admin_txt{'429'};     opendir DIR, $sourcedir; 
   $action_area = "detailedversion";     my @sourceDIR = readdir DIR; 
   &AdminTemplate;     closedir DIR; 
     @sourceDIR = sort @sourceDIR;
     foreach my $fileinDIR (@sourceDIR) {
         chomp $fileinDIR;
         if ( $fileinDIR =~ m/\.pl\Z/sm ) {
             require "$sourcedir/$fileinDIR";
             my $txtrevision = lc $fileinDIR;
             $txtrevision =~ s/\.pl/plver/igsm;
             ${$txtrevision} =~ s/\$Revision\: (.*?) \$/Build $1/igsm;
             $yymain .= qq~<tr>
                     <td class="windowbg2">$fileinDIR</td>
                     <td class="windowbg2"><i>$$txtrevision</i></td>
                 </tr>~;
         }
         elsif ( $fileinDIR =~ m/\.pm\Z/xsm ) {
             require "$sourcedir/$fileinDIR";
             my $txtrevision = lc $fileinDIR;
             $txtrevision =~ s/\.pm/pmver/igsm;
             ${$txtrevision} =~ s/\$Revision\: (.*?) \$/Build $1/igsm;
             $yymain .= qq~<tr>
                 <td class="windowbg2">$fileinDIR</td>
                 <td class="windowbg2"><i>${$txtrevision}</i></td>
             </tr>~;
         }
     }
   
     $yymain .= q~
         </table>
         </div>~;
   
     $yytitle     = $admin_txt{'429'};
     $action_area = 'detailedversion';
     AdminTemplate();
     return;
} }
   
sub Refcontrol { sub Refcontrol {
   &is_admin_or_gmod;     is_admin_or_gmod(); 
   &LoadLanguage('RefControl');     LoadLanguage('RefControl'); 
   
     require Sources::SubList;
   
   fopen(FILE, "$sourcedir/SubList.pl");     fopen( FILE, "$vardir/allowed.txt" ); 
   @scriptlines = <FILE>;    @allowed = <FILE>;
   fclose(FILE);    fclose(FILE);
   
   fopen(FILE, "$vardir/allowed.txt");     $counter   = 0; 
   @allowed = <FILE>;  
   fclose(FILE);     for my $key ( keys %director) { 
         push @actfound, $key;
   $startread = 0;         $counter++; 
   $counter   = 0;     } 
   
   foreach $scriptline (@scriptlines) {     $column  = int( $counter / 3 ) - 1; 
       chomp $scriptline;     $counter = 0; 
       if (substr($scriptline, 0, 1) eq "'") {    foreach my $actfound (@actfound) {
           $scriptline =~ /\'(.*?)\'/;         $selected = q{}; 
           $actionfound = $1;         foreach my $allow (@allowed) { 
           push(@actfound, $actionfound);             chomp $allow; 
           $counter++;             if ( $actfound eq $allow ) { 
       }                 $selected = ' checked="checked"'; 
   }                 last; 
   $column  = int($counter / 3);             } 
   $counter = 0;         } 
   foreach $actfound (@actfound) {         $refexpl_txt{$actfound} =~ s/\x22/\x27/gxsm;    # XHTML Validation 
       $selected = "";         $dismenu .= 
       foreach $allow (@allowed) {  qq~<input type="checkbox" name="$actfound" id="$actfound"$selected />&nbsp;<label for="$actfound"><img src="$admin_img{'question'}" alt="$reftxt{'1a'} $refexpl_txt{$actfound}" title="$reftxt{'1a'} $refexpl_txt{$actfound}" /> $actfound</label><br />\n~; 
           chomp $allow;         $counter++; 
           if ($actfound eq $allow) { $selected = ' checked="checked"'; last; }         if ( $counter > $column + 1 ) { 
       }             $dismenu .= q~</td><td class="windowbg2 vtop">~; 
       $refexpl_txt{$actfound} =~ s/"/'/g; # XHTML Validation             $counter = 0; 
       $dismenu .= qq~<input type="checkbox" name="$actfound" id="$actfound"$selected />&nbsp;<label for="$actfound"><img src="$imagesdir/question.gif" align="middle" alt="$reftxt{'1a'} $refexpl_txt{$actfound}" title="$reftxt{'1a'} $refexpl_txt{$actfound}" border="0" /> $actfound</label ><br />\n~;         } 
       $counter++;     } 
       if ($counter > $column + 1) {     $yymain .= qq~ 
           $dismenu .= qq~</td><td align="left" class="windowbg2" valign="top" width="33%">~;  
           $counter = 0;  
       }  
   }  
   $yymain .= qq~  
<form action="$adminurl?action=referer_control2" method="post"> <form action="$adminurl?action=referer_control2" method="post">
<div class="bordercolor" style="padding: 0px; width: 99%; margin-left: 0px; margin-right: auto;">     <div class="bordercolor rightboxdiv"> 
  <table width="100%" cellspacing="1" cellpadding="4">         <table class="border-space pad-cell" style="margin-bottom: .5em;"> 
   <tr valign="middle">             <colgroup> 
    <td align="left" class="titlebg" colspan="3">                 <col style="width: 33%" /> 
     <img src="$imagesdir/preferences.gif" alt="" border="0" /><b>$reftxt{'1'}</b>                 <col style="width: 34%" /> 
    </td>                 <col style="width: 33%" /> 
   </tr>             </colgroup> 
   <tr valign="middle">             <tr> 
    <td align="left" class="windowbg2" colspan="3"><br />                 <td class="titlebg" colspan="3"> 
     $reftxt{'2'}<br />                     $admin_img{'prefimg'} <b>$reftxt{'1'}</b> 
     <span class="small">                 </td> 
     $reftxt{'3'}<br /><br />             </tr><tr> 
     </span>                 <td class="windowbg2" colspan="3"><br /> 
    </td>                 $reftxt{'2'}<br /> 
   </tr>                 <span class="small">$reftxt{'3'}<br /><br /></span> 
   <tr valign="middle">                 </td> 
    <td align="left" class="windowbg2" valign="top" width="33%">             </tr><tr> 
     $dismenu                 <td class="windowbg2 vtop"> 
    </td>                 $dismenu 
                 </td>
             </tr>
         </table>
     </div>
  <div class="bordercolor rightboxdiv">
  <table class="border-space pad-cell">
     <tr>
         <th class="titlebg">$admin_img{'prefimg'} $admin_txt{'10'}</th>
     </tr><tr>
         <td class="catbg center">
              <input type="submit" value="$reftxt{'4'}" class="button" />
         </td>
   </tr>    </tr>
   <tr valign="middle">  </table> 
    <td align="center" class="catbg" colspan="3">  </div> 
     <input type="submit" value="$reftxt{'4'}" class="button" />  
    </td>  
    </tr>  
  </table>  
</div>  
</form>~; </form>~;
   
   $yytitle     = "$reftxt{'1'}";    $yytitle     = "$reftxt{'1'}";
   $action_area = "referer_control";     $action_area = 'referer_control'; 
   &AdminTemplate;     AdminTemplate(); 
     return;
} }
   
sub Refcontrol2 { sub Refcontrol2 {
   &is_admin_or_gmod;     is_admin_or_gmod(); 
   
   fopen(FILE, "$sourcedir/SubList.pl");     require Sources::SubList; 
   @scriptlines = <FILE>;  
   fclose(FILE);  
   
   $startread = 0;  
   $counter   = 0;  
   foreach $scriptline (@scriptlines) {  
       chomp $scriptline;  
       if (substr($scriptline, 0, 1) eq "'") {  
           $scriptline =~ /\'(.*?)\'/;  
           $actionfound = $1;  
           push(@actfound, $actionfound);  
           $counter++;  
       }  
   }  
   
   foreach $actfound (@actfound) {  
       if ($FORM{$actfound}) { push(@outfile, "$actfound\n"); }  
   }  
   
   fopen(FILE, ">$vardir/allowed.txt");  
   print FILE @outfile;  
   fclose(FILE);  
   
   $yySetLocation = $adminurl;     $counter   = 0; 
   &redirectexit;     for my $key ( keys %director) { 
         push @actfound, $key;
                 $counter++;
     }
   
     for my $actfound (@actfound) {
         if ( $FORM{$actfound} ) { push @outfile, "$actfound\n"; }
     }
   
     fopen( FILE, ">$vardir/allowed.txt" );
     print {FILE} @outfile or croak "$croak{'print'} FILE";
     fclose(FILE);
   
     $yySetLocation = qq~$adminurl?action=referer_control~;
     redirectexit();
     return;
} }
   
sub AddMember { sub AddMember {
   &is_admin_or_gmod;     is_admin_or_gmod(); 
   &LoadLanguage('Register');     LoadLanguage('Register'); 
   if ($regcheck) {  
       require "$sourcedir/Decoder.pl";  
       &validation_code;  
   }  
   
   $yymain .= qq~  
<script language="JavaScript1.2" type="text/javascript" src="$yyhtml_root/ajax.js"></script>  
<form action="$adminurl?action=addmember2" method="post" name="creator">  
  <table align="center" border="0" cellspacing="1" cellpadding="3" class="bordercolor">  
   <tr>  
    <td colspan="2" width="100%" valign="middle" class="titlebg">  
     <img src="$imagesdir/register.gif" alt="" border="0" style="vertical-align: middle;" /><b> $admintxt{'17a'}</b>  
    </td>  
   </tr>  
   <tr>  
    <td width="30%" class="windowbg"><label for="regusername"><b>$register_txt{'98'}:</b></label></td>  
    <td width="70%" class="windowbg"><input type="text" name="regusername" id="regusername" onchange="checkAvail('$scripturl',this.value,'user')" size="30" maxlength="18" /><input type="hidden" name="_session_id_" id="_session_id_" value="$sessionid" /><input type="hidden" name="regdate" id="regdate" value="$regdate" /><div id="useravailability"></div></td>  
   </tr>  
   <tr>  
    <td width="30%" class="windowbg"><label for="regrealname"><b>$register_txt{'98a'}:</b></label></td>  
    <td width="70%" class="windowbg"><input type="text" name="regrealname" id="regrealname" onchange="checkAvail('$scripturl',this.value,'display')" size="30" maxlength="30" /><div id="displayavailability"></div></td>  
   </tr>  
   <tr>  
    <td width="30%" class="windowbg"><label for="email"><b>$register_txt{'69'}:</b></label></td>  
    <td width="70%" class="windowbg"><input type="text" maxlength="100" name="email" id="email" onchange="checkAvail('$scripturl',this.value,'email')" size="50" /><div id="emailavailability"></div></td>  
   </tr>~;  
   if ($allow_hide_email == 1) {  
       $yymain .= qq~  
   <tr>  
    <td width="30%" class="windowbg"><label for="hideemail"><b>$register_txt{'721'}</b></label></td>  
    <td width="70%" class="windowbg"><input type="checkbox" name="hideemail" id="hideemail" value="1" checked="checked" /></td>  
   </tr>~;  
   }  
   
   # Language selector     $yymain .= qq~ 
   $yymain .= qq~  <script type="text/javascript" src="$yyhtml_root/YaBB.js"></script> 
   <tr>  <script type="text/javascript" src="$yyhtml_root/ajax.js"></script> 
    <td width="30%" class="windowbg"><label for="userlang"><b>$register_txt{'101'}</b></label></td>  <form action="$adminurl?action=addmember2" method="post" name="creator" accept-charset="$yymycharset"> 
    <td width="70%" class="windowbg"><select name="userlang" id="userlang">~;  <div class="bordercolor rightboxdiv"> 
   opendir(LNGDIR, $langdir);     <table class="border-space pad-cell" style="margin-bottom: .5em;"> 
   foreach (sort {lc($a) cmp lc($b)} readdir(LNGDIR)) {         <colgroup> 
       if (-e "$langdir/$_/Main.lng") { $yymain .= qq~<option value="$_"~ . ($_ eq $language ? ' selected="selected"' : '') . qq~>$_</option>~; }             <col style="width: 30%" /> 
   }             <col style="width: 70%" /> 
   close(LNGDIR);         </colgroup> 
   $yymain .= qq~</select></td>         <tr> 
   </tr>~;             <td colspan="2" class="titlebg"> 
                 $admin_img{'register'}<b> $admintxt{'17a'}</b>
   unless ($emailpassword) {             </td> 
       $yymain .= qq~         </tr><tr> 
   <tr>             <td class="windowbg"><label for="regusername"><b>$register_txt{'98'}:</b></label></td> 
    <td width="30%" class="windowbg"><label for="passwrd1"><b>$register_txt{'81'}:</b></label></td>             <td class="windowbg2"><input type="text" name="regusername" id="regusername" onchange="checkAvail('$scripturl',this.value,'user')" size="30" maxlength="18" /><input type="hidden" name="_session_id_" id="_session_id_" value="$sessionid" /><input type="hidden" name="regdate" id="regdate" value="$regdate" /><div id="useravailability"></div></td> 
    <td width="70%" class="windowbg">         </tr><tr> 
   <script language="JavaScript1.2" type="text/javascript" src="$yyhtml_root/YaBB.js"></script>             <td class="windowbg"><label for="regrealname"><b>$register_txt{'98a'}:</b></label></td> 
   <div style="float:left;"><input type="password" maxlength="30" name="passwrd1" id="passwrd1" size="30" onkeyup="runPassword(this.value);" onkeypress="capsLock(event,'cappasswrd1')" /> &nbsp; </div>             <td class="windowbg2"><input type="text" name="regrealname" id="regrealname" onchange="checkAvail('$scripturl',this.value,'display')" size="30" maxlength="30" /><div id="displayavailability"></div></td> 
   <div style="float:left; width: 150px; height: 20px;">         </tr><tr> 
   <div id="password-strength-meter" style="background: transparent url($imagesdir/empty_bar.gif) repeat-x center left; height: 4px"></div>             <td class="windowbg"><label for="email"><b>$register_txt{'69'}:</b></label></td> 
   <div class="pstrength-bar" id="passwrd1_bar" style="border: 1px solid #FFFFFF; height: 4px"></div>             <td class="windowbg2"><input type="text" maxlength="100" name="email" id="email" onchange="checkAvail('$scripturl',this.value,'email')" size="50" /><div id="emailavailability"></div></td> 
   <div class="pstrength-info" id="passwrd1_text">&nbsp;</div>         </tr>~; 
   </div>     if ( $allow_hide_email == 1 ) { 
   <div style="clear:left; color: red; font-weight: bold; display: none" id="cappasswrd1">$register_txt{'capslock'}</div>         $yymain .= qq~<tr> 
   <div style="clear:left; color: red; font-weight: bold; display: none" id="cappasswrd1_char">$register_txt{'wrong_char'}: <span id="cappasswrd1_character">&nbsp;</span></div>             <td class="windowbg"><label for="hideemail"><b>$register_txt{'721'}</b></label></td> 
    </td>             <td class="windowbg2"><input type="checkbox" name="hideemail" id="hideemail" value="1" checked="checked" /></td> 
   </tr>         </tr>~; 
   <tr>     } 
    <td width="30%" class="windowbg"><label for="passwrd2"><b>$register_txt{'82'}:</b></label></td>  
    <td width="70%" class="windowbg">     # Language selector 
   <input type="password" maxlength="30" name="passwrd2" id="passwrd2" size="30" onkeypress="capsLock(event,'cappasswrd2')" />     $yymain .= qq~<tr> 
   <div style="color: red; font-weight: bold; display: none" id="cappasswrd2">$register_txt{'capslock'}</div>             <td class="windowbg"><label for="userlang"><b>$register_txt{'101'}</b></label></td> 
   <div style="color: red; font-weight: bold; display: none" id="cappasswrd1_char">$register_txt{'wrong_char'}: <span id="cappasswrd1_character">&nbsp;</span></div>             <td class="windowbg2"> 
    </td>                 <select name="userlang" id="userlang">~; 
   </tr>~;     opendir LNGDIR, $langdir; 
   }     foreach ( sort { lc($a) cmp lc $b } readdir LNGDIR ) { 
         if ( -e "$langdir/$_/Main.lng" ) {
   if ($regcheck) {             $yymain .= 
       $yymain .= qq~                 qq~                    <option value="$_"~ 
   <tr>               . ( $_ eq $language ? ' selected="selected"' : q{} ) 
    <td width="30%" class="windowbg"><label for="verification"><b>$floodtxt{'1'}:</b></label></td>               . qq~>$_</option>~; 
    <td width="70%" class="windowbg">$showcheck<br /><label for="verification"><span class="small">$floodtxt{'casewarning'}</span></label></td>         } 
   </tr>     } 
   <tr>     closedir LNGDIR; 
    <td width="30%" class="windowbg"><label for="verification"><b>$floodtxt{'3'}:</b></label></td>     $yymain .= q~ 
    <td width="70%" class="windowbg"><input type="text" maxlength="30" name="verification" id="verification" size="30" /></td>                 </select> 
   </tr>~;             </td> 
   }         </tr>~; 
   
     if ( !$emailpassword ) {
         $yymain .= password_check();
         $yymain =~ s/{yabb reg_1}/$register_txt{'81'}/sm;
         $yymain =~ s/{yabb reg_2}/$register_txt{'82'}/sm;
         $yymain =~ s/{yabb reg_caplock}/$register_txt{'capslock'}/gsm;
         $yymain =~ s/{yabb reg_wrongchar}/$register_txt{'wrong_char'}/gsm;
     }
   
   $yymain .= qq~    $yymain .= qq~
   <tr>     </table> 
    <td colspan="2" align="center" class="catbg">  </div> 
     <input type="submit" value="$register_txt{'97'}" class="button" />  <div class="bordercolor rightboxdiv"> 
    </td>     <table class="border-space pad-cell"> 
   </tr>         <tr> 
  </table>             <th class="titlebg">$admin_img{'prefimg'} $admin_txt{'10'}</th> 
         </tr><tr>
             <td class="catbg center">
                 <input type="submit" value="$register_txt{'97'}" class="button" />
             </td>
         </tr>
     </table>
  </div>
</form> </form>
  <script type="text/javascript">
<script language="JavaScript1.2" type="text/javascript">     document.creator.regusername.focus(); 
<!--  
   // Password_strength_meter start  
   var verdects = new Array("$pwstrengthmeter_txt{'1'}","$pwstrengthmeter_txt{'2'}","$pwstrengthmeter_txt{'3'}","$pwstrengthmeter_txt{'4'}","$pwstrengthmeter_txt{'5'}","$pwstrengthmeter_txt{'6'}","$pwstrengthmeter_txt{'7'}","$pwstrengthmeter_txt{'8'}");  
   var colors = new Array("#8F8F8F","#BF0000","#FF0000","#00A0FF","#33EE00","#339900");  
   var scores = new Array($pwstrengthmeter_scores);  
   var common = new Array($pwstrengthmeter_common);  
   var minchar = $pwstrengthmeter_minchar;  
   
   function runPassword(D) {  
       var nPerc = checkPassword(D);  
       if (nPerc > -199 && nPerc < 0) {  
           strColor = colors[0];  
           strText = verdects[1];  
           strWidth = "5%";  
       } else if (nPerc == -200) {  
           strColor = colors[1];  
           strText = verdects[0];  
           strWidth = "0%";  
       } else if (scores[0] == -1 && scores[1] == -1 && scores[2] == -1 && scores[3] == -1) {  
           strColor = colors[4];  
           strText = verdects[7];  
           strWidth = "100%";  
       } else if (nPerc <= scores[0]) {  
           strColor = colors[1];  
           strText = verdects[2];  
           strWidth = "10%";  
       } else if (nPerc > scores[0] && nPerc <= scores[1]) {  
           strColor = colors[2];  
           strText = verdects[3];  
           strWidth = "25%";  
       } else if (nPerc > scores[1] && nPerc <= scores[2]) {  
           strColor = colors[3];  
           strText = verdects[4];  
           strWidth = "50%";  
       } else if (nPerc > scores[2] && nPerc <= scores[3]) {  
           strColor = colors[4];  
           strText = verdects[5];  
           strWidth = "75%";  
       } else {  
           strColor = colors[5];  
           strText = verdects[6];  
           strWidth = "100%";  
       }  
       document.getElementById("passwrd1_bar").style.width = strWidth;  
       document.getElementById("passwrd1_bar").style.backgroundColor = strColor;  
       document.getElementById("passwrd1_text").style.color = strColor;  
       document.getElementById("passwrd1_text").childNodes[0].nodeValue = strText;  
   }  
   
   function checkPassword(C) {  
       if (C.length == 0 || C.length < minchar) return -100;  
   
       for (var D = 0; D < common.length; D++) {  
           if (C.toLowerCase() == common[D]) return -200;  
       }  
   
       var F = 0;  
       if (C.length >= minchar && C.length <= (minchar+2)) {  
           F = (F + 6)  
       } else if (C.length >= (minchar + 3) && C.length <= (minchar + 4)) {  
           F = (F + 12)  
       } else if (C.length >= (minchar + 5)) {  
           F = (F + 18)  
       }  
   
       if (C.match(/[a-z]/)) {  
           F = (F + 1)  
       }  
       if (C.match(/[A-Z]/)) {  
           F = (F + 5)  
       }  
       if (C.match(/d+/)) {  
           F = (F + 5)  
       }  
       if (C.match(/(.*[0-9].*[0-9].*[0-9])/)) {  
           F = (F + 7)  
       }  
       if (C.match(/.[!,\@,#,\$,\%,^,&,*,?,_,\~]/)) {  
           F = (F + 5)  
       }  
       if (C.match(/(.*[!,\@,#,\$,\%,^,&,*,?,_,\~].*[!,\@,#,\$,\%,^,&,*,?,_,\~])/)) {  
           F = (F + 7)  
       }  
       if (C.match(/([a-z].*[A-Z])|([A-Z].*[a-z])/)){  
           F = (F + 2)  
       }  
       if (C.match(/([a-zA-Z])/) && C.match(/([0-9])/)) {  
           F = (F + 3)  
       }  
       if (C.match(/([a-zA-Z0-9].*[!,\@,#,\$,\%,^,&,*,?,_,\~])|([!,\@,#,\$,\%,^,&,*,?,_,\~].*[a-zA-Z0-9])/)) {  
           F = (F + 3)  
       }  
       return F;  
   }  
   // Password_strength_meter end  
// -->  
</script>  
~;  
   
   $yymain .= qq~  
<script type="text/javascript" language="JavaScript">  
<!--  
   document.creator.regusername.focus();  
   //function  
//-->  
</script>~; </script>~;
   
   $yytitle     = "$register_txt{'97'}";    $yytitle     = "$register_txt{'97'}";
   $action_area = "addmember";     $action_area = 'addmember'; 
   &AdminTemplate;     AdminTemplate(); 
     return;
} }
   
sub AddMember2 { sub AddMember2 {
   &is_admin_or_gmod;     is_admin_or_gmod(); 
   &LoadLanguage('Register');     LoadLanguage('Register'); 
   &LoadLanguage('Main');     LoadLanguage('Main'); 
   my %member;    my %member;
   while (($key, $value) = each(%FORM)) {    while ( ( $key, $value ) = each %FORM ) {
       $value =~ s~\A\s+~~;         $value =~ s/\A\s+//xsm; 
       $value =~ s~\s+\Z~~;         $value =~ s/\s+\Z//xsm; 
       $value =~ s~[\n\r]~~g;         $value =~ s/[\n\r]//gxsm; 
       $member{$key} = $value;        $member{$key} = $value;
   }    }
   $member{'username'} =~ s/\s/_/g;  
     # Make sure users can't register with banned details
   # Make sure users can't register with banned details     banning( $member{'regusername'}, $member{'email'}, 1 ); 
   &banning($member{'regusername'}, $member{'email'}, 1);  
  # check if there is a system hash named like this by checking existence through size
   # check if there is a system hash named like this by checking existence through size     my $hsize = keys %{ $member{'regusername'} }; 
   my $hsize = keys(%{ $member{'regusername'} });     if ( $hsize > 0 ) { fatal_error('system_prohibited_id'); } 
   if ($hsize > 0) { &admin_fatal_error("system_prohibited_id"); }     if ( length( $member{'regusername'} ) > 25 ) { 
   if (length($member{'regusername'}) > 25) { $member{'regusername'} = substr($member{'regusername'}, 0, 25); }         $member{'regusername'} = substr $member{'regusername'}, 0, 25; 
   &admin_fatal_error("no_username","($member{'regusername'})") if $member{'regusername'} eq '';     } 
   &admin_fatal_error("id_alfa_only","($member{'regusername'})") if $member{'regusername'} eq '_' || $member{'regusername'} eq '|';     if ( $member{'regusername'} eq q{} ) { 
   &admin_fatal_error("id_reserved","($member{'regusername'})") if $member{'regusername'} =~ /guest/i;         fatal_error( 'no_username', "($member{'regusername'})" ); 
   &admin_fatal_error("invalid_character","$register_txt{'35'} $register_txt{'241re'}") if $member{'regusername'} =~ /[^\w\+\-\.\@]/;     } 
   &admin_fatal_error("no_email","($member{'regusername'})") if $member{'email'} eq "";     if ( $member{'regusername'} eq q{_} || $member{'regusername'} eq q{|} ) { 
   &admin_fatal_error("id_taken","($member{'regusername'})") if -e "$memberdir/$member{'regusername'}.vars";         fatal_error( 'id_alfa_only', "($member{'regusername'})" ); 
   &admin_fatal_error("password_is_userid") if $member{'regusername'} eq $member{'passwrd1'};     } 
     if ( $member{'regusername'} =~ /guest/ism ) {
   &FromChars($member{'regrealname'});         fatal_error( 'id_reserved', "($member{'regusername'})" ); 
   $convertstr = $member{'regrealname'};     } 
   $convertcut = 30;     if ( $member{'regusername'} =~ /[^\w\+\-\.\@]/sm ) { 
   &CountChars;         fatal_error( 'invalid_character', 
   $member{'regrealname'} = $convertstr;             "$register_txt{'35'} $register_txt{'241e'}" ); 
   &admin_fatal_error("realname_to_long","($member{'regrealname'} => $convertstr)") if $cliped;     } 
   &admin_fatal_error("invalid_character", "$register_txt{'38'} $register_txt{'241re'}") if $member{'regrealname'} =~ /[^ \w\x80-\xFF\[\]\(\)#\%\+,\-\|\.:=\?\@\^]/;     if ( $member{'regusername'} =~ /^[0-9]+$/sm ) { 
         fatal_error( 'all_numbers',
   if ($regcheck) {             "$register_txt{'35'} $register_txt{'241n'}" ); 
       require "$sourcedir/Decoder.pl";     } 
       &validation_check($FORM{'verification'});     if ( $member{'email'} eq q{} ) { 
   }         fatal_error( 'no_email', "($member{'regusername'})" ); 
     }
   if ($emailpassword) {    if ( -e "$memberdir/$member{'regusername'}.vars" ) {
       srand();         fatal_error( 'id_taken', "($member{'regusername'})" ); 
       $member{'passwrd1'} = int(rand(100));     } 
       $member{'passwrd1'} =~ tr/0123456789/ymifxupbck/;     if ( $member{'regusername'} eq $member{'passwrd1'} ) { 
       $_ = int(rand(77));         fatal_error('password_is_userid'); 
       $_ =~ tr/0123456789/q8dv7w4jm3/;     } 
       $member{'passwrd1'} .= $_;  
       $_ = int(rand(89));     FromChars( $member{'regrealname'} ); 
       $_ =~ tr/0123456789/y6uivpkcxw/;     $convertstr = $member{'regrealname'}; 
       $member{'passwrd1'} .= $_;     $convertcut = 30; 
       $_ = int(rand(188));     CountChars(); 
       $_ =~ tr/0123456789/poiuytrewq/;     $member{'regrealname'} = $convertstr; 
       $member{'passwrd1'} .= $_;     if ($cliped) { 
       $_ = int(rand(65));         fatal_error( 'realname_to_long', 
       $_ =~ tr/0123456789/lkjhgfdaut/;             "($member{'regrealname'} => $convertstr)" ); 
       $member{'passwrd1'} .= $_;     } 
     if ( $member{'regrealname'} =~
   } else {         /[^ \w\x80-\xFF\[\]\(\)#\%\+,\-\|\.:=\?\@\^]/sm ) 
       &admin_fatal_error("password_mismatch","($member{'regusername'})") if ($member{'passwrd1'} ne $member{'passwrd2'});     { 
       &admin_fatal_error("no_password","($member{'regusername'})") if ($member{'passwrd1'} eq '');         fatal_error( 'invalid_character', 
       &admin_fatal_error("invalid_character","$register_txt{'36'} $register_txt{'241'}") if ($member{'passwrd1'}  =~ /[^\s\w!\@#\$\%\^&\*\(\)\+\|`~\-=\\:;'",\.\/\?\[\]\{\}]/);             "$register_txt{'38'} $register_txt{'241re'}" ); 
   }    }
   
   &admin_fatal_error("invalid_character","$register_txt{'69'} $register_txt{'241e'}") if ($member{'email'} !~ /^[\w\-\.\+]+\@[\w\-\.\+]+\.\w{2,4}$/);     if ($emailpassword) { 
   &admin_fatal_error("invalid_email") if (($member{'email'} =~ /(@.*@)|(\.\.)|(@\.)|(\.@)|(^\.)|(\.$)/) || ($member{'email'} !~ /\A.+@\[?(\w|[-.])+\.[a-zA-Z]{2,4}|[0-9]{1,4}\]?\Z/));         srand; 
         $member{'passwrd1'} = int rand 100;
   if (lc $member{'regusername'} eq lc &MemberIndex("check_exist", $member{'regusername'})) { &admin_fatal_error("id_taken","($member{'regusername'})"); }         $member{'passwrd1'} =~ tr/0123456789/ymifxupbck/; 
   if (lc $member{'email'} eq lc &MemberIndex("check_exist", $member{'email'})) { &admin_fatal_error("email_taken","($member{'email'})"); }         $_ = int rand 77; 
   if (lc $member{'regrealname'} eq lc &MemberIndex("check_exist", $member{'regrealname'})) { &admin_fatal_error("name_taken","($member{'regrealname'})"); }         $_ =~ tr/0123456789/q8dv7w4jm3/; 
         $member{'passwrd1'} .= $_;
   if ($name_cannot_be_userid && lc $member{'regusername'} eq lc $member{'regrealname'}) { &admin_fatal_error("name_is_userid"); }         $_ = int rand 89; 
         $_ =~ tr/0123456789/y6uivpkcxw/;
   fopen(RESERVE, "$vardir/reserve.txt") || &admin_fatal_error("cannot_open","$vardir/reserve.txt", 1);         $member{'passwrd1'} .= $_; 
   @reserve = <RESERVE>;         $_ = int rand 188; 
   fclose(RESERVE);         $_ =~ tr/0123456789/poiuytrewq/; 
   fopen(RESERVECFG, "$vardir/reservecfg.txt") || &admin_fatal_error("cannot_open","$vardir/reservecfg.txt", 1);         $member{'passwrd1'} .= $_; 
   @reservecfg = <RESERVECFG>;         $_ = int rand 65; 
   fclose(RESERVECFG);         $_ =~ tr/0123456789/lkjhgfdaut/; 
   for ($a = 0; $a < @reservecfg; $a++) {         $member{'passwrd1'} .= $_; 
       chomp $reservecfg[$a];     } 
   }     else { 
   $matchword = $reservecfg[0] eq 'checked';         if ( $member{'passwrd1'} ne $member{'passwrd2'} ) { 
   $matchcase = $reservecfg[1] eq 'checked';             fatal_error( 'password_mismatch', "($member{'regusername'})" ); 
   $matchuser = $reservecfg[2] eq 'checked';         } 
   $matchname = $reservecfg[3] eq 'checked';         if ( $member{'passwrd1'} eq q{} ) { 
   $namecheck = $matchcase eq 'checked' ? $member{'regusername'} : lc $member{'regusername'};             fatal_error( 'no_password', "($member{'regusername'})" ); 
   $realnamecheck = $matchcase eq 'checked' ? $member{'regrealname'} : lc $member{'regrealname'};         } 
         if ( $member{'passwrd1'} =~
   foreach $reserved (@reserve) {             /[^\s\w!\@#\$\%\^&\*\(\)\+\|`~\-=\\:;'",\.\/\?\[\]\{\}]/sm ) 
       chomp $reserved;         { 
       $reservecheck = $matchcase ? $reserved : lc $reserved;             fatal_error( 'invalid_character', 
       if ($matchuser) {                 "$register_txt{'36'} $register_txt{'241'}" ); 
           if ($matchword) {         } 
               if ($namecheck eq $reservecheck) { &admin_fatal_error('id_reserved',"$reserved"); }    }
           } else {  
               if ($namecheck =~ $reservecheck) { &admin_fatal_error('id_reserved',"$reserved"); }     if ( $member{'email'} !~ /^[\w\-\.\+]+\@[\w\-\.\+]+\.\w{2,4}$/sm ) { 
           }         fatal_error( 'invalid_character', 
       }             "$register_txt{'69'} $register_txt{'241e'}" ); 
       if ($matchname) {     } 
           if ($matchword) {     if ( 
               if ($realnamecheck eq $reservecheck) { &admin_fatal_error('name_reserved',"$reserved"); }         ( $member{'email'} =~ /(@.*@)|(\.\.)|(@\.)|(\.@)|(^\.)|(\.$)/sm ) 
           } else {         || ( $member{'email'} !~ 
               if ($realnamecheck =~ $reservecheck) { &admin_fatal_error('name_reserved',"$reserved"); }             /\A.+@\[?(\w|[-.])+\.[a-zA-Z]{2,4}|[0-9]{1,4}\]?\Z/sm ) 
           }       ) 
       }     { 
   }         fatal_error('invalid_email'); 
     }
   &admin_fatal_error("id_taken") if (-e ("$memberdir/$member{'username'}.vars"));  
     if (
   if ($send_welcomeim == 1) {         lc $member{'regusername'} eq 
       # new format msg file:         lc MemberIndex( 'check_exist', $member{'regusername'}, 0 ) ) 
       # messageid|(from)user|(touser(s))|(ccuser(s))|(bccuser(s))|subject|date|message|(parentmid)|reply#|ip|messagestatus|flags|storefolder|attachment     { 
       $messageid = $^T . $$;         fatal_error( 'id_taken', "($member{'regusername'})" ); 
       fopen(IM, ">$memberdir/$member{'regusername'}.msg", 1);     } 
       print IM "$messageid|$sendname|$member{'regusername'}|||$imsubject|$date|$imtext|$messageid|0|$ENV{'REMOTE_ADDR'}|s|u||\n";     if ( 
       fclose(IM);         lc $member{'email'} eq 
   }         lc MemberIndex( 'check_exist', $member{'email'}, 2 ) ) 
   $encryptopass = &encode_password($member{'passwrd1'});     { 
   $reguser      = $member{'regusername'};         fatal_error( 'email_taken', "($member{'email'})" ); 
   $registerdate = timetostring($date);     } 
     if (
   if ($default_template) { $new_template = $default_template; }         lc $member{'regrealname'} eq 
   else { $new_template = "default"; }         lc MemberIndex( 'check_exist', $member{'regrealname'}, 1 ) ) 
     {
   &ToHTML($member{'regrealname'});         fatal_error( 'name_taken', "($member{'regrealname'})" ); 
     }
   ${$uid.$reguser}{'password'}      = $encryptopass;  
   ${$uid.$reguser}{'realname'}      = $member{'regrealname'};     if ( $name_cannot_be_userid 
   ${$uid.$reguser}{'email'}         = lc($member{'email'});         && lc $member{'regusername'} eq lc $member{'regrealname'} ) 
   ${$uid.$reguser}{'postcount'}     = 0;     { 
   ${$uid.$reguser}{'usertext'}      = $defaultusertxt;         fatal_error('name_is_userid'); 
   ${$uid.$reguser}{'userpic'}       = "blank.gif";     } 
   ${$uid.$reguser}{'regdate'}       = $registerdate;  
   ${$uid.$reguser}{'regtime'}       = $date;     fopen( RESERVE, "$vardir/reserve.txt" ) 
   ${$uid.$reguser}{'timeselect'}    = $timeselected;       || fatal_error( 'cannot_open', "$vardir/reserve.txt", 1 ); 
   ${$uid.$reguser}{'timeoffset'}    = $timeoffset;     @reserve = <RESERVE>; 
   ${$uid.$reguser}{'dsttimeoffset'} = $dstoffset;     fclose(RESERVE); 
   ${$uid.$reguser}{'hidemail'}      = $FORM{'hideemail'} ? 1 : 0;     fopen( RESERVECFG, "$vardir/reservecfg.txt" ) 
   ${$uid.$reguser}{'timeformat'}    = qq~MM D+ YYYY @ HH:mm:ss*~;       || fatal_error( 'cannot_open', "$vardir/reservecfg.txt", 1 ); 
   ${$uid.$reguser}{'template'}      = $new_template;     @reservecfg = <RESERVECFG>; 
   ${$uid.$reguser}{'language'}      = $member{'userlang'};     fclose(RESERVECFG); 
   ${$uid.$reguser}{'pageindex'}     = qq~1|1|1~;     for my $aa ( 0 .. $#reservecfg ) { 
         chomp $reservecfg[$aa];
   &UserAccount($reguser, "register") & MemberIndex("add", $reguser) & FormatUserName($reguser);     } 
     $matchword = $reservecfg[0] eq 'checked';
   if ($emailpassword) {     $matchcase = $reservecfg[1] eq 'checked'; 
       my $templanguage = $language;     $matchuser = $reservecfg[2] eq 'checked'; 
       $language = $member{'userlang'};     $matchname = $reservecfg[3] eq 'checked'; 
       &LoadLanguage('Email');     $namecheck = 
       require "$sourcedir/Mailer.pl";         $matchcase eq 'checked' 
       my $message = &template_email($passwordregemail, {'displayname' => $member{'regrealname'}, 'username' => $reguser, 'password' => $member{'passwrd1'}});       ? $member{'regusername'} 
       &sendmail($member{'email'}, "$mailreg_txt{'apr_result_info'} $mbname", $message,'',$emailcharset);       : lc $member{'regusername'}; 
       $language = $templanguage;     $realnamecheck = 
         $matchcase eq 'checked' 
   } elsif ($emailwelcome) {       ? $member{'regrealname'} 
       my $templanguage = $language;       : lc $member{'regrealname'}; 
       $language = $member{'userlang'};  
       &LoadLanguage('Email');     foreach my $reserved (@reserve) { 
       require "$sourcedir/Mailer.pl";         chomp $reserved; 
       my $message = &template_email($welcomeregemail, {'displayname' => $member{'regrealname'}, 'username' => $reguser, 'password' => $member{'passwrd1'}});         $reservecheck = $matchcase ? $reserved : lc $reserved; 
       &sendmail($member{'email'}, "$mailreg_txt{'apr_result_info'} $mbname", $message,'',$emailcharset);         if ($matchuser) { 
       $language = $templanguage;             if ($matchword) { 
   }                 if ( $namecheck eq $reservecheck ) { 
                     fatal_error( 'id_reserved', "$reserved" );
   $yytitle       = "$register_txt{'245'}";                 } 
   $yymain        = "$register_txt{'245'}";             } 
   $yySetLocation = qq~$adminurl?action=viewmembers;sort=regdate;reversed=on;start=0~;             else { 
   &redirectexit;                 if ( $namecheck =~ $reservecheck ) { 
   $action_area = "addmember";                     fatal_error( 'id_reserved', "$reserved" ); 
   &AdminTemplate;                 } 
             }
         }
         if ($matchname) {
             if ($matchword) {
                 if ( $realnamecheck eq $reservecheck ) {
                     fatal_error( 'name_reserved', "$reserved" );
                 }
             }
             else {
                 if ( $realnamecheck =~ $reservecheck ) {
                     fatal_error( 'name_reserved', "$reserved" );
                 }
             }
         }
     }
   
     if ( -e ("$memberdir/$member{'username'}.vars") ) {
         fatal_error('id_taken');
     }
   
     if ( $send_welcomeim == 1 ) {
   
         $messageid = $BASETIME . $PROCESS_ID;
         fopen( IM, ">$memberdir/$member{'regusername'}.msg", 1 );
         print {IM}
  "$messageid|$sendname|$member{'regusername'}|||$imsubject|$date|$imtext|$messageid|0|$ENV{'REMOTE_ADDR'}|s|u||\n" 
           or croak "$croak{'print'} IM";
         fclose(IM);
     }
     $encryptopass = encode_password( $member{'passwrd1'} );
     $reguser      = $member{'regusername'};
     $registerdate = timetostring($date);
   
     if   ($default_template) { $new_template = $default_template; }
     else                     { $new_template = 'default'; }
   
     ToHTML( $member{'regrealname'} );
   
     ${ $uid . $reguser }{'password'}      = $encryptopass;
     ${ $uid . $reguser }{'realname'}      = $member{'regrealname'};
     ${ $uid . $reguser }{'email'}         = lc $member{'email'};
     ${ $uid . $reguser }{'postcount'}     = 0;
     ${ $uid . $reguser }{'usertext'}      = $defaultusertxt;
     ${ $uid . $reguser }{'userpic'}       = 'blank.gif';
     ${ $uid . $reguser }{'regdate'}       = $registerdate;
     ${ $uid . $reguser }{'regtime'}       = $date;
     ${ $uid . $reguser }{'timeselect'}    = $timeselected;
     ${ $uid . $reguser }{'timeoffset'}    = $timeoffset;
     ${ $uid . $reguser }{'dsttimeoffset'} = $dstoffset;
     ${ $uid . $reguser }{'hidemail'}      = $FORM{'hideemail'} ? 1 : 0;
     ${ $uid . $reguser }{'timeformat'}    = q~MM D+ YYYY @ HH:mm:ss*~;
     ${ $uid . $reguser }{'template'}      = $new_template;
     ${ $uid . $reguser }{'language'}      = $member{'userlang'};
     ${ $uid . $reguser }{'pageindex'}     = q~1|1|1~;
   
     UserAccount( $reguser, 'register' ) & MemberIndex( 'add', $reguser ) &
       FormatUserName($reguser);
   
     if ($emailpassword) {
         my $templanguage = $language;
         $language = $member{'userlang'};
         LoadLanguage('Email');
         require Sources::Mailer;
         my $message = template_email(
             $passwordregemail,
             {
                 'displayname' => $member{'regrealname'},
                 'username'    => $reguser,
                 'password'    => $member{'passwrd1'}
             }
         );
         sendmail( $member{'email'}, "$mailreg_txt{'apr_result_info'} $mbname",
             $message, q{}, $emailcharset );
         $language = $templanguage;
   
     }
     elsif ($emailwelcome) {
         my $templanguage = $language;
         $language = $member{'userlang'};
         LoadLanguage('Email');
         require Sources::Mailer;
         my $message = template_email(
             $welcomeregemail,
             {
                 'displayname' => $member{'regrealname'},
                 'username'    => $reguser,
                 'password'    => $member{'passwrd1'}
             }
         );
         sendmail( $member{'email'}, "$mailreg_txt{'apr_result_info'} $mbname",
             $message, q{}, $emailcharset );
         $language = $templanguage;
     }
   
     $yytitle = "$register_txt{'245'}";
     $yymain  = "$register_txt{'245'}";
     $yySetLocation =
       qq~$adminurl?action=viewmembers;sort=regdate;reversed=on;start=0~;
     redirectexit();
     $action_area = 'addmember';
     AdminTemplate();
     return;
  }
   
  sub AdminCheck {
     $yymain .= $my_admin_login;
     $formsession = cloak("$mbname$username");
     if   ($do_scramble_id) { $user = cloak($username); }
     else                   { $user = $username; }
   
     my $adminpass  = 'adminpass';
     my $cookiename = "$cookieusername$adminpass";
     if ( $yyCookies{$cookiename} ) {
         if ( $INFO{'action2'} ) {
             $my_action = qq~action=$INFO{'action2'};~;
         }
         if ( $INFO{'page'} ) {
             $my_page = qq~page=$INFO{'page'};~;
         }
         if ( $my_action || $my_page ) { $my_query = q{?}; }
         $yySetLocation = qq~$adminurl$my_query$my_action$my_page~;
         redirectexit();
     }
     else {
         $yymain =~
           s/{yabb adminchk}/$adminurl?action=admincheck2;username=$user/sm;
         if ( $INFO{'action2'} ) {
             $yymain =~ s/{yabb act}/$INFO{'action2'}/sm;
         }
         if ( $INFO{'page'} ) {
             $yymain =~ s/{yabb page}/$INFO{'page'}/sm;
         }
   
         $yynavigation = qq~&rsaquo; $admin_txt{'900'}~;
         $yytitle      = $admin_txt{'900'};
         $yyuname      = qq~${$uid.$username}{'realname'}~;
         template();
     }
     return;
  }
   
  sub AdminCheck2 {
   
     my $password = encode_password( $FORM{'passwrd'} || $INFO{'passwrd'} );
   
     if ( $FORM{'action'} ) { $my_action = qq~action=$FORM{'action'};~; }
     if ( $FORM{'page'} )   { $my_page   = qq~page=$FORM{'page'};~; }
     if ( $my_action || $my_page ) { $my_query = q{?}; }
   
     if   ( $do_scramble_id ) { $user = decloak($username); }
     else                   { $user = $username; }
     if ( ( $iamadmin || $iamgmod )
         && $password ne ${ $uid . $user }{'password'} )
     {
         fatal_error('no_admin_passwrd');
     }
     elsif ( $iamadmin
         && encode_password('admin') eq ${ $uid . $user }{'password'} )
     {
         fatal_error('default_password');
     }
   
     my $adminpass  = 'adminpass';
     my $cookiename = "$cookieusername$adminpass";
     push @otherCookies,
       write_cookie(
         -name    => "$cookiename",
         -value   => 'on',
         -path    => q{/},
         -expires => '0' 
       );
   
     $yySetLocation = qq~$adminurl$my_query$my_action$my_page~;
     redirectexit();
     return;
} }
   
1; 1;