Post by Todge on May 10, 2009 8:59:26 GMT -8
This will put a 'Thank You' button in the posting area, next to the 'Post Message' button at the bottom.
Clicking it will send a PM thanking the creator of the thread you are replying to. The thread's first post will be hidden until he/she has been thanked.
This is a 2 part code, and will need cookies to work.
This part goes in your MAIN FOOTER.. No editing is required.
This part goes in the Foorter(s) of the Board(s) you want it to effect..
Edit this part with the message you want left in place of the post until the thread creator has been thanked..
var hiddenMessage = '<font size="5"><b>Post hidden until if/when you thank the poster.</b></font>';
Clicking it will send a PM thanking the creator of the thread you are replying to. The thread's first post will be hidden until he/she has been thanked.
This is a 2 part code, and will need cookies to work.
This part goes in your MAIN FOOTER.. No editing is required.
<script type="text/javascript">
<!--
/*
Thank you button in posting area (Main Footer)
by Todge
Copyright © 2009
Please keep this header intact
*/
function setCookie(cookieValue)
{
var expireDate = new Date();
expireDate.setMonth(expireDate.getYear()+5);
document.cookie = 'thanks='+cookieValue+'; expires='+expireDate.toGMTString()+'; path=/;'
return;
}
if(location.href.match(/tion=pmsend&to(.)+&page=(\d)+(&)?(quote=(\d)+)?$/))
{
document.postForm.subject.value = 'Thank You';
document.postForm.message.value = 'Thank you for the information you gave in [url=';
document.postForm.message.value += document.cookie.split('Thread=')[1].split(/(&page=(\d)+)?;/)[0]+']this thread[/url].';
var thread = parseInt(location.href.split('&page=')[1]);
if(document.cookie.match(/thanks=/))
{
thread = document.cookie.split('thanks=')[1].split(';')[0]+'|'+thread;
}
if(thread.length > 4050)
{
thread = thread.replace(/(\d)+\|/,'');
}
var text = document.getElementsByTagName('font');
for(t=0; t<text.length; t++)
{
if(text[t].innerHTML.match(/Send Personal Message/))
{
text[t].innerHTML = text[t].innerHTML.replace('Personal Message','Thank You');
}}
var text = document.links;
for(t=0; t<text.length; t++)
{
if(text[t].innerHTML.match(/Private Messages/) && text[t].className == 'nav')
{
text[t].nextSibling.nodeValue = text[t].nextSibling.nodeValue.replace('Personal Message','Thank You');
}}
var cell = document.postForm.subject.parentNode.parentNode;
while(cell.firstChild.width != '100%')
{
cell.style.display = 'none';
cell = cell.nextSibling;
}
cell.getElementsByTagName('font')[0].style.display = 'none';
cell.getElementsByTagName('br')[0].style.display = 'none';
document.postForm.nextaction.nextSibling.value = 'Thank You';
document.postForm.onsubmit = function(){setCookie(thread);}
var button = document.getElementsByTagName('input');
for(b=0; b<button.length; b++)
{
if(button[b].value.match(/(Preview|Spell Check)/))
{
button[b].style.display = 'none';
}
if(button[b].value == 'Reset')
{
button[b].value = 'Cancel';
button[b].onclick = function(){document.location.href = document.cookie.split('Thread=')[1].split(';')[0];}
}}}
if(location.href.match(/\?action=pm$/) && document.referrer.match('&page='))
{
var text = document.getElementsByTagName('font');
for(t=0; t<text.length; t++)
{
if(text[t].innerHTML.match(/Inbox/))
{
text[t].innerHTML = text[t].innerHTML.replace('Inbox','Thank You');
}}
var text = document.links;
for(t=0; t<text.length; t++)
{
if(text[t].innerHTML.match(/Private Messages/) && text[t].className == 'nav')
{
text[t].nextSibling.nodeValue = text[t].nextSibling.nodeValue.replace('Inbox','Thank You');
}}
var cell = document.getElementsByTagName('td');
for(c=0; c<cell.length; c++)
{
if(cell[c].colSpan == '5' && cell[c].className == 'titlebg')
{
cell[c].height = '22';
cell[c].innerHTML = '<center><font class="titletext" size="2"><b>Your Thank You has been sent</b></font></center>';
}
if((cell[c].className == 'catbg' && cell[c].width == '5%') || (cell[c].className == 'windowbg' && cell[c].firstChild.nodeName == 'INPUT'))
{
cell[c].parentNode.style.display = 'none';
}
if(cell[c].colSpan == '5' && cell[c].firstChild.nodeName == 'INPUT' && cell[c].firstChild.value.match(/Delete Sele/))
{
cell[c].align = 'center';
cell[c].removeChild(cell[c].firstChild);
var retButton = document.createElement('INPUT');
retButton.type = 'button';
retButton.value = 'Return To Thread';
retButton.onclick = function(){document.location.href = document.cookie.split('Thread=')[1].split(';')[0];}
cell[c].appendChild(retButton);
}}}
// -->
</script>
This part goes in the Foorter(s) of the Board(s) you want it to effect..
<script type="text/javascript">
<!--
/*
Thank you button in posting area (board footer(s))
by Todge
Copyright © 2009
Please keep this header intact
*/
var hiddenMessage = '<font size="5"><b>Post hidden until if/when you thank the poster.</b></font>';
function setCookie(cookieValue)
{
var expireDate = new Date();
expireDate.setMonth(expireDate.getMonth()+2);
document.cookie = 'Thread='+cookieValue+'; expires='+expireDate.toGMTString()+'; path=/;'
return;
}
if(location.href.match(/tion=disp/))
{
var page = location.href.split('thread=')[1].split('&page')[0];
if(location.href.match(/thread=(\d)+(&page=1)?$/) && (!document.cookie.match(/thanks=/) || !page.match(new RegExp('^('+document.cookie.split('thanks=')[1].split(';')[0]+')$'))))
{
var post1 = document.getElementsByTagName('td');
for(p=0; p<post1.length; p++)
{
if(post1[p].className == 'catbg' && post1[p].width == '20%' && post1[p].innerHTML.match('Author'))
{
var tato = post1[p].parentNode.nextSibling.getElementsByTagName('b')[0].firstChild.href;
tato = tato.split('user=')[1];
if(pb_username != tato)
{
post1[p].parentNode.nextSibling.getElementsByTagName('td')[1].vAlign = 'middle';
post1[p].parentNode.nextSibling.getElementsByTagName('td')[1].align = 'center';
post1[p].parentNode.nextSibling.getElementsByTagName('td')[1].innerHTML = hiddenMessage;
var reply = document.links;
for(r=0; r<reply.length; r++)
{
if(reply[r].href.match(/tion=post&thread/))
{
reply[r].href += '&tato='+tato;
}}}
break;
}}}}
if(document.postForm && location.href.match(/&tato=/) && !location.href.match(/tion=modify/))
{
var page = location.href.split('thread=')[1].split('&page')[0];
if(!document.cookie.match(/thanks=/) || !page.match(new RegExp('^('+document.cookie.split('thanks=')[1].split(';')[0]+')$')))
{
var tato = location.href.split('tato=')[1];
var thankyou = document.createElement('input');
with(thankyou){value='Thank You'; type='button';}
var reply = document.postForm.nextaction.nextSibling;
reply.parentNode.insertBefore(thankyou,reply)
reply.parentNode.insertBefore(document.createTextNode(' '),reply);
thankyou.onclick = function(){setCookie(document.referrer);location.href = '/index.cgi?action=pmsend&to='+tato+'&page='+page;}
}}
// -->
</script>
Edit this part with the message you want left in place of the post until the thread creator has been thanked..
var hiddenMessage = '<font size="5"><b>Post hidden until if/when you thank the poster.</b></font>';