Post by FOX on May 27, 2011 12:15:23 GMT -5
[/img] without the stars
@blue
This bug with the categories isn't a bug, it's just not cross browser - which personally is grating on my nerves. I don't use firefox, and I don't plan to either, but sadly that's the only way I can see the site properly o.e
So, to persuade you to change the coding, I tried Evergreen in four different browsers, Chrome, IE, Firefox and Opera and took screenshots to show how people using that browser are seeing the site. I've also tried using the exact code your using and i just can't get it to work.
Half the people in the world use Internet Explorer, and Using internet explorer you can't see the boards on evergreen. So, that's half the potential members down the drain T.T
However, because fox is so fantastic, I haz a solution.
Firstly though, here is how Evergreen is shown on the below browsers;
As you can see, two of the four browsers don't even show the boards.
There is a code that does basically the same thing, i've tested it in all the four browser's I currently have and, it works.
(goes in the main footer)<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>/i)[0]+'</font><font size="-2">'+hideMessage+'</font>';
}
else if(newMes == 1)
{
hiddenCat.firstChild.innerHTML= hiddenCat.firstChild.innerHTML.split(/<\/font>/i)[0]+'</font><font size="-2">'+newMessage+showMessage+'</font>';
}
else
{
hiddenCat.firstChild.innerHTML = hiddenCat.firstChild.innerHTML.split(/<\/font>/i)[0]+'</font><font size="-2">'+showMessage+'</font>';
}
while(hiddenCat != hiddenCat.parentNode.lastChild && hiddenCat.nextSibling.firstChild.className != 'catbg')
{
hiddenCat = hiddenCat.nextSibling;
hiddenCat.style.display = collapse;
}
return;
}
// Find categories and make them collapsible..
var cat=document.getElementsByTagName('tr');
for(c=0; c<cat.length; c++)
{
if(cat[c].firstChild && cat[c].firstChild.className=='catbg' && cat[c].firstChild.colSpan=='5' && cat[c].firstChild.align!='right')
{
var cc = cat[c].getElementsByTagName('b')[0].innerHTML;
var cName = cat[c].getElementsByTagName('a')[0].name;
if(cc.match(/ $/))
{
cat[c].style.cursor = 'pointer';
cat[c].onclick = function(){
setCookie(this.getElementsByTagName('a')[0].name,'');
collapseCat(this,this.getElementsByTagName('a')[0].name);}
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(cName))
{
setCookie(cName,'new');
}
collapseCat(cat[c],cName);
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 catForm = document.forms;
for(c=0; c<catForm.length; c++)
{
if(catForm[c].hidden)
{
catForm = catForm[c];
break;
}}
var colName = catForm.name.value;
colTD1.innerHTML = '<font size="-1">Collapse Category:</font>';
if(colName.substr(colName.length-1,1) == ' ')
{
catForm.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]);
}}
catForm.onsubmit = function(){if(catForm.collapse.value == 1){catForm.name.value += ' ';}}
}
// -->
</script>
So, if you plan on using this code, here's how you go about it (;
- First delete the current collapsible code, 'collapse selected catagories' i think it's called (obviously, lol)
- Add the code above to the main footers (saves time, as it stops the code executing on every load)
- Edit the category names of the catageories you want to collapse to the images you want to used, via [*img]img here
[/li][li] Choose 'yes' on the Collapse Categories drop down box.
[/li][li] And thats it (:[/li][/ul]
Now you'll probably see a message 'click to expand this category' or whatever. To delete it, change this;
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>";
to this;
var hideMessage = "";
var showMessage = "";
var newMessage = "";
and it should work the exact same!
[/size]
[/blockquote]