victory1
Full Member
Posts: 102
victory1 said 0 great things
|
Post by victory1 on Jan 20, 2010 0:51:53 GMT -8
I love how this code looks and what it does. I would like to make 1 change if possible: I know it Tabulates all your Categories and I like that but I would love to have a normal/Home tab were all the Categories are showing and that Tab should be the default tab.
<style type="text/css"> <!-- .tab { background-color: #AAAAAA; } .tabhovver { background-color: #123456; } .tabselect { background-color: #654321; } --> </style> <table class="bordercolor" id="tabTable" width="100%" cellPadding="0" cellSpacing="1" border="0"><tbody><tr id="tabtr"></tr></tbody></table> <script type="text/javascript"> <!-- /* Tabulate Main Page by Todge Copyright © 2009 Please keep this header intact */
if(location.href.match(/\.com\/(index.cgi(\?)?)?(action=home)?$/)) { //Edit below.....
var tabAmount = 3;
// Edit above.....
var tabCount = 0;
// Find catagories and create tabs..
function tabselect(clicky) { for(c=0; c<catCount; c++) { document.getElementById('cat'+c).className = 'tab'; } clicky.className = 'tabselect'; clicky.onmouseout = function(){this.className = 'tabselect';} var catName = document.getElementsByTagName('a'); for(l=0; l<catName.length; l++) { if(catName[l].name.match(/^cat(\d)+$/)) { catName[l].parentNode.parentNode.style.display = 'none'; }} catName = document.getElementsByName(clicky.id); for(l=0; l<catName.length; l++) { catName[l].parentNode.parentNode.style.display = ''; } return; }
if(typeof(fContent) != 'undefined') { fCheck = 'News'; } else { fCheck = 'Forum Name'; } var tabBoard = new Array(); var td = document.getElementsByTagName('td'); var tabs = document.getElementById('tabtr'); catCount = 0; for(t=0; t<td.length; t++) {
// Add tabs.. if(td[t].className.match(/^(news)?titlebg$/) && td[t].innerHTML.match(fCheck)) { var newTR = document.createElement('tr'); var newTD = document.createElement('td'); newTD.id = 'theTabs'; newTD.colSpan = '5'; newTD.style.padding = '0'; newTR.appendChild(newTD); td[t].parentNode.parentNode.insertBefore(newTR,td[t].parentNode); t++; }
if(td[t].className == 'catbg' && td[t].colSpan == '5' && td[t].align != 'right') { td[t].id = 'cat'+catCount; td[t].align = 'center'; td[t].colSpan = '1'; td[t].style.cursor = 'pointer'; td[t].className = 'tab'; td[t].onclick = function(){tabselect(this);} td[t].onmouseover = function(){ var mOut = this.className; this.className = 'tabhovver'; this.onmouseout = function(){this.className = mOut;}} td[t].parentNode.style.display = 'none'; var boardTR = td[t].parentNode.nextSibling; tabs.appendChild(td[t]);
tabCount++;
if(tabCount == tabAmount) { var newTabTr = document.createElement('TR'); tabs.parentNode.appendChild(newTabTr); tabs = newTabTr; tabCount = 0; }
// Find and tag boards.. while(boardTR.firstChild.className == 'windowbg') { boardTR.firstChild.innerHTML += '<a name="cat'+catCount+'"></a>'; if(boardTR == boardTR.parentNode.lastChild) { break; } boardTR = boardTR.nextSibling; } catCount ++; }}
// Set width of tags.. var setWidth = document.getElementById('tabTable').getElementsByTagName('td'); for(s=0; s<setWidth.length-1; s++) { setWidth[s].width = parseInt(100/setWidth.length)+'%'; } document.getElementById('theTabs').appendChild(document.getElementById('tabTable')); tabselect(document.getElementById('cat0')); } // --> </script>
|
|
|
Post by Wormopolis on Jan 20, 2010 15:25:34 GMT -8
Todge said he was cool with any mod I made so I will start on this soon. keep your eye on the "new" icon changing to "in progress"
|
|
victory1
Full Member
Posts: 102
victory1 said 0 great things
|
Post by victory1 on Jan 20, 2010 18:36:05 GMT -8
Thanks! I'm excited!
|
|
|
Post by Wormopolis on Jan 25, 2010 9:40:54 GMT -8
I started on this, but ran into the problem with the code itself not doing something so I need to play with it.
I might end up asking Todge for advice on it.. its a weird one.
|
|
|
Post by Wormopolis on Jan 26, 2010 1:02:11 GMT -8
code so far...
<script type="text/javascript"> <!-- /* Tabulate Main Page by Todge Copyright © 2009 Please keep this header intact */
if(true && location.href.match(/\.com\/(index.cgi(\?)?)?(action=home)?$/)) { //Edit below.....
var tabAmount = 3;
// Edit above.....
var tabCount = 0;
// Find catagories and create tabs..
function tabselect(clicky) { for(c=0; c<catCount; c++) { document.getElementById('cat'+c).className = 'tab'; } document.getElementById('catall').className = 'tab'; clicky.className = 'tabselect'; clicky.onmouseout = function(){this.className = 'tabselect';} var catName = document.getElementsByTagName('a'); for(l=0; l<catName.length; l++) { if(catName[l].name.match(/^cat(\d)+$/)) {
catName[l].parentNode.parentNode.style.display = (clicky.id=='catall' ? '' : 'none');
}} catName = document.getElementsByName(clicky.id); for(l=0; l<catName.length; l++) { catName[l].parentNode.parentNode.style.display = ''; } return; }
if(typeof(fContent) != 'undefined') { fCheck = 'News'; } else { fCheck = 'Forum Name'; } var tabBoard = new Array(); var td = document.getElementsByTagName('td'); var tabs = document.getElementById('tabtr'); catCount = 0; for(t=0; t<td.length; t++) {
// Add tabs.. if(td[t].className.match(/^(news)?titlebg$/) && td[t].innerHTML.match(fCheck)) { var newTR = document.createElement('tr'); var newTD = document.createElement('td'); newTD.id = 'theTabs'; newTD.colSpan = '5'; newTD.style.padding = '0'; newTR.appendChild(newTD); td[t].parentNode.parentNode.insertBefore(newTR,td[t].parentNode); t++; }
if(td[t].className == 'catbg' && td[t].colSpan == '5' && td[t].align != 'right') { td[t].id = 'cat'+catCount; td[t].align = 'center'; td[t].colSpan = '1'; td[t].style.cursor = 'pointer'; td[t].className = 'tab'; td[t].onclick = function(){tabselect(this);} td[t].onmouseover = function(){ var mOut = this.className; this.className = 'tabhovver'; this.onmouseout = function(){this.className = mOut;}} td[t].parentNode.style.display = 'none'; var boardTR = td[t].parentNode.nextSibling; tabs.appendChild(td[t]);
tabCount++;
if(tabCount == tabAmount) { var newTabTr = document.createElement('TR'); tabs.parentNode.appendChild(newTabTr); tabs = newTabTr; tabCount = 0; }
// Find and tag boards.. while(boardTR.firstChild.className == 'windowbg') { boardTR.firstChild.innerHTML += '<a name="cat'+catCount+'"></a>'; if(boardTR == boardTR.parentNode.lastChild) { break; } boardTR = boardTR.nextSibling; } catCount ++; }}
// Set width of tags.. var setWidth = document.getElementById('tabTable').getElementsByTagName('td'); for(s=0; s<setWidth.length-1; s++) { setWidth[s].width = parseInt(100/setWidth.length)+'%'; }
wormodef=document.getElementById('tabTable'); wormodef.insertRow(0); wormocell=wormodef.rows[0].insertCell(0); wormocell.colSpan=tabAmount; wormocell.id='catall'; wormocell.className='tab'; wormocell.style.height='18'; wormocell.align='center'; wormocell.innerHTML="<font class='cattext' size='2'><b>All Categories</b></font>"; wormocell.onclick = function(){tabselect(this);} wormocell.onmouseover = function(){ var mOut = this.className; this.className = 'tabhovver'; this.onmouseout = function(){this.className = mOut;}}
document.getElementById('theTabs').appendChild(document.getElementById('tabTable')); tabselect(document.getElementById('catall')); } // --> </script>
|
|
|
Post by Wormopolis on Jan 26, 2010 22:28:59 GMT -8
for some reason, the code acts differently when a guest is logged in then a member. I need a bit more time with it.
|
|
victory1
Full Member
Posts: 102
victory1 said 0 great things
|
Post by victory1 on Jan 27, 2010 11:01:14 GMT -8
I'm also using a category splitter scripts for overall design. I'm using the Advance with no images; just wanted the split and to remove the word "Forum Name" on top of each category (made it looked busy).
These 2 codes interfere with each other. When I tried your test code the tabs did not show up but it did erase the name of my 1st category and took out all the splits. Here is the splitter code I'm using and exactly how I'm using it.
<script type="text/Javascript"> // Advanced Category Splitter v3.0 by Chris // Do not redistribute without permission of the creator /* DO NOT EDIT THIS LINE */ var him = []; var fim = [];
// EDIT HERE var type = 3; // 1 = Original ACS type. Text in head image. // 2 = Head/Base images with cat name in normal row. // 3 = Head/Base images with cat name in the Forum Name row spot.
var markAsReadType = 1; // 0 = Mark as read button is not shown at all. // 1 = Mark as read button is in own row in final category. // 2 = Mark as read button is in the footer image underneath final category
him["URL"] = " URL OF HEAD IMAGE "; // URL of your header image. Required only if using type 1. him["height"] = 19; // Pixel height of your head image. Required if using a head image
fim["URL"] = "URL OF BASE IMAGE"; // URL of your footer image. Required only if markAsReadType is 2 fim["height"] = 19; // Pixel height of your base image. Required if using a footer image.
var forumName = 1; // 0 = Don't include the forum name row. Note: This can mess up the cell sizes. // 1 = Include the forum name row.
var defaultCats = [ // These are the category ids for the categoriess that will be hidden on the first time the page is viewed. Last one does not have a comma. // NO COMMA ON LAST LINE ];
var spacing = 10; // Space between the categories.
// DO NOT EDIT var aTB = document.getElementsByTagName("TABLE"); var isIE = (document.all?true:false);
if(!document.cookie.match(/debo=1/i)){ defaultCats.push("debo"); for(a=0;a<defaultCats.length;a++){ document.cookie = defaultCats[a]+"=1;expires="+(new Date()).toGMTString().replace(/\d{4}/,"2050"); } }
function hideShow(i){ var i2 = document.getElementById(i); i2.style.display = (i2.style.display=="none"?"":"none"); document.cookie = i+"="+(i2.style.display == ""?"0":"1")+";expires="+(new Date()).toGMTString().replace(/\d{4}/,"2050"); }
var div = document.createElement("DIV"); var sp = document.createElement("DIV"); sp.style.height = spacing;
if(location.href.match(/action=(change|home)/i) || !location.href.match(/(action|board)=/i)) document.write("<script type='text/Javascript' src='http://www.iycatacombs.com/codes/acsv3/normal"+type+".js'><\/script>"); </script>
|
|
|
Post by Wormopolis on Jan 27, 2010 13:09:55 GMT -8
well yeah.. you never said anything about OTHER codes running.
why would you need a cat splitter when the tabbing code hides all categories but one?
|
|
victory1
Full Member
Posts: 102
victory1 said 0 great things
|
Post by victory1 on Jan 27, 2010 15:14:22 GMT -8
The whole reason of asking for this tweak is because I wanted to add a main tab that would display all the boards. That tab would be the default. So yeah I would still like it to be visually nice.
|
|
|
Post by Wormopolis on Jan 27, 2010 15:37:08 GMT -8
well the bigger problem is that this isnt a tweak that can be further refined by another code. the tabulate code completely removes the category heads and uses them AS the tabs across the top.
the category headings are simply no longer there in order for a cat splitter to work off of. splitting the boards might be doable however.
|
|
victory1
Full Member
Posts: 102
victory1 said 0 great things
|
Post by victory1 on Jan 28, 2010 18:13:07 GMT -8
If it's complicated then I guess I can live with it. But I have a question, in my endless web searching I found a site with codes for tabs that are simply using HTML url links to redirect users; is that possible with proboards? Here is a link of the codes: www.dynamicdrive.com/dynamicindex1/ddtabmenu.htm
|
|
|
Post by Wormopolis on Jan 28, 2010 21:12:52 GMT -8
you can easily turn the tabs into links, but where do you want te links to go?
I almost have the Guest bug thing figured out.
|
|
victory1
Full Member
Posts: 102
victory1 said 0 great things
|
Post by victory1 on Jan 28, 2010 22:43:44 GMT -8
you can easily turn the tabs into links, but where do you want te links to go? I almost have the Guest bug thing figured out. I was trying to simplify things and still get what I'm looking for, tabs to move around my forum quickly by displaying just a particular category with it's child boards per tabs without messing my overall format. If that's possible then connected to the Welcome table (or right underneath it) where it says Welcome X, login/register and date. Before the Information Center. Which ever one you decide on works for me. Thanks again.
|
|