vForums Support :: Programming & Coding :: Database of Codes/Hacks/Mods :: Add Menu Buttons v2 - View Topic
| |
| Michael Moderator
Recoding the future Posts: 4,043 Status: Offline Gender: Male Location: UK Joined:
Additional Groups: Coding Team
pmvForum | Add Menu Buttons v2 (27th Apr 08 at 7:38pm UTC) | | 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 | |
| ashkir Full Member
Posts: 1,159 Status: Offline Gender: Male Location: Cali! Age: 35 Joined:
pmskypemsnyahoo | Re: Add Menu Buttons v2 (29th Jul 08 at 12:31am UTC) | | Wrighty, when I was doing the preview I have a suggestion to make. Change the .<a href to :: <a href
:] | |
| dog199200 Guest | Re: Add Menu Buttons v2 (15th Oct 08 at 5:10am UTC) | | 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: - <script>
- /*Add Menu Buttons
- Created By Wrighty
- support.virtualforums.co.uk*/
-
- var menu = document.getElementById('menu_buttons').getElementsByTagName('font')[0];
-
- function do_menu(a_text,link, guest){
- if(guest){
- menu.innerHTML+= " :: <a href="+link+">"+a_text+"</a>";
- }else{
- if(vf_username != 'guest'){
- menu.innerHTML+= " :: <a href="+link+">"+a_text+"</a>";
- }
- }
- }
- do_menu('LINK NAME','LINK URL', false);
- </script>
Global header | |
| Nick Very Senior Member
Posts: 3,012 Status: Offline Gender: Male Location: vForums Age: 34 Joined:
pmwww | Re: Add Menu Buttons v2 (12th Jan 10 at 10:56pm UTC) | | This does not work, would not add the website link to the nav menu. But I did use the V1 and that one works. | |
| |
| |
|