F:\WEBSITES\testbed\zipped\yabb_svn_new\branches\2.5.2\cgi-bin\yabb2\Admin\MemberGroups.pl F:\WEBSITES\testbed\zipped\yabb_svn_new\trunk\cgi-bin\yabb2\Admin\MemberGroups.pm
############################################################################### ###############################################################################
# MemberGroups.pl                                                             # # MemberGroups.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);
  our $VERSION = '2.6.12';
   
$membergroupsplver = 'YaBB 2.5.2 $Revision: 1.0 $'; $membergroupspmver = 'YaBB 2.6.12 $Revision: 1710 $';
if ($action eq 'detailedversion') { return 1; } if ( $action eq 'detailedversion' ) { return 1; }
   
  $admin_images = "$yyhtml_root/Templates/Admin/default";
   
sub EditMemberGroups { sub EditMemberGroups {
   &is_admin_or_gmod;     is_admin_or_gmod(); 
   my ($MemStatAdmin, $MemStarNumAdmin, $MemStarPicAdmin, $MemTypeColAdmin, $noshowAdmin, $viewpermsAdmin, $topicpermsAdmin, $replypermsAdmin, $pollpermsAdmin, $attachpermsAdmin, undef) = split(/\|/, $Group{'Administrator'});  
   my ($MemStatGMod, $MemStarNumGMod, $MemStarPicGMod, $MemTypeColGMod, $noshowGMod, $viewpermsGMod, $topicpermsGMod, $replypermsGMod, $pollpermsGMod, $attachpermsGMod, undef) = split(/\|/, $Group{'Global Moderator'});  #            ( 
   my ($MemStatMod, $MemStarNumMod, $MemStarPicMod, $MemTypeColMod, $noshowMod, $viewpermsMod, $topicpermsMod, $replypermsMod, $pollpermsMod, $attachpermsMod, undef) = split(/\|/, $Group{'Moderator'});  #                $title,     $stars,       $starpic,    $color, 
   my $noshowAdmin = ($noshowAdmin == 1) ? "$admin_txt{'164'}" : "$admin_txt{'163'}";  #                $noshow,    $viewperms,   $topicperms, $replyperms, 
   my $noshowGMod = ($noshowGMod == 1) ? "$admin_txt{'164'}" : "$admin_txt{'163'}";  #                $pollperms, $attachperms, $additional 
   my $noshowMod = ($noshowMod == 1) ? "$admin_txt{'164'}" : "$admin_txt{'163'}";  #            ) 
   my $adminpi = &permImage($viewpermsAdmin, $topicpermsAdmin, $replypermsAdmin, $pollpermsAdmin, $attachpermsAdmin);  
   my $gmodpi = &permImage($viewpermsGMod,  $topicpermsGMod, $replypermsGMod, $pollpermsGMod, $attachpermsGMod);     $yymain .= qq~ 
   my $modpi = &permImage($viewpermsMod, $topicpermsMod, $replypermsMod, $pollpermsMod, $attachpermsMod);  <div class="bordercolor rightboxdiv"> 
     <table class="border-space pad-cell" style="margin-bottom: .5em;">
   $yymain .= qq~         <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{'guest'}&nbsp;<b>$admin_txt{'8'}</b> 
    <tr valign="middle">             </td> 
      <td align="left" class="titlebg">         </tr><tr> 
<img src="$imagesdir/guest.gif" alt="" border="0" />&nbsp;<b>$admin_txt{'8'}</b>             <td class="windowbg2"> 
      </td>                 <div class="pad-more">$admin_txt{'11'}</div> 
    </tr>             </td> 
    <tr valign="middle">         </tr> 
      <td align="left" class="windowbg2"><br />     </table> 
       $admin_txt{'11'}<br /><br />  </div> 
      </td>  <div class="bordercolor rightboxdiv"> 
    </tr>     <table class="border-space pad-cell" style="margin-bottom: .5em;"> 
  </table>         <colgroup> 
</div>             <col style="width: 25%" /> 
             <col style="width: 15%" />
<br />            <col style="width: 10%" />
             <col style="width: 25%" />
<div class="bordercolor" style="padding: 0px; width: 99%; margin-left: 0px; margin-right: auto;">             <col style="width: 10%" /> 
<table width="100%" cellspacing="1" cellpadding="4">             <col style="width: 15%" /> 
   <tr valign="middle">         </colgroup> 
       <td align="left" class="titlebg" colspan="6">         <tr> 
       <img src="$imagesdir/guest.gif" alt="" border="0" />&nbsp;<b>$admin_txt{'12'}</b>             <td class="titlebg" colspan="6"> 
       </td>                 $admin_img{'guest'}&nbsp;<b>$admin_txt{'12'}</b> 
   </tr>             </td> 
   <tr valign="middle">         </tr><tr> 
       <td align="center" class="catbg" width="25%"><b>$amgtxt{'03'}</b></td>             <td class="catbg center"><b>$amgtxt{'03'}</b></td> 
       <td align="center" class="catbg" width="15%"><b>$amgtxt{'19'}</b></td>             <td class="catbg center"><b>$amgtxt{'19'}</b></td> 
       <td align="center" class="catbg" width="10%"><b>$amgtxt{'08'}</b></td>             <td class="catbg center"><b>$amgtxt{'08'}</b></td> 
       <td align="center" class="catbg" width="25%"><b>$amgtxt{'01'}</b></td>             <td class="catbg center"><b>$amgtxt{'01'}</b></td> 
       <td align="center" class="catbg" width="10%"><b>$admin_txt{'53'}</b></td>             <td class="catbg center"><b>$admin_txt{'53'}</b></td> 
       <td align="center" class="catbg" width="15%"><b>&nbsp;</b></td>             <td class="catbg center"><b>&nbsp;</b></td>~; 
   </tr>     my @grps = sort keys %Group; 
   <tr valign="middle">     my @memstats = (); 
       <td align="center" class="windowbg2">$MemStatAdmin</td>     for ( @grps ) { 
       <td align="center" class="windowbg2"><img src="$imagesdir/$MemStarPicAdmin" /> x $MemStarNumAdmin</td>~;         @memstats = split /\|/xsm, $Group{$_}; 
         $memstats[4] = ( $memstats[4] == 1 ) ? "$admin_txt{'164'}" : "$admin_txt{'163'}";
   if ($MemTypeColAdmin) {         $yymain .= qq~ 
       $thecolname = &hextoname($MemTypeColAdmin);         </tr><tr> 
       $yymain .= qq~             <td class="windowbg2 center">$memstats[0]</td> 
       <td align="center" class="windowbg2"><span style="color:$MemTypeColAdmin">$thecolname</span></td>~;             <td class="windowbg2 center"><img src="$imagesdir/$memstats[2]" alt="" /> x $memstats[1]</td>~; 
   } else {  
       $yymain .= qq~     if ( $memstats[3] ) { 
       <td align="center" class="windowbg2" width="10%">&nbsp;</td>~;         $thecolname = hextoname($memstats[3]); 
   }         $yymain .= qq~ 
   $yymain .= qq~             <td class="windowbg2 center"><span style="color:$memstats[3]">$thecolname</span></td>~; 
       <td align="center" class="windowbg2">$noshowAdmin</td>     } 
       <td align="center" class="windowbg2"><a href="$adminurl?action=editgroup;group=Administrator">$admin_txt{'53'}</a></td>     else { 
       <td align="center" class="windowbg2">&nbsp;</td>         $yymain .= q~ 
   </tr>             <td class="windowbg2 center">&nbsp;</td>~; 
   <tr valign="middle">     } 
       <td align="center" class="windowbg2">$MemStatGMod</td>     $mgrp = $_; 
       <td align="center" class="windowbg2"><img src="$imagesdir/$MemStarPicGMod" /> x $MemStarNumGMod</td>~;     $mgrp =~ s/\ /%20/gsm; 
   if ($MemTypeColGMod) {     $yymain .= qq~ 
       $thecolname = &hextoname($MemTypeColGMod);             <td class="windowbg2 center">$memstats[4]</td> 
       $yymain .= qq~             <td class="windowbg2 center"><a href="$adminurl?action=editgroup;group=$mgrp">$admin_txt{'53'}</a></td> 
       <td align="center" class="windowbg2"><span style="color:$MemTypeColGMod">$thecolname</span></td>~;             <td class="windowbg2 center">&nbsp;</td>~; 
   } else {     } 
       $yymain .= qq~     $yymain .= q~ 
       <td align="center" class="windowbg2" width="10%">&nbsp;</td>~;         </tr> 
   }     </table> 
   $yymain .= qq~  
       <td align="center" class="windowbg2">$noshowGMod</td>  
       <td align="center" class="windowbg2"><a href="$adminurl?action=editgroup;group=Global Moderator">$admin_txt{'53'}</a></td>  
       <td align="center" class="windowbg2">&nbsp;</td>  
   </tr>  
   <tr valign="middle">  
       <td align="center" class="windowbg2">$MemStatMod</td>  
       <td align="center" class="windowbg2"><img src="$imagesdir/$MemStarPicMod" /> x $MemStarNumMod</td>~;  
   
   if ($MemTypeColMod) {  
       $thecolname = &hextoname($MemTypeColMod);  
       $yymain .= qq~  
       <td align="center" class="windowbg2"><span style="color:$MemTypeColMod">$thecolname</span></td>~;  
   } else {  
       $yymain .= qq~  
       <td align="center" class="windowbg2" width="10%">&nbsp;</td>~;  
   }  
   $yymain .= qq~  
       <td align="center" class="windowbg2">$noshowMod</td>  
       <td align="center" class="windowbg2"><a href="$adminurl?action=editgroup;group=Moderator">$admin_txt{'53'}</a></td>  
       <td align="center" class="windowbg2">&nbsp;</td>  
   </tr>  
</table>  
</div> </div>
  ~;
   
<br />     my $colspan = 6; 
     my $colgroup = q~<colgroup>
             <col  style="width: 25%" />
             <col  style="width: 15%" />
             <col  style="width: 10%" />
             <col  style="width: 25%" />
             <col  style="width: 10%" />
             <col  style="width: 15%" />
         </colgroup>
~; ~;
   
   my $colspan = 6;     if ( $addmemgroup_enabled > 0 ) { 
   my $width1 = '25%';         $additional_tablehead = 
   my $width2 = '10%';           qq~<td class="catbg center"><b>$amgtxt{'83'}</b></td>~; 
   my $width3 = '15%';         $colspan = 7; 
   if ($addmemgroup_enabled > 0) {         $colgroup = q~<colgroup> 
       $additional_tablehead = qq~<td align="center" class="catbg" width="15%"><b>$amgtxt{'83'}</b></td>~;             <col style="width: 25%" /> 
       $colspan = 7;             <col  style="width: 15%" /> 
       $width1 = '20%';             <col  style="width: 10%" /> 
       $width2 = '5%';             <col  style="width: 20%" /> 
       $width3 = '10%';             <col  style="width: 15%" /> 
   }             <col  style="width: 5%" /> 
   my $reorderlink = "";             <col  style="width: 10%" /> 
   if ($#nopostorder) {         </colgroup> 
       $reorderlink = qq~ | <a href="$adminurl?action=reordergroup">$admintxt{'reordergroups'}</a>~;  ~;    } 
   }     my $reorderlink = q{}; 
     if ($#nopostorder) {
   $yymain .= qq~         $reorderlink = 
<div class="bordercolor" style="padding: 0px; width: 99%; margin-left: 0px; margin-right: auto;">  qq~ | <a href="$adminurl?action=reordergroup">$admintxt{'reordergroups'}</a>~; 
<table width="100%" cellspacing="1" cellpadding="4">     } 
   <tr valign="middle">  
       <td align="left" class="titlebg" colspan="$colspan">     $yymain .= qq~ 
       <img src="$imagesdir/guest.gif" alt="" border="0" />&nbsp;<b>$amgtxt{'37'} (<a href="$adminurl?action=editgroup">$admintxt{'18c'}</a>$reorderlink)</b>  <div class="bordercolor rightboxdiv"> 
       </td>     <table class="border-space pad-cell" style="margin-bottom: .5em;"> 
   </tr>         $colgroup 
   <tr valign="middle">         <tr> 
       <td align="center" class="catbg" width="25%"><b>$amgtxt{'03'}</b></td>             <td class="titlebg" colspan="$colspan"> 
       <td align="center" class="catbg" width="15%"><b>$amgtxt{'19'}</b></td>                 $admin_img{'guest'}&nbsp;<b>$amgtxt{'37'} (<a href="$adminurl?action=editgroup">$admintxt{'18c'}</a>$reorderlink)</b> 
       <td align="center" class="catbg" width="10%"><b>$amgtxt{'08'}</b></td>             </td> 
       <td align="center" class="catbg" width="$width1"><b>$amgtxt{'01'}</b></td>         </tr><tr> 
       $additional_tablehead             <td class="catbg center"><b>$amgtxt{'03'}</b></td> 
       <td align="center" class="catbg" width="$width2"><b>$admin_txt{'53'}</b></td>             <td class="catbg center"><b>$amgtxt{'19'}</b></td> 
       <td align="center" class="catbg" width="$width3"><b>$admin_txt{'54'}</b></td>             <td class="catbg center"><b>$amgtxt{'08'}</b></td> 
   </tr>~;             <td class="catbg center"><b>$amgtxt{'01'}</b></td> 
             $additional_tablehead
   $count = 0;             <td class="catbg center"><b>$admin_txt{'53'}</b></td> 
   foreach (@nopostorder) {             <td class="catbg center"><b>$admin_txt{'54'}</b></td> 
       ($title, $stars, $starpic, $color, $noshow, $viewperms, $topicperms, $replyperms, $pollperms, $attachperms, $additional) = split(/\|/, $NoPost{$_});         </tr>~; 
       $permimage = "";  
       $permimage = &permImage($viewperms, $topicperms, $replyperms, $pollperms, $attachperms);     $count = 0; 
       $noshow = ($noshow == 1) ? "$admin_txt{'164'}" : "$admin_txt{'163'}";     for (@nopostorder) { 
       $additional = ($additional == 0) ? "$admin_txt{'164'}" : "$admin_txt{'163'}";         @memstats = split /\|/xsm, $NoPost{$_}; 
       if (!$stars) { $stars = "0"; }         $memstats[4] = ( $memstats[4] == 1 ) ? "$admin_txt{'164'}" : "$admin_txt{'163'}"; 
       $yymain .= qq~         $memstats[10] = 
   <tr>           ( $memstats[10] == 0 ) ? "$admin_txt{'164'}" : "$admin_txt{'163'}"; 
       <td align="center" class="windowbg2">$title</td>         if ( !$stars ) { $stars = 0; } 
       <td align="center" class="windowbg2"><img src="$imagesdir/$starpic" /> x $stars</td>~;         $yymain .= qq~<tr> 
             <td class="windowbg2 center">$memstats[0]</td>
       if ($color) {             <td class="windowbg2 center"><img src="$imagesdir/$memstats[2]" alt="" /> x $memstats[1]</td>~; 
           $thecolname = &hextoname($color);  
           $yymain .= qq~         if ($memstats[3]) { 
       <td align="center" class="windowbg2"><span style="color:$color">$thecolname</span></td>~;             $thecolname = hextoname($memstats[3]); 
       } else {             $yymain .= qq~ 
           $yymain .= qq~             <td class="windowbg2 center"><span style="color:$memstats[3]">$thecolname</span></td>~; 
       <td align="center" class="windowbg2">&nbsp;</td>~;         } 
       }         else { 
             $yymain .= q~
       $yymain .= qq~             <td class="windowbg2 center">&nbsp;</td>~; 
       <td align="center" class="windowbg2">$noshow</td>~;         } 
   
       if ($addmemgroup_enabled > 0) {         $yymain .= qq~ 
           $yymain .= qq~             <td class="windowbg2 center">$memstats[4]</td>~; 
       <td align="center" class="windowbg2">$additional</td>~;  
       }         if ( $addmemgroup_enabled > 0 ) { 
             $yymain .= qq~
       $yymain .= qq~             <td class="windowbg2 center">$memstats[10]</td>~; 
       <td align="center" class="windowbg2"><a href="$adminurl?action=editgroup;group=NP|$_">$admin_txt{'53'}</a></td>         } 
       <td align="center" class="windowbg2"><a href="$adminurl?action=delgroup;group=NP|$_">$admin_txt{'54'}</a></td>  
   </tr>~;         $yymain .= qq~ 
       $count++;             <td class="windowbg2 center"><a href="$adminurl?action=editgroup;group=NP|$_">$admin_txt{'53'}</a></td> 
   }             <td class="windowbg2 center"><a href="$adminurl?action=delgroup;group=NP|$_">$admin_txt{'54'}</a></td> 
         </tr>~;
   if ($count == 0) {         $count++; 
       $yymain .= qq~     } 
   <tr>  
       <td align="center" class="windowbg2" colspan="6">$amgtxt{'35'}</td>     if ( $count == 0 ) { 
   </tr>~;         $yymain .= qq~<tr> 
   }             <td class="windowbg2 center" colspan="6">$amgtxt{'35'}</td> 
         </tr>~;
     }
   
   $yymain .= qq~    $yymain .= qq~
</table>    </table>
</div> </div>
  <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 style="width: 25%" /> 
<table width="100%" cellspacing="1" cellpadding="4">             <col style="width: 15%" /> 
   <tr valign="middle">             <col style="width: 10%" /> 
       <td align="left" class="titlebg" colspan="6">             <col style="width: 25%" /> 
       <img src="$imagesdir/guest.gif" alt="" border="0" />&nbsp;<b>$amgtxt{'40'}&nbsp;(<a href="$adminurl?action=editgroup1">$admintxt{'18c'}</a>)</b>             <col style="width: 10%" /> 
       </td>             <col style="width: 15%" /> 
   </tr>         </colgroup> 
   <tr valign="middle">         <tr> 
       <td align="center" class="catbg" width="25%"><b>$amgtxt{'03'}</b></td>             <td class="titlebg" colspan="6"> 
       <td align="center" class="catbg" width="15%"><b>$amgtxt{'19'}</b></td>                 $admin_img{'guest'}&nbsp;<b>$amgtxt{'40'}&nbsp;(<a href="$adminurl?action=editgroup1">$admintxt{'18c'}</a>)</b> 
       <td align="center" class="catbg" width="10%"><b>$amgtxt{'08'}</b></td>             </td> 
       <td align="center" class="catbg" width="25%"><b>$admin_txt{'21'}</b></td>         </tr><tr> 
       <td align="center" class="catbg" width="10%"><b>$admin_txt{'53'}</b></td>             <td class="catbg center"><b>$amgtxt{'03'}</b></td> 
       <td align="center" class="catbg" width="15%"><b>$admin_txt{'54'}</b></td>             <td class="catbg center"><b>$amgtxt{'19'}</b></td> 
   </tr>~;             <td class="catbg center"><b>$amgtxt{'08'}</b></td> 
             <td class="catbg center"><b>$admin_txt{'21'}</b></td>
   my $count = 0;             <td class="catbg center"><b>$admin_txt{'53'}</b></td> 
   foreach (sort { $b <=> $a } keys %Post) {             <td class="catbg center"><b>$admin_txt{'54'}</b></td> 
       my ($title, $stars, $starpic, $color, $noshow, $viewperms, $topicperms, $replyperms, $pollperms, $attachperms, undef) = split(/\|/, $Post{$_});         </tr>~; 
   
       $permimage = "";     my $count = 0; 
       $permimage = &permImage($viewperms, $topicperms, $replyperms, $pollperms, $attachperms);     for ( reverse sort { $a <=> $b } keys %Post ) { 
       $noshow    = ($noshow == 1) ? "$admin_txt{'164'}" : "$admin_txt{'163'}";         @memstats = split /\|/xsm, $Post{$_}; 
       if (!$stars) { $stars = "0"; }         $memstats[4] = ( $memstats[4] == 1 ) ? "$admin_txt{'164'}" : "$admin_txt{'163'}"; 
       if ($starpic !~ /\//) { $starpic = "$imagesdir/$starpic"; }        if ( !$memstats[1] )             { $memstats[1]   = 0; }
       $yymain .= qq~         if ( $memstats[2] !~ /\//xsm ) { $memstats[2] = "$imagesdir/$memstats[2]"; } 
   <tr>         $yymain .= qq~<tr> 
       <td align="center" class="windowbg2" width="25%">$title</td>             <td class="windowbg2 center">$memstats[0]</td> 
       <td align="center" class="windowbg2" width="15%"><img src="$starpic" /> x $stars</td>~;             <td class="windowbg2 center"><img src="$memstats[2]" alt="" /> x $memstats[1]</td>~; 
   
       if ($color) {        if ($memstats[3]) {
           $thecolname = &hextoname($color);             $thecolname = hextoname($memstats[3]); 
           $yymain .= qq~            $yymain .= qq~
       <td align="center" class="windowbg2" width="10%"><span style="color: $color;">$thecolname</span></td>~;             <td class="windowbg2 center"><span style="color: $memstats[3];">$thecolname</span></td>~; 
       } else {         } 
           $yymain .= qq~         else { 
       <td align="center" class="windowbg2" width="10%">&nbsp;</td>~;             $yymain .= q~ 
       }             <td class="windowbg2 center">&nbsp;</td>~; 
         }
       $yymain .= qq~  
       <td align="center" class="windowbg2" width="25%">$_</td>         $yymain .= qq~ 
       <td align="center" class="windowbg2" width="10%"><a href="$adminurl?action=editgroup;group=P|$_">$admin_txt{'53'}</a></td>             <td class="windowbg2 center">$_</td> 
       <td align="center" class="windowbg2" width="15%"><a href="$adminurl?action=delgroup;group=P|$_">$admin_txt{'54'}</a></td>             <td class="windowbg2 center"><a href="$adminurl?action=editgroup;group=P|$_">$admin_txt{'53'}</a></td> 
   </tr>~;             <td class="windowbg2 center"><a href="$adminurl?action=delgroup;group=P|$_">$admin_txt{'54'}</a></td> 
       $count++;         </tr>~; 
   }         $count++; 
     }
   if ($count == 0) {  
       $yymain .= qq~     if ( $count == 0 ) { 
   <tr>         $yymain .= qq~<tr> 
       <td class="windowbg2" colspan="6">$amgtxt{'36'}</td>            <td class="windowbg2" colspan="6">$amgtxt{'36'}</td>
   </tr>~;        </tr>~;
   }    }
   $yymain .= qq~     $yymain .= q~ 
</table>    </table>
</div> </div>
~; ~;
   
   $yytitle = $admin_txt{'8'};    $yytitle     = $admin_txt{'8'};
   $action_area = 'modmemgr';    $action_area = 'modmemgr';
   
   &AdminTemplate;     AdminTemplate(); 
     return;
} }
   
sub hextoname { sub hextoname {
   $colorname = $_[0];     ($colorname) = @_; 
   $colorname =~ s~aqua|#00FFFF~$amgtxt{'56'}~i;     $colorname =~ s/aqua|\x2300FFFF/$amgtxt{'56'}/ism; 
   $colorname =~ s~black|#000000~$amgtxt{'57'}~i;     $colorname =~ s/black|\x23000000/$amgtxt{'57'}/ism; 
   $colorname =~ s~blue|#0000FF~$amgtxt{'58'}~i;     $colorname =~ s/blue|\x230000FF/$amgtxt{'58'}/ism; 
   $colorname =~ s~fuchsia|#FF00FF~$amgtxt{'59'}~i;     $colorname =~ s/fuchsia|\x23FF00FF/$amgtxt{'59'}/ism; 
   $colorname =~ s~gray|#808080~$amgtxt{'60'}~i;     $colorname =~ s/gray|\x23808080/$amgtxt{'60'}/ism; 
   $colorname =~ s~green|#008000~$amgtxt{'61'}~i;     $colorname =~ s/green|\x23008000/$amgtxt{'61'}/ism; 
   $colorname =~ s~lime|#00FF00~$amgtxt{'62'}~i;     $colorname =~ s/lime|\x2300FF00/$amgtxt{'62'}/ism; 
   $colorname =~ s~maroon|#800000~$amgtxt{'63'}~i;     $colorname =~ s/maroon|\x23800000/$amgtxt{'63'}/ism; 
   $colorname =~ s~navy|#000080~$amgtxt{'64'}~i;     $colorname =~ s/navy|\x23000080/$amgtxt{'64'}/ism; 
   $colorname =~ s~olive|#808000~$amgtxt{'65'}~i;     $colorname =~ s/olive|\x23808000/$amgtxt{'65'}/ism; 
   $colorname =~ s~purple|#800080~$amgtxt{'66'}~i;     $colorname =~ s/purple|\x23800080/$amgtxt{'66'}/ism; 
   $colorname =~ s~red|#FF0000~$amgtxt{'67'}~i;     $colorname =~ s/red|\x23FF0000/$amgtxt{'67'}/ism; 
   $colorname =~ s~silver|#C0C0C0~$amgtxt{'68'}~i;     $colorname =~ s/silver|\x23C0C0C0/$amgtxt{'68'}/ism; 
   $colorname =~ s~teal|#008080~$amgtxt{'69'}~i;     $colorname =~ s/teal|\x23008080/$amgtxt{'69'}/ism; 
   $colorname =~ s~white|#FFFFFF~$amgtxt{'70'}~i;     $colorname =~ s/white|\x23FFFFFF/$amgtxt{'70'}/ism; 
   $colorname =~ s~yellow|#FFFF00~$amgtxt{'71'}~i;     $colorname =~ s/yellow|\x23FFFF00/$amgtxt{'71'}/ism; 
   $colorname =~ s~#DEB887~$amgtxt{'75'}~i;     $colorname =~ s/\x23DEB887/$amgtxt{'75'}/ism; 
   $colorname =~ s~#FFD700~$amgtxt{'76'}~i;     $colorname =~ s/\x23FFD700/$amgtxt{'76'}/ism; 
   $colorname =~ s~#FFA500~$amgtxt{'77'}~i;     $colorname =~ s/\x23FFA500/$amgtxt{'77'}/ism; 
    $colorname =~ s~#A0522D~$amgtxt{'78'}~i;     $colorname =~ s/\x23A0522D/$amgtxt{'78'}/ism; 
   $colorname =~ s~#87CEEB~$amgtxt{'79'}~i;     $colorname =~ s/\x2387CEEB/$amgtxt{'79'}/ism; 
   $colorname =~ s~#6A5ACD~$amgtxt{'80'}~i;     $colorname =~ s/\x236A5ACD/$amgtxt{'80'}/ism; 
   $colorname =~ s~#4682B4~$amgtxt{'81'}~i;     $colorname =~ s/\x234682B4/$amgtxt{'81'}/ism; 
   $colorname =~ s~#9ACD32~$amgtxt{'82'}~i;     $colorname =~ s/\x239ACD32/$amgtxt{'82'}/ism; 
   return $colorname;    return $colorname;
} }
   
sub editAddGroup { sub editAddGroup {
   &is_admin_or_gmod;     is_admin_or_gmod(); 
   if ($INFO{'group'}) {     my @memstats = (); 
       $viewtitle = $admintxt{'18a'};     if ( $INFO{'group'} ) { 
       ($type, $element) = split(/\|/, $INFO{'group'});         $viewtitle = $admintxt{'18a'}; 
       if ($element ne '') {         ( $type, $element ) = split /\|/xsm, $INFO{'group'}; 
           if ($type eq 'P') {        if ( $element ne q{} ) {
               $posts = $element;             if ( $type eq 'P' ) { 
               ($title, $stars, $starpic, $color, $noshow, $viewperms, $topicperms, $replyperms, $pollperms, $attachperms, $additional) = split(/\|/, $Post{$element});                 $posts = $element; 
           } else {                 @memstats = split /\|/xsm, $Post{$element}; 
               $noposts = $element;             } 
               $choosable = 1;             else { 
               ($title, $stars, $starpic, $color, $noshow, $viewperms, $topicperms, $replyperms, $pollperms, $attachperms, $additional) = split(/\|/, $NoPost{$element});                 $noposts   = $element; 
           }                 $choosable = 1; 
       } else {                 @memstats = split /\|/xsm, $NoPost{$element}; 
           ($title, $stars, $starpic, $color, $noshow, $viewperms, $topicperms, $replyperms, $pollperms, $attachperms, $additional) = split(/\|/, $Group{$INFO{'group'}});             } 
       }        }
   } else {        else {
       $viewtitle = $admintxt{'18b'};             @memstats = split /\|/xsm, $Group{ $INFO{'group'} }; 
       $title = '';         } 
       $stars = '';     } 
       $starpic = '';     else { 
       $color = '';         $viewtitle = $admintxt{'18b'}; 
       $posts = '';         $memstats[0]    = q{}; 
       $noposts = 1;         $memstats[1]    = q{}; 
       foreach (sort { $a <=> $b } keys %NoPost) {         $memstats[2]    = q{}; 
           $noposts = $_ + 1;         $memstats[3]     = q{}; 
       }         $posts     = q{}; 
   }         $noposts   = 1; 
         for ( sort { $a <=> $b } keys %NoPost ) {
   if ($stars !~ /\A[0-9]+\Z/) { $stars = 0; }             $noposts = $_ + 1; 
         }
   $otherdisable = qq~ disabled="disabled"~;     } 
   
   # Get star selected if needed.     if ( $stars !~ /\A[0-9]+\Z/xsm ) { $stars = 0; } 
   if    ($starpic eq "staradmin.gif")  { $stars1 = "selected=\"selected\"" }  
   elsif ($starpic eq "stargmod.gif")   { $stars2 = "selected=\"selected\"" }     $otherdisable = q~ disabled="disabled"~; 
   elsif ($starpic eq "starmod.gif")    { $stars3 = "selected=\"selected\"" }  
   elsif ($starpic eq "starblue.gif")   { $stars4 = "selected=\"selected\"" }     # Get star selected if needed. 
   elsif ($starpic eq "starsilver.gif") { $stars5 = "selected=\"selected\"" }     my @starsgif = ( 
   elsif ($starpic eq "stargold.gif")   { $stars6 = "selected=\"selected\"" }         q{},            'staradmin.png',  'stargmod.png', 'starfmod.png', 'starmod.png', 
   elsif ($starpic eq "")               { $stars1 = "selected=\"selected\"" }         'starblue.png', 'starsilver.png', 'stargold.png', 
   else { $stars7 = "selected=\"selected\""; $pick = $starpic; $otherdisable = ""; }     ); 
   my $starurl = ($starpic !~ m~http://~ ? "$imagesdir/" : "") . ($starpic ? $starpic : "blank.gif");     my @starstxt = ( q{}, "$amgtxt{'20'}","$amgtxt{'21'}","$amgtxt{'21a'}","$amgtxt{'22'}", 
         "$amgtxt{'23'}","$amgtxt{'24'}","$amgtxt{'25'}",
   $color =~ s/\#//g;     ); 
     my @stara = ();
   $pc = qq~ checked="checked"~;     $pick         = $memstats[2]; 
   $pd = "";     $otherdisable = q{}; 
   $pt = "";     my $stsel = 0; 
     foreach my $i ( 1 .. 7 ) {
   if ($noshow) { $pc = ''; }         if ( $memstats[2] eq $starsgif[$i] ) { 
   if ($additional) { $admg = qq~ checked="checked"~; }             $stara[$i] = q{ selected="selected"}; 
             $stsel++;
   if ($posts eq "" && $action ne "editgroup1") { $post2 = qq~ checked="checked"~; $pt = qq~ disabled="disabled"~; }        }
   else { $post1 = qq~ checked="checked"~; $pd = qq~ disabled="disabled"~; }    }
     if ( $stsel == 0 ) {
   if ($viewperms == 1) { $vc  = qq~ checked="checked"~; }         $stara[8] = q{ selected="selected"}; 
   if ($topicperms == 1) { $tc  = qq~ checked="checked"~; }    }
   if ($replyperms == 1) { $rc  = qq~ checked="checked"~; }     my $starurl = 
   if ($pollperms == 1) { $poc = qq~ checked="checked"~; }         ( $memstats[2] !~ m{http://}xsm ? "$imagesdir/" : q{} ) 
   if ($attachperms == 1) { $ac  = qq~ checked="checked"~; }       . ( $memstats[2]                  ? $memstats[2]      : 'blank.gif' ); 
   
   $yymain .= qq~     $memstats[3] =~ s/\#//gxsm; 
   
     $pc = q~ checked="checked"~;
     $pd = q{};
     $pt = q{};
   
     if ($memstats[4])     { $pc   = q{}; }
     if ($memstats[10]) { $admg = q~ checked="checked"~; }
   
     if ( $posts eq q{} && $action ne 'editgroup1' ) {
         $post2 = q{ checked="checked"};
         $pt    = q{ disabled="disabled"};
     }
     else { $post1 = q~ checked="checked"~; $pd = q~ disabled="disabled"~; }
   
     if ( $memstats[5] == 1 ) { $vc  = q~ checked="checked"~; }
     if ( $memstats[6] == 1 ) { $tc  = q~ checked="checked"~; }
     if ( $memstats[7] == 1 ) { $rc  = q~ checked="checked"~; }
     if ( $memstats[8] == 1 ) { $poc = q~ checked="checked"~; }
     if ( $memstats[9] == 1 ) { $ac  = q~ checked="checked"~; }
   
<form name="groups" action="$adminurl?action=editAddGroup2" method="post">     $yymain .= qq~ 
  <form name="groups" action="$adminurl?action=editAddGroup2" method="post" enctype="multipart/form-data" accept-charset="$yymycharset">
<input type="hidden" name="original" value="$INFO{'group'}" /> <input type="hidden" name="original" value="$INFO{'group'}" />
<input type="hidden" name="origin" value="$action" /> <input type="hidden" name="origin" value="$action" />
   
<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="2">         <col style="width:40%" /> 
       <img src="$imagesdir/preferences.gif" alt="" border="0" /> <b>$viewtitle</b>         <col style="width:60%" /> 
       </td>     </colgroup> 
   </tr>     <tr> 
   <tr valign="middle">         <td class="titlebg" colspan="2">$admin_img{'prefimg'} <b>$viewtitle</b></td> 
       <td class="windowbg" width="40%"><label for="title">$amgtxt{'51'}:</label></td>     </tr><tr> 
       <td class="windowbg2" width="60%"><input type="text" name="title" id="title" value="$title" /></td>         <td class="windowbg"><label for="title">$amgtxt{'51'}:</label></td> 
   </tr><tr>         <td class="windowbg2"><input type="text" name="title" id="title" value="$memstats[0]" /></td> 
       <td class="windowbg"><label for="numstars">$amgtxt{'05'}</label></td>     </tr><tr> 
       <td class="windowbg2"><input type="text" name="numstars" id="numstars" size="2" value="$stars" /></td>         <td class="windowbg"><label for="numstars">$amgtxt{'05'}</label></td> 
   </tr><tr>         <td class="windowbg2"><input type="text" name="numstars" id="numstars" size="2" value="$memstats[1]" /></td> 
       <td class="windowbg"><label for="starsadmin">$amgtxt{'38'}:</label></td>     </tr><tr> 
       <td class="windowbg2">         <td class="windowbg"><label for="starsadmin">$amgtxt{'38'}:</label></td> 
           <select name="starsadmin" id="starsadmin" onchange="stars(this.value); showimage();">         <td class="windowbg2"> 
           <option value="staradmin.gif" $stars1>$amgtxt{'20'}</option>             <select name="starsadmin" id="starsadmin" onchange="stars(this.value); showimage();">~; 
           <option value="stargmod.gif" $stars2>$amgtxt{'21'}</option>     for my $i ( 1 .. 7 ) { 
           <option value="starmod.gif" $stars3>$amgtxt{'22'}</option>             $yymain .= qq~                <option value="$starsgif[$i]"$stara[$i]>$starstxt[$i]</option>\n~; 
           <option value="starblue.gif" $stars4>$amgtxt{'23'}</option>     } 
           <option value="starsilver.gif" $stars5>$amgtxt{'24'}</option>     $yymain .= qq~                <option value="other"$stara[8]>$amgtxt{'26'}</option> 
           <option value="stargold.gif" $stars6>$amgtxt{'25'}</option>             </select> 
           <option value="other" $stars7>$amgtxt{'26'}</option>             &nbsp; 
           </select>             <label for="otherstar"><b>$amgtxt{'26'}</b></label> <input type="file" name="otherstar" id="otherstar" size="35"$otherdisable /><input type="hidden" name="cur_otherstar" value="$pick" /> <span class="cursor small bold" title="$admin_txt{'remove_file'}" onclick="document.getElementById('otherstar').value='';">X</span> 
           &nbsp;            &nbsp;
           <label for="otherstar"><b>$amgtxt{'26'}</b></label> <input type="text" name="otherstar" id="otherstar" onchange="showimage();" value="$pick"$otherdisable />            <img src="$starurl" id="starpic" alt="" />
           &nbsp;         </td> 
           <img src="$starurl" name="starpic" border="0" alt="" />     </tr><tr> 
       </td>         <td class="windowbg"><label for="color">$amgtxt{'08'}:</label></td> 
   </tr><tr>         <td class="windowbg2" > 
       <td class="windowbg"><label for="color">$amgtxt{'08'}:</label></td>             <select name="color" id="color" onchange="viscolor(this.options[this.selectedIndex].value);"> 
       <td class="windowbg2" >             <option value="">--</option> 
           <select name="color" id="color" onchange="viscolor(this.options[this.selectedIndex].value);">             <option value="00FFFF">$amgtxt{'56'}</option> 
           <option value=""></option>             <option value="000000">$amgtxt{'57'}</option> 
           <option value="00FFFF">$amgtxt{'56'}</option>             <option value="0000FF">$amgtxt{'58'}</option> 
           <option value="000000">$amgtxt{'57'}</option>             <option value="FF00FF">$amgtxt{'59'}</option> 
           <option value="0000FF">$amgtxt{'58'}</option>             <option value="808080">$amgtxt{'60'}</option> 
           <option value="FF00FF">$amgtxt{'59'}</option>             <option value="008000">$amgtxt{'61'}</option> 
           <option value="808080">$amgtxt{'60'}</option>             <option value="00FF00">$amgtxt{'62'}</option> 
           <option value="008000">$amgtxt{'61'}</option>             <option value="800000">$amgtxt{'63'}</option> 
           <option value="00FF00">$amgtxt{'62'}</option>             <option value="000080">$amgtxt{'64'}</option> 
           <option value="800000">$amgtxt{'63'}</option>             <option value="808000">$amgtxt{'65'}</option> 
           <option value="000080">$amgtxt{'64'}</option>             <option value="800080">$amgtxt{'66'}</option> 
           <option value="808000">$amgtxt{'65'}</option>             <option value="FF0000">$amgtxt{'67'}</option> 
           <option value="800080">$amgtxt{'66'}</option>             <option value="C0C0C0">$amgtxt{'68'}</option> 
           <option value="FF0000">$amgtxt{'67'}</option>             <option value="008080">$amgtxt{'69'}</option> 
           <option value="C0C0C0">$amgtxt{'68'}</option>             <option value="FFFFFF">$amgtxt{'70'}</option> 
           <option value="008080">$amgtxt{'69'}</option>             <option value="FFFF00">$amgtxt{'71'}</option> 
           <option value="FFFFFF">$amgtxt{'70'}</option>             <option value="DEB887">$amgtxt{'75'}</option> 
           <option value="FFFF00">$amgtxt{'71'}</option>             <option value="FFD700">$amgtxt{'76'}</option> 
           <option value="DEB887">$amgtxt{'75'}</option>             <option value="FFA500">$amgtxt{'77'}</option> 
           <option value="FFD700">$amgtxt{'76'}</option>             <option value="A0522D">$amgtxt{'78'}</option> 
           <option value="FFA500">$amgtxt{'77'}</option>             <option value="87CEEB">$amgtxt{'79'}</option> 
           <option value="A0522D">$amgtxt{'78'}</option>             <option value="6A5ACD">$amgtxt{'80'}</option> 
           <option value="87CEEB">$amgtxt{'79'}</option>             <option value="4682B4">$amgtxt{'81'}</option> 
           <option value="6A5ACD">$amgtxt{'80'}</option>             <option value="9ACD32">$amgtxt{'82'}</option> 
           <option value="4682B4">$amgtxt{'81'}</option>             </select> &nbsp; 
           <option value="9ACD32">$amgtxt{'82'}</option>             <span id="grpcolor"~ 
           </select> &nbsp;       . ( $memstats[3] ne q{} ? qq* style="color: #$memstats[3];"* : q{} ) 
           <span id="grpcolor"~ . ($color ne '' ? qq* style="color: #$color;"* : '') . qq~><label for="color2"><b>$amgtxt{'08'}</b></label></span>      . qq~><label for="color2"><b>$amgtxt{'08'}</b></label></span>
           #<input type="text" name="color2" id="color2" size="6" value="$color" maxlength="6" onkeyup="viscolor(this.value);" /> &nbsp;            #<input type="text" name="color2" id="color2" size="6" value="$memstats[3]" maxlength="6" onkeyup="viscolor(this.value);" /> &nbsp;
           <img src="$imagesdir/palette1.gif" style="cursor: pointer" onclick="window.open('$scripturl?action=palette;task=templ', '', 'height=308,width=302,menubar=no,toolbar=no,scrollbars=no')" align="top" alt="" border="0" />            <img src="$admin_images/palette1.gif" style="cursor: pointer; vertical-align:top" onclick="window.open('$scripturl?action=palette;task=templ', '', 'height=308,width=302,menubar=no,toolbar=no,scrollbars=no')" alt="" />
       </td>        </td>
   </tr>~;    </tr>~;
   
   # Get color selected    # Get color selected
   $yymain =~ s/(<option value="$color")/$1 selected="selected"/;     $yymain =~ s/(<option value="$memstats[3]")/$1 selected="selected"/sm; 
   
   unless (exists $Group{$INFO{'group'}}) {    if ( !exists $Group{ $INFO{'group'} } ) {
       $yymain .= qq~         $yymain .= qq~<tr> 
   <tr>         <td class="windowbg"><label for="postindepend">$amgtxt{'39a'}</label></td> 
       <td class="windowbg"><label for="postindepend">$amgtxt{'39a'}</label></td>         <td class="windowbg2"> 
       <td class="windowbg2">             <input type="radio" name="postdepend" id="postindepend" value="No" $post2 class="windowbg2" style="border: 0; vertical-align: middle;" onclick="depend(this.value)" /> 
           <input type="radio" name="postdepend" id="postindepend" value="No" $post2 class="windowbg2" style="border: 0px; vertical-align: middle;" onclick="depend(this.value)" /><br />            <br />
           <label for="viewpublic"><b>$amgtxt{'42'}?</b>            <label for="viewpublic"><b>$amgtxt{'42'}?</b>
           <input type="checkbox" name="viewpublic" id="viewpublic" value="1"$pc$pd style="vertical-align: middle;" /> <br />$amgtxt{'43'}</label>            <input type="checkbox" name="viewpublic" id="viewpublic" value="1"$pc$pd style="vertical-align: middle;" /> <br />$amgtxt{'43'}</label>
           <input type="hidden" name="noposts" id="noposts" value="$noposts" />            <input type="hidden" name="noposts" id="noposts" value="$noposts" />
       </td>        </td>
   </tr><tr>    </tr><tr>
       <td class="windowbg"><label for="postdepend">$amgtxt{'39'}</label></td>        <td class="windowbg"><label for="postdepend">$amgtxt{'39'}</label></td>
       <td class="windowbg2">        <td class="windowbg2">
           <input type="radio" name="postdepend" id="postdepend" value="Yes" $post1 class="windowbg2" style="border: 0px; vertical-align: middle;" onclick="depend(this.value)" /><br />            <input type="radio" name="postdepend" id="postdepend" value="Yes" $post1 class="windowbg2" style="border: 0; vertical-align: middle;" onclick="depend(this.value)" />
           <label for="posts"><b>$amgtxt{'04'}</b></label> <input type="text" name="posts" id="posts" size="5" value="$posts"$pt style="vertical-align: middle;" />            <br />
       </td>             <label for="posts"><b>$amgtxt{'04'}</b></label> <input type="text" name="posts" id="posts" size="5" value="$posts"$pt style="vertical-align: middle;" /> 
   </tr>~;         </td> 
     </tr>~;
   } else {     } 
       $yymain .= qq~     else { 
   <tr>         $yymain .= qq~<tr> 
       <td class="windowbg"><label for="viewpublic"><b>$amgtxt{'42'}</b> <br /><b>$amgtxt{'43'}</b></label></td>        <td class="windowbg"><label for="viewpublic"><b>$amgtxt{'42'}</b> <br /><b>$amgtxt{'43'}</b></label></td>
       <td class="windowbg2">        <td class="windowbg2">
           <input type="checkbox" name="viewpublic" id="viewpublic" value="1"$pc$pd style="vertical-align: middle;" />            <input type="checkbox" name="viewpublic" id="viewpublic" value="1"$pc$pd style="vertical-align: middle;" />
       </td>        </td>
   </tr>~;    </tr>~;
   }    }
   
   if ($addmemgroup_enabled > 0) {    if ( $addmemgroup_enabled > 0 ) {
       if ($choosable || (!$choosable && $action ne 'editgroup1' && !$INFO{'group'})) {         if ( $choosable 
           $yymain .= qq~             || ( !$choosable && $action ne 'editgroup1' && !$INFO{'group'} ) ) 
   <tr>         { 
       <td class="windowbg"><label for="additional">$amgtxt{'83'}</label></td>             $yymain .= qq~<tr> 
       <td class="windowbg2">         <td class="windowbg"><label for="additional">$amgtxt{'83'}</label></td> 
           <input type="checkbox" name="additional" id="additional" value="1"$admg style="vertical-align: middle;" /> <br /><label for="additional">$amgtxt{'84'}</label>         <td class="windowbg2"> 
       </td>             <input type="checkbox" name="additional" id="additional" value="1"$admg style="vertical-align: middle;" /> <br /><label for="additional">$amgtxt{'84'}</label> 
   </tr>~;         </td> 
       }     </tr>~; 
   }        }
   unless ($INFO{'group'} eq "Administrator") {     } 
       $yymain .= qq~     if ( $INFO{'group'} ne 'Administrator' ) { 
</table>        $yymain .= qq~ 
     </table>
</div> </div>
  <div class="bordercolor rightboxdiv">
     <table class="border-space pad-cell" style="margin-bottom: .5em;">
         <colgroup>
             <col span="5" style="width: 20%" />
         </colgroup>
         <tr>
             <td class="titlebg" colspan="5">
                 $admin_img{'prefimg'} <b>$amgtxt{'44'}</b>
             </td>
         </tr><tr>
             <td class="catbg center"><label for="view"><span class="small">$amgtxt{'45'} $amgtxt{'46'}</span></label></td>
             <td class="catbg center"><label for="topics"><span class="small">$amgtxt{'45'} $amgtxt{'47'}</span></label></td>
             <td class="catbg center"><label for="reply"><span class="small">$amgtxt{'45'} $amgtxt{'48'}</span></label></td>
             <td class="catbg center"><label for="polls"><span class="small">$amgtxt{'45'} $amgtxt{'49'}</span></label></td>
             <td class="catbg center"><label for="attach"><span class="small">$amgtxt{'45'} $amgtxt{'50'}</span></label></td>
         </tr><tr>
             <td class="windowbg2 center"><span class="small"><input type="checkbox" name="view" id="view" value="1"$vc /></span></td>
             <td class="windowbg2 center"><span class="small"><input type="checkbox" name="topics" id="topics" value="1"$tc /></span></td>
             <td class="windowbg2 center"><span class="small"><input type="checkbox" name="reply" id="reply" value="1"$rc /></span></td>
             <td class="windowbg2 center"><span class="small"><input type="checkbox" name="polls" id="polls" value="1"$poc /></span></td>
             <td class="windowbg2 center"><span class="small"><input type="checkbox" name="attach" id="attach" value="1"$ac /></span></td>
         </tr>~;
     }
   
<br />    $yymain .= qq~ 
     </table>
<div class="bordercolor" style="padding: 0px; width: 99%; margin-left: 0px; margin-right: auto;">  </div> 
<table width="100%" cellspacing="1" cellpadding="4">  <div class="bordercolor rightboxdiv"> 
   <tr valign="middle">  <table class="border-space pad-cell" style="margin-bottom: .5em;"> 
       <td align="left" class="titlebg" colspan="5">     <tr> 
           <img src="$imagesdir/preferences.gif" alt="" border="0" /><b>$amgtxt{'44'}</b>         <th class="titlebg">$admin_img{'prefimg'} $admin_txt{'10'}</th> 
       </td>     </tr><tr> 
   </tr>         <td class="catbg center"> 
   <tr valign="middle">                 <input type="submit" value="$admin_txt{'10'}" class="button" /> 
       <td align="center" class="catbg" width="20%"><label for="view"><span class="small">$amgtxt{'45'} $amgtxt{'46'}</span></label></td>             </td> 
       <td align="center" class="catbg" width="20%"><label for="topics"><span class="small">$amgtxt{'45'} $amgtxt{'47'}</span></label></td>         </tr> 
       <td align="center" class="catbg" width="21%"><label for="reply"><span class="small">$amgtxt{'45'} $amgtxt{'48'}</span></label></td>     </table> 
       <td align="center" class="catbg" width="19%"><label for="polls"><span class="small">$amgtxt{'45'} $amgtxt{'49'}</span></label></td>  
       <td align="center" class="catbg" width="20%"><label for="attach"><span class="small">$amgtxt{'45'} $amgtxt{'50'}</span></label></td>  
   </tr>  
   <tr valign="middle">  
       <td align="center" class="windowbg2" width="20%"><span class="small"><input type="checkbox" name="view" id="view" value="1"$vc /></span></td>  
       <td align="center" class="windowbg2" width="20%"><span class="small"><input type="checkbox" name="topics" id="topics" value="1"$tc /></span></td>  
       <td align="center" class="windowbg2" width="21%"><span class="small"><input type="checkbox" name="reply" id="reply" value="1"$rc /></span></td>  
       <td align="center" class="windowbg2" width="19%"><span class="small"><input type="checkbox" name="polls" id="polls" value="1"$poc /></span></td>  
       <td align="center" class="windowbg2" width="20%"><span class="small"><input type="checkbox" name="attach" id="attach" value="1"$ac /></span></td>  
   </tr>~;  
   }  
   
   $yymain .= qq~  
   <tr valign="middle">  
       <td align="center" class="catbg" colspan="5">  
           <input type="submit" value="$admin_txt{'10'}" class="button" />  
       </td>  
   </tr>  
</table>  
</div> </div>
</form> </form>
   
<script type="text/javascript"> <script type="text/javascript">
<!--  
function viscolor(v) { function viscolor(v) {
   v = v.toUpperCase();    v = v.toUpperCase();
   v = v.replace(/[^A-F0-9]/g, '');    v = v.replace(/[^A-F0-9]/g, '');
   if (v) document.getElementById('grpcolor').style.color = '#' + v;    if (v) document.getElementById('grpcolor').style.color = '#' + v;
   else   document.getElementById('grpcolor').style.color = '#000000';    else   document.getElementById('grpcolor').style.color = '#000000';
   document.getElementById('color2').value = v;    document.getElementById('color2').value = v;
   j = 0;    j = 0;
   for (i = 0; i < document.getElementById('color').length; i++) {    for (i = 0; i < document.getElementById('color').length; i++) {
       if (document.getElementById('color').options[i].value == v) {        if (document.getElementById('color').options[i].value == v) {
               document.getElementById('color').options[i].selected = true;                document.getElementById('color').options[i].selected = true;
               j = 1; break;                j = 1; break;
           }            }
   }    }
   if (j == 0) document.getElementById('color').options[0].selected = true;    if (j === 0) document.getElementById('color').options[0].selected = true;
} }
   
function previewColor(color) { function previewColor(color) {
   color = color.replace(/#/, '');    color = color.replace(/\x23/, '');
   document.getElementById('color2').value = color;    document.getElementById('color2').value = color;
   viscolor(color);    viscolor(color);
} }
   
function stars(value) { function stars(value) {
   if (value == "other") document.getElementById('otherstar').disabled = false;    if (value == "other") document.getElementById('otherstar').disabled = false;
   else document.getElementById('otherstar').disabled = true;    else document.getElementById('otherstar').disabled = true;
} }
   
function showimage() { function showimage() {
   selected = document.groups.starsadmin.options[document.groups.starsadmin.selectedIndex].value;    selected = document.groups.starsadmin.options[document.groups.starsadmin.selectedIndex].value;
   otherurl = document.groups.otherstar.value;     useimg = (selected != "other") ? "$imagesdir/"+selected : "$imagesdir/blank.gif"; 
   useimg = (selected != "other") ? "$imagesdir/"+selected : ((otherurl != "") ? otherurl : "$imagesdir/blank.gif");     document.images.starpic.src=useimg; 
   document.images.starpic.src=useimg;     if (document.images.starpic.complete === false) { 
   if (document.images.starpic.complete == false) {         useimg = (selected != "other") ? "$defaultimagesdir/"+selected :  "$defaultimagesdir/blank.gif"; 
       useimg = (selected != "other") ? "$defaultimagesdir/"+selected : ((otherurl != "") ? otherurl : "$defaultimagesdir/blank.gif");         document.images.starpic.src=useimg; 
       document.images.starpic.src=useimg;     } 
   }  
} }
   
function depend(value) { function depend(value) {
   if (value == "Yes") {    if (value == "Yes") {
       document.getElementById('posts').disabled = false;        document.getElementById('posts').disabled = false;
       if (document.getElementById('posts').value == '') document.getElementById('posts').value = 0;        if (document.getElementById('posts').value === '') document.getElementById('posts').value = 0;
       document.getElementById('viewpublic').checked = true;        document.getElementById('viewpublic').checked = true;
       document.getElementById('viewpublic').disabled = true;        document.getElementById('viewpublic').disabled = true;
   } else{    } else{
       document.getElementById('posts').disabled = true;        document.getElementById('posts').disabled = true;
       document.getElementById('viewpublic').disabled = false;        document.getElementById('viewpublic').disabled = false;
   }    }
} }
//-->  
</script> </script>
   
~; ~;
   $yytitle     = $admin_txt{'8'};    $yytitle     = $admin_txt{'8'};
   $action_area = "modmemgr";     $action_area = 'modmemgr'; 
     AdminTemplate();
   &AdminTemplate;     return; 
} }
   
sub editAddGroup2 { sub editAddGroup2 {
   &is_admin_or_gmod;     is_admin_or_gmod(); 
   
   # Additional checks are: # Additional checks are:
   # If post independent -> post dependent, then need to kill off post independent # If post independent -> post dependent, then need to kill off post independent
   # If post dependent -> post independent, then need to kill off post dependent. # If post dependent -> post independent, then need to kill off post dependent.
   # If post dependent -> NEW post dependent, then need to kill off OLD post dependent. # If post dependent -> NEW post dependent, then need to kill off OLD post dependent.
   $newpostdep = 0;    $newpostdep = 0;
   
   if (!$FORM{'title'}) { &admin_fatal_error("no_group_name"); }    if ( !$FORM{'title'} ) { fatal_error('no_group_name'); }
   $name = $FORM{'title'};    $name = $FORM{'title'};
   
   $name =~ s~&amp;~&~g;     $name =~ s/\x27/&\x2339;/gxsm; 
   $name =~ s~'~&#39;~g;     $name =~ s/,/&\x2344;/gxsm; 
   $name =~ s~,~&#44;~g;     $name =~ s/\|/&\x23124;/gxsm; 
   $name =~ s~\|~&#124;~g;     $lcname = lc $name; 
   $lcname = lc($name);  
     if ( $FORM{'starsadmin'} eq 'other' ) {
   $star       = ($FORM{'starsadmin'} eq "other") ? $FORM{'otherstar'} : $FORM{'starsadmin'};         $cur_otherstar = $FORM{'cur_otherstar'}; 
   $color      = $FORM{'color2'} ne '' ? "#$FORM{'color2'}" : '';         if ( $FORM{'otherstar'} ne q{} ) { 
   $postdepend = $FORM{'postdepend'};             $star = UploadFile('otherstar', 'Templates/Forum/default', 'png jpg jpeg gif', '250', '0'); 
   if ($FORM{'posts'} !~ /\d+/ && $postdepend eq "Yes") { &admin_fatal_error("no_post_number"); }             if ( $cur_otherstar !~ /^(staradmin|stargmod|starfmod|starmod|starsilver|starblue|stargold).png$/ ) { 
   else { $posts = $FORM{'posts'} }                 unlink "$htmldir/Templates/Forum/default/$cur_otherstar"; 
   if ($postdepend eq "No") { $noposts = $FORM{'noposts'}; }            }
         }
   if ($FORM{'viewpublic'}) { $viewpublic = 0 }         else { 
   else { $viewpublic = 1 }             $star = $cur_otherstar; 
   $view   = $FORM{'view'}   || 0;         } 
   $topics = $FORM{'topics'} || 0;     } 
   $reply  = $FORM{'reply'}  || 0;     else { $star = $FORM{'starsadmin'}; } 
   $polls  = $FORM{'polls'}  || 0;     $color = $FORM{'color2'} ne q{} ? "#$FORM{'color2'}" : q{}; 
   $attach = $FORM{'attach'} || 0;     $postdepend = $FORM{'postdepend'}; 
   $additional = $FORM{'additional'} || 0;     if ( $FORM{'posts'} !~ /\d+/xsm && $postdepend eq 'Yes' ) { 
   $original = $FORM{'original'};         fatal_error('no_post_number'); 
     }
   # all the checks.     else { $posts = $FORM{'posts'} } 
   if ($original ne '') {     if ( $postdepend eq 'No' ) { $noposts = $FORM{'noposts'}; } 
       ($type, $element) = split(/\|/, $original);  
     if   ( $FORM{'viewpublic'} ) { $viewpublic = 0 }
       # Ignoring Administrative groups.     else                         { $viewpublic = 1 } 
       if ($element ne "") {     $view       = $FORM{'view'}       || 0; 
           if ($type eq "P") {     $topics     = $FORM{'topics'}     || 0; 
               if ($element != $posts || $postdepend eq "No") {     $reply      = $FORM{'reply'}      || 0; 
                   if ($iamgmod) { &admin_fatal_error("newpostdep_gmod"); }     $polls      = $FORM{'polls'}      || 0; 
     $attach     = $FORM{'attach'}     || 0;
                   delete $Post{$element};     $additional = $FORM{'additional'} || 0; 
                   $newpostdep = 1;     $original   = $FORM{'original'}; 
                   $noposts    = 1;  
                   foreach (sort { $a <=> $b } keys %NoPost) {     # all the checks. 
                       $noposts = $_ + 1;     if ( $original ne q{} ) { 
                   }         ( $type, $element ) = split /\|/xsm, $original; 
               }  
           } elsif ($type eq "NP") {         # Ignoring Administrative groups. 
               if ($element != $noposts || $postdepend eq "Yes") {        if ( $element ne q{} ) {
                   delete $NoPost{$element};             if ( $type eq 'P' ) { 
                   for ($i = 0; $i < @nopostorder; $i++) {                if ( $element != $posts || $postdepend eq 'No' ) {
                       if ($nopostorder[$i] == $element) {                     if ($iamgmod) { fatal_error('newpostdep_gmod'); } 
                           splice(@nopostorder,$i,1);  
                           last;                     delete $Post{$element}; 
                       }                     $newpostdep = 1; 
                   }                     $noposts    = 1; 
               }                     foreach ( sort { $a <=> $b } keys %NoPost ) { 
           }                         $noposts = $_ + 1; 
       }                    }
   }                }
             }
   if ((split(/\|/, $Group{$original}, 2))[0] ne $name) {            elsif ( $type eq 'NP' ) {
       if ($lcname eq lc((split(/\|/, $Group{'Administrator'}, 2))[0])) { &admin_fatal_error("double_group", $lcname); }                 if ( $element != $noposts || $postdepend eq 'Yes' ) { 
       if ($lcname eq lc((split(/\|/, $Group{'Global Moderator'}, 2))[0])) { &admin_fatal_error("double_group", $lcname); }                     delete $NoPost{$element}; 
       if ($lcname eq lc((split(/\|/, $Group{'Moderator'}, 2))[0])) { &admin_fatal_error("double_group", $lcname); }                     for my $i ( 0 .. ( @nopostorder - 1 ) ) { 
   }                         if ( $nopostorder[$i] == $element ) { 
                             splice @nopostorder, $i, 1;
   # Check Post Independent                             last; 
   foreach my $key (keys %NoPost) {                         } 
       if ($type eq "NP" && $key eq $element) { next; }                    }
       ($value, undef) = split(/\|/, $NoPost{$key}, 2);                 } 
       $lcvalue = lc($value);             } 
       if ($lcname eq $lcvalue) { &admin_fatal_error("double_group", $lcname); }        }
   }    }
   
   # Check Post Dependent     if ( ( split /\|/xsm, $Group{$original}, 2 )[0] ne $name ) { 
   foreach my $key (keys %Post) {         if ( $lcname eq lc( ( split /\|/xsm, $Group{'Administrator'}, 2 )[0] ) ) 
       if ($type eq "P" && $key eq $element) { next; }         { 
       ($value, undef) = split(/\|/, $Post{$key}, 2);             fatal_error( 'double_group', $lcname ); 
       $lcvalue = lc($value);         } 
       if ($lcname eq $lcvalue) { &admin_fatal_error("double_group", $lcname); }         if ( 
   }             $lcname eq lc( ( split /\|/xsm, $Group{'Global Moderator'}, 2 )[0] ) 
           )
   if ($FORM{'numstars'} !~ /\A[0-9]+\Z/) { $FORM{'numstars'} = 0; }         { 
   # Now, we must deliberate on what type of thing this group is, and add/readd(when editing) it.             fatal_error( 'double_group', $lcname ); 
   # First, using original variable, we check to see it's not a perma-group.         } 
   ($type, $element) = split(/\|/, $original);         if ( 
   if ($element eq "" && $original ne "") {             $lcname eq lc( ( split /\|/xsm, $Group{'Mid Moderator'}, 2 )[0] ) 
       # We have a perma-group! $type is now equal to the perma group or key for the hash.           ) 
       # add in code to actually set the line.         { 
       $Group{"$type"} = "$name|$FORM{'numstars'}|$star|$color|$viewpublic|$view|$topics|$reply|$polls|$attach|$additional";             fatal_error( 'double_group', $lcname ); 
   } else {         } 
       # post dependent group.         if ( $lcname eq lc( ( split /\|/xsm, $Group{'Moderator'}, 2 )[0] ) ) { 
       if ($postdepend eq "Yes") {             fatal_error( 'double_group', $lcname ); 
           foreach my $key (keys %Post) {         } 
               if ($posts == $key && ($FORM{'origin'} eq "editgroup1" || $original ne "P|$posts")) {     } 
                   &admin_fatal_error("double_count","($posts)");  
               }     # Check Post Independent 
           }     foreach my $key ( keys %NoPost ) { 
         if ( $type eq 'NP' && $key eq $element ) { next; }
           if ($iamgmod) { &admin_fatal_error("newpostdep_gmod"); }         ( $value, undef ) = split /\|/xsm, $NoPost{$key}, 2; 
         $lcvalue = lc $value;
           $Post{$posts} = "$name|$FORM{'numstars'}|$star|$color|0|$view|$topics|$reply|$polls|$attach|$additional";         if ( $lcname eq $lcvalue ) { 
           $newpostdep = 1;             fatal_error( 'double_group', $lcname ); 
         }
       # no post group     } 
       } else {  
           $NoPost{$noposts} = "$name|$FORM{'numstars'}|$star|$color|$viewpublic|$view|$topics|$reply|$polls|$attach|$additional";     # Check Post Dependent 
           my $isinorder;     foreach my $key ( keys %Post ) { 
           for ($i = 0; $i < @nopostorder; $i++) {         if ( $type eq 'P' && $key eq $element ) { next; } 
               if ($NoPost{$nopostorder[$i]} && $nopostorder[$i] == $noposts) {         ( $value, undef ) = split /\|/xsm, $Post{$key}, 2; 
                   $isinorder = 1; last;         $lcvalue = lc $value; 
               }         if ( $lcname eq $lcvalue ) { 
           }             fatal_error( 'double_group', $lcname ); 
           if (!$isinorder) { push(@nopostorder, $noposts); }        }
       }    }
   }  
     if ( $FORM{'numstars'} !~ /\A[0-9]+\Z/xsm ) { $FORM{'numstars'} = 0; }
   require "$admindir/NewSettings.pl";  
   &SaveSettingsTo('Settings.pl'); # save @nopostorder, %Group, %NoPost and %Post  # Now, we must deliberate on what type of thing this group is, and add/read(when editing) it. 
  # First, using original variable, we check to see it's not a perma-group.
   if ($newpostdep) {     ( $type, $element ) = split /\|/xsm, $original; 
       $yySetLocation = qq~$adminurl?action=rebuildmemlist;actiononfinish=modmemgr~;     if ( $element eq q{} && $original ne q{} ) { 
   } else {  
       $yySetLocation = qq~$adminurl?action=modmemgr~;  # We have a perma-group! $type is now equal to the perma group or key for the hash. 
   }  # add in code to actually set the line. 
   &redirectexit;         $Group{"$type"} = 
  "$name|$FORM{'numstars'}|$star|$color|$viewpublic|$view|$topics|$reply|$polls|$attach|$additional";
     }
     else {
   
         # post dependent group.
         if ( $postdepend eq 'Yes' ) {
             foreach my $key ( keys %Post ) {
                 if (
                     $posts == $key
                     && (   $FORM{'origin'} eq 'editgroup1' 
                         || $original ne "P|$posts" )
                   )
                 {
                     fatal_error( 'double_count', "($posts)" );
                 }
             }
   
             if ($iamgmod) { fatal_error('newpostdep_gmod'); }
   
             $Post{$posts} =
  "$name|$FORM{'numstars'}|$star|$color|0|$view|$topics|$reply|$polls|$attach|$additional";
             $newpostdep = 1;
   
             # no post group
         }
         else {
             $NoPost{$noposts} =
  "$name|$FORM{'numstars'}|$star|$color|$viewpublic|$view|$topics|$reply|$polls|$attach|$additional";
             my $isinorder;
             for my $i ( 0 .. ( @nopostorder - 1 ) ) {
                 if (   $NoPost{ $nopostorder[$i] }
                     && $nopostorder[$i] == $noposts )
                 {
                     $isinorder = 1;
                     last;
                 }
             }
             if ( !$isinorder ) { push @nopostorder, $noposts; }
         }
     }
   
     require Admin::NewSettings;
     SaveSettingsTo('Settings.pm');
   
     # save @nopostorder, %Group, %NoPost and %Post
   
     if ($newpostdep) {
         $yySetLocation =
           qq~$adminurl?action=rebuildmemlist;actiononfinish=modmemgr~;
     }
     else {
         $yySetLocation = qq~$adminurl?action=modmemgr~;
     }
     redirectexit();
     return;
} }
   
sub permImage { sub permImage {
   my $viewperms, $topicperms, $replyperms, $pollperms, $attachperms;     my @x = @_; 
     my $viewperms =
       ( $x[0] != 1 ) ? qq~<img src="$imagesdir/open.gif" alt="" />~ : q{};
     my $topicperms =
       ( $x[1] != 1 ) ? qq~<img src="$imagesdir/new_thread.gif" alt="" />~ : q{};
     my $replyperms =
       ( $x[2] != 1 ) ? qq~<img src="$imagesdir/reply.gif" alt="" />~ : q{};
     my $pollperms =
       ( $x[3] != 1 ) ? qq~<img src="$imagesdir/poll_create.gif" alt="" />~ : q{};
     my $attachperms =
       ( $x[4] != 1 ) ? qq~<img src="$imagesdir/paperclip.gif" alt="" />~ : q{};
   
   $viewperms   = ($_[0] != 1) ? "<img src=\"$imagesdir/open.gif\" />"        : "";     return "$viewperms $topicperms $replyperms $pollperms $attachperms"; 
   $topicperms  = ($_[1] != 1) ? "<img src=\"$imagesdir/new_thread.gif\" />"  : "";  
   $replyperms  = ($_[2] != 1) ? "<img src=\"$imagesdir/reply.gif\" />"       : "";  
   $pollperms   = ($_[3] != 1) ? "<img src=\"$imagesdir/poll_create.gif\" />" : "";  
   $attachperms = ($_[4] != 1) ? "<img src=\"$imagesdir/paperclip.gif\" />"   : "";  
   
   return "$viewperms $topicperms $replyperms $pollperms $attachperms";  
} }
   
sub deleteGroup { sub deleteGroup {
   if ($INFO{'group'}) {    if ( $INFO{'group'} ) {
       ($type, $element) = split(/\|/, $INFO{'group'});         ( $type, $element ) = split /\|/xsm, $INFO{'group'}; 
       if ($element ne "") {        if ( $element ne q{} ) {
           if ($type eq "P") {            if ( $type eq 'P' ) {
               delete $Post{$element};                delete $Post{$element};
           } elsif ($type eq "NP") {             } 
               delete $NoPost{$element};             elsif ( $type eq 'NP' ) { 
               &KillModeratorGroup($element);                 delete $NoPost{$element}; 
           }                 KillModeratorGroup($element); 
       }            }
   } else {         } 
       &admin_fatal_error("no_info");     } 
   }     else { 
         fatal_error('no_info');
   my @new_nopostorder;     } 
   foreach (@nopostorder) {  
       if ($NoPost{$_}) { push(@new_nopostorder, $_); }     my @new_nopostorder; 
   }     foreach (@nopostorder) { 
   @nopostorder = @new_nopostorder;         if ( $NoPost{$_} ) { push @new_nopostorder, $_; } 
     }
   require "$admindir/NewSettings.pl";     @nopostorder = @new_nopostorder; 
   &SaveSettingsTo('Settings.pl'); # save @nopostorder, %Group, %NoPost and %Post  
     require Admin::NewSettings;
   $yySetLocation = qq~$adminurl?action=rebuildmemlist;actiononfinish=modmemgr~;     SaveSettingsTo('Settings.pm'); 
   &redirectexit;  
     # save @nopostorder, %Group, %NoPost and %Post
   
     $yySetLocation =
       qq~$adminurl?action=rebuildmemlist;actiononfinish=modmemgr~;
     redirectexit();
     return;
} }
   
sub reorderGroups { sub reorderGroups {
   $selsize = 0;    $selsize = 0;
   foreach (@nopostorder) {    foreach (@nopostorder) {
       if ($NoPost{$_}) {        if ( $NoPost{$_} ) {
           ($title, undef) = split(/\|/, $NoPost{$_}, 2);             ( $title, undef ) = split /\|/xsm, $NoPost{$_}, 2; 
           if ($_ eq $INFO{"thegroup"}) {            if ( $_ eq $INFO{'thegroup'} ) {
               $orderopt .= qq~<option value="$_" selected="selected">$title</option>~;                 $orderopt .= 
           } else {                   qq~<option value="$_" selected="selected">$title</option>~; 
               $orderopt .= qq~<option value="$_">$title</option>~;             } 
           }             else { 
           $selsize++;                 $orderopt .= qq~<option value="$_">$title</option>~; 
       }            }
   }             $selsize++; 
         }
   $rowspan = $#nopostorder + 2;     } 
   $yymain .= qq~  
<div class="bordercolor" style="padding: 0px; width: 75%; margin-left: auto; margin-right: auto;">     $rowspan = $#nopostorder + 2; 
<table width="100%" cellspacing="1" cellpadding="4">     $yymain .= qq~ 
   <tr valign="middle">  <div class="bordercolor rightboxdiv"> 
       <td align="left" class="titlebg" colspan="3">     <table class="border-space pad-cell"> 
           <img src="$imagesdir/guest.gif" alt="" border="0" />&nbsp;<b>$admintxt{'reordergroups2'}</b>         <colgroup> 
       </td>             <col span="2" style="width:33%" /> 
   </tr>             <col style="width:34%" /> 
   <tr valign="middle">         </colgroup> 
       <td align="center" class="catbg" width="33%"><b>$amgtxt{'03'}</b></td>         <tr> 
       <td align="center" class="catbg" width="33%"><b>$amgtxt{'19'}</b></td>             <td class="titlebg" colspan="3"> 
       <td align="center" class="windowbg" width="34%" rowspan="$rowspan">                 <img src="$imagesdir/guest.gif" alt="" />&nbsp;<b>$admintxt{'reordergroups2'}</b> 
           <form action="$adminurl?action=reordergroup2" method="post" name="groupsorder" style="display: inline; white-space: nowrap;">             </td> 
           <select name="ordergroups" class="small" size="$selsize" style="width: 130px;">         </tr><tr> 
               $orderopt             <td class="catbg center"><b>$amgtxt{'03'}</b></td> 
           </select><br />             <td class="catbg center"><b>$amgtxt{'19'}</b></td> 
           <input type="submit" value="$admin_txt{'739a'}" name="moveup" style="font-size: 11px; width: 65px;" class="button" /><input type="submit" value="$admin_txt{'739b'}" name="movedown" style="font-size: 11px; width: 65px;" class="button" />             <td class="windowbg center" rowspan="$rowspan"> 
           </form>                 <form action="$adminurl?action=reordergroup2" method="post" name="groupsorder" style="display: inline; white-space: nowrap;" accept-charset="$yymycharset"> 
       </td>                     <select name="ordergroups" class="small" size="$selsize" style="width: 130px;"> 
   </tr>~;                         $orderopt 
                     </select>
   foreach (@nopostorder) {                     <br /> 
       ($title, $stars, $starpic, $color, undef) = split(/\|/, $NoPost{$_}, 5);                     <input type="submit" value="$admin_txt{'739a'}" name="moveup" style="font-size: 11px; width: 65px;" class="button" /><input type="submit" value="$admin_txt{'739b'}" name="movedown" style="font-size: 11px; width: 65px;" class="button" /> 
       if (!$stars) { $stars = "0"; }                 </form> 
       $yymain .= qq~             </td> 
   <tr>         </tr>~; 
       <td align="left" class="windowbg2">~;  
     foreach (@nopostorder) {
       if ($color) { $yymain .= qq~<span style="color:$color"><b>$title</b></span>~; }         ( $title, $stars, $starpic, $color, undef ) = split /\|/xsm, 
       else { $yymain .= qq~<b>$title</b>~; }           $NoPost{$_}, 5; 
       $yymain .= qq~         if ( !$stars ) { $stars = '0'; } 
       </td>         $yymain .= q~<tr> 
       <td align="center" class="windowbg2">~;            <td class="windowbg2">~;
   
       for (1..$stars) { $yymain .= qq~<img src="$imagesdir/$starpic" />~; }         if ($color) { 
             $yymain .= qq~<span style="color:$color"><b>$title</b></span>~;
       $yymain .= qq~         } 
       </td>         else { $yymain .= qq~<b>$title</b>~; } 
   </tr>~;         $yymain .= q~ 
   }             </td> 
             <td class="windowbg2 center">~;
   $yymain .= qq~  
         for ( 1 .. $stars ) {
             $yymain .= qq~<img src="$imagesdir/$starpic" alt="" />~;
         }
   
         $yymain .= q~
             </td>
         </tr>~;
     }
   
</table>     $yymain .= q~ 
     </table>
</div>~; </div>~;
   
   $yytitle = $admintxt{'reordergroups'};    $yytitle     = $admintxt{'reordergroups'};
   $action_area = 'modmemgr';    $action_area = 'modmemgr';
   
   &AdminTemplate;     AdminTemplate(); 
     return;
} }
   
sub reorderGroups2 { sub reorderGroups2 {
   my $moveitem = $FORM{'ordergroups'};    my $moveitem = $FORM{'ordergroups'};
   
   if ($moveitem) {  
       for ($i = 0; $i < @nopostorder; $i++) {  
           if ($nopostorder[$i] == $moveitem &&  
               (($FORM{'moveup'}   && $i > 0             && $i <= $#nopostorder) ||  
                ($FORM{'movedown'} && $i < $#nopostorder && $i >= 0))) {  
               my $j = $FORM{'moveup'} ? $i - 1 : $i + 1;  
               $nopostorder[$i] = $nopostorder[$j];  
               $nopostorder[$j] = $moveitem;  
               last;  
           }  
       }  
   }  
   
   require "$admindir/NewSettings.pl";  
   &SaveSettingsTo('Settings.pl'); # save @nopostorder  
   
   $yySetLocation = qq~$adminurl?action=reordergroup;thegroup=$moveitem~;     if ($moveitem) { 
   &redirectexit;         for my $i ( 0 .. ( @nopostorder - 1 ) ) { 
             if (
                 $nopostorder[$i] == $moveitem
                 && (   ( $FORM{'moveup'} && $i > 0 && $i <= $#nopostorder )
                     || ( $FORM{'movedown'} && $i < $#nopostorder && $i >= 0 ) )
               )
             {
                 my $j = $FORM{'moveup'} ? $i - 1 : $i + 1;
                 $nopostorder[$i] = $nopostorder[$j];
                 $nopostorder[$j] = $moveitem;
                 last;
             }
         }
     }
   
     require Admin::NewSettings;
     SaveSettingsTo('Settings.pm');
   
     # save @nopostorder
   
     $yySetLocation = qq~$adminurl?action=reordergroup;thegroup=$moveitem~;
     redirectexit();
     return;
} }
   
1; 1;