D:\my docs\My Received Files\Yabb\Yabb\YaBB_2.5_AEB\cgi-bin\yabb2_old\Admin\Admin.pl D:\WEBSITES\testbed\cgi-bin\yabb252\Admin\Admin.pl
############################################################################### ###############################################################################
# Admin.pl                                                                    # # Admin.pl                                                                    #
############################################################################### ###############################################################################
# YaBB: Yet another Bulletin Board                                            # # YaBB: Yet another Bulletin Board                                            #
# Open-Source Community Software for Webmasters                               # # Open-Source Community Software for Webmasters                               #
# Version:        YaBB 2.5 Anniversary Edition                                # # Version:        YaBB 2.5.2                                                  #
# Packaged:       July 04, 2010                                               # # Packaged:       September 30, 2012                                          #
# Distributed by: http://www.yabbforum.com                                    # # Distributed by: http://www.yabbforum.com                                    #
# =========================================================================== # # =========================================================================== #
# Copyright (c) 2000-2010 YaBB (www.yabbforum.com) - All Rights Reserved.     # # Copyright (c) 2000-2012 YaBB (www.yabbforum.com) - All Rights Reserved.     #
# Software by:  The YaBB Development Team                                     # # Software by:  The YaBB Development Team                                     #
#               with assistance from the YaBB community.                      # #               with assistance from the YaBB community.                      #
# Sponsored by: Xnull Internet Media, Inc. - http://www.ximinc.com            #    
#               Your source for web hosting, web design, and domains.         #    
############################################################################### ###############################################################################
   
$adminplver  = 'YaBB 2.5 AE $Revision: 1.82 $'; $adminplver  = 'YaBB 2.5.2 $Revision: 1.0 $';
   
sub Admin { sub Admin {
   &is_admin_or_gmod;    &is_admin_or_gmod;
   
   $yymain .= qq~    $yymain .= qq~
<div class="bordercolor" style="padding: 0px; width: 99%; margin-left: 0px; margin-right: auto;"> <div class="bordercolor" style="padding: 0px; width: 99%; margin-left: 0px; margin-right: auto;">
  <table width="100%" cellspacing="1" cellpadding="4">   <table width="100%" cellspacing="1" cellpadding="4">
    <tr valign="middle">     <tr valign="middle">
      <td align="left" class="titlebg" colspan="2">       <td align="left" class="titlebg" colspan="2">
       <b>$admintxt{'1'}</b>        <b>$admintxt{'1'}</b>
     </td>      </td>
    </tr>     </tr>
    <tr valign="middle">     <tr valign="middle">
      <td align="left" class="windowbg2">       <td align="left" class="windowbg2">
       <img alt="Admin Centre Logo" src="$defaultimagesdir/aarea.jpg" />        <img alt="Admin Centre Logo" src="$defaultimagesdir/aarea.jpg" />
      </td>       </td>
      <td align="left" class="windowbg2">       <td align="left" class="windowbg2">
       $admintxt{'2'}        $admintxt{'2'}
     </td>      </td>
    </tr>     </tr>
  </table>   </table>
</div> </div>
   
<br /> <br />
   
<div style="float: left; width: 49%; text-align: left;"> <div style="float: left; width: 49%; text-align: left;">
   
<div class="bordercolor" style="padding: 0px; width: 95%; margin-left: 0px; margin-right: auto;"> <div class="bordercolor" style="padding: 0px; width: 95%; margin-left: 0px; margin-right: auto;">
  <table width="100%" cellspacing="1" cellpadding="4">   <table width="100%" cellspacing="1" cellpadding="4">
    <tr valign="middle">     <tr valign="middle">
      <td align="left" class="titlebg">       <td align="left" class="titlebg">
       <b>$admintxt{'6'}</b>        <b>$admintxt{'6'}</b>
     </td>      </td>
    </tr>     </tr>
    <tr align="center" valign="middle">     <tr align="center" valign="middle">
      <td align="left" class="catbg">       <td align="left" class="catbg">
       <span class="small">YaBB 2</span>        <span class="small">YaBB 2</span>
      </td>       </td>
    </tr>     </tr>
    <tr valign="middle">     <tr valign="middle">
      <td align="left" class="windowbg2"><br />       <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 /> 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>      </td>
    </tr>     </tr>
    <tr align="center" valign="middle">     <tr align="center" valign="middle">
      <td align="left" class="catbg">       <td align="left" class="catbg">
       <span class="small">$yabbThanks</span>        <span class="small">$yabbThanks</span>
      </td>       </td>
    </tr>     </tr>
    <tr valign="middle">     <tr valign="middle">
      <td align="left" class="windowbg2"><br />       <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 /> 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 /> $noBytesHarmed<br /><br />
     </td>      </td>
    </tr>     </tr>
  </table>   </table>
</div> </div>
   
<br /> <br />
   
<div class="bordercolor" style="padding: 0px; width: 95%; margin-left: 0px; margin-right: auto;"> <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" src="http://www.yabbforum.com/update/versioncheck.js" type="text/javascript"></script>
 <script language="JavaScript" type="text/javascript">  <script language="JavaScript" type="text/javascript">
 <!-- //hide from dinosaurs  <!-- //hide from dinosaurs
   document.write('<table width="100%" cellspacing="1" cellpadding="4">');    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 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>');    document.write('<tr><td class="windowbg2">$versiontxt{'4'}</td><td class="windowbg2"><b>$YaBBversion</b></td></tr>');
   if (!STABLE) {    if (!STABLE) {
       document.write('<tr><td colspan="2" class="titlebg">$rna</b></td></tr>');        document.write('<tr><td colspan="2" class="titlebg">$rna</b></td></tr>');
   } else {    } 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{'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{'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>');        document.write('<tr><td class="windowbg2">$versiontxt{'8'}</td><td class="windowbg2"><b>'+ALPHA+'</b></td></tr>');
       if (STABLE == "$YaBBversion") {        if (STABLE == "$YaBBversion") {
           document.write('<tr><td colspan="2" valign="middle" class="windowbg2"><br />$versiontxt{'6'}<br /><br /></td></tr>');            document.write('<tr><td colspan="2" valign="middle" class="windowbg2"><br />$versiontxt{'6'}<br /><br /></td></tr>');
       } else {        } else {
           document.write('<tr><td colspan="2" valign="middle" class="windowbg2"><br />$versiontxt{'2'}'+STABLE+'$versiontxt{'3'}<br /><br /></td></tr>');            document.write('<tr><td colspan="2" valign="middle" class="windowbg2"><br />$versiontxt{'2'}'+STABLE+'$versiontxt{'3'}<br /><br /></td></tr>');
       }        }
   }    }
   document.write('</table>');    document.write('</table>');
 // -->  // -->
 </script>  </script>
 <noscript>$versiontxt{'1'}</noscript>  <noscript>$versiontxt{'1'}</noscript>
</div> </div>
   
</div> </div>
<div style="float: left; width: 50%; text-align: right;"> <div style="float: left; width: 50%; text-align: right;">
   
<div class="bordercolor" style="padding: 0px; width: 100%; margin-left: auto; margin-right: 0px;"> <div class="bordercolor" style="padding: 0px; width: 100%; margin-left: auto; margin-right: 0px;">
  <table width="100%" cellspacing="1" cellpadding="4">   <table width="100%" cellspacing="1" cellpadding="4">
    <tr valign="middle">     <tr valign="middle">
      <td align="left" class="titlebg">       <td align="left" class="titlebg">
       <b>$admintxt{'4'}</b>        <b>$admintxt{'4'}</b>
     </td>      </td>
    </tr>     </tr>
    <tr valign="middle">     <tr valign="middle">
      <td align="left" class="windowbg2">       <td align="left" class="windowbg2">
       <iframe src="http://www.yabbforum.com/update/" frameborder="0" width="100%" height="293">$iFrameSupport</iframe>        <iframe src="http://www.yabbforum.com/update/" frameborder="0" width="100%" height="293">$iFrameSupport</iframe>
     </td>      </td>
    </tr>     </tr>
  </table>   </table>
</div> </div>
   
<br /> <br />
   
<div class="bordercolor" style="padding: 0px; width: 100%; margin-left: auto; margin-right: 0px;"> <div class="bordercolor" style="padding: 0px; width: 100%; margin-left: auto; margin-right: 0px;">
  <table width="100%" cellspacing="1" cellpadding="4">   <table width="100%" cellspacing="1" cellpadding="4">
    <tr valign="middle">     <tr valign="middle">
      <td align="left" class="titlebg">       <td align="left" class="titlebg">
       <b>$admintxt{'5'}</b>        <b>$admintxt{'5'}</b>
     </td>      </td>
    </tr>     </tr>
    <tr valign="middle">     <tr valign="middle">
      <td align="left" class="windowbg2">~;       <td align="left" class="windowbg2">~;
   
   &GetLastLogins;    &GetLastLogins;
   
   $yymain .= qq~    $yymain .= qq~
     </td>      </td>
    </tr>     </tr>
  </table>   </table>
</div>~; </div>~;
   
   if (-d "./Convert") {    if (-d "./Convert") {
       $yymain .= qq~        $yymain .= qq~
<br /> <br />
<div class="bordercolor" style="padding: 0px; width: 100%; margin-left: auto; margin-right: 0px;"> <div class="bordercolor" style="padding: 0px; width: 100%; margin-left: auto; margin-right: 0px;">
<form name="backdelete" action="$adminurl?action=convdelete" method="post"> <form name="backdelete" action="$adminurl?action=convdelete" method="post">
<table width="100%" cellspacing="1" cellpadding="4"> <table width="100%" cellspacing="1" cellpadding="4">
   <tr valign="middle">    <tr valign="middle">
   <td align="left" class="titlebg">    <td align="left" class="titlebg">
       <b>$admintxt{'7'}</b>        <b>$admintxt{'7'}</b>
   </td>    </td>
   </tr>    </tr>
   <tr valign="middle">    <tr valign="middle">
   <td align="left" class="windowbg2"><br />    <td align="left" class="windowbg2"><br />
       $admintxt{'8'}<br /><br />        $admintxt{'8'}<br /><br />
   </td>    </td>
   </tr>    </tr>
   <tr valign="middle">    <tr valign="middle">
   <td align="center" class="catbg">    <td align="center" class="catbg">
       <input type="submit" value="$admintxt{'9'}" class="button" />        <input type="submit" value="$admintxt{'9'}" class="button" />
   </td>    </td>
   </tr>    </tr>
</table> </table>
</form> </form>
</div>~; </div>~;
   }    }
     
   $yymain .= qq~    $yymain .= qq~
</div>~; </div>~;
   
   require "$admindir/ModuleChecker.pl";    require "$admindir/ModuleChecker.pl";
   
   $yymain .= qq~    $yymain .= qq~
<div style="float: left; padding: 0px; width: 99%; margin-left: 0px; margin-right: auto; height: 100px;">&nbsp;</div> <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;
} }
   
