Post by Bradley on Sept 1, 2005 21:01:50 GMT -5
A basic sticky thread divider. Live Preview: ccwtest123.proboards29.com/index.cgi?board=stickydivd
Board Footers
<script type="text/javascript">
<!--
/*
Sticky Divider v1.1
Copyright © 2005 Bradley Nelson a.k.a. CCWorld
All Rights Reserved
For use on Proboards Boards only.
This Header must remain intact at all times.
Do not re-post without permission.
*/
var StickyI = "sticky.gif";
var StickyLI = "stickylock.gif";
var StickyMsg = "Important: ";
var divHeight = "18";
var divClass = "catbg";
var tables = document.getElementsByTagName("table");var Divider; var a; var i;
var StickyRegex = new RegExp("("+StickyI+"|"+StickyLI+")", "i"); var tempNode;
function splitNow(cspan){
Divider = tables.item(a).insertRow(i+1).insertCell(0);
Divider.setAttribute("style", "height: "+divHeight+"px");
Divider.setAttribute("colspan", cspan);
Divider.setAttribute("class", divClass);
}
function AppendText(cell,t){
if (StickyMsg != ""){
if (t==2){
tempNode = cell.firstChild.nextSibling.nextSibling.nextSibling.firstChild.nextSibling;
tempNode.insertBefore(document.createTextNode(StickyMsg), tempNode.firstChild);
} else {
tempNode = cell.firstChild.nextSibling.nextSibling.firstChild.nextSibling;
tempNode.insertBefore(document.createTextNode(StickyMsg), tempNode.firstChild);
}
}
}
for(a=0; a<tables.length-1; a++){
if(tables.item(a).innerHTML.match(/>Subject</) && tables.item(a).width=="100%" && tables.item(a).cellSpacing=="1"){
for(i=2; i<tables.item(a).rows.length-1; i++){
if (tables.item(a).rows.item(i+1).firstChild.width != "100%" && tables.item(a).rows.item(i+1).firstChild.height != "5" && tables.item(a).rows.item(i).firstChild.height != "5"){
if (tables.item(a).rows.item(i).firstChild.firstChild.nodeName.match(/font/i) && tables.item(a).rows.item(i).firstChild.firstChild.firstChild.nodeName.match(/img/i) && tables.item(a).rows.item(i).firstChild.firstChild.firstChild.getAttribute("src").match(StickyRegex)){
AppendText(tables.item(a).rows.item(i),1);
if(!(tables.item(a).rows.item(i+1).firstChild.firstChild.firstChild.getAttribute("src").match(StickyRegex))){
splitNow(7);
break;
}
}
else if (tables.item(a).rows.item(i).firstChild.nextSibling.firstChild.firstChild.nodeName.match(/img/i) && tables.item(a).rows.item(i).firstChild.nextSibling.firstChild.firstChild.getAttribute("src").match(StickyRegex)){
AppendText(tables.item(a).rows.item(i),2);
if(!(tables.item(a).rows.item(i+1).firstChild.nextSibling.firstChild.firstChild.getAttribute("src").match(StickyRegex))){
splitNow(8);
break;
}
}
}
}
}
}
//-->
</script>
File name of your sticky image
File name of your sticky lock image
Text to put before the threads name on the board index. Leave blank for none.
Height of the divider in pixles without px or anthoer unit of measurement
The class name of the divider
Board Footers
<script type="text/javascript">
<!--
/*
Sticky Divider v1.1
Copyright © 2005 Bradley Nelson a.k.a. CCWorld
All Rights Reserved
For use on Proboards Boards only.
This Header must remain intact at all times.
Do not re-post without permission.
*/
var StickyI = "sticky.gif";
var StickyLI = "stickylock.gif";
var StickyMsg = "Important: ";
var divHeight = "18";
var divClass = "catbg";
var tables = document.getElementsByTagName("table");var Divider; var a; var i;
var StickyRegex = new RegExp("("+StickyI+"|"+StickyLI+")", "i"); var tempNode;
function splitNow(cspan){
Divider = tables.item(a).insertRow(i+1).insertCell(0);
Divider.setAttribute("style", "height: "+divHeight+"px");
Divider.setAttribute("colspan", cspan);
Divider.setAttribute("class", divClass);
}
function AppendText(cell,t){
if (StickyMsg != ""){
if (t==2){
tempNode = cell.firstChild.nextSibling.nextSibling.nextSibling.firstChild.nextSibling;
tempNode.insertBefore(document.createTextNode(StickyMsg), tempNode.firstChild);
} else {
tempNode = cell.firstChild.nextSibling.nextSibling.firstChild.nextSibling;
tempNode.insertBefore(document.createTextNode(StickyMsg), tempNode.firstChild);
}
}
}
for(a=0; a<tables.length-1; a++){
if(tables.item(a).innerHTML.match(/>Subject</) && tables.item(a).width=="100%" && tables.item(a).cellSpacing=="1"){
for(i=2; i<tables.item(a).rows.length-1; i++){
if (tables.item(a).rows.item(i+1).firstChild.width != "100%" && tables.item(a).rows.item(i+1).firstChild.height != "5" && tables.item(a).rows.item(i).firstChild.height != "5"){
if (tables.item(a).rows.item(i).firstChild.firstChild.nodeName.match(/font/i) && tables.item(a).rows.item(i).firstChild.firstChild.firstChild.nodeName.match(/img/i) && tables.item(a).rows.item(i).firstChild.firstChild.firstChild.getAttribute("src").match(StickyRegex)){
AppendText(tables.item(a).rows.item(i),1);
if(!(tables.item(a).rows.item(i+1).firstChild.firstChild.firstChild.getAttribute("src").match(StickyRegex))){
splitNow(7);
break;
}
}
else if (tables.item(a).rows.item(i).firstChild.nextSibling.firstChild.firstChild.nodeName.match(/img/i) && tables.item(a).rows.item(i).firstChild.nextSibling.firstChild.firstChild.getAttribute("src").match(StickyRegex)){
AppendText(tables.item(a).rows.item(i),2);
if(!(tables.item(a).rows.item(i+1).firstChild.nextSibling.firstChild.firstChild.getAttribute("src").match(StickyRegex))){
splitNow(8);
break;
}
}
}
}
}
}
//-->
</script>
File name of your sticky image
File name of your sticky lock image
Text to put before the threads name on the board index. Leave blank for none.
Height of the divider in pixles without px or anthoer unit of measurement
The class name of the divider