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.

Certain Text Change

2 posters

Go down

Certain Text Change Empty Certain Text Change

Post by Ace 1 Tue Jun 09, 2015 12:58 pm

Can anyone tell me how to make a word (or words) with a certain string in them to be changed to another string and have a color added to them?

For example, FM has the "You have 1 new message" but with a yellowish color. My forum does not do this. Another thing is that I want to change any word with "Plazma Burst 2" to "Plazma Burst 2"

CSS and JavaScript are preferred.

Thanks.
Ace 1
Ace 1
Helper
Helper

Male Posts : 843
Reputation : 64
Language : English - French?
Location : Druid Hill Park

https://help.forumotion.com

Back to top Go down

Certain Text Change Empty Re: Certain Text Change

Post by Ace 1 Thu Jun 11, 2015 2:42 am

Bump
Ace 1
Ace 1
Helper
Helper

Male Posts : 843
Reputation : 64
Language : English - French?
Location : Druid Hill Park

https://help.forumotion.com

Back to top Go down

Certain Text Change Empty Re: Certain Text Change

Post by Ace 1 Fri Jun 12, 2015 11:20 am

Bumpperrr
Ace 1
Ace 1
Helper
Helper

Male Posts : 843
Reputation : 64
Language : English - French?
Location : Druid Hill Park

https://help.forumotion.com

Back to top Go down

Certain Text Change Empty Re: Certain Text Change

Post by Niko Fri Jun 12, 2015 11:57 am

Hello,

is your forum version #phpBB3 Certain Text Change Fmphpb11 ?

and for
Another thing is that I want to change any word with "Plazma Burst 2" to "Plazma Burst 2"
did you try the censor function of forumotion? thumleft

Have a nice day! :rose:
Niko
Niko
Helper
Helper

Male Posts : 3317
Reputation : 255
Language : English, Italian, French
Location : Italy

https://www.fmcodes.net/

Back to top Go down

Certain Text Change Empty Re: Certain Text Change

Post by Ace 1 Fri Jun 12, 2015 12:19 pm

@Niko phpbb3.

And Ik about the censor function I was talking about changing the text and the color of the word.
Ace 1
Ace 1
Helper
Helper

Male Posts : 843
Reputation : 64
Language : English - French?
Location : Druid Hill Park

https://help.forumotion.com

Back to top Go down

Certain Text Change Empty Re: Certain Text Change

Post by Niko Sat Jun 13, 2015 12:40 pm

Maybe you could try setting the "replacing-world" as:
Code:
[color=red]text[/color]

or
Code:
<font color="red">text</font>

I think one of this two solution could work well Wink
Niko
Niko
Helper
Helper

Male Posts : 3317
Reputation : 255
Language : English, Italian, French
Location : Italy

https://www.fmcodes.net/

Back to top Go down

Certain Text Change Empty Re: Certain Text Change

Post by Ace 1 Sat Jun 13, 2015 1:37 pm

XD @Niko I meant that any word on the forum with a certain string automatically turns to another color or string.

Example: I type "Hey Forumotion".

Result: "Hey ForuMotion"


CSS and JavaScript are preferred.
Ace 1
Ace 1
Helper
Helper

Male Posts : 843
Reputation : 64
Language : English - French?
Location : Druid Hill Park

https://help.forumotion.com

Back to top Go down

Certain Text Change Empty Re: Certain Text Change

Post by Niko Sun Jun 14, 2015 3:03 pm

@Ace 1 did you try with the censor function before? Wink

anyway, if you prefer #javascript this code should work:
Code:
$(document).ready(function() {
  var c = document.getElementsByClassName('content clearfix');
    for (i=0; i<c.length; i++) {   
      c[i].innerHTML = c[i].innerHTML.replace(/twitter/g,'<b><font color="#00a5cd">twitter</font></b>');    }});

for example this code replace the word twitter with twitter Wink
Exclamation the only limitation is that the first element (here: twitter) must be replace with the exact word or sentence you want to replace. This way, twitter will be replace, but not Twitter

Niko
Niko
Helper
Helper

Male Posts : 3317
Reputation : 255
Language : English, Italian, French
Location : Italy

https://www.fmcodes.net/

Back to top Go down

Certain Text Change Empty Re: Certain Text Change

Post by Ace 1 Fri Jun 19, 2015 8:13 pm

@Niko thanks so much!!
Ace 1
Ace 1
Helper
Helper

Male Posts : 843
Reputation : 64
Language : English - French?
Location : Druid Hill Park

https://help.forumotion.com

Back to top Go down

Back to top

- Similar topics

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