sub DeleteConverterFiles { sub DeleteConverterFiles {
   my @convertdir = qw~Boards Members Messages Variables~;    my @convertdir = qw~Boards Members Messages Variables~;
   
   foreach $cnvdir (@convertdir) {    foreach $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) || &admin_fatal_error("cannot_open_dir","$convdir");
           @convlist = readdir("CNVDIR");            @convlist = readdir("CNVDIR");
           closedir("CNVDIR");            closedir("CNVDIR");
           foreach $file (@convlist) {            foreach $file (@convlist) {
               unlink "$convdir/$file" || &admin_fatal_error("cannot_open_dir","$convdir/$file");                unlink "$convdir/$file" || &admin_fatal_error("cannot_open_dir","$convdir/$file");
           }            }
           rmdir("$convdir");            rmdir("$convdir");
       }        }
   }    }
   $convdir = "./Convert";    $convdir = "./Convert";
   if (-d "$convdir") {    if (-d "$convdir") {
       opendir("CNVDIR", $convdir) || &admin_fatal_error("cannot_open_dir","$convdir");        opendir("CNVDIR", $convdir) || &admin_fatal_error("cannot_open_dir","$convdir");
       @convlist = readdir("CNVDIR");        @convlist = readdir("CNVDIR");
       closedir("CNVDIR");        closedir("CNVDIR");
       foreach $file (@convlist) {        foreach $file (@convlist) {
           unlink "$convdir/$file";            unlink "$convdir/$file";
       }        }
       rmdir("$convdir");        rmdir("$convdir");
   }    }
   if (-e "./Setup.pl") { unlink("./Setup.pl"); }    if (-e "./Setup.pl") { unlink("./Setup.pl"); }
   
   $yymain .= qq~<b>$admintxt{'10'}</b>~;    $yymain .= qq~<b>$admintxt{'10'}</b>~;
   $yytitle = "$admintxt{'10'}";    $yytitle = "$admintxt{'10'}";
   &AdminTemplate;    &AdminTemplate;
} }
   
sub GetLastLogins { sub GetLastLogins {
   fopen(ADMINLOG, "$vardir/adminlog.txt");    fopen(ADMINLOG, "$vardir/adminlog.txt");
   @adminlog = <ADMINLOG>;    @adminlog = <ADMINLOG>;
   fclose(ADMINLOG);    fclose(ADMINLOG);
   
   foreach $line (@adminlog) {    foreach $line (@adminlog) {
       chomp $line;        chomp $line;
       @element = split(/\|/, $line);        @element = split(/\|/, $line);
       if (!${$uid.$element[0]}{'realname'}) { &LoadUser($element[0]); }    # If user is not in memory, s/he must be loaded.        if (!${$uid.$element[0]}{'realname'}) { &LoadUser($element[0]); }    # If user is not in memory, s/he must be loaded.
       $element[2] = &timeformat($element[2]);        $element[2] = &timeformat($element[2]);
       $yymain .= qq~        $yymain .= qq~
       <a href="$scripturl?action=viewprofile;username=$useraccount{$element[0]}">${$uid.$element[0]}{'realname'}</a> <span class="small">($element[1]) - $element[2]</span><br />        <a href="$scripturl?action=viewprofile;username=$useraccount{$element[0]}">${$uid.$element[0]}{'realname'}</a> <span class="small">($element[1]) - $element[2]</span><br />
       ~;        ~;
   }    }
} }
   
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, $threadcount, $messagecount, $maxdays, $totalt, $totalm, $avgt, $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 = qq~<a href="$scripturl?action=viewprofile;username=$useraccount{$latestmember}">${$uid.$latestmember}{'realname'}</a>~;
   $memcount ||= 1;    $memcount ||= 1;
   
   $numcats = 0;    $numcats = 0;
   
   unless ($mloaded == 1) { require "$boardsdir/forum.master"; }    unless ($mloaded == 1) { require "$boardsdir/forum.master"; }
   foreach $catid (@categoryorder) {    foreach $catid (@categoryorder) {
       $boardlist = $cat{$catid};        $boardlist = $cat{$catid};
       $numcats++;        $numcats++;
       (@bdlist) = split(/\,/, $boardlist);        (@bdlist) = split(/\,/, $boardlist);
       ($catname, $catperms, $catallowcol) = split(/\|/, $catinfo{"$catid"});        ($catname, $catperms, $catallowcol) = split(/\|/, $catinfo{"$catid"});
   
       foreach $curboard (@bdlist) {        foreach $curboard (@bdlist) {
           chomp $curboard;            chomp $curboard;
           $numboards++;            $numboards++;
           push(@loadboards, $curboard);            push(@loadboards, $curboard);
       }        }
   }    }
   
   &BoardTotals("load", @loadboards);    &BoardTotals("load", @loadboards);
   foreach $curboard (@loadboards) {    foreach $curboard (@loadboards) {
       $totalm += ${$uid.$curboard}{'messagecount'};        $totalm += ${$uid.$curboard}{'messagecount'};
       $totalt += ${$uid.$curboard}{'threadcount'};        $totalt += ${$uid.$curboard}{'threadcount'};
   }    }
   
   $avgm = int($totalm / $memcount);    $avgm = int($totalm / $memcount);
   &LoadAdmins;    &LoadAdmins;
   
   if ($enableclicklog) {    if ($enableclicklog) {
       my (@log);        my (@log);
       fopen(LOG, "$vardir/clicklog.txt");        fopen(LOG, "$vardir/clicklog.txt");
       @log = <LOG>;        @log = <LOG>;
       fclose(LOG);        fclose(LOG);
       $yyclicks    = @log;        $yyclicks    = @log;
       $yyclicks = &NumberFormat($yyclicks);        $yyclicks = &NumberFormat($yyclicks);
       $yyclicktext = $admin_txt{'692'};        $yyclicktext = $admin_txt{'692'};
       $yyclicklink = qq~&nbsp;(<a href="$adminurl?action=showclicks">$admin_txt{'693'}</a>)~;        $yyclicklink = qq~&nbsp;(<a href="$adminurl?action=showclicks">$admin_txt{'693'}</a>)~;
   } else {    } else {
       $yyclicktext = $admin_txt{'692a'};        $yyclicktext = $admin_txt{'692a'};
       $yyclicklink = "";        $yyclicklink = "";
   }    }
   my (@elog);    my (@elog);
   fopen(ELOG, "$vardir/errorlog.txt");    fopen(ELOG, "$vardir/errorlog.txt");
   @elog = <ELOG>;    @elog = <ELOG>;
   fclose(ELOG);    fclose(ELOG);
   $errorslog = @elog;    $errorslog = @elog;
   $memcount = &NumberFormat($memcount);    $memcount = &NumberFormat($memcount);
   $totalt = &NumberFormat($totalt);    $totalt = &NumberFormat($totalt);
   $totalm = &NumberFormat($totalm);    $totalm = &NumberFormat($totalm);
   $avgm = &NumberFormat($avgm);    $avgm = &NumberFormat($avgm);
   $errorslog = &NumberFormat($errorslog);    $errorslog = &NumberFormat($errorslog);
   
   $yymain .= qq~    $yymain .= qq~
