vForums Support Banner



 

Welcome Guest! Please Login or Register
vForums Support :: Programming & Coding :: Code Requests & Support :: Change News name [support] - View Topic
Topic Rating: *****
Printable View
Nick
Very Senior Member
*****

[Avatar]

Posts: 3,013
Status: Offline
Gender: Male
Location: vForums
Age: 35
Joined:  
Reputation: 62%  


pmwww
Change News name [support] (7th Nov 08 at 12:57am UTC)
Code:
 
  1. <script type="text/javascript">
  2. <!--
  3. /*Change News name
  4. Please do not repost
  5. http://icodes.vforums.co.uk*/
  6.  
  7. var span = document.getElementsByTagName("span");
  8. for (e = 0 ; e < span.length ; e ++) {
  9. if (span[e].className.match(/forum_news/i)) {
  10. span[e].innerHTML = span[e].innerHTML.replace('News','Welcome to the {Forbidden}~{Reunion}');
  11. }
  12. }
  13.  
  14. //-->
  15. </script>
  16.  
 


I tried my best on this, but for some reason it wont work {Sad}

Can anyone possibly please fix this for me?

Thanks
Marc
vChat Developer
*****
I <3 Rossy

Posts: 3,388
Status: Offline
Gender: Male
Location: Ontario, Canada
Age: 33
Joined:  

Additional Groups:
Coding Team
***


Reputation: 40%  


pmwww
Re: Change News name [support] (7th Nov 08 at 8:00pm UTC)
The reason it's not working is because the news title bar is in a td, not a span element. Also, is no "forum_news" class. There is a "forum_news" ID, however, which you could use to get to the News title bar.

Something like this would work:

Code:
 
  1. <script type="text/javascript">
  2. <!--
  3. /*Change News name
  4. Please do not repost
  5. http://icodes.vforums.co.uk*/
  6.  
  7. var forum_news = document.getElementById("forum_news").parentNode.previousSibling;
  8.  
  9. forum_news.innerHTML = forum_news.innerHTML.replace('News','Welcome to the {Forbidden}~{Reunion}');
  10.  
  11. //-->
  12. </script>
 


{Smile}

rroll.to— Shorten a link, rickroll your friends.
Nick
Very Senior Member
*****

[Avatar]

Posts: 3,013
Status: Offline
Gender: Male
Location: vForums
Age: 35
Joined:  
Reputation: 62%  


pmwww
Re: Change News name [support] (7th Nov 08 at 9:46pm UTC)
Oh ok I see

But sorry Marc, It did not work {Unsure}
Marc
vChat Developer
*****
I <3 Rossy

Posts: 3,388
Status: Offline
Gender: Male
Location: Ontario, Canada
Age: 33
Joined:  

Additional Groups:
Coding Team
***


Reputation: 40%  


pmwww
Re: Change News name [support] (8th Nov 08 at 9:46pm UTC)
Are you putting it in your Main Footer? The news fader loads after the headers, so the code needs to be placed in the footer to work. {Wink}

rroll.to— Shorten a link, rickroll your friends.
Nick
Very Senior Member
*****

[Avatar]

Posts: 3,013
Status: Offline
Gender: Male
Location: vForums
Age: 35
Joined:  
Reputation: 62%  


pmwww
Re: Change News name [support] (8th Nov 08 at 10:27pm UTC)
Ohh ok, that explains it, I did not know that {Tongue Out}

It works.

If you want you can add it to the code database.
Nick
Very Senior Member
*****

[Avatar]

Posts: 3,013
Status: Offline
Gender: Male
Location: vForums
Age: 35
Joined:  
Reputation: 62%  


pmwww
Re: Change News name [support] (8th Nov 08 at 10:28pm UTC)
 
The reason it's not working is because the news title bar is in a td, not a span element. Also, is no "forum_news" class. There is a "forum_news" ID, however, which you could use to get to the News title bar.

Something like this would work:

Code:
 
  1. <script type="text/javascript">
  2. <!--
  3. /*Change News name
  4. Please do not repost
  5. http://icodes.vforums.co.uk
  6. http://support.vforums.co.uk*/
  7.  
  8. var forum_news = document.getElementById("forum_news").parentNode.previousSibling;
  9.  
  10. forum_news.innerHTML = forum_news.innerHTML.replace('News','Welcome to the {Forbidden}~{Reunion}');
  11.  
  12. //-->
  13. </script>
 


{Smile}
 Printable View

All times are GMT+0 :: The current time is 6:37pm
Page generated in 0.4659 seconds
This Forum is Powered By vForums (v2.4)
Create a Forum for Free | Find Forums