Post by Jay on Aug 10, 2005 5:57:39 GMT -8
Preview: none
Placement: board footers
Compatability: PBv4 / cross-browser
Notes: read below
---
<script type="text/javascript">
<!--
/* Created by Jay.
Divided Sticky Threads with Head/Base Images
ngmaster.proboards21.com
This code may not be redistributed without permission.
Please leave this header intact at all times. */
// Colorize sticky threads (yes or no)?
var colorSticky = 'yes';
// If yes, what color would you like them?
var hexColor = '#FF0000';
var stickySettings = [
['URL TO HEAD IMAGE'], // head image
['URL TO BASE IMAGE'], // base image
['25'] // gap size
];
function getMe(item) {
if (document.getElementsByTagName(item).nodeType != 1) {
return document.getElementsByTagName(item);
}
}
var stickyRE = /stick(y|ylock)(.*?)?\.{1}/;
for (var i = 0; i < getMe('table').length; i ++) {
if (!window.location.href.match(/(page=2|=display)/) && window.location.href.match(/(i|^)\?board=.*?$/)) {
if (getMe('table').item(i).id != 'newtab' && !getMe('table').item(i).rows.item(0).cells.item(0).innerHTML.match(/Sub-Boards?/) && getMe('table').item(i).width == '100%' && getMe('table').item(i).cellPadding == 4 && getMe('table').item(i).rows.item(2).innerHTML.match(/stick(y|ylock)(.*?)?\.{1}/)) {
var headImg = document.createElement('img');
headImg.setAttribute('border', '0');
headImg.setAttribute('src', stickySettings[0]);
headImg.style.verticalAlign = 'bottom';
getMe('table').item(i).parentNode.insertBefore(headImg, getMe('table').item(i));
getMe('table').item(i).rows.item(0).style.display = 'none';
var cloneTargets = getMe('table').item(i).rows.item(0).cloneNode(true).innerHTML + '</tr><tr>' + getMe('table').item(i).rows.item(1).cloneNode(true).innerHTML;
for (var t = 1; t < getMe('table').item(i).rows.length; t ++) {
if (getMe('table').rows[t].firstChild.colSpan >= 7 && getMe('table').rows[t].firstChild.height == 5) {
getMe('table').rows[t].parentNode.removeChild(getMe('table').rows[t]);
}
if (stickyRE.test(getMe('table').item(i).rows.item(t).innerHTML)) {
var linkCol = getMe('table').item(i).rows.item(t).getElementsByTagName('a')[0];
eval("(/^yes$/.exec(colorSticky)? linkCol.style.color = hexColor : '')");
}
if (t != 1 && !stickyRE.exec(getMe('table').item(i).rows.item(t).innerHTML)) {
var endSticky = getMe('table').item(i).rows.item(t - 1).innerHTML;
}
var newTab = '</tr></table><img border="0" src="' + stickySettings[1] + '" /><div style="height: ' + stickySettings[2] + 'px";><br /><br /></div><table id="newtab" width="100%" border="0" cellpadding="4" cellspacing="1" class="bordercolor"><tr>';
getMe('table').parentNode.parentNode.parentNode.parentNode.style.backgroundColor = 'transparent';
getMe('table').parentNode.parentNode.parentNode.parentNode.parentNode.style.backgroundColor = 'transparent';
getMe('table').className = 'bordercolor';
getMe('table').parentNode.innerHTML = getMe('table').parentNode.innerHTML.replace(endSticky, endSticky + newTab + cloneTargets + '</tr>');
}
}
}
}
//-->
</script>
---
This will give you the ability to seperate the stickied threads and announcements, add head/base images, and colorize the stickied thread titles if wanted. Read below to see how to edit.
Your sticky and sticky lock icons must be named:
sticky.gif/png/jpg
stickylock.gif/png/jpg
or have the word 'sticky' and 'stickylock' in them.
The red bit will be set to 'yes' or 'no' depending on if you want to colourize the stickied threads.
The blue bit will be the actual hex colour if you selected yes.
The green bits will be the head/base image url's.
The orange bit is the gap height between the stickied and normal threads.
Placement: board footers
Compatability: PBv4 / cross-browser
Notes: read below
---
<script type="text/javascript">
<!--
/* Created by Jay.
Divided Sticky Threads with Head/Base Images
ngmaster.proboards21.com
This code may not be redistributed without permission.
Please leave this header intact at all times. */
// Colorize sticky threads (yes or no)?
var colorSticky = 'yes';
// If yes, what color would you like them?
var hexColor = '#FF0000';
var stickySettings = [
['URL TO HEAD IMAGE'], // head image
['URL TO BASE IMAGE'], // base image
['25'] // gap size
];
function getMe(item) {
if (document.getElementsByTagName(item).nodeType != 1) {
return document.getElementsByTagName(item);
}
}
var stickyRE = /stick(y|ylock)(.*?)?\.{1}/;
for (var i = 0; i < getMe('table').length; i ++) {
if (!window.location.href.match(/(page=2|=display)/) && window.location.href.match(/(i|^)\?board=.*?$/)) {
if (getMe('table').item(i).id != 'newtab' && !getMe('table').item(i).rows.item(0).cells.item(0).innerHTML.match(/Sub-Boards?/) && getMe('table').item(i).width == '100%' && getMe('table').item(i).cellPadding == 4 && getMe('table').item(i).rows.item(2).innerHTML.match(/stick(y|ylock)(.*?)?\.{1}/)) {
var headImg = document.createElement('img');
headImg.setAttribute('border', '0');
headImg.setAttribute('src', stickySettings[0]);
headImg.style.verticalAlign = 'bottom';
getMe('table').item(i).parentNode.insertBefore(headImg, getMe('table').item(i));
getMe('table').item(i).rows.item(0).style.display = 'none';
var cloneTargets = getMe('table').item(i).rows.item(0).cloneNode(true).innerHTML + '</tr><tr>' + getMe('table').item(i).rows.item(1).cloneNode(true).innerHTML;
for (var t = 1; t < getMe('table').item(i).rows.length; t ++) {
if (getMe('table').rows[t].firstChild.colSpan >= 7 && getMe('table').rows[t].firstChild.height == 5) {
getMe('table').rows[t].parentNode.removeChild(getMe('table').rows[t]);
}
if (stickyRE.test(getMe('table').item(i).rows.item(t).innerHTML)) {
var linkCol = getMe('table').item(i).rows.item(t).getElementsByTagName('a')[0];
eval("(/^yes$/.exec(colorSticky)? linkCol.style.color = hexColor : '')");
}
if (t != 1 && !stickyRE.exec(getMe('table').item(i).rows.item(t).innerHTML)) {
var endSticky = getMe('table').item(i).rows.item(t - 1).innerHTML;
}
var newTab = '</tr></table><img border="0" src="' + stickySettings[1] + '" /><div style="height: ' + stickySettings[2] + 'px";><br /><br /></div><table id="newtab" width="100%" border="0" cellpadding="4" cellspacing="1" class="bordercolor"><tr>';
getMe('table').parentNode.parentNode.parentNode.parentNode.style.backgroundColor = 'transparent';
getMe('table').parentNode.parentNode.parentNode.parentNode.parentNode.style.backgroundColor = 'transparent';
getMe('table').className = 'bordercolor';
getMe('table').parentNode.innerHTML = getMe('table').parentNode.innerHTML.replace(endSticky, endSticky + newTab + cloneTargets + '</tr>');
}
}
}
}
//-->
</script>
---
This will give you the ability to seperate the stickied threads and announcements, add head/base images, and colorize the stickied thread titles if wanted. Read below to see how to edit.
Your sticky and sticky lock icons must be named:
sticky.gif/png/jpg
stickylock.gif/png/jpg
or have the word 'sticky' and 'stickylock' in them.
The red bit will be set to 'yes' or 'no' depending on if you want to colourize the stickied threads.
The blue bit will be the actual hex colour if you selected yes.
The green bits will be the head/base image url's.
The orange bit is the gap height between the stickied and normal threads.