<div class="bordercolor" style="padding: 0px; width: 99%; margin-left: 0px; margin-right: auto;"> <div class="bordercolor" style="padding: 0px; width: 99%; margin-left: 0px; margin-right: auto;">
  <table width="100%" cellspacing="1" cellpadding="4">   <table width="100%" cellspacing="1" cellpadding="4">
    <tr valign="middle">     <tr valign="middle">
     <td align="left" class="titlebg">      <td align="left" class="titlebg">
       <img src="$imagesdir/info.gif" alt="" border="0" /> <b>$admintxt{'28'}</b>        <img src="$imagesdir/info.gif" alt="" border="0" /> <b>$admintxt{'28'}</b>
     </td>      </td>
    </tr>     </tr>
    <tr valign="middle">     <tr valign="middle">
     <td align="left" class="catbg">      <td align="left" class="catbg">
      <i>$admin_txt{'94'}</i>       <i>$admin_txt{'94'}</i>
     </td>      </td>
    </tr>     </tr>
    <tr valign="middle">     <tr valign="middle">
     <td align="left" class="windowbg2"><br />      <td align="left" class="windowbg2"><br />
      <div style="float: left; clear: left; width: 35%; text-align: left; padding-top: 2px; padding-bottom: 2px;">$admin_txt{'488'}</div>       <div style="float: left; clear: left; width: 35%; text-align: left; padding-top: 2px; padding-bottom: 2px;">$admin_txt{'488'}</div>
      <div style="float: left; width: 10%; text-align: right; padding-top: 2px; padding-bottom: 2px;">$memcount</div>       <div style="float: left; width: 10%; text-align: right; padding-top: 2px; padding-bottom: 2px;">$memcount</div>
      <br />       <br />
      <div style="float: left; clear: left; width: 35%; text-align: left; padding-top: 2px; padding-bottom: 2px;">$admin_txt{'490'}</div>       <div style="float: left; clear: left; width: 35%; text-align: left; padding-top: 2px; padding-bottom: 2px;">$admin_txt{'490'}</div>
      <div style="float: left; width: 10%; text-align: right; padding-top: 2px; padding-bottom: 2px;">$totalt</div>       <div style="float: left; width: 10%; text-align: right; padding-top: 2px; padding-bottom: 2px;">$totalt</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 style="float: left; clear: left; width: 35%; text-align: left; padding-top: 2px; padding-bottom: 2px;">$admin_txt{'489'}</div>
      <div style="float: left; width: 10%; text-align: right; padding-top: 2px; padding-bottom: 2px;">$totalm</div>       <div style="float: left; width: 10%; text-align: right; padding-top: 2px; padding-bottom: 2px;">$totalm</div>
      <br />       <br />
      <div style="float: left; clear: left; width: 35%; text-align: left; padding-top: 2px; padding-bottom: 2px;">$admintxt{'39'}</div>       <div style="float: left; clear: left; width: 35%; text-align: left; padding-top: 2px; padding-bottom: 2px;">$admintxt{'39'}</div>
      <div style="float: left; width: 10%; text-align: right; padding-top: 2px; padding-bottom: 2px;">$avgm</div>       <div style="float: left; width: 10%; text-align: right; padding-top: 2px; padding-bottom: 2px;">$avgm</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 style="float: left; clear: left; width: 35%; text-align: left; padding-top: 2px; padding-bottom: 2px;">$admin_txt{'658'}</div>
      <div style="float: left; width: 10%; text-align: right; padding-top: 2px; padding-bottom: 2px;">$numcats</div>       <div style="float: left; width: 10%; text-align: right; padding-top: 2px; padding-bottom: 2px;">$numcats</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 style="float: left; clear: left; width: 35%; text-align: left; padding-top: 2px; padding-bottom: 2px;">$admin_txt{'665'}</div>
      <div style="float: left; width: 10%; text-align: right; padding-top: 2px; padding-bottom: 2px;">$numboards</div>       <div style="float: left; width: 10%; text-align: right; padding-top: 2px; padding-bottom: 2px;">$numboards</div>
      <br />       <br />
      <div style="float: left; clear: left; width: 35%; text-align: left; padding-top: 2px; padding-bottom: 2px;">$errorlog{'3'}</div>       <div style="float: left; clear: left; width: 35%; text-align: left; padding-top: 2px; padding-bottom: 2px;">$errorlog{'3'}</div>
      <div style="float: left; width: 10%; text-align: right; padding-top: 2px; padding-bottom: 2px;">$errorslog</div>       <div style="float: left; width: 10%; text-align: right; padding-top: 2px; padding-bottom: 2px;">$errorslog</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 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 style="float: left; width: 10%; text-align: right; padding-top: 2px; padding-bottom: 2px;">$yyclicks</div>       <div style="float: left; width: 10%; text-align: right; padding-top: 2px; padding-bottom: 2px;">$yyclicks</div>
      <div style="float: left; width: 55%; text-align: left; padding-top: 2px; padding-bottom: 2px;">$yyclicklink</div>       <div style="float: left; width: 55%; text-align: left; padding-top: 2px; padding-bottom: 2px;">$yyclicklink</div>
      <br />&nbsp;<br />       <br />&nbsp;<br />
     </td>      </td>
    </tr>     </tr>
    <tr valign="middle">     <tr valign="middle">
      <td align="left" class="catbg">       <td align="left" class="catbg">
       <i>$admin_txt{'657'}</i>        <i>$admin_txt{'657'}</i>
     </td>      </td>
    </tr>     </tr>
    <tr valign="middle">     <tr valign="middle">
      <td align="left" class="windowbg2"><br />       <td align="left" class="windowbg2"><br />
       <div style="float: left; clear: left; width: 35%; text-align: left; padding-top: 2px; padding-bottom: 2px;">$admin_txt{'656'}</div>        <div style="float: left; clear: left; width: 35%; text-align: left; padding-top: 2px; padding-bottom: 2px;">$admin_txt{'656'}</div>
       <div style="float: left; width: 65%; text-align: left; padding-top: 2px; padding-bottom: 2px;">$thelatestmember</div>        <div style="float: left; width: 65%; text-align: left; padding-top: 2px; padding-bottom: 2px;">$thelatestmember</div>
       <br />        <br />
       <div style="float: left; clear: left; width: 35%; text-align: left; padding-top: 2px; padding-bottom: 2px;">$admin_txt{'659'}</div>        <div style="float: left; clear: left; width: 35%; text-align: left; padding-top: 2px; padding-bottom: 2px;">$admin_txt{'659'}</div>
       <div style="float: left; width: 65%; text-align: left; padding-top: 2px; padding-bottom: 2px;">        <div style="float: left; width: 65%; text-align: left; padding-top: 2px; padding-bottom: 2px;">
       ~;        ~;
   
   # Sorts the threads to find the most recent post    # 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    # No need to check for board access here because only admins have access to this page
   unless ($mloaded == 1) { require "$boardsdir/forum.master"; }    unless ($mloaded == 1) { require "$boardsdir/forum.master"; }
   foreach $catid (@categoryorder) {    foreach $catid (@categoryorder) {
       $boardlist = $cat{$catid};        $boardlist = $cat{$catid};
       (@bdlist) = split(/\,/, $boardlist);        (@bdlist) = split(/\,/, $boardlist);
       foreach $curboard (@bdlist) {        foreach $curboard (@bdlist) {
           push(@goodboards, $curboard);            push(@goodboards, $curboard);
       }        }
   }    }
   
   &BoardTotals("load", @goodboards);    &BoardTotals("load", @goodboards);
   # &getlog; not used here !!?    # &getlog; not used here !!?
   foreach $curboard (@goodboards) {    foreach $curboard (@goodboards) {
       chomp $curboard;        chomp $curboard;
       $lastposttime = ${$uid.$curboard}{'lastposttime'};        $lastposttime = ${$uid.$curboard}{'lastposttime'};
       $lastposttime{$curboard} = &timeformat(${$uid.$curboard}{'lastposttime'});        $lastposttime{$curboard} = &timeformat(${$uid.$curboard}{'lastposttime'});
       ${$uid.$curboard}{'lastposttime'} = ${$uid.$curboard}{'lastposttime'} eq 'N/A' || !${$uid.$curboard}{'lastposttime'} ? $boardindex_txt{'470'} : ${$uid.$curboard}{'lastposttime'};        ${$uid.$curboard}{'lastposttime'} = ${$uid.$curboard}{'lastposttime'} eq 'N/A' || !${$uid.$curboard}{'lastposttime'} ? $boardindex_txt{'470'} : ${$uid.$curboard}{'lastposttime'};
       $lastpostrealtime{$curboard} = ${$uid.$curboard}{'lastposttime'} eq 'N/A' || !${$uid.$curboard}{'lastposttime'} ? '' : ${$uid.$curboard}{'lastposttime'};        $lastpostrealtime{$curboard} = ${$uid.$curboard}{'lastposttime'} eq 'N/A' || !${$uid.$curboard}{'lastposttime'} ? '' : ${$uid.$curboard}{'lastposttime'};
       if (${$uid.$curboard}{'lastposter'} =~ m~\AGuest-(.*)~) {        if (${$uid.$curboard}{'lastposter'} =~ m~\AGuest-(.*)~) {
           ${$uid.$curboard}{'lastposter'} = $1;            ${$uid.$curboard}{'lastposter'} = $1;
           $lastposterguest{$curboard} = 1;            $lastposterguest{$curboard} = 1;
       }        }
       ${$uid.$curboard}{'lastposter'} = ${$uid.$curboard}{'lastposter'} eq 'N/A' || !${$uid.$curboard}{'lastposter'} ? $boardindex_txt{'470'} : ${$uid.$curboard}{'lastposter'};        ${$uid.$curboard}{'lastposter'} = ${$uid.$curboard}{'lastposter'} eq 'N/A' || !${$uid.$curboard}{'lastposter'} ? $boardindex_txt{'470'} : ${$uid.$curboard}{'lastposter'};
       ${$uid.$curboard}{'messagecount'} = ${$uid.$curboard}{'messagecount'} || 0;        ${$uid.$curboard}{'messagecount'} = ${$uid.$curboard}{'messagecount'} || 0;
       ${$uid.$curboard}{'threadcount'} = ${$uid.$curboard}{'threadcount'} || 0;        ${$uid.$curboard}{'threadcount'} = ${$uid.$curboard}{'threadcount'} || 0;
       $totalm += ${$uid.$curboard}{'messagecount'};        $totalm += ${$uid.$curboard}{'messagecount'};
       $totalt += ${$uid.$curboard}{'threadcount'};        $totalt += ${$uid.$curboard}{'threadcount'};
   
       # determine the true last post on all the boards a user has access to        # determine the true last post on all the boards a user has access to
       if ($lastposttime > $lastthreadtime) {        if ($lastposttime > $lastthreadtime) {
           $lsdatetime = &timeformat($lastposttime);            $lsdatetime = &timeformat($lastposttime);
           $lsposter = ${$uid.$curboard}{'lastposter'};            $lsposter = ${$uid.$curboard}{'lastposter'};
           $lssub = ${$uid.$curboard}{'lastsubject'};            $lssub = ${$uid.$curboard}{'lastsubject'};
           $lspostid = ${$uid.$curboard}{'lastpostid'};            $lspostid = ${$uid.$curboard}{'lastpostid'};
           $lsreply = ${$uid.$curboard}{'lastreply'};            $lsreply = ${$uid.$curboard}{'lastreply'};
           $lastthreadtime = $lastposttime;            $lastthreadtime = $lastposttime;
       }        }
   }    }
   ($lssub, undef) = &Split_Splice_Move($lssub,0);    ($lssub, undef) = &Split_Splice_Move($lssub,0);
   &ToChars($lssub);    &ToChars($lssub);
   $yymain .= qq~<a href="$scripturl?num=$lspostid/$lsreply#$lsreply">$lssub</a> ($lsdatetime)</div>    $yymain .= qq~<a href="$scripturl?num=$lspostid/$lsreply#$lsreply">$lssub</a> ($lsdatetime)</div>
       <br />        <br />
       <div style="float: left; clear: left; width: 35%; text-align: left; padding-top: 2px; padding-bottom: 2px;">$admin_txt{'684'}</div>        <div style="float: left; clear: left; width: 35%; text-align: left; padding-top: 2px; padding-bottom: 2px;">$admin_txt{'684'}</div>
       <div style="float: left; width: 65%; text-align: left; padding-top: 2px; padding-bottom: 2px;">$administrators</div>        <div style="float: left; width: 65%; text-align: left; padding-top: 2px; padding-bottom: 2px;">$administrators</div>
       <br />        <br />
       <div style="float: left; clear: left; width: 35%; text-align: left; padding-top: 2px; padding-bottom: 2px;">$admin_txt{'684a'}</div>        <div style="float: left; clear: left; width: 35%; text-align: left; padding-top: 2px; padding-bottom: 2px;">$admin_txt{'684a'}</div>
       <div style="float: left; width: 65%; text-align: left; padding-top: 2px; padding-bottom: 2px;">$gmods</div>        <div style="float: left; width: 65%; text-align: left; padding-top: 2px; padding-bottom: 2px;">$gmods</div>
       <br />        <br />
       <div style="float: left; clear: left; width: 35%; text-align: left; padding-top: 2px; padding-bottom: 2px;">$admin_txt{'425'}</div>        <div style="float: left; clear: left; width: 35%; text-align: left; padding-top: 2px; padding-bottom: 2px;">$admin_txt{'425'}</div>
       <div style="float: left; width: 65%; text-align: left; padding-top: 2px; padding-bottom: 2px;">        <div style="float: left; width: 65%; text-align: left; padding-top: 2px; padding-bottom: 2px;">
       <script language="javascript" src="http://www.yabbforum.com/update/versioncheck.js" type="text/javascript"></script>        <script language="javascript" src="http://www.yabbforum.com/update/versioncheck.js" type="text/javascript"></script>
       <script language="JavaScript" type="text/javascript">           <script language="JavaScript" type="text/javascript">   
        <!-- //hide from dinosaurs            <!-- //hide from dinosaurs   
         document.write("$versiontxt{'4'} <b>$YaBBversion</b> - $versiontxt{'5'} <b>"+STABLE+"</b> <p>");             document.write("$versiontxt{'4'} <b>$YaBBversion</b> - $versiontxt{'5'} <b>"+STABLE+"</b> <p>");   
        // -->         // -->
       </script>        </script>
       <noscript>$versiontxt{'1'} <img src="http://www.yabbforum.com/images/version/versioncheck.gif" alt="" /></noscript>          <noscript>$versiontxt{'1'} <img src="http://www.yabbforum.com/images/version/versioncheck.gif" alt="" /></noscript>  
       </div>        </div>
       <br />&nbsp;<br />        <br />&nbsp;<br />
     </td>      </td>
    </tr>     </tr>
  </table>   </table>
