Page Index Toggle Pages: 1 ReplyAdd Poll Send Topic
Normal Topic Censor Words (Read 1313 times)
 
Paste Member Name in Quick Reply Box pyragony54
Language
***
Offline


I Love YaBB!

Posts: 852
Location: Йошкар-Ола
Joined: May 25th, 2014
Gender: Male
Mood: Dead
Zodiac sign: Scorpio
Censor Words
Oct 18th, 2017 at 6:34pm
Mark & QuoteQuote  
Quote:
Nicht abgefangene Fehler :
Kann nicht öffnen CENSOR at /var/www/vhosts/yabbtest.de/cgi-bin/yabb2/Admin/AdminEdit.pm line 154.
  

if (idea == 'none') {use (manuals) && (Google | | search)}
if ($ answer == 0) {post (question)}
Back to top
 
IP Logged
 
Paste Member Name in Quick Reply Box Dandello
Forum Administrator
YaBB Modder
*****
Offline


I love YaBB 2.7!

Posts: 2234
Location: The Land of YaBB
Joined: Feb 12th, 2014
Gender: Female
Mood: Annoyed
Zodiac sign: Virgo
Re: Censor Words
Reply #1 - Oct 18th, 2017 at 7:50pm
Mark & QuoteQuote  
More bugs (and missing file checks) - I should have the fix up later today or tomorrow.
  

Perfection is not possible. Excellence, however, is excellent.
Back to top
WWW  
IP Logged
 
Paste Member Name in Quick Reply Box Dandello
Forum Administrator
YaBB Modder
*****
Offline


I love YaBB 2.7!

Posts: 2234
Location: The Land of YaBB
Joined: Feb 12th, 2014
Gender: Female
Mood: Annoyed
Zodiac sign: Virgo
Re: Censor Words
Reply #2 - Oct 18th, 2017 at 10:30pm
Mark & QuoteQuote  
Okay - a fix:
In Admin/AdminEdit.pm find
Code (Perl)
Select All
     my ( $censorlanguage, $line );
     if ( $FORM{'censorlanguage'} ) { $censorlanguage = $FORM{'censorlanguage'} }
     else                           { $censorlanguage = $lang; }
     opendir LNGDIR, $langdir;
     my @langitems = readdir LNGDIR;
     closedir LNGDIR;
     my $drawnldirs = q{};

     foreach my $fld ( sort { lc($a) cmp lc $b } @langitems ) {
         my $dispsel = q{};
         if ( -e "$langdir/$fld/Main.lng" ) {
             my $displang = $lngs{$fld};
             if ( $censorlanguage eq $fld ) {
                 $dispsel = ' selected="selected"';
             }
             $drawnldirs .= qq~<option value="$fld"$dispsel>$displang</option>~;
         }
     }

     our ($CENSOR);
     fopen( 'CENSOR', '<', "$langdir/$censorlanguage/censor.txt" )
       or croak "$croak{'open'} CENSOR";
     my @censored = <$CENSOR>;
     fclose('CENSOR') or croak "$croak{'close'} CENSOR";
     foreach my $i (@censored) {
         $i =~ tr/\r//d;
         $i =~ tr/\n//d;
     } 




replace with
Code (Perl)
Select All
     my $censorlanguage = $lang;
     my $line = q{};
     if ( $FORM{'censorlanguage'} ) { $censorlanguage = $FORM{'censorlanguage'} }
     opendir LNGDIR, $langdir;
     my @langitems = readdir LNGDIR;
     closedir LNGDIR;
     my $drawnldirs = q{};

     foreach my $fld ( sort { lc($a) cmp lc $b } @langitems ) {
         my $dispsel = q{};
         if ( -e "$langdir/$fld/Main.lng" ) {
             my $displang = $lngs{$fld};
             if ( $censorlanguage eq $fld ) {
                 $dispsel = ' selected="selected"';
             }
             $drawnldirs .= qq~<option value="$fld"$dispsel>$displang</option>~;
         }
     }

     my @censored = ();
     our ($CENSOR);
     if ( -e "$langdir/$censorlanguage/censor.txt") {
         fopen( 'CENSOR', '<', "$langdir/$censorlanguage/censor.txt" ) or croak "$croak{'open'} CENSOR";
         @censored = <$CENSOR>;
         fclose('CENSOR') or croak "$croak{'close'} CENSOR";
         chomp @censored;
         foreach my $i (@censored) {
             $i =~ s/[\n\r]//gxsm;
         }
     } 



This not only makes sure the file exists, but fixes a bug where it just wasn't looking in the right place.
  

Perfection is not possible. Excellence, however, is excellent.
Back to top
WWW  
IP Logged
 
Paste Member Name in Quick Reply Box pyragony54
Language
***
Offline


I Love YaBB!

Posts: 852
Location: Йошкар-Ола
Joined: May 25th, 2014
Gender: Male
Mood: Dead
Zodiac sign: Scorpio
Re: Censor Words
Reply #3 - Oct 20th, 2017 at 6:46am
Mark & QuoteQuote  
Works    Smiley
  

if (idea == 'none') {use (manuals) && (Google | | search)}
if ($ answer == 0) {post (question)}
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
ReplyAdd Poll Send Topic
Bookmarks: del.icio.us Digg Facebook Google LinkedIn reddit Twitter Yahoo
Censor Words

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