Post by Isa The Great on Jul 26, 2009 10:04:52 GMT -5
This will add a button in your post area that will in turn add [whisper][/whisper] tags into your post..
Put it in your Global Footer or the footer of the board you want it to work on..
You edit this line with the URL of the button image you want added to your post page...
var whisperButton = 'URL OF WHISPER BUTTON';
To use the whisper tags, you need to tell who you want to be able to see the whispered text, add the names of the members you would like to see the whisper in the first tag..
Eg.
[whisper=Sharon,Tracy]Only Sharon and Tracy can read this[/whisper]
Note: The main Admin can see all whispers...
Put it in your Global Footer or the footer of the board you want it to work on..
<script type="text/javascript">
<!--
/*
Whisper tags by Todge (Todge-@ntlworld.com)
Copyright © 2005
Please keep this header intact
*/
var whisperButton = 'URL OF WHISPER BUTTON';
var whoCanSee;
// Add Whisper button to post area and stop whispers being quoted...
if(document.postForm)
{
var TD = document.getElementsByTagName('TD');
for(t=0; t<TD.length; t++)
{
if(TD[t].width == "30%" && TD[t].innerHTML.match(/Add Tags:/i))
{
if(location.href.match('quote='))
{
quoted = document.postForm.message.value.split('[whisper');
document.postForm.message.value='';
for(qT=1; qT<quoted.length; qT++)
{
quoted[qT]=quoted[qT].split('/whisper]');
quoted[qT][0]='';
quoted[qT]=quoted[qT].join('');
}
document.postForm.message.value=quoted.join('');
}
TD[t+1].getElementsByTagName('font')[0].innerHTML+='<a href=javascript:add("[whisper=]","[/whisper]")><img src="'+whisperButton+'" alt="Whisper" border="0"/>'
break;
}
}
}
// Find whispers and hide text...
var post = document.getElementsByTagName('TD');
for(t=0; t<post.length; t++)
{
if((post[t].align=='right'&&post[t].height=='20'&&post[t].vAlign=='bottom'&&post[t].width=='40%')||(post[t+1].className=='windowbg2' && post[t+1].width=='100%' && post[t+1].innerHTML.match('whisper]')))
{
var posttxt=post[t+1].innerHTML;
posttxt=posttxt.split('[whisper');
for(s=1; s<posttxt.length; s++)
{
if(posttxt[s].split(']')[0].split('=').length>1)
{
whoCanSee = posttxt[s].split('=')[1].split(']')[0];
whoCanSee = whoCanSee.split(',');
}
posttxt[s]=posttxt[s].split('[/whisper]');
posttxt[s][0]=posttxt[s][0].split(']');
whisperBody=posttxt[s][0][1];
if(posttxt[s][0].length>2)
{
for(wB=2; wB<posttxt[s][0].length; wB++)
{
whisperBody+=']'+posttxt[s][0][wB];
}
}
posttxt[s][0]=posttxt[s][0].join(']');
whisperBody='Whispered message to: '+whoCanSee.join(', ')+'<table class="bordercolor" border="0" cellpadding="2" cellspacing="1" width="90%"><tr><td bgcolor="FFFFFF">'+whisperBody+'</td></tr></table>';
showW = 0;
for(vM=0; vM<whoCanSee.length; vM++)
{
if(whoCanSee[vM] == pb_displayname || pb_username == 'admin')
{
showW = 1;
break;
}
}
if(showW == 0)
{
whisperBody='';
}
posttxt[s][0]=whisperBody;
posttxt[s]=posttxt[s].join(' ');
}
posttxt=posttxt.join(' ');
post[t+1].innerHTML=posttxt;
}
}
// -->
</script>
You edit this line with the URL of the button image you want added to your post page...
var whisperButton = 'URL OF WHISPER BUTTON';
To use the whisper tags, you need to tell who you want to be able to see the whispered text, add the names of the members you would like to see the whisper in the first tag..
Eg.
[whisper=Sharon,Tracy]Only Sharon and Tracy can read this[/whisper]
Note: The main Admin can see all whispers...