</div>~; </div>~;
   
   $yytitle = $admintxt{'28'};    $yytitle = $admintxt{'28'};
   $action_area = "stats";    $action_area = "stats";
   &AdminTemplate;    &AdminTemplate;
} }
   
sub LoadAdmins { sub LoadAdmins {
   &is_admin_or_gmod;    &is_admin_or_gmod;
   my (@members, $curentry, $memdata);    my (@members, $curentry, $memdata);
   $administrators = "";    $administrators = "";
   $gmods          = "";    $gmods          = "";
   &ManageMemberinfo("load");    &ManageMemberinfo("load");
   while (($membername, $value) = each(%memberinf)) {    while (($membername, $value) = each(%memberinf)) {
       ($memberrealname, undef, $memposition, $memposts) = split(/\|/, $value);        ($memberrealname, undef, $memposition, $memposts) = split(/\|/, $value);
       if($do_scramble_id){$membernameCloaked = &cloak($membername); } else { $membernameCloaked = $membername; }        if($do_scramble_id){$membernameCloaked = &cloak($membername); } else { $membernameCloaked = $membername; }
       if ($memposition eq "Administrator") {        if ($memposition eq "Administrator") {
           $administrators .= qq~ <a href="$scripturl?action=viewprofile;username=$membernameCloaked">$memberrealname</a><span class="small">,</span> \n~;            $administrators .= qq~ <a href="$scripturl?action=viewprofile;username=$membernameCloaked">$memberrealname</a><span class="small">,</span> \n~;
       }        }
       if ($memposition eq "Global Moderator") {        if ($memposition eq "Global Moderator") {
           $gmods .= qq~ <a href="$scripturl?action=viewprofile;username=$membernameCloaked">$memberrealname</a><span class="small">,</span> \n~;            $gmods .= qq~ <a href="$scripturl?action=viewprofile;username=$membernameCloaked">$memberrealname</a><span class="small">,</span> \n~;
       }        }
   }    }
   $administrators =~ s~<span class="small">,</span> \n\Z~~;    $administrators =~ s~<span class="small">,</span> \n\Z~~;
   $gmods          =~ s~<span class="small">,</span> \n\Z~~;    $gmods          =~ s~<span class="small">,</span> \n\Z~~;
   if ($gmods eq "") { $gmods = qq~&nbsp;~; }    if ($gmods eq "") { $gmods = qq~&nbsp;~; }
   undef %memberinf;    undef %memberinf;
} }
   
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);    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);
   
   $i = 0;    $i = 0;
   foreach $curentry (@log) {    foreach $curentry (@log) {
       ($iplist[$i], $date, $to[$i], $from[$i], $info[$i]) = split(/\|/, $curentry);        ($iplist[$i], $date, $to[$i], $from[$i], $info[$i]) = split(/\|/, $curentry);
       $i++;        $i++;
   }    }
   $i = 0;    $i = 0;
   foreach $curentry (@info) {    foreach $curentry (@info) {
       if ($curentry !~ /\s\(Win/i || $curentry !~ /\s\(mac/) { $curentry =~ s/\s\((compatible;\s)*/ - /ig; }        if ($curentry !~ /\s\(Win/i || $curentry !~ /\s\(mac/) { $curentry =~ s/\s\((compatible;\s)*/ - /ig; }
       else { $curentry =~ s/(\S)*\(/; /g; }        else { $curentry =~ s/(\S)*\(/; /g; }
       if ($curentry =~ /\s-\sWin/i) { $curentry =~ s/\s-\sWin/; win/ig; }        if ($curentry =~ /\s-\sWin/i) { $curentry =~ s/\s-\sWin/; win/ig; }
       if ($curentry =~ /\s-\sMac/i) { $curentry =~ s/\s-\sMac/; mac/ig; }        if ($curentry =~ /\s-\sMac/i) { $curentry =~ s/\s-\sMac/; mac/ig; }
       ($browser[$i], $os[$i]) = split(/\;\s/, $curentry);        ($browser[$i], $os[$i]) = split(/\;\s/, $curentry);
       if ($os[$i] =~ /\)\s\S/) { ($os[$i], $browser[$i]) = split(/\)\s/, $os[$i]); }        if ($os[$i] =~ /\)\s\S/) { ($os[$i], $browser[$i]) = split(/\)\s/, $os[$i]); }
       $os[$i] =~ s/\)//g;        $os[$i] =~ s/\)//g;
       $i++;        $i++;
   }    }
   
   for ($i = 0; $i < @iplist; $i++) { $iplist{ $iplist[$i] }++; }    for ($i = 0; $i < @iplist; $i++) { $iplist{ $iplist[$i] }++; }
   $i = 0;    $i = 0;
   while (($key, $val) = each(%iplist)) {    while (($key, $val) = each(%iplist)) {
       $newiplist[$i] = [$key, $val];        $newiplist[$i] = [$key, $val];
       $i++;        $i++;
   }    }
   $totalclick = @iplist;    $totalclick = @iplist;
   $totalip    = @newiplist;    $totalip    = @newiplist;
   for ($i = 0; $i < @newiplist; $i++) {    for ($i = 0; $i < @newiplist; $i++) {
   
       if ($newiplist[$i]->[0] =~ /\S+/ && $newiplist[$i]->[0] =~ /\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}/) {        if ($newiplist[$i]->[0] =~ /\S+/ && $newiplist[$i]->[0] =~ /\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}/) {
           $guestiplist .= qq~$newiplist[$i]->[0]&nbsp;<span style="color: #FF0000;">(<i>$newiplist[$i]->[1]</i>)</span><br />~;            $guestiplist .= qq~$newiplist[$i]->[0]&nbsp;<span style="color: #FF0000;">(<i>$newiplist[$i]->[1]</i>)</span><br />~;
       } else {        } else {
           &LoadUser($newiplist[$i]->[0]);            &LoadUser($newiplist[$i]->[0]);
           if($do_scramble_id){$cloakedUserName = &cloak($newiplist[$i]->[0]); } else {$cloakedUserName = $newiplist[$i]->[0]; }            if($do_scramble_id){$cloakedUserName = &cloak($newiplist[$i]->[0]); } else {$cloakedUserName = $newiplist[$i]->[0]; }
           my $displayUserName = $newiplist[$i]->[0];            my $displayUserName = $newiplist[$i]->[0];
           if(${$uid.$displayUserName}{'realname'} && (${$uid.$displayUserName}{'realname'} ne $newiplist[$i]->[0]))     {            if(${$uid.$displayUserName}{'realname'} && (${$uid.$displayUserName}{'realname'} ne $newiplist[$i]->[0]))     {
               $displayUserName = ${$uid.$displayUserName}{'realname'};}                $displayUserName = ${$uid.$displayUserName}{'realname'};}
           $useriplist .= qq~<a href="$scripturl?action=viewprofile;username=$cloakedUserName">$displayUserName</a>&nbsp;<span style="color: #FF0000;">(<i>$newiplist[$i]->[1]</i>)</span><br />~;            $useriplist .= qq~<a href="$scripturl?action=viewprofile;username=$cloakedUserName">$displayUserName</a>&nbsp;<span style="color: #FF0000;">(<i>$newiplist[$i]->[1]</i>)</span><br />~;
       }        }
   }    }
   
   for ($i = 0; $i < @browser; $i++) { $browser{ $browser[$i] }++; }    for ($i = 0; $i < @browser; $i++) { $browser{ $browser[$i] }++; }
   $i = 0;    $i = 0;
   while (($key, $val) = each(%browser)) {    while (($key, $val) = each(%browser)) {
       $newbrowser[$i] = [$key, $val];        $newbrowser[$i] = [$key, $val];
       $i++;        $i++;
   }    }
   $totalbrow = @newbrowser;    $totalbrow = @newbrowser;
   for ($i = 0; $i < @newbrowser; $i++) {    for ($i = 0; $i < @newbrowser; $i++) {
       if ($newbrowser[$i]->[0] =~ /\S+/) {        if ($newbrowser[$i]->[0] =~ /\S+/) {
           $browserlist .= qq~$newbrowser[$i]->[0] &nbsp;<span style="color: #FF0000;">(<i>$newbrowser[$i]->[1]</i>)</span><br />~;            $browserlist .= qq~$newbrowser[$i]->[0] &nbsp;<span style="color: #FF0000;">(<i>$newbrowser[$i]->[1]</i>)</span><br />~;
       }        }
   }    }
   
   for ($i = 0; $i < @os; $i++) { $os{ $os[$i] }++; }    for ($i = 0; $i < @os; $i++) { $os{ $os[$i] }++; }
   $i = 0;    $i = 0;
   while (($key, $val) = each(%os)) {    while (($key, $val) = each(%os)) {
       $newoslist[$i] = [$key, $val];        $newoslist[$i] = [$key, $val];
       $i++;        $i++;
   }    }
   $totalos = @newoslist;    $totalos = @newoslist;
   for ($i = 0; $i < @newoslist; $i++) {    for ($i = 0; $i < @newoslist; $i++) {
       if ($newoslist[$i]->[0] =~ /\S+/) {        if ($newoslist[$i]->[0] =~ /\S+/) {
           $oslist .= qq~$newoslist[$i]->[0] &nbsp;<span style="color: #FF0000;">(<i>$newoslist[$i]->[1]</i>)</span><br />~;            $oslist .= qq~$newoslist[$i]->[0] &nbsp;<span style="color: #FF0000;">(<i>$newoslist[$i]->[1]</i>)</span><br />~;
       }        }
   }    }
   
   for ($i = 0; $i < @to; $i++) { $to{ $to[$i] }++; }    for ($i = 0; $i < @to; $i++) { $to{ $to[$i] }++; }
   $i = 0;    $i = 0;
   while (($key, $val) = each(%to)) {    while (($key, $val) = each(%to)) {
       $newtolist[$i] = [$key, $val];        $newtolist[$i] = [$key, $val];
       $i++;        $i++;
   }    }
   for ($i = 0; $i < @newtolist; $i++) {    for ($i = 0; $i < @newtolist; $i++) {
       if ($newtolist[$i]->[0] =~ /\S+/) {        if ($newtolist[$i]->[0] =~ /\S+/) {
           $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 />~;            $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 />~;
       }        }
   }    }
   
   for ($i = 0; $i < @from; $i++) { $from{ $from[$i] }++; }    for ($i = 0; $i < @from; $i++) { $from{ $from[$i] }++; }
   $i = 0;    $i = 0;
   while (($key, $val) = each(%from)) {    while (($key, $val) = each(%from)) {
       $newfromlist[$i] = [$key, $val];        $newfromlist[$i] = [$key, $val];
       $i++;        $i++;
   }    }
   for ($i = 0; $i < @newfromlist; $i++) {    for ($i = 0; $i < @newfromlist; $i++) {
       if ($newfromlist[$i]->[0] =~ /\S+/ && $newfromlist[$i]->[0] !~ m~$boardurl~i) {        if ($newfromlist[$i]->[0] =~ /\S+/ && $newfromlist[$i]->[0] !~ m~$boardurl~i) {
       $message = qq~<a href="$newfromlist[$i]->[0]" target="_blank">$newfromlist[$i]->[0]</a>~;        $message = qq~<a href="$newfromlist[$i]->[0]" target="_blank">$newfromlist[$i]->[0]</a>~;
       #   &wrap;        #   &wrap;
       #   if (!$yyYaBBCloaded) { require "$sourcedir/YaBBC.pl"; }        #   if (!$yyYaBBCloaded) { require "$sourcedir/YaBBC.pl"; }
       #   &DoUBBC;        #   &DoUBBC;
           &wrap2;            &wrap2;
           $referlist .= qq~$message&nbsp;<span style="color: #FF0000;">(<i>$newfromlist[$i]->[1]</i>)</span><br />~;            $referlist .= qq~$message&nbsp;<span style="color: #FF0000;">(<i>$newfromlist[$i]->[1]</i>)</span><br />~;
       }        }
   }    }
   
   $yymain .= qq~    $yymain .= qq~
   
<div class="bordercolor" style="padding: 0px; width: 99%; margin-left: 0px; margin-right: auto;"> <div class="bordercolor" style="padding: 0px; width: 99%; margin-left: 0px; margin-right: auto;">
  <table width="100%" cellspacing="1" cellpadding="4">   <table width="100%" cellspacing="1" cellpadding="4">
    <tr valign="middle">     <tr valign="middle">
     <td align="left" class="titlebg">      <td align="left" class="titlebg">
      <img src="$imagesdir/info.gif" alt="" border="0" /> <b>$admin_txt{'693'}</b>       <img src="$imagesdir/info.gif" alt="" border="0" /> <b>$admin_txt{'693'}</b>
     </td>      </td>
    </tr>     </tr>
    <tr valign="middle">     <tr valign="middle">
     <td align="left" class="windowbg2"><br />      <td align="left" class="windowbg2"><br />
      $admin_txt{'697'}$logtimetext<br /><br />       $admin_txt{'697'}$logtimetext<br /><br />
     </td>      </td>
    </tr>     </tr>
  </table>   </table>
</div>~; </div>~;
   
   if ($enableclicklog) {    if ($enableclicklog) {
       $yymain .= qq~        $yymain .= qq~
   
<br /> <br />
   
<div class="bordercolor" style="padding: 0px; width: 99%; margin-left: 0px; margin-right: auto;"> <div class="bordercolor" style="padding: 0px; width: 99%; margin-left: 0px; margin-right: auto;">
  <table width="100%" cellspacing="1" cellpadding="4">   <table width="100%" cellspacing="1" cellpadding="4">
   <tr valign="middle">    <tr valign="middle">
    <td align="left" class="titlebg" colspan="2">     <td align="left" class="titlebg" colspan="2">
     <img src="$imagesdir/cat.gif" alt="" border="0" /> <b>$admin_txt{'694'}</b>      <img src="$imagesdir/cat.gif" alt="" border="0" /> <b>$admin_txt{'694'}</b>
    </td>     </td>
   </tr>    </tr>
   <tr valign="middle">    <tr valign="middle">
    <td align="left" class="windowbg2" colspan="2"><br />     <td align="left" class="windowbg2" colspan="2"><br />
     $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 valign="middle">    <tr valign="middle">
    <td align="center" class="catbg" width="50%">     <td align="center" class="catbg" width="50%">
     <b>$clicklog_txt{'users'}</b>      <b>$clicklog_txt{'users'}</b>
    </td>     </td>
    <td align="center" class="catbg" width="50%">     <td align="center" class="catbg" width="50%">
     <b>$clicklog_txt{'guests'}</b>      <b>$clicklog_txt{'guests'}</b>
    </td>     </td>
   </tr>    </tr>
   <tr valign="middle">    <tr valign="middle">
    <td align="left" class="windowbg2" valign="top" width="50%"><br />     <td align="left" class="windowbg2" valign="top" width="50%"><br />
     $useriplist<br />      $useriplist<br />
    </td>     </td>
    <td align="left" class="windowbg2" valign="top" width="50%"><br />     <td align="left" class="windowbg2" valign="top" width="50%"><br />
     $guestiplist<br />      $guestiplist<br />
    </td>     </td>
   </tr>    </tr>
  </table>   </table>
</div> </div>
   
<br /> <br />
   
<div class="bordercolor" style="padding: 0px; width: 99%; margin-left: 0px; margin-right: auto;"> <div class="bordercolor" style="padding: 0px; width: 99%; margin-left: 0px; margin-right: auto;">
  <table width="100%" cellspacing="1" cellpadding="4">   <table width="100%" cellspacing="1" cellpadding="4">
   <tr valign="middle">    <tr valign="middle">
    <td align="left" class="titlebg">     <td align="left" class="titlebg">
     <img src="$imagesdir/cat.gif" alt="" border="0" /> <b>$admin_txt{'695'}</b>      <img src="$imagesdir/cat.gif" alt="" border="0" /> <b>$admin_txt{'695'}</b>
    </td>     </td>
   </tr>    </tr>
   <tr valign="middle">    <tr valign="middle">
    <td align="left" class="catbg">     <td align="left" class="catbg">
     <i>$admin_txt{'744'}: $totalbrow</i>      <i>$admin_txt{'744'}: $totalbrow</i>
    </td>     </td>
   </tr>    </tr>
   <tr valign="middle">    <tr valign="middle">
    <td align="left" class="windowbg2"><br />     <td align="left" class="windowbg2"><br />
     $browserlist<br />      $browserlist<br />
    </td>     </td>
   </tr>    </tr>
  </table>   </table>
</div> </div>
   
<br /> <br />
   
<div class="bordercolor" style="padding: 0px; width: 99%; margin-left: 0px; margin-right: auto;"> <div class="bordercolor" style="padding: 0px; width: 99%; margin-left: 0px; margin-right: auto;">
  <table width="100%" cellspacing="1" cellpadding="4">   <table width="100%" cellspacing="1" cellpadding="4">
   <tr valign="middle">    <tr valign="middle">
    <td align="left" class="titlebg">     <td align="left" class="titlebg">
     <img src="$imagesdir/cat.gif" alt="" border="0" /> <b>$admin_txt{'696'}</b>      <img src="$imagesdir/cat.gif" alt="" border="0" /> <b>$admin_txt{'696'}</b>
    </td>     </td>
   </tr>    </tr>
   <tr valign="middle">    <tr valign="middle">
    <td align="left" class="catbg">     <td align="left" class="catbg">
     <i>$admin_txt{'745'}: $totalos</i>      <i>$admin_txt{'745'}: $totalos</i>
    </td>     </td>
   </tr>    </tr>
   <tr valign="middle">    <tr valign="middle">
    <td align="left" class="windowbg2"><br />     <td align="left" class="windowbg2"><br />
     $oslist<br />      $oslist<br />
    </td>     </td>
   </tr>    </tr>
  </table>   </table>
</div> </div>
   
<br /> <br />
   
<div class="bordercolor" style="padding: 0px; width: 99%; margin-left: 0px; margin-right: auto;"> <div class="bordercolor" style="padding: 0px; width: 99%; margin-left: 0px; margin-right: auto;">
  <table width="100%" cellspacing="1" cellpadding="4">   <table width="100%" cellspacing="1" cellpadding="4">
   <tr valign="middle">    <tr valign="middle">
    <td align="left" class="titlebg">     <td align="left" class="titlebg">
     <img src="$imagesdir/cat.gif" alt="" border="0" /> <b>$admin_txt{'696a'}</b>      <img src="$imagesdir/cat.gif" alt="" border="0" /> <b>$admin_txt{'696a'}</b>
    </td>     </td>
   </tr>    </tr>
   <tr valign="middle">    <tr valign="middle">
    <td align="left" class="windowbg2"><br />     <td align="left" class="windowbg2"><br />
     $scriptcalls<br />      $scriptcalls<br />
    </td>     </td>
   </tr>    </tr>
  </table>   </table>
</div> </div>
   
<br /> <br />
   
<div class="bordercolor" style="padding: 0px; width: 99%; margin-left: 0px; margin-right: auto;"> <div class="bordercolor" style="padding: 0px; width: 99%; margin-left: 0px; margin-right: auto;">
  <table width="100%" cellspacing="1" cellpadding="4">   <table width="100%" cellspacing="1" cellpadding="4">
   <tr valign="middle">    <tr valign="middle">
    <td align="left" class="titlebg">     <td align="left" class="titlebg">
     <img src="$imagesdir/cat.gif" alt="" border="0" /> <b>$admin_txt{'838'}</b>      <img src="$imagesdir/cat.gif" alt="" border="0" /> <b>$admin_txt{'838'}</b>
    </td>     </td>
   </tr>    </tr>
   <tr valign="middle">    <tr valign="middle">
    <td align="left" class="windowbg2"><br />     <td align="left" class="windowbg2"><br />
     $referlist<br />      $referlist<br />
    </td>     </td>
   </tr>    </tr>
  </table>   </table>
</div> </div>
~; ~;
   }    }
   
   $yytitle     = $admin_txt{'693'};    $yytitle     = $admin_txt{'693'};
   $action_area = "showclicks";    $action_area = "showclicks";
   &AdminTemplate;    &AdminTemplate;
} }
   
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" style="padding: 0px; width: 99%; margin-left: 0px; margin-right: auto;">
  <table width="100%" cellspacing="1" cellpadding="4">   <table width="100%" cellspacing="1" cellpadding="4">
   <tr valign="middle">    <tr valign="middle">
    <td align="left" class="titlebg">     <td align="left" class="titlebg">
     <img src="$imagesdir/ban.gif" alt="" border="0" /> <b>$aduptxt{'04'}</b>      <img src="$imagesdir/ban.gif" alt="" border="0" /> <b>$aduptxt{'04'}</b>
    </td>     </td>
   </tr>    </tr>
   <tr valign="middle">    <tr valign="middle">
    <td align="left" class="windowbg2"><br />     <td align="left" class="windowbg2"><br />
     $aduptxt{'05'}<br /><br />      $aduptxt{'05'}<br /><br />
    </td>     </td>
   </tr>    </tr>
   <tr valign="middle">    <tr valign="middle">
    <td align="left" class="windowbg2"><br />     <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><br /><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><br /><br />
     <div align="left" style="margin-left: 25px; margin-right: auto;">~;      <div align="left" style="margin-left: 25px; margin-right: auto;">~;
   
   unless ($mloaded == 1) { require "$boardsdir/forum.master"; }    unless ($mloaded == 1) { require "$boardsdir/forum.master"; }
   
   foreach $catid (@categoryorder) {    foreach $catid (@categoryorder) {
       $boardlist = $cat{$catid};        $boardlist = $cat{$catid};
       (@bdlist) = split(/\,/, $boardlist);        (@bdlist) = split(/\,/, $boardlist);
       ($catname, $catperms) = split(/\|/, $catinfo{"$catid"});        ($catname, $catperms) = split(/\|/, $catinfo{"$catid"});
   
       foreach $curboard (@bdlist) {        foreach $curboard (@bdlist) {
           ($boardname, $boardperms, $boardview) = split(/\|/, $board{"$curboard"});            ($boardname, $boardperms, $boardview) = split(/\|/, $board{"$curboard"});
   
           $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 />~;
       }        }
   }    }
   $yymain .= qq~    $yymain .= qq~
     </div><br />      </div><br />
    </td>     </td>
   </tr>    </tr>
   <tr valign="middle">    <tr valign="middle">
    <td align="center" class="catbg">     <td align="center" class="catbg">
     <input type="submit" value="$admin_txt{'31'}" class="button" />      <input type="submit" value="$admin_txt{'31'}" class="button" />
    </td>     </td>
   </tr>    </tr>
  </table>   </table>
