The forum of the forums
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Replacing words

2 posters

Go down

Solved Replacing words

Post by Hert Sat 24 Jan - 21:59

Hello,

There has been something I would like to try, but sadly I'm not that familiar with Javascript - but I know I have to use that.
What I would like to try is to replace words: for example, I don't want people to place the word dog on my forum so I want it to be replaced with cat. They can however still type it in the quick reply option, but I want it to somehow swap the word dog for the word cat in the post that will eventually show up on the forum.

I do know I have to do something like this:
Code:

function myFunction() {
    var str = document.getElementById("demo").innerHTML;
    var res = str.replace("dog", "cat");
    document.getElementById("demo").innerHTML = res;
}
I however need to give the post the right id and I do not know if that works if I try to do it in the template, so I was wondering if there is an option without giving anything an id?

Love & Rockets,
Hert.
Hert
Hert
Forumember

Posts : 81
Reputation : 3
Language : Dutch and English

http://afterthefall.actieforum.com/

Back to top Go down

Solved Re: Replacing words

Post by Ange Tuteur Sat 24 Jan - 22:18

Hi @Hert,

Like a censor, correct ? You can censor words here :
Administration Panel > General > Word Censoring

Here you'll be able to manage words that you want to censor. You can check this topic for more information : https://help.forumotion.com/t1245-word-username-censorship
Ange Tuteur
Ange Tuteur
Forumaster

Male Posts : 13207
Reputation : 3000
Language : English & 日本語
Location : Pennsylvania

https://fmdesign.forumotion.com

Back to top Go down

Solved Re: Replacing words

Post by Hert Sat 24 Jan - 23:01

O that works just as good, hihi ~

Well that solved my problem, thank you!
Hert
Hert
Forumember

Posts : 81
Reputation : 3
Language : Dutch and English

http://afterthefall.actieforum.com/

Back to top Go down

Solved Re: Replacing words

Post by Ange Tuteur Sun 25 Jan - 1:11

You're welcome ! Mr. Green

Archived

Have a nice day. Smile
Ange Tuteur
Ange Tuteur
Forumaster

Male Posts : 13207
Reputation : 3000
Language : English & 日本語
Location : Pennsylvania

https://fmdesign.forumotion.com

Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum