Post by Matt Wilkes on May 29, 2006 23:17:22 GMT -5
<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>
I thought this was pretty cool.
Name: The 'Whisper' Effect
What does cheese do?: cheese places a new button on your posting panel that allows you to post a message or a portion of your message that only certain users can view. Note that the main (creator of the site only) admin can view ALL 'whispers' no matter if they are directed to him or not.
Where?: Global Footers
The line near the top that says;
var whisperButton = 'URL OF WHISPER BUTTON';
must have the URL of WHISPER BUTTON replaced with the URL of the button you wish to appear on the post panel that users must push in order to set up a 'whisper'.