Post by Uchiha Sasuke on Jul 31, 2004 3:06:47 GMT
well, this is basically the same as the third one, all bugs fixed, and, the board's mods are already found in this code, as well as being able to allow regular members to to view all secret messages
what this code does is allow you to send secret messages within a post to other users
Features (6):
Send secret messages to other users within posts
Multiple user selection for messages
Admin, G-mod, and moderators (only in there board) able to view all secret messages
View own secrets that are sent
Choose special users that have power to view all secrets
Bugs fixed
Directions:
so, lets say you want to just send a secret message to jeo
you'd type
well, lets say you want to send the same message to jeo, jake, and jerry
you'd type
To add special users that have the power to view all secrets, which will most likely be the board moderators, just edit the colored part of the code, and directions to that will be at the bottom of the code
Code goes in FOOTERS
Now, to add Special users that will have power to view all secret messages, find this part in the code
see where is says "Member1", that is where the special user's login name will go
to add more than one, keep adding
and up the yellow number by 1 each time, like say i wanted Member1 and Member2 to both be able to view all secrets, it'd look like this
other than that, have fun ^_~
#nosmileys#nosmileys
what this code does is allow you to send secret messages within a post to other users
Features (6):
Send secret messages to other users within posts
Multiple user selection for messages
Admin, G-mod, and moderators (only in there board) able to view all secret messages
View own secrets that are sent
Choose special users that have power to view all secrets
Bugs fixed
Directions:
so, lets say you want to just send a secret message to jeo
you'd type
[whisper=jeo]THE MESSAGE[/whisper]
well, lets say you want to send the same message to jeo, jake, and jerry
you'd type
[whisper=jeo,jake,jerry]THE MESSAGE[/whisper]
To add special users that have the power to view all secrets, which will most likely be the board moderators, just edit the colored part of the code, and directions to that will be at the bottom of the code
Code goes in FOOTERS
<script>
/*
Send Secret Message v4.0
Coded by NCGI (Uchiha Sasuke)
Please do NOT remove this credit, or else
your board will be in violation of copyright laws
This code may NOT be reposted without express permission of the creator
*/
SpecialMember = new Array();
SpecialMember[0] = "Member1"
var TD = document.getElementsByTagName("TD");
var ModNames = "";
for (t=0;t<TD.length;t++) {
function alertit() {
alert('When putting in the username for the person you want to send the secret message to\nRemeber that the username has to be the name that that person logs in with\n\nTo Send A Secret To Multiple People\nAll you have to do is put the first username in, then after the first, put a cama, then the next name.\nFor Example: I want to send a message to john, joe, and green, it would look like this\n\n[whisper=john,joe,green]Message[/whisper]');
}
function FixQuote() {
document.postmodify.message.innerHTML = document.postmodify.message.innerHTML.replace(/\n/gi,"%break%");
if (document.postmodify.message.value.match(/\[whisper=(.+?)\](.+?)\[\/whisper\]/gi)) {
quotereplacement = "[whisper="+RegExp.$1+"]"+RegExp.$2+"[/whisper]"
document.postmodify.message.value = document.postmodify.message.value.replace(quotereplacement,'');}
document.postmodify.message.value = document.postmodify.message.value.replace(/%break%/gi,"\n");}
if (location.href.indexOf("quote=") != -1) {
FixQuote();}
function viewsecret() {
if (TD[5].innerHTML.match(/username=(.+?)">/i)) {username = RegExp.$1+','}
else {username = ''}
if (document.postmodify.message.value.match(/\[whisper=(.+?)\](.+?)\[\/whisper\]/gi)) {
vto = RegExp.$1
vmessage = RegExp.$2
removeusername = "[whisper="+vto+"]"+vmessage+"[/whisper]"
if (vto.match(username)) {}
else {document.postmodify.message.value = document.postmodify.message.value.replace(removeusername,'[whisper='+username+vto+']'+vmessage+'[/whisper]')
viewsecret()}}}
function GetMods() {
if (TD[t].parentNode.parentNode.parentNode.width=="100%" && TD[t].firstChild.tagName=="IMG" && TD[t].innerHTML.match(/Moderato(r|rs): /gi)) {
for (h=0;h<TD[t].getElementsByTagName('a').length;h++) {
if (TD[t].getElementsByTagName('a')[h].href.match(/username=/gi)) {
mn = TD[t].getElementsByTagName('a')[h].href.split('viewprofile&')[1]+"|";
ModNames = ModNames+mn;}}}
}
function DoWhisper() {
if (ModNames=="") {GetMods();}
else {
if (TD[t].innerHTML.match(/\[whisper=(.+?)\](.+?)\[\/whisper\]/gi)) {
var to = RegExp.$1
var replacehidden = RegExp.$2
var secondto = to; var thirdto = to
if (secondto.match(/,/)) {secondto = secondto.replace(/,/gi,'|username='); }
if (thirdto.match(/,/)) {thirdto = thirdto.replace(/,/gi,', ')}
for (s=0;s<SpecialMember.length;s++) {addmember = '|username='+SpecialMember}
hiddento = '(action=admin'+addmember+'|'+ModNames+'username='+secondto+')'
if (TD[2].innerHTML.match(/Welcome/)) {smessage = ""}
else if (TD[5].innerHTML.match(hiddento)) {
smessage = '<br/><br/>Whispered Message To: '+thirdto+'<table class="bordercolor" cellspacing="1" width="90%" name="secret"><tr><td width="100%"><table cellpadding="2" cellspacing="0" class="quote" width="100%"><tr><td width="100%"><font face="Arial,Helvetica" class="quote" size="1">'+replacehidden+'</font></td></tr></table></td></tr></table><br/><br/>'}
else {smessage = ""}
if (smessage.match(/<b>Whispered Message To:\s(.+?),\s/i)) {
tonothing = '<b>Whispered Message To: '+RegExp.$1+','
smessage = smessage.replace(tonothing,'<b>Whispered Message To:')}
replaceit = "[whisper="+to+"]"+replacehidden+"[/whisper]"
TD[t].innerHTML = TD[t].innerHTML.replace(replaceit,smessage)
DoWhisper()}}}
if (location.href.indexOf("=post") != -1 || location.href.indexOf("=reply") != -1 || location.href.indexOf("=modify") != -1 || location.href.indexOf("=createpoll") != -1 ) {document.postmodify.onsubmit = viewsecret
if (TD[t].innerHTML.match(/Add Smileys:/) && TD[t].className=="windowbg2" && TD[t].width=="23%") {
document.postmodify.post[0].onclick="viewsecret()"
TD[t+1].innerHTML = TD[t+1].innerHTML+"<br/><a href=\"javascript:void(0)\"><span onclick=\"alertit(),add('[whis'),add('per=USERNAME(s)]Message[/whis'),add('per]')\">Secret</span></a>"
}
else if (TD[t].innerHTML.match(/<textarea/i)) {}
else {DoWhisper();}}
if (location.href.indexOf("=display") != -1 || location.href.indexOf("=recent") != -1) {DoWhisper();}}
</script>
/*
Send Secret Message v4.0
Coded by NCGI (Uchiha Sasuke)
Please do NOT remove this credit, or else
your board will be in violation of copyright laws
This code may NOT be reposted without express permission of the creator
*/
SpecialMember = new Array();
SpecialMember[0] = "Member1"
var TD = document.getElementsByTagName("TD");
var ModNames = "";
for (t=0;t<TD.length;t++) {
function alertit() {
alert('When putting in the username for the person you want to send the secret message to\nRemeber that the username has to be the name that that person logs in with\n\nTo Send A Secret To Multiple People\nAll you have to do is put the first username in, then after the first, put a cama, then the next name.\nFor Example: I want to send a message to john, joe, and green, it would look like this\n\n[whisper=john,joe,green]Message[/whisper]');
}
function FixQuote() {
document.postmodify.message.innerHTML = document.postmodify.message.innerHTML.replace(/\n/gi,"%break%");
if (document.postmodify.message.value.match(/\[whisper=(.+?)\](.+?)\[\/whisper\]/gi)) {
quotereplacement = "[whisper="+RegExp.$1+"]"+RegExp.$2+"[/whisper]"
document.postmodify.message.value = document.postmodify.message.value.replace(quotereplacement,'');}
document.postmodify.message.value = document.postmodify.message.value.replace(/%break%/gi,"\n");}
if (location.href.indexOf("quote=") != -1) {
FixQuote();}
function viewsecret() {
if (TD[5].innerHTML.match(/username=(.+?)">/i)) {username = RegExp.$1+','}
else {username = ''}
if (document.postmodify.message.value.match(/\[whisper=(.+?)\](.+?)\[\/whisper\]/gi)) {
vto = RegExp.$1
vmessage = RegExp.$2
removeusername = "[whisper="+vto+"]"+vmessage+"[/whisper]"
if (vto.match(username)) {}
else {document.postmodify.message.value = document.postmodify.message.value.replace(removeusername,'[whisper='+username+vto+']'+vmessage+'[/whisper]')
viewsecret()}}}
function GetMods() {
if (TD[t].parentNode.parentNode.parentNode.width=="100%" && TD[t].firstChild.tagName=="IMG" && TD[t].innerHTML.match(/Moderato(r|rs): /gi)) {
for (h=0;h<TD[t].getElementsByTagName('a').length;h++) {
if (TD[t].getElementsByTagName('a')[h].href.match(/username=/gi)) {
mn = TD[t].getElementsByTagName('a')[h].href.split('viewprofile&')[1]+"|";
ModNames = ModNames+mn;}}}
}
function DoWhisper() {
if (ModNames=="") {GetMods();}
else {
if (TD[t].innerHTML.match(/\[whisper=(.+?)\](.+?)\[\/whisper\]/gi)) {
var to = RegExp.$1
var replacehidden = RegExp.$2
var secondto = to; var thirdto = to
if (secondto.match(/,/)) {secondto = secondto.replace(/,/gi,'|username='); }
if (thirdto.match(/,/)) {thirdto = thirdto.replace(/,/gi,', ')}
for (s=0;s<SpecialMember.length;s++) {addmember = '|username='+SpecialMember
hiddento = '(action=admin'+addmember+'|'+ModNames+'username='+secondto+')'
if (TD[2].innerHTML.match(/Welcome/)) {smessage = ""}
else if (TD[5].innerHTML.match(hiddento)) {
smessage = '<br/><br/>Whispered Message To: '+thirdto+'<table class="bordercolor" cellspacing="1" width="90%" name="secret"><tr><td width="100%"><table cellpadding="2" cellspacing="0" class="quote" width="100%"><tr><td width="100%"><font face="Arial,Helvetica" class="quote" size="1">'+replacehidden+'</font></td></tr></table></td></tr></table><br/><br/>'}
else {smessage = ""}
if (smessage.match(/<b>Whispered Message To:\s(.+?),\s/i)) {
tonothing = '<b>Whispered Message To: '+RegExp.$1+','
smessage = smessage.replace(tonothing,'<b>Whispered Message To:')}
replaceit = "[whisper="+to+"]"+replacehidden+"[/whisper]"
TD[t].innerHTML = TD[t].innerHTML.replace(replaceit,smessage)
DoWhisper()}}}
if (location.href.indexOf("=post") != -1 || location.href.indexOf("=reply") != -1 || location.href.indexOf("=modify") != -1 || location.href.indexOf("=createpoll") != -1 ) {document.postmodify.onsubmit = viewsecret
if (TD[t].innerHTML.match(/Add Smileys:/) && TD[t].className=="windowbg2" && TD[t].width=="23%") {
document.postmodify.post[0].onclick="viewsecret()"
TD[t+1].innerHTML = TD[t+1].innerHTML+"<br/><a href=\"javascript:void(0)\"><span onclick=\"alertit(),add('[whis'),add('per=USERNAME(s)]Message[/whis'),add('per]')\">Secret</span></a>"
}
else if (TD[t].innerHTML.match(/<textarea/i)) {}
else {DoWhisper();}}
if (location.href.indexOf("=display") != -1 || location.href.indexOf("=recent") != -1) {DoWhisper();}}
</script>
Now, to add Special users that will have power to view all secret messages, find this part in the code
SpecialMember[0] = "Member1"
see where is says "Member1", that is where the special user's login name will go
to add more than one, keep adding
SpecialMember[0] = "Member1"
and up the yellow number by 1 each time, like say i wanted Member1 and Member2 to both be able to view all secrets, it'd look like this
SpecialMember[0] = "Member1"
SpecialMember[1] = "Member2"
SpecialMember[1] = "Member2"
other than that, have fun ^_~
#nosmileys#nosmileys