vForums Support > Programming & Coding :: Database of Codes/Hacks/Mods :: > Add Website Link to Right of Menu

Add Website Link to Right of Menu - Posted By Michael (wrighty) on 31st Dec 07 at 5:33pm
This will add a website (or other) button to the right hand side of the menu. Very similar to the current one here at vFS

Global Header

Code:
 
  1. <script>
  2. /*Add website link to menu - support.virtualforums.co.uk*/
  3.  
  4. var image = "http://virtualforums.co.uk/images/homepage/website.gif"; //Image to Show
  5. var link = "http://support.virtualforums.co.uk"; //Website Link
  6.  
  7. //DO NOT EDIT BELOW HERE!
  8. var m = document.getElementById('welcome_table').getElementsByTagName('td').item(2);
  9. m.innerHTML = "<div style='float:left'>"+m.innerHTML+"</div><div style='float: right'><a href='"+link+"'><img src='"+image+"'></a></div>";
  10. </script>
 

Re: Add Website Link to Right of Menu - Posted By BizzD (0wnzer) on 31st Dec 07 at 5:41pm
Thanks Wrighty {Smile}

Re: Add Website Link to Right of Menu - Posted By Michael (wrighty) on 31st Dec 07 at 5:42pm
No problem! {Smile}

Re: Add Website Link to Right of Menu - Posted By Entold (silentassassin) on 25th Apr 08 at 1:07am
Very Nice

Re: Add Website Link to Right of Menu - Posted By Alex Bailey (system) on 18th Jul 08 at 9:27pm
shows up when not logged in, doesnt show when logged in

Link: www.bailey.vforums.co.uk

Re: Add Website Link to Right of Menu - Posted By RuhRoe (mezorro) on 2nd Nov 08 at 8:47pm
Can someone help? http://gamerspark.vforums.co.uk/

It shows up on the right but when I click it it just goes to the same place. I hover over it and the link goes to http://gamerspark.vforums.co.uk/www.thegamerspark.com

Anything I'm doing wrong?

Code:
 
  1. <script>
  2. /*Add website link to menu - support.virtualforums.co.uk*/
  3.  
  4. var image = "http://virtualforums.co.uk/images/homepage/website.gif"; //Image to Show
  5. var link = "www.thegamerspark.com"; //Website Link
  6.  
  7. //DO NOT EDIT BELOW HERE!
  8. var m = document.getElementById('welcome_table').getElementsByTagName('td').item(2);
  9. m.innerHTML = "<div style='float:left'>"+m.innerHTML+"</div><div style='float: right'><a href='"+link+"'><img src='"+image+"'></a></div>";
  10. </script>
 

Re: Add Website Link to Right of Menu - Posted By Nick (nickb) on 2nd Nov 08 at 9:19pm
change the www. to html:// see if that changes it.

Re: Add Website Link to Right of Menu - Posted By RuhRoe (mezorro) on 3rd Nov 08 at 1:37am
Pretty sure you mean http:// ?

I switched it to that and it worked {Grin} Thanks

Re: Add Website Link to Right of Menu - Posted By Nick (nickb) on 3rd Nov 08 at 1:44am
 
Pretty sure you mean http:// ?

I switched it to that and it worked {Grin} Thanks


Yep I did. XD to much HTML running through my brain at the time, still is. I was even thinking about it at the staff meeting at my place of work.

I knew it had to be http:// that's the most common thing now, I hardly ever see www. unless its http://www.

edit:
Whoa {Shocked} slashes are adding them selves into stuff

Re: Add Website Link to Right of Menu - Posted By ashkir (ashkir) on 17th May 09 at 7:49pm
Preview: http://wimg.co.uk/BDvtKF.gif