|
Post by Wormopolis on Nov 7, 2009 7:32:59 GMT -8
Browser Tested: IE and FF placement: Board or Global footer
keeps track of threads you have posted in by letting you change the style of the thread title.
variable changes how many threads it remembers (not unlimited).
code:
<style type="text/css"> .tracked_posted {text-decoration: underline; color: 00FF00;} .tracked_NOTposted {text-transform: uppercase; font-weight: bold; size: 2;} </style>
<script type="text/javascript"> <!-- // trackPosts v 1.2 // by Wormopolis - www.wormocodes.com // keep header intact
var trackNumPosts=10;
function updateCookie() { tp=''; if (location.href.match(/thread=(\d+)/)) thnum=RegExp.$1; if (document.cookie.match(/trackposts=(.*?)($|;)/)) { tp=RegExp.$1; } if (tp!='' && tp.match(new RegExp('(^|:)?'+thnum+'(:|$)?','i'))) { tp=tp.replace(new RegExp('(^|:)?'+thnum+'(:|$)?','i'),':'); } tp=':'+thnum+tp; if (tp.split(':').length>trackNumPosts) { temp=tp.split(':'); while(temp.length>trackNumPosts) hold=temp.pop(); tp=temp.join(':'); } expdate=new Date(); expdate.setYear(expdate.getFullYear()+1); document.cookie="trackposts="+tp+"; expires="+expdate; }
if ( location.href.match(/board=/) && !location.href.match(/trackposts/)) { tp=''; if (document.cookie.match(/trackposts=(.*?)($|;)/)) { tp=RegExp.$1; } if (location.href.match(/thread=(\d+)/)) { tnum=RegExp.$1; // record thread number if posting/quoting if (document.referrer.match(/action=post/)) { updateCookie(); } // quick reply needs to have its submit function modded frm=document.getElementsByTagName('form'); for (f=0; f<frm.length; f++) { if (frm[f].method=='post' && frm[f].getElementsByTagName('textarea')[0] && frm[f].getElementsByTagName('textarea')[0].name=='message' && frm[f].firstChild.name=='action') { if (document.addEventListener) { frm[f].addEventListener('submit',updateCookie,false); } else { frm[f].attachEvent('onsubmit',updateCookie); } break; } } } else { // check cookie for thread numbers and classify the thread links accordingly for (tds=document.getElementsByTagName('td'), i=0; i<tds.length; i++) { if (tds[i].width.match(/4(3|8)%/) && tds[i].className.match(/windowbg/) && tds[i].getElementsByTagName('font')[0]) { holdthis=tds[i].getElementsByTagName('font')[0].getElementsByTagName('a'); tTitle=holdthis[holdthis.length-1]; nFnt=document.createElement('font'); nFnt.appendChild(tTitle.firstChild); tTitle.appendChild(nFnt); tNum=tTitle.href.match(/thread=(\d+)/); tNum=RegExp.$1; if (tp!='' && tp.match(new RegExp('(^|:)?'+tNum+'(:|$)?','i'))) { nFnt.className='tracked_posted'; } else { nFnt.className='tracked_NOTposted'; } } } } }
// --> </script>
preview: using it in submissions board currently
|
|
|
Post by Silly Test Account on Nov 11, 2009 21:59:18 GMT -8
test for a bug fix.
|
|
|
Post by Wormopolis on Dec 19, 2010 14:59:29 GMT -8
update version 1.2: bug fix after a PB change
|
|