Post by Todge on May 21, 2006 14:36:19 GMT -8
This will stop people bumping (double posting) within 24 hours of their previous post..
Put this in your Global Header, above any code that alters the welcome table...
And put this in the footer of the board(s) that you want to stop people from bumping in, (Global Footer if you want it to effect ALL boards)..
No editting is required..
Put this in your Global Header, above any code that alters the welcome table...
<script type="text/javascript">
<!--
/*
Get current time, by Todge
Needed for anti-bumping code in the footer
Copyright © 2006
Please keep this header intact
*/
if(location.href.match('action=display') && location.href.match('thread='))
{
var currentTime = document.getElementsByTagName('font')[2].innerHTML.split(/<br>/i)[1].split(', ');
var currentHour = parseInt(currentTime[currentTime.length-1].split(':')[0]);
var currentMinute = currentTime[currentTime.length-1].split(':')[1];
if(currentMinute.match('pm'))
{
currentHour = currentHour + 12;
}
currentMinute = parseInt(currentMinute);
document.write(currentHour+':'+currentMinute);
}
// -->
</script>
And put this in the footer of the board(s) that you want to stop people from bumping in, (Global Footer if you want it to effect ALL boards)..
<script type="text/javascript">
<!--
/*
Anti-bumping code by Todge
You need the current time code in your header!
Copyright © 2006
Please keep this header intact
*/
if(location.href.match('action=display') && location.href.match('thread='))
{
function disableBumping()
{
var reply = document.getElementsByTagName('a');
for(a=0; a<reply.length; a++)
{
if(reply[a].href.match('action=post'))
{
reply[a].style.display = 'none';
}}
var qreply = document.getElementsByTagName('td');
for(q=0; q<qreply.length; q++)
{
if(qreply[q].innerHTML.match('Quick Reply') && qreply[q].className == 'titlebg' && qreply[q].width == '100%')
{
qreply=qreply[q].parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode;
qreply.style.display = 'none';
qreply.previousSibling.style.display = 'none';
qreply.previousSibling.previousSibling.style.display = 'none';
}}}
function findPost()
{
if(pb_username == 'Guest')
{
disableBumping();
return;
}
var lastPost = document.getElementsByTagName('td');
for(l=lastPost.length-1; l>0; l--)
{
if(lastPost[l].width == '20%' && lastPost[l].className.match('window'))
{
if(lastPost[l].innerHTML.match('user='+pb_username))
{
if(lastPost[l].nextSibling.firstChild.firstChild.firstChild.firstChild.nextSibling.innerHTML.match('Today'))
{
disableBumping();
return;
}
if(lastPost[l].nextSibling.firstChild.firstChild.firstChild.firstChild.nextSibling.innerHTML.match('Yesterday'))
{
var postTime = lastPost[l].nextSibling.firstChild.firstChild.firstChild.firstChild.nextSibling.innerHTML.split(' »')[0].split(' ');
postTime = postTime[postTime.length-1];
var postHour = parseInt(postTime.split(':')[0]);
if(postTime.match('pm'))
{
postHour = postHour+12;
}
var postMinute = parseInt(postTime.split(':')[1]);
if((postHour>currentHour)||(postHour==currentHour&&postMinute>currentMinute))
{
disableBumping();
return;
}
}
}
break;
}
}
}
var onePage = 0;
var page = document.getElementsByTagName('select');
for(s=0; s<page.length; s++)
{
if(page[s].name == 'pageMenu')
{
onePage = 1;
if(page[s].value < page[s].lastChild.value)
{
disableBumping();
break;
}
else
{
findPost();
break;
}
}}
if(onePage == 0)
{
findPost();
}
}
// -->
</script>
No editting is required..