Marc vChat Developer
I <3 Rossy
Posts: 3,388 Status: Offline Gender: Male Location: Ontario, Canada Age: 32 Joined:
Additional Groups: Coding Team
pmwww | Categorized Sub-Boards (22nd Mar 08 at 7:29pm UTC) | | Code: - <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];
-
- // Category Spacing
- var catSpace = 0; // Space you want between categories
-
- // 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>' + ((catSpace > 0) ? '<div style="height: '+catSpace+'px"></div>' : '');
- }
- sb.innerHTML = nt;
- }
- //-->
- </script>
The above goes in your board footer.
This goes in your board header:
Code: - <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 "database")
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. | |
rroll.to— Shorten a link, rickroll your friends. |
|