vForums Support Banner



 

Welcome Guest! Please Login or Register
vForums Support :: Programming & Coding :: Code Requests & Support :: [F] Some codes are not working right - View Topic
Topic Rating: *****
Printable View
This topic was locked 19th Jul 08 at 11:26pm by Michael
Graystorm
New Member
*

Posts: 20
Status: Offline
Joined:  
Reputation: 0%  


pm
[F] Some codes are not working right (18th Jul 08 at 3:47am UTC)
Some of my codes aren't functioning correctly.
Image

The top one is how it looks and the bottom one is how it should look. No green or dividers whatsoever.

Admin>Headers/Footers>Global>Default

Global Header

<script type="text/javascript">
/*Remove :: from Menu
Created By Wrighty
support.virtualforums.co.uk*/

var menu = document.getElementById('welcome_table').getElementsByTagName('td')[2];

menu.innerHTML = menu.innerHTML.replace(new RegExp(" ::","g"),'');
</script>

Global footer

<script>
/*Reorder Menu
Coded By Wrighty
Do Not: Rip, Repost or Claim*/

var a = [
["0","1","2","3","5","6","4"], //Admin Menu
["0","1","2","3","4","5"], //Member Menu
["0","1","2","3","4"] //Guest Menu
];

var l = [];
var x = get('menu_buttons','id').firstChild.firstChild.firstChild.firstChild;
var y = '';
for(a=0;a<x.firstChild.getElementsByTagName('a').length;a++){
l.push('<a href="'+x.firstChild.getElementsByTagName('a')[a]+'">'+x.getElementsByTagName('a')[a].innerHTML+'</a>');
}
var n = (x.innerHTML.match(/\/admin\//))? a[0] : (vf_username == 'guest')? a[2] : a[1];
for(a=0; a<n.length-1;a++){
y += l[n[a]]
y += ' :: ';
}
y += l[n[n.length-1]];
x.firstChild.innerHTML = y
</script>




One of these codes is supposed to put the Admin button at the end of the menu buttons line and the other is to remove the :: between menu buttons.

How do I get it so that there is no green and it looks like the bottom half of the image above?

Thanks for the help. {Smile}

~Graystorm
Marc
vChat Developer
*****
I <3 Rossy

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

Additional Groups:
Coding Team
***


Reputation: 40%  


pmwww
Re: Some codes are not working right (18th Jul 08 at 3:51am UTC)
Could we get a link to your forum please?

rroll.to— Shorten a link, rickroll your friends.
Graystorm
New Member
*

Posts: 20
Status: Offline
Joined:  
Reputation: 0%  


pm
Re: Some codes are not working right (18th Jul 08 at 3:53am UTC)
Sure.

http://warriorsotn.vforums.co.uk/
Marc
vChat Developer
*****
I <3 Rossy

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

Additional Groups:
Coding Team
***


Reputation: 40%  


pmwww
Re: Some codes are not working right (18th Jul 08 at 3:58am UTC)
I cannot see either code placed in your global headers. Are you sure you placed i t in the proper header for the proper skin? {Smile}

rroll.to— Shorten a link, rickroll your friends.
Graystorm
New Member
*

Posts: 20
Status: Offline
Joined:  
Reputation: 0%  


pm
Re: Some codes are not working right (18th Jul 08 at 3:59am UTC)
I'm pretty sure I did. Let me redo it.

Edit-

I reinstalled the codes but the one that goes in the footer isn't working. Also, why is the logout icons below all the others?

Is there a code to make it so there is no green showing around the banner and the menu buttons?
Marc
vChat Developer
*****
I <3 Rossy

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

Additional Groups:
Coding Team
***


Reputation: 40%  


pmwww
Re: Some codes are not working right (18th Jul 08 at 4:40am UTC)
Both codes can go in the global header. {Wink}

As for removing the spaces, replace the first code with this:

<script type="text/javascript">
/*Remove :: from Menu
Created By Wrighty
support.virtualforums.co.uk*/

var menu = document.getElementById('welcome_table').getElementsByTagName('td')[2];

menu.innerHTML = menu.innerHTML.replace(new RegExp(" :: ","g"),'');
</script>

rroll.to— Shorten a link, rickroll your friends.
Graystorm
New Member
*

Posts: 20
Status: Offline
Joined:  
Reputation: 0%  


pm
Re: Some codes are not working right (18th Jul 08 at 1:21pm UTC)
It worked! Thanks so much! {Smile} Is there a code that can remove all the green around the banner and menu buttons?

-Edit-

I managed to get the admin button moved to the end of the menu button line* but it has :: and a space between it and the logout button.

This is the link

* by using these two codes

Code:
 
  1. <script>
  2. /*Remove Select Menu Buttons
  3. Created By Wrighty
  4. Do Not: Rip, Repost or Claim*/
  5.  
  6. var y = get('menu_buttons','id');
  7. var x = y.getElementsByTagName('a');
  8. for(a=0;a<x.length;a++){
  9.     if(x[a].getElementsByTagName('img')[0].alt.match(/(admin)/i)){
  10.         x[a].style.display = 'none';
  11.     }
  12. }
  13. </script>
  14.  
 


Code:
 
  1. <script>
  2. /*Add Menu Buttons
  3. Created By Wrighty
  4. support.virtualforums.co.uk*/
  5.  
  6. var menu = get('menu_buttons','id').getElementsByTagName('font')[0];
  7.  
  8. function do_menu(img_src,link){
  9. menu.innerHTML+= " :: <a href="+link+"><img src='"+img_src+"' border=0></a>";
  10. }
  11.  
  12. do_menu('http://i248.photobucket.com/albums/gg184/amberstreak/wotnbanerli_08.gif','http://warriorsotn.vforums.co.uk/action/admin/');
  13. </script>
  14.  
 


One to remove the admin button and one to put it back, this time at the end.

If someone could help me get the This Code to work, that would be great because I think the button reorder code might make it so there isn't any :: and space between the admin button.
Marc
vChat Developer
*****
I <3 Rossy

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

Additional Groups:
Coding Team
***


Reputation: 40%  


pmwww
Re: Some codes are not working right (18th Jul 08 at 4:12pm UTC)
Switch the second code with this:

Code:
 
  1. <script>
  2. /*Add Menu Buttons
  3. Created By Wrighty
  4. support.virtualforums.co.uk*/
  5.  
  6. var menu = get('menu_buttons','id').getElementsByTagName('font')[0];
  7.  
  8. function do_menu(img_src,link){
  9. menu.innerHTML+= "<a href="+link+"><img src='"+img_src+"' border=0></a>";
  10. }
  11.  
  12. do_menu('http://i248.photobucket.com/albums/gg184/amberstreak/wotnbanerli_08.gif','http://warriorsotn.vforums.co.uk/action/admin/');
  13. </script>
 


Then put this in your global headers to remove the spacing:

Code:
 
  1. <style type="text/css">
  2. <!--
  3. #menu_buttons{
  4. height: 53px;
  5. }
  6. //-->
  7. </style>
 


And finally, in your admin panel, under "Modify Skin", change the forum width from 780 down to 720. {Smile}

rroll.to— Shorten a link, rickroll your friends.
Graystorm
New Member
*

Posts: 20
Status: Offline
Joined:  
Reputation: 0%  


pm
Re: Some codes are not working right (18th Jul 08 at 5:03pm UTC)
Yay! The codes worked!

The one problem is that now the admin button is on the bottom again and there is still a little space around the menu buttons.

EDIT:

I just realized, the admin button is available to guests and members. I am now using the menu reorder.
Michael
Moderator
*****

[Avatar]
Recoding the future

Posts: 4,043
Status: Offline
Gender: Male
Location: UK
Joined:  

Additional Groups:
Coding Team
***


Reputation: 58%  


pmtwittervForum
Re: Some codes are not working right (19th Jul 08 at 7:31pm UTC)
I can't see the admin panel link for guests! {Unsure}
Graystorm
New Member
*

Posts: 20
Status: Offline
Joined:  
Reputation: 0%  


pm
Re: Some codes are not working right (19th Jul 08 at 11:24pm UTC)
I removed the code. Actually, can you lock this post? I'm going to request a coded skin for my website.
Michael
Moderator
*****

[Avatar]
Recoding the future

Posts: 4,043
Status: Offline
Gender: Male
Location: UK
Joined:  

Additional Groups:
Coding Team
***


Reputation: 58%  


pmtwittervForum
Re: Some codes are not working right (19th Jul 08 at 11:26pm UTC)
Ok {Smile}
 Printable View

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