The following warnings occurred:
Warning [2] Use of undefined constant SAPI_NAME - assumed 'SAPI_NAME' (this will throw an Error in a future version of PHP) - Line: 3388 - File: inc/functions.php PHP 7.4.33-nmm7 (Linux)
File Line Function
/inc/functions.php 3388 errorHandler->error
/showthread.php 116 build_archive_link
Warning [2] Use of undefined constant IN_ARCHIVE - assumed 'IN_ARCHIVE' (this will throw an Error in a future version of PHP) - Line: 3331 - File: inc/functions.php PHP 7.4.33-nmm7 (Linux)
File Line Function
/inc/functions.php 3331 errorHandler->error
/inc/functions.php 3324 build_forum_breadcrumb
/showthread.php 195 build_forum_breadcrumb
Warning [2] Use of undefined constant IN_ARCHIVE - assumed 'IN_ARCHIVE' (this will throw an Error in a future version of PHP) - Line: 3331 - File: inc/functions.php PHP 7.4.33-nmm7 (Linux)
File Line Function
/inc/functions.php 3331 errorHandler->error
/showthread.php 195 build_forum_breadcrumb






Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
ANTI SWEARING?
Author Message
kn4tseb
Master
**

Posts: 392
Likes Given: 45
Likes Received: 10 in 10 posts
Joined: May 2014
Reputation: 0



Post: #7
RE: ANTI SWEARING?
Okey, once again i need some help, wasnt hard to replace a single forbidden word from a string, but the thing is how could i replace multiple words in a single function that returns the complete text but the matched badwords replaced by a newword?

Code:
[SPEECH spk_player]
ON=*
FORBIDDENWORDS <ARGS>

[FUNCTION FORBIDDENWORDS]
LOCAL.ARGS = <ARGS>
ARGS=BW1,BW2,BW3,BW4,BW5,BW6,BW7,BW8,BW9,BW10
FOR 0 <EVAL <ARGV>-1>
IF STRMATCH("*<ARGV[<LOCAL._FOR>]>*","*<LOCAL.ARGS>*")
LOCAL.BWORDS ++
LOCAL.BADWORDS .= <STRREPLACE <ARGV[<LOCAL._FOR>]>,%&@#&$,<LOCAL.ARGS>>
ENDIF
ENDFOR

This way will return N ARGS, depending on how many bad words were said and each <LOCAL.BADWORDS> will have one of the word replaced but the other ones wont be, as logic...

i havent been able to figure a way to replace every bad word in a single text.

thanks in advance
(This post was last modified: 10-01-2014 12:34 PM by kn4tseb.)
10-01-2014 12:32 PM
Find all posts by this user Like Post Quote this message in a reply
Post Reply 


Messages In This Thread
ANTI SWEARING? - kn4tseb - 09-30-2014, 01:28 PM
RE: ANTI SWEARING? - Extreme - 09-30-2014, 03:15 PM
RE: ANTI SWEARING? - kn4tseb - 10-01-2014, 03:02 AM
RE: ANTI SWEARING? - Extreme - 10-01-2014, 03:35 AM
RE: ANTI SWEARING? - darksun84 - 10-01-2014, 03:47 AM
RE: ANTI SWEARING? - kn4tseb - 10-01-2014, 04:51 AM
RE: ANTI SWEARING? - kn4tseb - 10-01-2014 12:32 PM
RE: ANTI SWEARING? - Extreme - 10-01-2014, 01:08 PM
RE: ANTI SWEARING? - kn4tseb - 10-01-2014, 02:13 PM

Forum Jump:


User(s) browsing this thread: 1 Guest(s)