Post by Scorpian on Jul 17, 2006 14:44:54 GMT -8
Alright, using my knowledge from the category splitter I made, I created these 2 codes. They both add head/base images to the info center. Wait, why are there two versions? Because of the range of head/base images out there.
Version 1 of my code will add an image above the info center and below the info center. Nothing fancy
Version 2 of my code will turn the info center titlebar into the head image and add one below the info center.
Both of those codes are cross-browser. I've tested them in FireFox 1.5 and Internet Explorer 6. Put the code you choose in your main footers. The closer to the top, the faster it loads. Editting is described within the code.
Version 1 of my code will add an image above the info center and below the info center. Nothing fancy
<script type='text/javascript'>
/* Info Center head/base images by Scorpian
Version 1 - Images above and below table
http://roddyinnov.proboards75.com */
/*=== Edit These ===*/
var headImg = 'URL'; // URL of head image
var baseImg = 'URL'; // URL of base image
/*=== Do Not Edit ===*/
var riTable = document.getElementsByTagName('table');
if(location.href.match(/action=home/i) || !location.href.match(/(action|board)=/i)){
for(x=0; x<riTable.length; x++){
if(riTable[x].cellSpacing == 1 && riTable[x].cellPadding == 4 && riTable[x].rows[0].cells[0].innerHTML.match(/Info\sCenter/i)){
var newHTML = "<img src='"+headImg+"'/><table width='100%' cellspacing='1' cellpadding='4' border='0' class='bordercolor'>";
newHTML += riTable[x].innerHTML
newHTML += "</table><img src='"+baseImg+"'/>";
var theTable = riTable[x].parentNode;
theTable.parentNode.parentNode.parentNode.style.backgroundColor = 'transparent';
theTable.innerHTML = theTable.innerHTML.replace(theTable.innerHTML,newHTML);
}
}
}
</script>
Version 2 of my code will turn the info center titlebar into the head image and add one below the info center.
<script type='text/javascript'>
/* Info Center head/base images by Scorpian
Version 2 - IC Title turned into Head Image
http://roddyinnov.proboards75.com */
/*=== Edit These ===*/
var headImg = 'URL'; // URL of head image
var headHeight = 25; // Height of head image
var baseImg = 'URL'; // URL of base image
/*=== Do Not Edit ===*/
var riTable = document.getElementsByTagName('table');
if(location.href.match(/action=home/i) || !location.href.match(/(action|board)=/i)){
for(x=0; x<riTable.length; x++){
if(riTable[x].cellSpacing == 1 && riTable[x].cellPadding == 4 && riTable[x].rows[0].cells[0].innerHTML.match(/Info\sCenter/i)){
riTable[x].rows[0].style.display = 'none';
var padding = headHeight-21;
var newHeight = headHeight-padding;
var newHTML = "<div style='background-image:url("+headImg+");height:"+newHeight+"px;text-align:center;padding-top:"+padding+"px;'>"
newHTML += riTable[x].rows[0].cells[0].innerHTML;
newHTML += "</div><table width='100%' cellspacing='1' cellpadding='4' border='0' class='bordercolor'>";
newHTML += riTable[x].innerHTML
newHTML += "</table><img src='"+baseImg+"'/>";
var theTable = riTable[x].parentNode;
theTable.parentNode.parentNode.parentNode.style.backgroundColor = 'transparent';
theTable.innerHTML = theTable.innerHTML.replace(theTable.innerHTML,newHTML);
}
}
}
</script>
Both of those codes are cross-browser. I've tested them in FireFox 1.5 and Internet Explorer 6. Put the code you choose in your main footers. The closer to the top, the faster it loads. Editting is described within the code.