vForums Support Banner



 

Welcome Guest! Please Login or Register
vForums Support :: Programming & Coding :: Code Requests & Support :: [F] Sub-boards brackets "[..]" - View Topic
Topic Rating: *****
Printable View
This topic was locked 15th May 08 at 10:20pm by Michael
Nick
Very Senior Member
*****

[Avatar]

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


pmwww
[F] Sub-boards brackets "[..]" (14th May 08 at 6:16pm UTC)
I need a code that will put [] before and after the sub board names that shows up on the parent board so like:

some board
Some boards Description
Sub-boards: [sub-board 1] [sub-board 2] [sub-board 3] etc.

If you need any more info, please say so.

Thanks,
Darkmage
Michael
Moderator
*****

[Avatar]
Recoding the future

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

Additional Groups:
Coding Team
***


Reputation: 58%  


pmtwittervForum
Re: Sub-boards brackets "[..]" (15th May 08 at 3:15pm UTC)
Try this! {Grin}

<script>
/*Sub-Boards in []
Created By Wrighty*/

var x = get('font','tag');

for(c=0; c<x.length; c++){
    if(x[c].innerHTML.match(/Sub-Boards/) && x[c].size == '1'){
        var f = x[c].getElementsByTagName('a');
        for(y=0;y<f.length;y++){
            f[y].parentNode.insertBefore(document.createTextNode('['), f[y]);
            f[y].parentNode.insertBefore(document.createTextNode(']'), f[y].nextSibling);
        }
    }
}
</script>


Global Footer
Nick
Very Senior Member
*****

[Avatar]

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


pmwww
Re: Sub-boards brackets "[..]" (15th May 08 at 8:05pm UTC)
Thanks, is there anyway they can be white, and it be separated with "-" instead of the "," Thanks.
Michael
Moderator
*****

[Avatar]
Recoding the future

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

Additional Groups:
Coding Team
***


Reputation: 58%  


pmtwittervForum
Re: Sub-boards brackets "[..]" (15th May 08 at 8:16pm UTC)
Try this! {Grin}

<script>
/*Sub-Boards in []
Created By Wrighty*/

var x = get('font','tag');

for(c=0; c<x.length; c++){
    if(x[c].innerHTML.match(/Sub-Boards/) && x[c].size == '1'){
        x[c].innerHTML = x[c].innerHTML.replace(/,/,' -');
        var f = x[c].getElementsByTagName('a');
        var l = document.createElement('font');
        l.appendChild(document.createTextNode('['));
        l.color = '#FFFFFF';
        var r = document.createElement('font');
        r.appendChild(document.createTextNode(']'));
        r.color = '#FFFFFF';
        for(y=0;y<f.length;y++){
            f[y].parentNode.insertBefore(l.cloneNode(true), f[y]);
            f[y].parentNode.insertBefore(r.cloneNode(true), f[y].nextSibling);
        }
    }
}
</script>


Global Footer
Nick
Very Senior Member
*****

[Avatar]

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


pmwww
Re: Sub-boards brackets "[..]" (15th May 08 at 9:51pm UTC)
Thanks it works ^_^
Michael
Moderator
*****

[Avatar]
Recoding the future

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

Additional Groups:
Coding Team
***


Reputation: 58%  


pmtwittervForum
Re: Sub-boards brackets "[..]" (15th May 08 at 10:20pm UTC)
{Grin}

Welcome
 Printable View

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