Previous Thread
Next Thread
Print Thread
Rate Thread
Joined: Oct 2002
Posts: 105
E
ehm Offline OP
Journeyman
OP Offline
Journeyman
E
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
B
bud Offline
Newbie
Offline
Newbie
B
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
E
ehm Offline OP
Journeyman
OP Offline
Journeyman
E
Joined: Oct 2002
Posts: 105
Work like a charme
THank you Bud.
So far no bad words

Joined: May 2002
Posts: 153
B
Member
Offline
Member
B
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
B
bud Offline
Newbie
Offline
Newbie
B
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
badfrog
badfrog
somewhere on the coast of Maine
Posts: 94
Joined: March 2007
Forum Statistics
Forums63
Topics37,551
Posts293,823
Members13,839
Most Online5,166
Sep 15th, 2019
Today's Statistics
Currently Online 307
Topics Created 0
Posts Made 0
Users Online 0
Birthdays 26
Top Posters
AllenAyres 21,079
JoshPet 10,369
LK 7,394
Lord Dexter 6,708
Gizmo 5,808
Greg Hard 4,625
Top Posters(30 Days)
isaac 5
Top Likes Received
isaac 64
Gizmo 12
Brett 7
WebGuy 2
Top Likes Received (30 Days)
isaac 3
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2020 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 7.7.6
(Snapshot build 20201121.dev)
Responsive Width:

PHP: 5.4.45 Page Time: 0.038s Queries: 25 (0.013s) Memory: 3.2880 MB (Peak: 3.6362 MB) Data Comp: Zlib Server Time: 2020-11-26 23:57:59 UTC
Valid HTML 5 and Valid CSS