frogdude
TRu Member
frogdude.proboards104.com
Posts: 211
|
Post by frogdude on Dec 3, 2007 13:47:05 GMT -5
hey, i added this category collapse a while ago, it worked, then it didnt. im contacting its creator, but they are a little slow to answer. so...i was wondering if anyone could take a look and see what its conflicting with. i have the idea its with the "your shop" v.3 code. they are located in my main footer, so thats where you can look. but if you find otu naything else, just let me know, thanks?
|
|
|
Post by Wrighty on Dec 3, 2007 14:16:27 GMT -5
can you post the code you're using here please?
|
|
frogdude
TRu Member
frogdude.proboards104.com
Posts: 211
|
Post by frogdude on Dec 3, 2007 17:56:52 GMT -5
just the collapse, or both the collapse and the shop?
|
|
|
Post by Spike on Dec 3, 2007 18:22:36 GMT -5
just post both of them
|
|
frogdude
TRu Member
frogdude.proboards104.com
Posts: 211
|
Post by frogdude on Dec 4, 2007 12:04:46 GMT -5
i deleted the shop, so ill post the collapse code only.
oh, and i had the creator modify it, and this is the modded one, it is made now so that it has cookies for remembering how each category was last colapsed, or opened.
any questions, just ask
<script type="text/javascript"> <!-- /* Collapse categories (Admin editable) By Todge Copyright © 2007 Please keep this header intact */
// Edit below...
var hideMessage = " - Click to hide this forum"; var showMessage = " - Click to show this forum"; var newMessage = "<font color=000000> There are new messages in this forum</font>";
// Edit above...
var newMes = 0;
// Set cookie function.. function setCookie(cookieName,cookieValue) { var expireDate = new Date(); expireDate.setMonth(expireDate.getMonth()+6); if(cookieValue == 'new') { document.cookie = cookieName+'=none; expires='+expireDate.toGMTString()+'; path=/'; return; } var cValue = document.cookie; cValue = cValue.split(cookieName)[1].split(';')[0]; if(cookieValue == '' && cValue.match(/none/)) { if(document.all){ cookieValue = 'block';} else{ cookieValue = '';} } else { cookieValue = 'none'; }
document.cookie = cookieName+'='+cookieValue+'; expires='+expireDate.toGMTString()+'; path=/'; return; }
// Collapse or expand category.. function collapseCat(hiddenCat,catName) { var collapse = document.cookie; collapse = collapse.split(catName+'=')[1].split(';')[0];
if(collapse == '' || collapse == 'block') { hiddenCat.firstChild.innerHTML = hiddenCat.firstChild.innerHTML.split(/<font size=/i)[0]+'<font size="-2">'+hideMessage+'</font>'; } else { if(newMes == 1) { hiddenCat.firstChild.innerHTML = hiddenCat.firstChild.innerHTML.split(/<font size=/i)[0]+'<font size="-2">'+newMessage+showMessage+'</font>'; } else { hiddenCat.firstChild.innerHTML = hiddenCat.firstChild.innerHTML.split(/<font size=/i)[0]+'<font size="-2">'+showMessage+'</font>'; }} while(hiddenCat != hiddenCat.parentNode.lastChild && hiddenCat.nextSibling.firstChild.className != 'catbg') { hiddenCat = hiddenCat.nextSibling; hiddenCat.style.display = collapse; }}
// Find categories and make them collapsible.. var cat=document.getElementsByTagName('tr'); for(c=0; c<cat.length; c++) { if(cat[c].firstChild.className=='catbg' && cat[c].firstChild.colSpan=='5' && cat[c].firstChild.align!='right') { var cc = cat[c].getElementsByTagName('b')[0].innerHTML; if(cc.substr(cc.length-1,1)==' ') { cat[c].style.cursor = 'pointer'; cat[c].onclick = function(){ var cName = this.getElementsByTagName('b')[0].innerHTML; cName = cName.substr(0,cName.length-1);
setCookie(cName,''); collapseCat(this,cName);}
var board = cat[c].nextSibling; while(board != board.parentNode.lastChild && board.firstChild.className == 'windowbg') { if(board.getElementsByTagName('img')[0].alt == '[/li][li]') { newMes = 1; break; } board = board.nextSibling; }
var pageCookie = document.cookie; cc = cc.substr(0,cc.length-1); if(!pageCookie.match(cc)) { setCookie(cc,'new'); }
collapseCat(cat[c],cc); newMes = 0; }}}
// Add admin functions... if(location.href.match('action=categorymodify2')) { var colTR = document.createElement('TR'); var colTD1 = document.createElement('TD'); var colTD2 = document.createElement('TD'); var colTD3 = document.createElement('TD');
var colName = document.forms[0].name.value;
colTD1.innerHTML = '<font size="-1">Collapse Category:</font>'; if(colName.substr(colName.length-1,1) == ' ') { document.forms[0].name.value = colName.slice(0,colName.length-1); colTD2.innerHTML = '<font size="-1"><select name="collapse"><option value="0">No</option><option value="1" selected="1">Yes</option></select></font>'; } else { colTD2.innerHTML = '<font size="-1"><select name="collapse"><option value="0" selected="1">No</option><option value="1">Yes</option></select></font>'; } colTD3.innerHTML = '<font size="-2">Selecting "yes" will make this category collapsable.</font>';
colTR.appendChild(colTD1); colTR.appendChild(colTD2); colTR.appendChild(colTD3);
var cats = document.getElementsByTagName('tr'); for(t=0; t<cats.length; t++) { if(cats[t].innerHTML.match('Limit Access:') && cats[t].firstChild.width == '160') { cats[t].parentNode.insertBefore(colTR,cats[t]); }}
document.getElementsByTagName('input')[document.getElementsByTagName('input').length-1].onclick = function(){if(document.forms[0].collapse.value == 1){document.forms[0].name.value = document.forms[0].name.value+' ';}}
} // --> </script>
|
|
|
Post by Wrighty on Dec 4, 2007 12:11:10 GMT -5
whats the url of your forum?
|
|
frogdude
TRu Member
frogdude.proboards104.com
Posts: 211
|
Post by frogdude on Dec 4, 2007 12:11:43 GMT -5
|
|
|
Post by Wrighty on Dec 4, 2007 12:22:10 GMT -5
The shop code is still on your forum.
|
|
frogdude
TRu Member
frogdude.proboards104.com
Posts: 211
|
Post by frogdude on Dec 4, 2007 13:30:40 GMT -5
where, i deleted it. add, ok, i found it, all deleted now. but it still isnt working.
|
|
|
Post by Wrighty on Dec 4, 2007 13:32:25 GMT -5
This one in your footer <script type="text/javascript"> <!-- /* YourShop Version 0.3
Copyright 2005-2006 Bradley Nelson a.k.a CCWorld All Rights Reserved
|
|
frogdude
TRu Member
frogdude.proboards104.com
Posts: 211
|
Post by frogdude on Dec 4, 2007 13:36:58 GMT -5
all gone, but it still isnt working.
|
|
|
Post by Wrighty on Dec 4, 2007 13:38:15 GMT -5
try removing the head/base images code by jay.
|
|
frogdude
TRu Member
frogdude.proboards104.com
Posts: 211
|
Post by frogdude on Dec 4, 2007 13:50:28 GMT -5
but i like those!!! do i have to??
|
|
|
Post by Wrighty on Dec 4, 2007 13:56:03 GMT -5
just for a second so we can see if that is the problem
|
|
frogdude
TRu Member
frogdude.proboards104.com
Posts: 211
|
Post by frogdude on Dec 4, 2007 17:00:20 GMT -5
yes., this code is the problem, now what do i do, is there another splitter code that i can use, that wont conflict with it.
<script type="text/javascript"> <!-- /* Created by Jay. Divided Categories with Head/Base Images
http://ngmaster.proboards21.com This code may not be redistributed without permission. Please leave this header intact at all times. */
var headBaseSettings = [ ['http://i144.photobucket.com/albums/r164/froggyman50/Proboards%20Stuff/Questing%20Games%20Forums/transparent.png'], // head image ['http://i144.photobucket.com/albums/r164/froggyman50/Proboards%20Stuff/Questing%20Games%20Forums/base-2.png'], // base image ['15'] // gap size ];
var getTR = document.getElementsByTagName('tr'); if (window.location.href.match(/com(\/$|\/index\.c\wi\??($|\w{6}=home)$)$/)) { for (var i = 1; i < getTR.length; i ++) { if (getTR.item(i).firstChild.colSpan == 2 && getTR.item(i).firstChild.firstChild.className == 'titletext' && getTR.item(i).firstChild.innerHTML.match(/>Forum Name</)) { var titleBase = document.createElement('img'); titleBase.src = headBaseSettings[1]; var cloneTitle = getTR.item(i).cloneNode(true).innerHTML; } if (getTR.item(i).firstChild.colSpan == 5 && getTR.item(i).firstChild.className == 'catbg' && getTR.item(i).firstChild.align != 'right') { var cloneTarget = getTR.item(i).getElementsByTagName('td')[0].cloneNode(true).innerHTML; var newTab = '<td id="del"></td></tr></table>' + (getTR.item(i - 1).innerHTML.match(/>Forum Name</)? '' : '<img src="' + headBaseSettings[1] + '" /><div style="height: ' + headBaseSettings[2] + 'px;"></div>') + '<img src="' + headBaseSettings[0] + '" style="vertical-align: bottom;" /><table width="100%" cellspacing="1" cellpadding="4" class="bordercolor"><tr><td class="catbg" colspan="6">' + cloneTarget + '</td></tr><tr id="frow">'; eval("(getTR.item(i - 1).innerHTML.match(/>Forum Name</)? getTR.item(i).parentNode.parentNode.parentNode.parentNode.parentNode.insertRow(-1).insertCell(-1).appendChild(titleBase) : '')"); getTR.item(i).parentNode.className = 'bordercolor'; with (getTR.item(i).parentNode.parentNode.parentNode) { parentNode.parentNode .parentNode.style.backgroundColor = 'transparent'; innerHTML = innerHTML.replace(getTR.item(i).cloneNode(true).innerHTML, newTab + cloneTitle); } } if (getTR.item(i).firstChild.id == 'del' || (getTR.item(i).id != 'frow' && getTR.item(i).getElementsByTagName('td')[0].className == 'titlebg' && getTR.item(i).getElementsByTagName('td')[0].innerHTML.match(/>Forum Name</))) { getTR.item(i).style.display = 'none'; } } }
//--> </script>
|
|