Post by Todge on Mar 9, 2006 13:13:25 GMT -8
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..
Put it in your Global Footer..
Edit this line at the top..
with the URL of the image you want as the Whisper Button..
Any whispers will appear red and italic if the viewer is one of the receivers, otherwise they will not appear at all..
Put it in your Global Footer or the footer of the board you want it to work on..
Put it in your Global Footer..
<script type="text/javascript">
<!--
/*
Whisper Tags (V2)
by Todge
Copyright © 2009
Please keep this header intact
*/
// Edit Below...
var whisperButton = 'URL OF IMAGE';
// Edit Above...
// Add button to posting page..
if(document.postForm && !location.href.match(/tion=pmsend/))
{
function getPeeps()
{
var wPeeps = '';
wPeeps = prompt('Please enter the USERNAMES of the poeple you want to whisper to, seperated by commas.. (admin,Guest,'+pb_username+')','');
if(wPeeps != null && wPeeps != '')
{
add('[whisper='+wPeeps+']','[/whisper]');
return;
}
else if(wPeeps == '')
{
alert('You have to whisper to someone..');
getPeeps();
}
return;
}
var newButton = document.createElement('a');
newButton.innerHTML = '<img src="'+whisperButton+'" border="0">';
newButton.href='javascript:getPeeps()';
document.postForm.color.parentNode.appendChild(newButton);
}
// Remove whispers from quotes..
if(document.postForm && location.href.match(/"e/))
{
var rW = document.postForm.message.value.split(/\[\/whisper\]/);
for(r=0; r<rW.length; r++)
{
rW[r] = rW[r].replace(/\[whisper=(.)+/,'');
}
document.postForm.message.value = rW.join('');
}
// Find and hide whispers...
if(location.href.match(/tion=(display|post&thread|recent|pmview)/))
{
var posts = document.getElementsByTagName('font');
for(p=0; p<posts.length; p++)
{
if((posts[p].innerHTML.match(/google_ad_section_start/) || (document.postForm && posts[p].size=="1")) && posts[p].innerHTML.match(/\[whisper=/))
{
var whispers = posts[p].innerHTML.split(/\[whisper=/);
for(w=1; w<whispers.length; w++)
{
var thisW = whispers[w].split(/\]/)[1].split(/\[\/whisper/)[0];
var shPeeps = whispers[w].split(/\]/)[0];
if(shPeeps.match(pb_username))
{
posts[p].innerHTML = posts[p].innerHTML.replace('[whisper='+shPeeps+']'+thisW+'[/whisper]','<font color="red"><i>'+thisW+'</i></font>');
}
else if(!shPeeps.match(pb_username))
{
posts[p].innerHTML = posts[p].innerHTML.replace('[whisper='+shPeeps+']'+thisW+'[/whisper]','');
}}}}}
// -->
</script>
Edit this line at the top..
var whisperButton = 'URL OF IMAGE';
with the URL of the image you want as the Whisper Button..
Any whispers will appear red and italic if the viewer is one of the receivers, otherwise they will not appear at all..
Please note..
Any staff member that can modify a member's post will be able to see all whispers when modifying..
!PLEASE BE AWARE THAT NO CODE IS TOTALLY SECURE..
I DON'T RECOMMEND SENSITIVE OR PERSONAL INFO BE USED WITH THIS CODE!
Any staff member that can modify a member's post will be able to see all whispers when modifying..
!PLEASE BE AWARE THAT NO CODE IS TOTALLY SECURE..
I DON'T RECOMMEND SENSITIVE OR PERSONAL INFO BE USED WITH THIS CODE!