April 19, 2024, 02:46:59 am
Welcome, Guest. Please login or register.

Login with username, password and session length
News: Welcome to Revolution X, where Coding meets Graphics.
 
  Home Help Search Arcade Affiliates Staff List Calendar Members Login Register  

[code] Change Info Center text

Pages: [1]   Go Down
  Print  
Author Topic: [code] Change Info Center text  (Read 726 times)
0 Members and 1 Guest are viewing this topic.
Nick
Member
Member
Offline Offline

Gender: Male
Posts: 48


View Profile
Badges: (View All)
« on: September 01, 2009, 04:30:02 pm »

***I just saw Vitality already had a code to do this, it was just a little different than this one. This thread can be closed

This is the first code I've posted on a forum... A simple code that changes the Info Center's Header text:
Code:
<script type="text/javascript">
//Nick -- http://revolutionX.smfforfree3.com
//Change NEW TEXT and yourboard using the instructions below
var newIC = "NEW TEXT";
var nICkrocks = document.getElementsByTagName("div");
var nICk = nICkrocks.length;
while(nICk--){
    if(nICkrocks[nICk].className == "catbg" && nICkrocks[nICk].innerHTML.match("yourboard - Info Center")){
        nICkrocks[nICk].innerHTML=nICkrocks[nICk].innerHTML.replace("yourboard - Info Center",newIC);
    }
}
</script>

Instructions:
NEW TEXT | Replace this with whatever you want the new text to be; you can use HTML for this, as long as you use single quotes instead of double Wink
yourboard | Replace this with your forum's name (not URL)

Works in FireFox and Safari. I'm on a Mac and can't check IE right now since I'm not home :p
« Last Edit: September 01, 2009, 04:45:30 pm by SyntaxBlitz » Report Spam   Logged

Share on Facebook Share on Twitter

Exilis
Optimistic & Creative
Global Moderator
Global Moderator
Offline Offline

Posts: 929


View Profile
Badges: (View All)
Tenth year Anniversary Linux User Combination
« Reply #1 on: September 01, 2009, 04:45:03 pm »

It's perfectly fine to have multiple of the same code, in case a certain one isn't working for whatever reason (maybe JS was updated and only one of the two codes works)

Just so long as they were both independently written (You didn't steal the base or whole code from someone else) it's fine Wink
Report Spam   Logged

Global Mod, (sort of) at your service.

http://twitter.com/timothyaveni

Nick
Member
Member
Offline Offline

Gender: Male
Posts: 48


View Profile
Badges: (View All)
« Reply #2 on: September 01, 2009, 04:51:32 pm »

It's perfectly fine to have multiple of the same code, in case a certain one isn't working for whatever reason (maybe JS was updated and only one of the two codes works)

Just so long as they were both independently written (You didn't steal the base or whole code from someone else) it's fine Wink

Oh ok.. As you can see, this isn't really similar to the other code:
Code:
<script>
//Change Info Center Text

newtext = "NEW_TEXT"

var a = document.getElementsByTagName('div')
for(i=0;i<a.length;i++){
if(a[i].className == "catbg" && a[i].innerHTML.match(/Info Center/i)){
a[i].innerHTML = a[i].innerHTML.replace("Info Center",newtext);
}}
</script>
Report Spam   Logged
Pages: [1]   Go Up
  Print  
 
Jump to:  

Powered by EzPortal
Bookmark this site! | Upgrade This Forum
SMF For Free - Create your own Forum

Powered by SMF | SMF © 2016, Simple Machines
Privacy Policy