|
|
Joined: Oct 2002
Posts: 105
Journeyman
|
Journeyman
Joined: Oct 2002
Posts: 105 |
I realize today that 'Bad Words' script doesn't remove/change if one user decide to put a bad word on his/her signature (more "his" than "her" ...  ) There is any way to control it? I'm using 6.2
|
|
|
|
Joined: Jul 2002
Posts: 19
Newbie
|
Newbie
Joined: Jul 2002
Posts: 19 |
1. Make a copy of changebasic.php just in case 2. Add the following below line 238 of changebasic.php (the block of code that deals with getting rid of html in the signature) <br />// ---------------------------------------------------------------------<br />// Substitute any filters/badwords with the $config[censored] variable in the signature<br /> $words[0] = "";<br /> if ($config['censored']) {<br /> $badwords = @file("{$config['path']}/filters/badwords");<br /> if (!is_array($badwords)) {<br /> $badwords = @file ("{$config['phpurl']}/filters/badwords");<br /> }<br /> while (list($linenum,$line) = each($badwords) ) {<br /> $line = chop($line);<br /> if ( (preg_match("/^\r/",$line)) || (preg_match("/^\n/",$line)) ) {<br /> continue; <br /> }<br /> $islines = 1;<br /> $words[count($words)] = $line;<br /> // PHP4 ONLY<br /> // array_push ($words, $line);<br /> }<br /> if ($islines) {<br /> $badwords = join("|", $words);<br /> $badwords = preg_replace("/^\|/","",$badwords);<br /> <br /> $Signature = preg_replace("/\b($badwords)\b/i",$config['censored'],$Signature);<br /> }<br /> }<br />
|
|
|
|
Joined: Oct 2002
Posts: 105
Journeyman
|
Journeyman
Joined: Oct 2002
Posts: 105 |
Work like a charme  THank you Bud. So far no bad words 
|
|
|
|
Joined: May 2002
Posts: 153
Member
|
Member
Joined: May 2002
Posts: 153 |
That is great. No bad word in signatures.
Is there a way to have no bad word, filters, in private messages?
|
|
|
|
Joined: Jul 2002
Posts: 19
Newbie
|
Newbie
Joined: Jul 2002
Posts: 19 |
Sure. 1. Make a backup of sendmessage.php and mess_reply.php 2. Add the following code beneath line 123 in sendmessage.php 3. Add the same code beneath line 100 in mess_reply.php <br />// ---------------------------------------------------------------------<br />// Substitute any filters/badwords with the $config[censored] variable in the <br />// message or subject <br /> $words[0] = ""; <br /> if ($config['censored']) {<br /> $badwords = @file("{$config['path']}/filters/badwords");<br /> if (!is_array($badwords)) {<br /> $badwords = @file ("{$config['phpurl']}/filters/badwords");<br /> }<br /> while (list($linenum,$line) = each($badwords) ) {<br /> $line = chop($line);<br /> if ( (preg_match("/^\r/",$line)) || (preg_match("/^\n/",$line)) ) {<br /> continue;<br /> }<br /> $islines = 1;<br /> $words[count($words)] = $line;<br /> // PHP4 ONLY <br /> // array_push ($words, $line); <br /> }<br /> if ($islines) { <br /> $badwords = join("|", $words);<br /> $badwords = preg_replace("/^\|/","",$badwords);<br /> <br /> $Message = preg_replace("/\b($badwords)\b/i",$config['censored'],$Message);<br /> $Subject = preg_replace("/\b($badwords)\b/i",$config['censored'],$Subject);<br /> }<br /> }<br /> $FormBody = $Message;<br /> $FormSubject = $Subject;<br />
|
|
|
Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.
Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
|
|
Posts: 417
Joined: November 2001
|
|
Forums63
Topics37,575
Posts293,930
Members13,823
|
Most Online6,139 Sep 21st, 2024
|
|
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
|
|
|
|
|