Previous Thread
Next Thread
Print Thread
Rate Thread
Joined: Oct 2002
Posts: 105
ehm
Offline
Journeyman
Journeyman
Offline
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

Sponsored Links
Joined: Jul 2002
Posts: 19
bud Offline
Newbie
Newbie
Offline
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)

Code
<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
ehm
Offline
Journeyman
Journeyman
Offline
Joined: Oct 2002
Posts: 105
Work like a charme
THank you Bud.
So far no bad words

Joined: May 2002
Posts: 153
Member
Member
Offline
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
bud Offline
Newbie
Newbie
Offline
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

Code
<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 />

Sponsored Links

Link Copied to Clipboard
Donate Today!
Donate via PayPal

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.
Recommended Hosts
We have personally worked with and recommend the following Web Hosts:
Stable Host
bluehost
InterServer
Visit us on Facebook
Member Spotlight
Bill B
Bill B
Issaquah, WA
Posts: 87
Joined: December 2001
Forum Statistics
Forums63
Topics37,570
Posts293,915
Members13,848
Most Online5,166
Sep 15th, 2019
Today's Statistics
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
Top Posters
AllenAyres 21,079
JoshPet 10,369
LK 7,394
Lord Dexter 6,708
Gizmo 5,829
Greg Hard 4,625
Top Posters(30 Days)
Top Likes Received
isaac 81
Gizmo 20
Brett 7
WebGuy 2
Morgan 2
Top Likes Received (30 Days)
None yet
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2022 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Preview build 20221129)