vForums Support Banner Image



 

Welcome Guest! Please Login or Register
vForums Support :: Programming & Coding :: Database of Codes/Hacks/Mods :: View Topic - Add Menu Buttons v2
Printable View
Wrighty
Very Senior Member
*****

[Avatar]

Posts: 3,269
Status: Offline
Gender: Male
Joined: 16th Dec 2007
Reputation: 16%  



Add Menu Buttons v2 (27th Apr 08 at 8:38pm)
This version allows you to choose whether the button is shown to guests or not.

just add 'false' to not show it to members.

<script>
/*Add Menu Buttons
Created By Wrighty
support.virtualforums.co.uk*/

var menu = get('menu_buttons','id').getElementsByTagName('font')[0];

function do_menu(img_src,link, guest){
    if(guest){
        menu.innerHTML+= " .<a href="+link+"><img src='" +img_src+"' border=0> </a>";
    }else{
        if(vf_username != 'guest'){
            menu.innerHTML+= " .<a href="+link+"><img src='"+img_src+"' border=0> </a>";
        }
    }
}
do_menu('IMAGE LINK','URL TO LINK TO', false);
</script>


Global header
Back to Top - Link to Post

Image
Ash.
Full Member
***

[Avatar]

Posts: 477
Status: Offline
Joined: 5th Jan 2008
Reputation: 11%  



Re: Add Menu Buttons v2 (29th Jul 08 at 1:31am)
Wrighty, when I was doing the preview I have a suggestion to make. Change the .<a href to :: <a href

:]
Back to Top - Link to Post

Image

Free Quality Avatars! Hotlinking Allowed!
Dwight
Senior Member
****

[Avatar]
I'm an evil turkey!!!

Posts: 994
Status: Offline
Gender: Male
Location: Behind You
Age: 16
Joined: 21st Jan 2008
Reputation: 5%  



Re: Add Menu Buttons v2 (15th Oct 08 at 6:10am)
I figured I would post this before it had been requested. This version of the code works the same way, by setting is guests can view the link or not, but this one is to be used with a text menu instead of an image menu.

Just like above, set it to false if you do not want guests to see the link, but true if you want everyone to see the link.

Code:
 
  1. <script>
  2. /*Add Menu Buttons
  3. Created By Wrighty
  4. support.virtualforums.co.uk*/
  5.  
  6. var menu = document.getElementById('menu_buttons').getElementsByTagName('font')[0];
  7.  
  8. function do_menu(a_text,link, guest){
  9.     if(guest){
  10.             menu.innerHTML+= " :: <a href="+link+">"+a_text+"</a>";
  11.     }else{
  12.         if(vf_username != 'guest'){
  13.             menu.innerHTML+= " :: <a href="+link+">"+a_text+"</a>";
  14.         }
  15.     }
  16. }
  17. do_menu('LINK NAME','LINK URL', false);
  18. </script>
 


Global header
Back to Top - Link to Post - Last edit: 15th Oct 08 at 6:10am by Dwight

Image
Image
Image
Printable View

All times are GMT+1 :: The current time is 6:06pm
Page generated in 0.5774 seconds
with 16 Database Queries and 6 cache files
This Forum is Powered By vForums
Create a Forum for Free