</div> </div>
</form>~; </form>~;
   
   $action_area = "deleteoldthreads";    $action_area = "deleteoldthreads";
   &AdminTemplate;    &AdminTemplate;
} }
   
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 ($count, $currentmem, $start, $sortmode, $sortorder, $deadusers, @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) { &admin_fatal_error('no_access'); }
   
   if ($FORM{'del_mail'} || $FORM{'emailtext'} ne '') { require "$sourcedir/Mailer.pl"; }    if ($FORM{'del_mail'} || $FORM{'emailtext'} ne '') { require "$sourcedir/Mailer.pl"; }
   
   fopen(FILE, "$memberdir/memberlist.txt");    fopen(FILE, "$memberdir/memberlist.txt");
   @memnum = <FILE>;    @memnum = <FILE>;
   fclose(FILE);    fclose(FILE);
   $count = 0;    $count = 0;
   
   if ($FORM{'button'} == 1 && $FORM{'emailtext'} ne "") {    if ($FORM{'button'} == 1 && $FORM{'emailtext'} ne "") {
       $FORM{'emailsubject'} =~ s~\|~&#124~g;        $FORM{'emailsubject'} =~ s~\|~&#124~g;
       $FORM{'emailtext'}    =~ s~\|~&#124~g;        $FORM{'emailtext'}    =~ s~\|~&#124~g;
       $FORM{'emailtext'} =~ s/\r(?=\n*)//g;        $FORM{'emailtext'} =~ s/\r(?=\n*)//g;
       $mailline = qq~$date|$FORM{'emailsubject'}|$FORM{'emailtext'}|$username~;        $mailline = qq~$date|$FORM{'emailsubject'}|$FORM{'emailtext'}|$username~;
       &MailList($mailline);        &MailList($mailline);
   }    }
   
   my $templanguage = $language;    my $templanguage = $language;
   
   while (@memnum >= $count) {    while (@memnum >= $count) {
       $currentmem = $FORM{"member$count"};        $currentmem = $FORM{"member$count"};
       if (exists $FORM{"member$count"}) {        if (exists $FORM{"member$count"}) {
           if (-e "$memberdir/$currentmem.vars") { # Bypass dead entries.            if (-e "$memberdir/$currentmem.vars") { # Bypass dead entries.
               &LoadUser($currentmem);                &LoadUser($currentmem);
               if ($FORM{'emailtext'} ne '') {                if ($FORM{'emailtext'} ne '') {
                   $emailsubject = $FORM{'emailsubject'};                    $emailsubject = $FORM{'emailsubject'};
                   $emailtext = $FORM{'emailtext'};                    $emailtext = $FORM{'emailtext'};
                   $emailsubject =~ s~\[name\]~${$uid.$currentmem}{'realname'}~ig;                    $emailsubject =~ s~\[name\]~${$uid.$currentmem}{'realname'}~ig;
                   $emailsubject =~ s~\[username\]~$currentmem~ig;                    $emailsubject =~ s~\[username\]~$currentmem~ig;
                   $emailtext =~ s~\[name\]~${$uid.$currentmem}{'realname'}~ig;                    $emailtext =~ s~\[name\]~${$uid.$currentmem}{'realname'}~ig;
                   $emailtext =~ s~\[username\]~$currentmem~ig;                    $emailtext =~ s~\[username\]~$currentmem~ig;
                   &sendmail(${$uid.$currentmem}{'email'}, $emailsubject, $emailtext);                    &sendmail(${$uid.$currentmem}{'email'}, $emailsubject, $emailtext);
               } elsif ($FORM{'del_mail'}) {                } elsif ($FORM{'del_mail'}) {
                   $language = ${$uid.$currentmem}{'language'};                    $language = ${$uid.$currentmem}{'language'};
                   &LoadLanguage('Email');                    &LoadLanguage('Email');
                   my $message = &template_email($deleteduseremail, {'displayname' => ${$uid.$currentmem}{'realname'}});                    my $message = &template_email($deleteduseremail, {'displayname' => ${$uid.$currentmem}{'realname'}});
                   &sendmail(${$uid.$currentmem}{'email'}, "$deletedusersybject $mbname", $message, '', $emailcharset);                    &sendmail(${$uid.$currentmem}{'email'}, "$deletedusersybject $mbname", $message, '', $emailcharset);
               }                }
               undef %{$uid.$currentmem} if $currentmem ne $username;                undef %{$uid.$currentmem} if $currentmem ne $username;
           }            }
           if ($FORM{'button'} == 2) {            if ($FORM{'button'} == 2) {
               unlink("$memberdir/$currentmem.dat");                unlink("$memberdir/$currentmem.dat");
               unlink("$memberdir/$currentmem.vars");                unlink("$memberdir/$currentmem.vars");
               unlink("$memberdir/$currentmem.ims");                unlink("$memberdir/$currentmem.ims");
               unlink("$memberdir/$currentmem.msg");                unlink("$memberdir/$currentmem.msg");
               unlink("$memberdir/$currentmem.log");                unlink("$memberdir/$currentmem.log");
               unlink("$memberdir/$currentmem.rlog");                unlink("$memberdir/$currentmem.rlog");
               unlink("$memberdir/$currentmem.outbox");                unlink("$memberdir/$currentmem.outbox");
               unlink("$memberdir/$currentmem.imstore");                unlink("$memberdir/$currentmem.imstore");
               unlink("$memberdir/$currentmem.imdraft");                unlink("$memberdir/$currentmem.imdraft");
               # save name up                # save name up
               push (@userslist, $currentmem);                push (@userslist, $currentmem);
               # For security, remove username from mod position                # For security, remove username from mod position
               &KillModerator($currentmem);                &KillModerator($currentmem);
           }            }
       }        }
       $count++;        $count++;
   }    }
   if (@userslist) { &MemberIndex("remove", join(',', @userslist)); }    if (@userslist) { &MemberIndex("remove", join(',', @userslist)); }
   
   &automaintenance("off");    &automaintenance("off");
   
   $language = $templanguage;    $language = $templanguage;
   if ($FORM{'button'} == 1) {    if ($FORM{'button'} == 1) {
       $yySetLocation = qq~$adminurl?action=mailing;sort=$INFO{'sort'}~;        $yySetLocation = qq~$adminurl?action=mailing;sort=$INFO{'sort'}~;
   } else {    } else {
       $yySetLocation = qq~$adminurl?action=viewmembers;start=$INFO{'start'};sort=$INFO{'sort'};reversed=$INFO{'reversed'}~;        $yySetLocation = qq~$adminurl?action=viewmembers;start=$INFO{'start'};sort=$INFO{'sort'};reversed=$INFO{'reversed'}~;
   }    }
   &redirectexit;    &redirectexit;
} }
   
