Post by Jordan on Dec 3, 2008 14:42:35 GMT -8
This cross browser script allows you to add an extra column in your board listings to contain an image that may illustrate the type of content of that board.
For this version of the script to work correctly, every board needs an image. If you know you are not going to have an image for each board, use this version. You must also know the id of the board which you can find on the Modify Board page in your administration panel.
For a preview, just view the sub-board version's preview as it is essentially the same thing.
Main Footers
<script type="text/javascript"><!--
/*
* Images in Main Board Listings
* Created by Triad
* support.proboards.com
*/
var _images = [
["board_id", "image_url"],
["board_id", "image_url"] // No comma last line
];
if(document.title.split(" - ")[1].match(/Home/)){
var a, tr = document.getElementsByTagName("tr");
for(a = 1; a < tr.length; a++){
if(tr.cells[0].colSpan == "5" && tr.cells[0].className == "catbg")
tr.cells[0].colSpan = 6;
else if(tr.cells[0].colSpan == "2" && tr.cells[0].innerHTML.match(/Forum Name/))
tr.cells[0].colSpan = 3;
else if(tr.cells[4] && tr.cells[1].width == "66%"){
var id = tr.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.insertCell(1);
_cell.className = "windowbg";
_cell.appendChild(_img);
break;
}
}
}
}
}
//--></script>
For this version of the script to work correctly, every board needs an image. If you know you are not going to have an image for each board, use this version. You must also know the id of the board which you can find on the Modify Board page in your administration panel.
For a preview, just view the sub-board version's preview as it is essentially the same thing.
Main Footers
<script type="text/javascript"><!--
/*
* Images in Main Board Listings
* Created by Triad
* support.proboards.com
*/
var _images = [
["board_id", "image_url"],
["board_id", "image_url"] // No comma last line
];
if(document.title.split(" - ")[1].match(/Home/)){
var a, tr = document.getElementsByTagName("tr");
for(a = 1; a < tr.length; a++){
if(tr.cells[0].colSpan == "5" && tr.cells[0].className == "catbg")
tr.cells[0].colSpan = 6;
else if(tr.cells[0].colSpan == "2" && tr.cells[0].innerHTML.match(/Forum Name/))
tr.cells[0].colSpan = 3;
else if(tr.cells[4] && tr.cells[1].width == "66%"){
var id = tr.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.insertCell(1);
_cell.className = "windowbg";
_cell.appendChild(_img);
break;
}
}
}
}
}
//--></script>