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 January 24th 2015, 9:59 pm

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 January 24th 2015, 10:18 pm

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 January 24th 2015, 11:01 pm

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 January 25th 2015, 1:11 am

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