sub ipban { sub ipban {
   &is_admin_or_gmod;    &is_admin_or_gmod;
   
   my ($eban, $iban, $uban) = ($email_banlist, $ip_banlist, $user_banlist);    my ($eban, $iban, $uban) = ($email_banlist, $ip_banlist, $user_banlist);
   $iban =~ s/,/\n/g;    $iban =~ s/,/\n/g;
   $eban =~ s/,/\n/g;    $eban =~ s/,/\n/g;
   $uban =~ s/,/\n/g;    $uban =~ s/,/\n/g;
   
   $yymain .= qq~    $yymain .= qq~
<form action="$adminurl?action=ipban2" method="post"> <form action="$adminurl?action=ipban2" method="post">
<div class="bordercolor" style="padding: 0px; width: 99%; margin-left: 0px; margin-right: auto;"> <div class="bordercolor" style="padding: 0px; width: 99%; margin-left: 0px; margin-right: auto;">
  <table width="100%" cellspacing="1" cellpadding="4">   <table width="100%" cellspacing="1" cellpadding="4">
   <tr valign="middle">    <tr valign="middle">
    <td align="left" class="titlebg">     <td align="left" class="titlebg">
     <img src="$imagesdir/ban.gif" alt="" border="0" /><b>$admin_txt{'340'}</b>      <img src="$imagesdir/ban.gif" alt="" border="0" /><b>$admin_txt{'340'}</b>
    </td>     </td>
   </tr>    </tr>
   <tr valign="middle">    <tr valign="middle">
    <td align="left" class="catbg">     <td align="left" class="catbg">
     <label for="ban"><span class="small">$admin_txt{'724'}</span></label>      <label for="ban"><span class="small">$admin_txt{'724'}</span></label>
    </td>     </td>
   </tr>    </tr>
   <tr valign="middle">    <tr valign="middle">
    <td align="center" class="windowbg2"><br />     <td align="center" class="windowbg2"><br />
     <textarea cols="60" rows="10" name="ban" id="ban" style="width: 95%">$iban</textarea><br /><br />      <textarea cols="60" rows="10" name="ban" id="ban" style="width: 95%">$iban</textarea><br /><br />
    </td>     </td>
   </tr>    </tr>
   <tr valign="middle">    <tr valign="middle">
    <td align="left" class="catbg">     <td align="left" class="catbg">
     <label for="ban_email"><span class="small">$admin_txt{'725'}</span></label>      <label for="ban_email"><span class="small">$admin_txt{'725'}</span></label>
    </td>     </td>
   </tr>    </tr>
   <tr valign="middle">    <tr valign="middle">
    <td align="center" class="windowbg2"><br />     <td align="center" class="windowbg2"><br />
     <textarea cols="60" rows="10" name="ban_email" id="ban_email" style="width: 95%">$eban</textarea><br /><br />      <textarea cols="60" rows="10" name="ban_email" id="ban_email" style="width: 95%">$eban</textarea><br /><br />
    </td>     </td>
   </tr>    </tr>
   <tr valign="middle">    <tr valign="middle">
    <td align="left" class="catbg">     <td align="left" class="catbg">
     <label for="ban_memname"><span class="small">$admin_txt{'725a'}</span></label>      <label for="ban_memname"><span class="small">$admin_txt{'725a'}</span></label>
    </td>     </td>
   </tr>    </tr>
   <tr valign="middle">    <tr valign="middle">
    <td align="center" class="windowbg2"><br />     <td align="center" class="windowbg2"><br />
     <textarea cols="60" rows="10" name="ban_memname" id="ban_memname" style="width: 95%">$uban</textarea><br /><br />      <textarea cols="60" rows="10" name="ban_memname" id="ban_memname" style="width: 95%">$uban</textarea><br /><br />
    </td>     </td>
   </tr>    </tr>
   <tr valign="middle">    <tr valign="middle">
    <td align="center" class="catbg">     <td align="center" class="catbg">
     <input type="submit" value="$admin_txt{'10'}" class="button" />      <input type="submit" value="$admin_txt{'10'}" class="button" />
    </td>     </td>
   </tr>    </tr>
  </table>   </table>
</div> </div>
</form>~; </form>~;
   
   $yytitle     = "$admin_txt{'340'}";    $yytitle     = "$admin_txt{'340'}";
   $action_area = "ipban";    $action_area = "ipban";
   &AdminTemplate;    &AdminTemplate;
} }
   
