The forum of the forums
Welcome to the Official Support Forum of Forumotion!

To take full advantage of everything offered by our forum, please log in if you are already a member, or join our community if you've not yet.



Create a free forum like this one.

Certain Text Change

View previous topic View next topic Go down

Certain Text Change

Post by Ace 1 on June 9th 2015, 1: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
Forumember

Male Posts : 689
Reputation : 38
Language : my css ready java yo scripts boi
Location : Druid Hill Park smoking indo

http://genocideclan.forumotion.com

Back to top Go down

Re: Certain Text Change

Post by Ace 1 on June 11th 2015, 3:42 am

Bump

Ace 1
Forumember

Male Posts : 689
Reputation : 38
Language : my css ready java yo scripts boi
Location : Druid Hill Park smoking indo

http://genocideclan.forumotion.com

Back to top Go down

Re: Certain Text Change

Post by Ace 1 on June 12th 2015, 12:20 pm

Bumpperrr

Ace 1
Forumember

Male Posts : 689
Reputation : 38
Language : my css ready java yo scripts boi
Location : Druid Hill Park smoking indo

http://genocideclan.forumotion.com

Back to top Go down

Re: Certain Text Change

Post by Niko on June 12th 2015, 12:57 pm

Hello,

is your forum version #phpBB3 ?

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
Hyperactive

Male Posts : 2163
Reputation : 93
Language : English, French, Italian, Spanish, Latin

https://www.translationscloud.com/?utm_source=forumotion&utm

Back to top Go down

Re: Certain Text Change

Post by Ace 1 on June 12th 2015, 1: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
Forumember

Male Posts : 689
Reputation : 38
Language : my css ready java yo scripts boi
Location : Druid Hill Park smoking indo

http://genocideclan.forumotion.com

Back to top Go down

Re: Certain Text Change

Post by Niko on June 13th 2015, 1: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
Hyperactive

Male Posts : 2163
Reputation : 93
Language : English, French, Italian, Spanish, Latin

https://www.translationscloud.com/?utm_source=forumotion&utm

Back to top Go down

Re: Certain Text Change

Post by Ace 1 on June 13th 2015, 2: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
Forumember

Male Posts : 689
Reputation : 38
Language : my css ready java yo scripts boi
Location : Druid Hill Park smoking indo

http://genocideclan.forumotion.com

Back to top Go down

Re: Certain Text Change

Post by Niko on June 14th 2015, 4: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
Hyperactive

Male Posts : 2163
Reputation : 93
Language : English, French, Italian, Spanish, Latin

https://www.translationscloud.com/?utm_source=forumotion&utm

Back to top Go down

Re: Certain Text Change

Post by Ace 1 on June 19th 2015, 9:13 pm

@Niko thanks so much!!

Ace 1
Forumember

Male Posts : 689
Reputation : 38
Language : my css ready java yo scripts boi
Location : Druid Hill Park smoking indo

http://genocideclan.forumotion.com

Back to top Go down

View previous topic View next topic Back to top


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