Page Index Toggle Pages: 1 ReplyAdd Poll Send Topic
Normal Topic GMod permissions (Read 881 times)
 
Paste Member Name in Quick Reply Box Dandello
Forum Administrator
YaBB Modder
*****
Offline


I love YaBB 2.7!

Posts: 2235
Location: The Land of YaBB
Joined: Feb 12th, 2014
Gender: Female
Mood: Annoyed
Zodiac sign: Virgo
GMod permissions
Feb 11th, 2015 at 1:13am
Mark & QuoteQuote  
Does not properly show which items are checked.

In Admin/AdminEdit.pm find
Code (Perl)
Select All
    fopen( MODACCESS, "$vardir/gmodsettings.txt" );
     @scriptlines = <MODACCESS>;
     fclose(MODACCESS);

     $startread = 0;
     $counter   = 0;
     foreach my $scriptline (@scriptlines) {
         chomp $scriptline;
         if ( substr( $scriptline, 0, 1 ) eq q{'} ) {
             $scriptline =~ s/newsettings\;page\=//xsm;
             if ( $scriptline =~ /\"(.*?)\"/sm ) {
                 $allow = $1;
             }
             if ( $scriptline =~ /\'(.*?)\'/sm ) {
                 $actionfound = $1;
             }
             push @actfound, $actionfound;
             push @allowed,  $allow;
             $counter++;
         }
     }
     @actfound = sort @actfound;
     $column  = int( $counter / 2 );
     $counter = 0;
     $aa      = 0;
     foreach my $actfound (@actfound) {
         $checked = q{};
         if ( $allowed[$aa] eq 'on' ) { $checked = ' checked="checked"'; }
         $dismenu .=
 qq~\n<input type="checkbox" name="$actfound" id="$actfound"$checked />&nbsp;<label for="$actfound"><img src="$admin_img{'question'}" alt="$reftxt{'1a'} $gmodprivexpl_txt{$actfound}" title="$reftxt{'1a'} $gmodprivexpl_txt{$actfound}" /> $actfound</label><br />~;
         $counter++;
         $aa++;
         if ( $counter > $column + 1 ) {
             $dismenu .= q~</td><td class="windowbg2 vtop">~;
             $counter = 0;
         }
     } 



Replace with:
Code (Perl)
Select All
    $counter   = 0;
     my %gmodset1 = ();
     for my $key ( keys %gmod_access ) {
         $value = $gmod_access{$key};
         $key =~ s/newsettings\;page\=//xsm;
         $gmodset1{$key} = $value;
         $counter++;
     }
     $column  = int( $counter / 2 );
     $counter = 0;
     my @gmodsrt = sort keys %gmodset1;
     for my $actfound (@gmodsrt) {
         $checked = q{};
         if ( $gmodset1{$actfound} eq 'on' ) { $checked = ' checked="checked"'; }
         $dismenu .=
 qq~\n<input type="checkbox" name="$actfound" id="$actfound"$checked />&nbsp;<label for="$actfound"><img src="$admin_img{'question'}" alt="$reftxt{'1a'} $gmodprivexpl_txt{$actfound}" title="$reftxt{'1a'} $gmodprivexpl_txt{$actfound}" /> $actfound</label><br />~;
         $counter++;
         if ( $counter > $column + 1 ) {
             $dismenu .= q~</td><td class="windowbg2 vtop">~;
             $counter = 0;
         }
     } 

  

Perfection is not possible. Excellence, however, is excellent.
Back to top
WWW  
IP Logged
 
Page Index Toggle Pages: 1
ReplyAdd Poll Send Topic
Bookmarks: del.icio.us Digg Facebook Google LinkedIn reddit Twitter Yahoo
GMod permissions

Please type the characters exactly as they appear in the image,
without the first 2 and last 2 characters.
The characters must be typed in the same order,
and they are case-sensitive.
Open Preview Preview

You can resize the textbox by dragging the right or bottom border.
Off Topic Comment Insert Spoiler
Insert Hyperlink Insert FTP Link Insert Image Insert E-mail Insert Media Insert Table Insert Table Row Insert Table Column Insert Horizontal Rule Insert Teletype Insert Code Insert Quote Edited Superscript Subscript Insert List /me - my name Insert Marquee Insert Timestamp No Parse
Bold Italicized Underline Insert Strikethrough Highlight
                       
Change Text Color
Insert Preformatted Text Left Align Centered Right Align
resize_wb
resize_hb







Max 5000 characters. Remaining characters:
Text size: %
More Smilies
View All Smilies
Collapse additional features Collapse/Expand additional features Smiley Wink Cheesy Grin Angry Sad Shocked Cool Huh Roll Eyes Tongue Embarrassed Lips Sealed Undecided Kiss Cry