|
Post by tunescool on Jun 2, 2010 12:41:46 GMT -8
i know you spent ALOT of time working on my sub board display on my main page. i have it saved on my external hard drive in case i ever use it again. im gonna have to get rid of it and replace it with this drop down. the last cell with threads and posts takes away from the whole board width and im going to be using quotes as board descriptions. and i may add sub boards for the kiddies who want to have a forum for fashion or whatever. the one board with a quote has already changed height. i want it in the same position you put the sub boards before. take your time and do it whenever, ill live with the one boards misshapened height
<script type="text/javascript"> <!-- /* Sub-Boards Dropdown in Board Cell By Devin - Don't redistribute */
var subboardTitle = "Sub Forums"; var subboardMessage = 0; //0 to hide the default sub-board message, e.g. (2 sub-boards)
// No more editing var td = document.getElementsByTagName("TD"); var fj = document.getElementById("forumjump"); var sbm = /\s\(\d+\ssub-boards?\)/i; pb_bubble++;
var SBDD = { init: function(){ if(location.href.match(/action=home/i) || !location.href.match(/(action|board)=/i)){ this.makeEm(); this.fillEm(); } }, makeEm: function(){ for(i = 0; i < td.length; i++){ if(td[i].width == "8%" && td[i+1] && td[i+1].width == "66%"){ td[i+1].style.cursor = "default"; } if(td[i].width == "66%" && td[i].innerHTML.match(sbm)){ var sbHolder = document.createElement("DIV"); sbHolder.id = "sbh_" + td[i].getElementsByTagName("a")[0].href.split(/board=/i)[1]; if(subboardMessage == 0){ td[i].innerHTML = td[i].innerHTML.replace(sbm, ""); } td[i].appendChild(sbHolder); } } }, fillEm: function(){ for(i = 4; i < fj.options.length; i++){ if(!fj.options[i].text.match(/---\s/) && fj.options[i+1] && fj.options[i+1].text.match(/---\s/i)){ var cur_board = fj.options[i].value.split(/board=/i)[1]; if(document.getElementById("sbh_" + cur_board)){ var cur_sel = "<select onchange='if(this.options[this.selectedIndex].value) window.location = \"index.cgi?board=\" + this.options[this.selectedIndex].value + \"\"'><option>" + subboardTitle + "</option>"; while(fj.options[i+1].text.match(/---\s/i)){ i++; cur_sel += "<option value='" + fj.options[i].value.split(/board=/i)[1] + "'>" + fj.options[i].text.split("--- ")[1] + "</option>"; } document.getElementById("sbh_" + cur_board).innerHTML = cur_sel; } } } } }
SBDD.init();
//--> </script>
|
|
|
Post by Wormopolis on Jun 9, 2010 0:42:12 GMT -8
with all the extensive remodeling of the main page, this is gonna be a task. everything this code looks for has been manipulated so paramters will need to change.
to start, the sub-boards code you are currently using needs to be removed and this one put in its place. then we can see what has to be changed in this code for it to find where it needs to be. also this code requires "show sub-boards on main page" setting to be turned on in order to work.
|
|
|
Post by tunescool on Jun 9, 2010 1:47:14 GMT -8
ok i put it in
|
|
|
Post by Wormopolis on Jun 9, 2010 13:32:10 GMT -8
find this line:
td.appendChild(sbHolder);
replace with:
td.firstChild.rows[0].cells[1].appendChild(sbHolder);
thats just a shot in the dark... Im not 100% sure the innerHTML has been reformatted by that point.
|
|
|
Post by tunescool on Jun 9, 2010 13:49:03 GMT -8
changed it rite away, that was simple. the only thing is its got Sub Boards as the first thing in the drop down. can you get rid of that?
|
|
|
Post by Wormopolis on Jun 9, 2010 14:37:02 GMT -8
just have it blank?
|
|
|
Post by tunescool on Jun 9, 2010 14:48:32 GMT -8
the first thing after it says sub boards on the drop down. theres four options in the drop downs, i only have three sub boards.
and i cant figure out how to get Sub Boards on the drop down bold, not the actual sub boards
|
|
|
Post by Wormopolis on Jun 9, 2010 15:45:26 GMT -8
here is the problem if you have it put the first thing there. you will never be able to select it. the drop down works on CHANGE. meaning that if it already on the first item, you cant change TO the first item. if you change to the second item, it takes you that sub-board immediately.
it either has to be blank or say something else.
the next thing you asked about confuses me because you said you wanted that gone?
|
|
|
Post by tunescool on Jun 9, 2010 16:05:48 GMT -8
thefirst thing i asked was what you just explained. how about just ------------
the Sub Boards that you see before you hit the drop down rite on the drop down i want to bold
|
|
|
Post by Wormopolis on Jun 9, 2010 19:30:56 GMT -8
The default thing displayed in a select IS the first option of the select. if you change "SUB BOARDS" to "----------" then that is what will be displayed as default, AND it will be the first thing in the drop down list.
|
|
|
Post by tunescool on Jun 9, 2010 19:57:08 GMT -8
alrite if thats the way it is, i never really noticed that all dropdowns were like that looking at them now. so if you bolded the thing you see without hitting it the first one would be bold too?
can they all be bolded in just this code?
|
|
|
Post by Wormopolis on Jun 9, 2010 21:33:15 GMT -8
exactly. if you bold the first thing, it will be bolded in the drop down as well. and you NEED something other then the first sub-board as the first thing or no one will ever be able to select the first sub-board
I agree it should look different... try this:
change the variable var subboardTitle = "Sub Forums";
to be var subboardTitle = "<center><b>sub forums</b></center>";
|
|
|
Post by tunescool on Jun 9, 2010 22:15:46 GMT -8
i already tried the <b></b>s and ><b></b><s
|
|
|
Post by Wormopolis on Jun 9, 2010 22:19:29 GMT -8
go head and change that variable so I can see if it will take HTML inside like its supposed to.
|
|
|
Post by tunescool on Jun 9, 2010 22:45:37 GMT -8
is there a free site that i could use to narrow down where problems are on my site. im having a ton of problems all of a sudden. it takes 2 minutes to load a page, only my site and just in firefox. i started a thread with craig and i even started a thread on a mac forum. i put that line back in
|
|