victory1
Full Member
Posts: 102
victory1 said 0 great things
|
Post by victory1 on Feb 12, 2010 19:01:58 GMT -8
There's a bug in this code. If you are in advanced moderation mode then you cannot have a sticky and announcement between the images. It moves the sticky down and keeps the announcements. But when you are not in advanced moderation mode then all stickies and announcement are between the pictures. Here is the thread that Ricky & Craig helped me to pinpoint the issue for background info: support.proboards.com/index.cgi?board=support&action=display&thread=345895The code is located here in the code database and it seems that the person is no longer part of proboards. support.proboards.com/index.cgi?board=codedatabase&action=display&n=1&thread=70317<script type="text/javascript"> <!-- /* Created by Jay. Divided Sticky Threads with Head/Base Images
http://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')[i].rows[t].firstChild.colSpan == 7 && getMe('table')[i].rows[t].firstChild.height == 5) { getMe('table')[i].rows[t].parentNode.removeChild(getMe('table')[i].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')[i].parentNode.parentNode.parentNode.parentNode.style.backgroundColor = 'transparent'; getMe('table')[i].parentNode.parentNode.parentNode.parentNode.parentNode.style.backgroundColor = 'transparent'; getMe('table')[i].className = 'bordercolor'; getMe('table')[i].parentNode.innerHTML = getMe('table')[i].parentNode.innerHTML.replace(endSticky, endSticky + newTab + cloneTargets + '</tr>'); } } } }
//--> </script>
|
|
|
Post by Wormopolis on Feb 12, 2010 23:59:09 GMT -8
change
if (getMe('table').rows[t].firstChild.colSpan == 7 && getMe('table').rows[t].firstChild.height == 5) {
to
if (getMe('table').rows[t].firstChild.colSpan >= 7 && getMe('table').rows[t].firstChild.height == 5) {
|
|
victory1
Full Member
Posts: 102
victory1 said 0 great things
|
Post by victory1 on Feb 13, 2010 3:56:01 GMT -8
That was it. It works now in both mode, advanced moderation and non. Thanks. I'm going to share your solution with Craig so he can change the database. Thanks ;D
|
|
|
Post by Wormopolis on Feb 13, 2010 4:04:40 GMT -8
excellent!
|
|
victory1
Full Member
Posts: 102
victory1 said 0 great things
|
Post by victory1 on Feb 13, 2010 4:17:47 GMT -8
Thanks Wormo, I thought I found a bug but that's because I have announcements in close private board call announcements that only staff can read. So that's why guess can't read announcements. thanks again
|
|