Post by Triad on Dec 3, 2008 20:19:35 GMT -5
This cross browser script allows you to add an extra column in your sub-board listings to contain an image that may illustrate the type of content of that board.
For this script to work correctly, every board needs an image. You must also know the id of the board which you can find on the Modify Board page in your administration panel.
Preview
Global Footers
<script type="text/javascript"><!--
/*
* Images in Sub-Board Listings
* Created by Triad
*/
var _images = [
["board_id", "image_url"],
["board_id", "image_url"] // No comma last line
];
if(location.href.match(/board=/) && !location.href.match(/action=/i)){
for(var tb = document.getElementsByTagName("table"), a = 1; a < tb.length; a++){
if(tb[a-1].className == "bordercolor" && tb.cellPadding == "4" && tb.rows[0].cells[0].colSpan == "2"){
tb.rows[0].cells[0].colSpan = 3;
for(var tr = tb.rows, x = 1; x < tr.length; x++){
var id = tr[x].cells[1].firstChild.firstChild.href.split("=")[1];
for(y = 0; y < _images.length; y++){
if(_images[y][0] == id){
var _img = document.createElement("img");
_img.src = _images[y][1];
_img.border = 0;
var _cell = tr[x].insertCell(1);
_cell.className = "windowbg";
_cell.appendChild(_img);
break;
}
}
} break;
}
}
}
//--></script>
For this script to work correctly, every board needs an image. You must also know the id of the board which you can find on the Modify Board page in your administration panel.
Preview
Global Footers
<script type="text/javascript"><!--
/*
* Images in Sub-Board Listings
* Created by Triad
*/
var _images = [
["board_id", "image_url"],
["board_id", "image_url"] // No comma last line
];
if(location.href.match(/board=/) && !location.href.match(/action=/i)){
for(var tb = document.getElementsByTagName("table"), a = 1; a < tb.length; a++){
if(tb[a-1].className == "bordercolor" && tb.cellPadding == "4" && tb.rows[0].cells[0].colSpan == "2"){
tb.rows[0].cells[0].colSpan = 3;
for(var tr = tb.rows, x = 1; x < tr.length; x++){
var id = tr[x].cells[1].firstChild.firstChild.href.split("=")[1];
for(y = 0; y < _images.length; y++){
if(_images[y][0] == id){
var _img = document.createElement("img");
_img.src = _images[y][1];
_img.border = 0;
var _cell = tr[x].insertCell(1);
_cell.className = "windowbg";
_cell.appendChild(_img);
break;
}
}
} break;
}
}
}
//--></script>