vForums Support Banner



 

Welcome Guest! Please Login or Register
vForums Support :: Programming & Coding :: Code Requests & Support :: [F] Seperating Select Sub-Boards - View Topic (Page 4 of 4)Page: « 2 3 4
Topic Rating: *****
Printable View
This topic was locked 16th Mar 08 at 7:50pm by Michael
Marc
vChat Developer
*****
I <3 Rossy

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

Additional Groups:
Coding Team
***


Reputation: 40%  


pmwww
Re: Seperating Select Sub-Boards (16th Mar 08 at 7:39pm UTC)
No problem. {Smile}

Sorry for the wait. {Sad}

rroll.to— Shorten a link, rickroll your friends.
dog199200
Guest
Re: Seperating Select Sub-Boards (16th Mar 08 at 7:40pm UTC)
no its no problem, but one more thing, is there a way to put a space between the categories?
Michael
Moderator
*****

[Avatar]
Recoding the future

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

Additional Groups:
Coding Team
***


Reputation: 58%  


pmtwittervForum
Re: Seperating Select Sub-Boards (16th Mar 08 at 7:45pm UTC)
 
<script type="text/javascript">
<!--
/*
Categorized Sub-Boards by Cr0w
Copyright 2008
Do not repost
*/
var sp = []; var brds = new Array(); var cts = new Array(); //Do Not Edit This Line

// Categories
cts[0] = "Category 1 Name";
cts[1] = "Category 2 Name";

// Board Organization
sp[0] = ["Board ID",category_id];
sp[1] = ["Board ID",category_id];
sp[2] = ["Board ID",category_id];
sp[3] = ["Board ID",category_id];

// No More Edits
if(!location.href.match(/topic/)){
var tr = get('tr','tag');
var td = get('td','tag');
var sb = get('subboards','id');
var n = 0;
var nt = "";
var ntree = get('nav_tree','id');

for(t=0;t<tr.length;t++){
if(tr[t].id.match(/^board_(.+?)$/i)){
for(i=0;i<sp.length;i++){
if(RegExp.$1==sp[i][0]){
brds[n] = tr[t].cloneNode(true);
n++;
}
}
tr[t].style.display = "none";
}
}
for(s=0;s<td.length;s++){
if(td[s].width=="70%" && td[s].innerHTML.match(/Sub\-Board Name/) && td[s+1].width=="22%"){
td[s].parentNode.parentNode.parentNode.parentNode.style.display = "none";
}
}

ntree.style.display = "none";
nt = '<table align="center" width="' + vf_width + '"><tr><td id="nav_tree">' + ntree.innerHTML + '</td></tr></table>';
for(x=0;x<cts.length;x++){
nt += '<table align="center" class="border" cellpadding="2" cellspacing="1" width="' + vf_width + '">';
nt += '<tr><td align="center" class="title1" colspan="5">' + cts[x] + '</td></tr>';
for(q=0;q<brds.length;q++){
if(sp[q][1]==x){
nt += '<tr>' + brds[q].innerHTML + '</tr>';
}
}
nt += '</table><br><br>';
}
sb.innerHTML = nt;
}
//-->
</script>


The above goes in your board footer.

This goes in your board header:

Code:
 
  1. <div id="subboards"></div>
 


Now, to edit:

cts[0] = "Category 1 Name"; - Self explanatory; the name for the first new category.

sp[0] = ["Board ID",category_id];

"Board ID" is the ID for the sub-board you're putting in a category. (Ex: This board's ID is "coderequest")

category_id is the ID number of the category your board is being put in. For example, if you have cts[0] = "Rawr", "Rawr" has an ID of 0.

Note: Make sure the "Board Organization" list is in the same order as your boards appear on the page, otherwise they will not get organized properly.



Try that! {Smile}
dog199200
Guest
Re: Seperating Select Sub-Boards (16th Mar 08 at 7:47pm UTC)
awesome, thats perfect, thx Wrighty for fixing it and thx Marc for coding it {Smile}
Michael
Moderator
*****

[Avatar]
Recoding the future

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

Additional Groups:
Coding Team
***


Reputation: 58%  


pmtwittervForum
Re: [f] Seperating Select Sub-Boards (16th Mar 08 at 7:50pm UTC)
Welcome! {Smile}

*locks*
 Printable View
Page: « 2 3 4

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