sub ipban2 { sub ipban2 {
   &is_admin_or_gmod;    &is_admin_or_gmod;
   
   $FORM{'ban'} =~ tr/\r//d;    $FORM{'ban'} =~ tr/\r//d;
   $FORM{'ban'} =~ s/\A[\s\n]+| |[\s\n]+\Z//g;    $FORM{'ban'} =~ s/\A[\s\n]+| |[\s\n]+\Z//g;
   $FORM{'ban'} =~ s~\n\s*\n~\n~g;    $FORM{'ban'} =~ s~\n\s*\n~\n~g;
   $FORM{'ban'} =~ s/\n/,/g;    $FORM{'ban'} =~ s/\n/,/g;
   $FORM{'ban_email'} =~ tr/\r//d;    $FORM{'ban_email'} =~ tr/\r//d;
   $FORM{'ban_email'} =~ s/\A[\s\n]+| |[\s\n]+\Z//g;    $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\s*\n~\n~g;
   $FORM{'ban_email'} =~ s/\n/,/g;    $FORM{'ban_email'} =~ s/\n/,/g;
   $FORM{'ban_memname'} =~ tr/\r//d;    $FORM{'ban_memname'} =~ tr/\r//d;
   $FORM{'ban_memname'} =~ s/\A[\s\n]+| |[\s\n]+\Z//g;    $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\s*\n~\n~g;
   $FORM{'ban_memname'} =~ s/\n/,/g;    $FORM{'ban_memname'} =~ s/\n/,/g;
   
   ($email_banlist, $ip_banlist, $user_banlist) = ($FORM{'ban_email'}, $FORM{'ban'}, $FORM{'ban_memname'});    ($email_banlist, $ip_banlist, $user_banlist) = ($FORM{'ban_email'}, $FORM{'ban'}, $FORM{'ban_memname'});
   
   require "$admindir/NewSettings.pl";    require "$admindir/NewSettings.pl";
   &SaveSettingsTo('Settings.pl');    &SaveSettingsTo('Settings.pl');
   
   $yySetLocation = $adminurl;    $yySetLocation = $adminurl;
   &redirectexit;    &redirectexit;
} }
   
sub ipban_update { sub ipban_update {
   # This is for quick updating for banning + unbanning    # This is for quick updating for banning + unbanning
   &is_admin_or_gmod;    &is_admin_or_gmod;
   
   my ($ban_details, @banlist);    my ($ban_details, @banlist);
   if ($INFO{'ban'}) {    if ($INFO{'ban'}) {
       foreach (split(/,/, $ip_banlist)) {        foreach (split(/,/, $ip_banlist)) {
           if ($_ ne $INFO{'ban'}) { push(@banlist, $_); }            if ($_ ne $INFO{'ban'}) { push(@banlist, $_); }
       }        }
       push(@banlist, $INFO{'ban'}) unless $INFO{'unban'};        push(@banlist, $INFO{'ban'}) unless $INFO{'unban'};
       $ip_banlist = join(',', @banlist);        $ip_banlist = join(',', @banlist);
   
   } elsif ($INFO{'ban_email'}) {    } elsif ($INFO{'ban_email'}) {
       foreach (split(/,/, $email_banlist)) {        foreach (split(/,/, $email_banlist)) {
           if ($_ ne $INFO{'ban_email'}) { push(@banlist, $_); }            if ($_ ne $INFO{'ban_email'}) { push(@banlist, $_); }
       }        }
       push(@banlist, $INFO{'ban_email'}) unless $INFO{'unban'};        push(@banlist, $INFO{'ban_email'}) unless $INFO{'unban'};
       $email_banlist = join(',', @banlist);        $email_banlist = join(',', @banlist);
   
   } elsif ($INFO{'ban_memname'}) {    } elsif ($INFO{'ban_memname'}) {
       $INFO{'ban_memname'} = $do_scramble_id ? &decloak($INFO{'ban_memname'}) : $INFO{'ban_memname'};        $INFO{'ban_memname'} = $do_scramble_id ? &decloak($INFO{'ban_memname'}) : $INFO{'ban_memname'};
       foreach (split(/,/, $user_banlist)) {        foreach (split(/,/, $user_banlist)) {
           if ($_ ne $INFO{'ban_memname'}) { push(@banlist, $_); }            if ($_ ne $INFO{'ban_memname'}) { push(@banlist, $_); }
       }        }
       push(@banlist, $INFO{'ban_memname'}) unless $INFO{'unban'};        push(@banlist, $INFO{'ban_memname'}) unless $INFO{'unban'};
       $user_banlist = join(',', @banlist);        $user_banlist = join(',', @banlist);
   }    }
   
   require "$admindir/NewSettings.pl";    require "$admindir/NewSettings.pl";
   &SaveSettingsTo('Settings.pl');    &SaveSettingsTo('Settings.pl');
   
   $yySetLocation = qq~$scripturl?action=viewprofile;username=$INFO{'username'}~;    $yySetLocation = qq~$scripturl?action=viewprofile;username=$INFO{'username'}~;
   &redirectexit;    &redirectexit;
} }
   
