Board Logo

 Username:    Password:    Stay logged in: Welcome Guest. Please Login or Register.  May 24th, 2017, 8:19pm


« Previous Topic | Next Topic »
Pages: 1  Notify Send Topic Print
 thread  Author  Topic: Text Replacement.  (Read 10199 times)
Jason
Conforums founding member
Executive Member


member is offline

Avatar

Hello!


PM

Gender: Male
Posts: 5804
xx Text Replacement.
« Thread started on: May 26th, 2003, 7:03pm »

Text Replacement

It is possible to replace any word(s) on your board with another. This is done by using the code below.

Just change the highlighted bits.

<script language="javascript">
<!--
if (location.href.indexOf("=headersfooters") != -1 ) { }
else
{
var range = document.body.createTextRange();
range.collapse(true);
while (range.findText("Word(s) to search for")) {
range.text="Word(s) to replace with";
range.collapse(false);
}
}
-->
</script>

For this code to work correctly, it should really be put in the footers of all the boards you want to make changes too, not just the main footer.

Note: This code is not cross browser compatible.
« Last Edit: Oct 30th, 2004, 4:39pm by Dave » User IP Logged

User Image
Richard
Executive Member


member is offline

Avatar




Homepage PM


Posts: 11512
xx Re: Text Replacement.
« Reply #1 on: Nov 21st, 2004, 8:14pm »

To Replace multiple different text with multipe different images:

<script>
<!--
function TitleSwitch(text,image){
var TD = document.getElementsByTagName("TD");
for(i=0;i<TD.length;i++){
if(TD[i].className.match(/^(title|cat)bg$/) && TD[i].innerHTML.match(text)){
TD[i].innerHTML=TD[i].innerHTML.replace(text,"<img src='"+image+"'/>")
}}}

TitleSwitch("TEXT","IMAGE URL")
TitleSwitch("TEXT","IMAGE URL")
TitleSwitch("TEXT","IMAGE URL")
//add more if neded

//-->
</script>

Place this script in your footer where needed.
« Last Edit: Nov 21st, 2004, 8:15pm by Richard » User IP Logged

Pages: 1  Notify Send Topic Print
« Previous Topic | Next Topic »

Back To Top
Donate $6.99 for 50,000 Ad-Free Pageviews!

| |

This forum powered for FREE by Conforums ©
Sign up for your own Free Message Board today!
Terms of Service | Privacy Policy | Conforums Support | Parental Controls