sub ver_detail { sub ver_detail {
   &is_admin_or_gmod;    &is_admin_or_gmod;
   
   require "$boarddir/$yyexec.$yyext";    require "$boarddir/$yyexec.$yyext";
   $adminindexplver =~ s/\$Revision\: (.*?) \$/Build $1/ig;    $adminindexplver =~ s/\$Revision\: (.*?) \$/Build $1/ig;
   $YaBBplver =~ s/\$Revision\: (.*?) \$/Build $1/ig;    $YaBBplver =~ s/\$Revision\: (.*?) \$/Build $1/ig;
   
   $yymain .= qq~    $yymain .= qq~
   <div class="bordercolor" style="padding: 0px; width: 99%; margin-left: 0px; margin-right: auto;">    <div class="bordercolor" style="padding: 0px; width: 99%; margin-left: 0px; margin-right: auto;">
   <table width="100%" cellspacing="1" cellpadding="4">    <table width="100%" cellspacing="1" cellpadding="4">
   <tr valign="middle">    <tr valign="middle">
           <td align="left" class="titlebg" colspan="3"><img src="$imagesdir/info.gif" alt="" border="0" /><b>$admin_txt{'429'}</b></td>            <td align="left" class="titlebg" colspan="3"><img src="$imagesdir/info.gif" alt="" border="0" /><b>$admin_txt{'429'}</b></td>
    </tr>     </tr>
   <tr valign="middle">    <tr valign="middle">
       <td align="left" class="windowbg2" colspan="3">        <td align="left" class="windowbg2" colspan="3">
       <script language="javascript" src="http://www.yabbforum.com/update/versioncheck.js" type="text/javascript"></script>        <script language="javascript" src="http://www.yabbforum.com/update/versioncheck.js" type="text/javascript"></script>
       $versiontxt{'4'} <b>$YaBBversion</b><br />        $versiontxt{'4'} <b>$YaBBversion</b><br />
       <script language="JavaScript" type="text/javascript">           <script language="JavaScript" type="text/javascript">   
       <!-- //hide from dinosaurs           <!-- //hide from dinosaurs   
           document.write("$versiontxt{'5'} <b>"+STABLE+"</b><br />$versiontxt{'7'} <b>"+BETA+"</b>");               document.write("$versiontxt{'5'} <b>"+STABLE+"</b><br />$versiontxt{'7'} <b>"+BETA+"</b>");   
       // -->        // -->
       </script>        </script>
       <noscript>$versiontxt{'1'} <img src="http://www.yabbforum.com/images/version/versioncheck.gif" alt="" /></noscript>          <noscript>$versiontxt{'1'} <img src="http://www.yabbforum.com/images/version/versioncheck.gif" alt="" /></noscript>  
   </td>    </td>
   </tr>    </tr>
   <tr valign="middle">    <tr valign="middle">
       <td align="center" class="catbg" width="40%"><b>$admin_txt{'495'}</b><br /></td>        <td align="center" class="catbg" width="40%"><b>$admin_txt{'495'}</b><br /></td>
       <td align="center" class="catbg" width="60%"><b>$admin_txt{'494'}</b><br /></td>        <td align="center" class="catbg" width="60%"><b>$admin_txt{'494'}</b><br /></td>
   </tr>    </tr>
   <tr>    <tr>
       <td class="windowbg2" align="left">$admin_txt{'496'}</td>        <td class="windowbg2" align="left">$admin_txt{'496'}</td>
       <td class="windowbg2" align="left"><i>$YaBBversion</i></td>        <td class="windowbg2" align="left"><i>$YaBBversion</i></td>
   </tr><tr>    </tr><tr>
       <td class="windowbg2" align="left">$yyexec.$yyext</td>        <td class="windowbg2" align="left">$yyexec.$yyext</td>
       <td class="windowbg2" align="left"><i>$YaBBplver</i></td>        <td class="windowbg2" align="left"><i>$YaBBplver</i></td>
   </tr><tr>    </tr><tr>
       <td class="windowbg2" align="left">AdminIndex.pl</td>        <td class="windowbg2" align="left">AdminIndex.pl</td>
       <td class="windowbg2" align="left"><i>$adminindexplver</i></td>        <td class="windowbg2" align="left"><i>$adminindexplver</i></td>
   </tr>~;    </tr>~;
   
   opendir(LNGDIR, $langdir);    opendir(LNGDIR, $langdir);
   my @lfilesanddirs = readdir(LNGDIR);    my @lfilesanddirs = readdir(LNGDIR);
   close(LNGDIR);    close(LNGDIR);
   foreach $fld (@lfilesanddirs) {    foreach $fld (@lfilesanddirs) {
       if (-d "$langdir/$fld" && $fld =~ m^\A[0-9a-zA-Z_\#\%\-\:\+\?\$\&\~\,\@/]+\Z^ && -e "$langdir/$fld/Main.lng") {        if (-d "$langdir/$fld" && $fld =~ m^\A[0-9a-zA-Z_\#\%\-\:\+\?\$\&\~\,\@/]+\Z^ && -e "$langdir/$fld/Main.lng") {
           fopen(FILE, "$langdir/$fld/version.txt");            fopen(FILE, "$langdir/$fld/version.txt");
           my @ver = <FILE>;            my @ver = <FILE>;
           fclose(FILE);            fclose(FILE);
           $yymain .= qq~            $yymain .= qq~
   <tr>    <tr>
       <td width="30%" class="windowbg2" align="left">$fld Language Pack</td>        <td width="30%" class="windowbg2" align="left">$fld Language Pack</td>
       <td width="35%" class="windowbg2" align="left"><i>$ver[0]</i></td>        <td width="35%" class="windowbg2" align="left"><i>$ver[0]</i></td>
   </tr>~;    </tr>~;
       }        }
   }    }
   $yymain .= qq~    $yymain .= qq~
   <tr valign="middle">    <tr valign="middle">
       <td align="left" class="titlebg" colspan="3"><b>$admin_txt{'430'}</b></td>        <td align="left" class="titlebg" colspan="3"><b>$admin_txt{'430'}</b></td>
   </tr>~;    </tr>~;
   
   opendir(DIR, $admindir);    opendir(DIR, $admindir);
   my @adminDIR = readdir(DIR);    my @adminDIR = readdir(DIR);
   close(DIR);    close(DIR);
   @adminDIR = sort (@adminDIR);    @adminDIR = sort (@adminDIR);
   foreach my $fileinDIR (@adminDIR) {    foreach my $fileinDIR (@adminDIR) {
       chomp $fileinDIR;        chomp $fileinDIR;
       if ($fileinDIR =~ m/\.pl\Z/) {        if ($fileinDIR =~ m/\.pl\Z/) {
           require "$admindir/$fileinDIR";            require "$admindir/$fileinDIR";
           my $txtrevision = lc $fileinDIR;            my $txtrevision = lc $fileinDIR;
           $txtrevision =~ s/\.pl/plver/ig;            $txtrevision =~ s/\.pl/plver/ig;
           $$txtrevision =~ s/\$Revision\: (.*?) \$/Build $1/ig;            $$txtrevision =~ s/\$Revision\: (.*?) \$/Build $1/ig;
           $yymain .= qq~            $yymain .= qq~
   <tr>    <tr>
       <td class="windowbg2" align="left">$fileinDIR</td>        <td class="windowbg2" align="left">$fileinDIR</td>
       <td class="windowbg2" align="left"><i>$$txtrevision</i></td>        <td class="windowbg2" align="left"><i>$$txtrevision</i></td>
   </tr>~;    </tr>~;
       }        }
   }    }
   $yymain .= qq~    $yymain .= qq~
   <tr valign="middle">    <tr valign="middle">
       <td align="left" class="titlebg" colspan="3"><b>$admin_txt{'431'}</b></td>        <td align="left" class="titlebg" colspan="3"><b>$admin_txt{'431'}</b></td>
   </tr>~;    </tr>~;
   
   opendir(DIR, $sourcedir);    opendir(DIR, $sourcedir);
   my @sourceDIR = readdir(DIR);    my @sourceDIR = readdir(DIR);
   close(DIR);    close(DIR);
   @sourceDIR = sort (@sourceDIR);    @sourceDIR = sort (@sourceDIR);
   foreach my $fileinDIR (@sourceDIR) {    foreach my $fileinDIR (@sourceDIR) {
       chomp $fileinDIR;        chomp $fileinDIR;
       if ($fileinDIR =~ m/\.pl\Z/) {        if ($fileinDIR =~ m/\.pl\Z/) {
           require "$sourcedir/$fileinDIR";            require "$sourcedir/$fileinDIR";
           my $txtrevision = lc $fileinDIR;            my $txtrevision = lc $fileinDIR;
           $txtrevision =~ s/\.pl/plver/ig;            $txtrevision =~ s/\.pl/plver/ig;
           $$txtrevision =~ s/\$Revision\: (.*?) \$/Build $1/ig;            $$txtrevision =~ s/\$Revision\: (.*?) \$/Build $1/ig;