Post by Triad on Nov 16, 2008 15:29:40 GMT -5
This script gives all staff an extra "UBBC" button that replaces all highlighted text in a user's message with a censored "message". This is meant to make it easier for staff when having to deal with spam.
This was requested by absolute who has generously made a UBBC button and a censored image as shown below. Please host them yourself if you can.
I would like to point out that you can use text, UBBC or smilies for the censoring message, but if you choose to use an image or a long message, I would suggest using a short keyword word such as :censor: for the censoredMessage variable which can be replaced with the Proboards built in censoring feature.
Global Footers
<script type="text/javascript"><!--
/*
Censor Text Button For Staff
Created by Triad
*/
var censoredMessage = ":censor:";
var _imgURL = "http://img233.imageshack.us/img233/6818/censoredubbchv0.gif";
function staffReplace(){
if(arguments[0]){
var t = document.postForm.message;
if(typeof t.selectionStart != "undefined"){
var start = t.value.substr(0, t.selectionStart);
var end = t.value.substr(t.selectionEnd, t.value.length);
var curSel = start + arguments[0];
t.value = curSel + end;
t.focus();
t.setSelectionRange(curSel.length, curSel.length);
} else if(document.all){
t.focus();
var curSel = document.selection.createRange();
curSel.text = arguments[0];
}
}
}
if(document.postForm){
var tb = document.getElementsByTagName("table");
for(x=2,y=tb.length; x<y; x++){
if(tb[x].cellPadding == "4" && tb[x].rows[1] && tb[x].rows[1].cells[0].innerHTML.match(/subject:/i)){
if(tb[x].rows[tb[x].rows.length-2].cells[0].innerHTML.match(/(announcement|sticky|lock)/i)){
var _img = document.createElement("img");
_img.src = _imgURL;
_img.border = 0;
_img.alt = "Staff Replace";
var _a = document.createElement("a");
_a.href = "Javascript: staffReplace(censoredMessage)";
_a.appendChild(_img);
document.postForm.color.parentNode.appendChild(_a);
break;
}
}
}
}
//--></script>
If you have any problems or suggestion for this script, please post them here.
Enjoy
This was requested by absolute who has generously made a UBBC button and a censored image as shown below. Please host them yourself if you can.
I would like to point out that you can use text, UBBC or smilies for the censoring message, but if you choose to use an image or a long message, I would suggest using a short keyword word such as :censor: for the censoredMessage variable which can be replaced with the Proboards built in censoring feature.
Global Footers
<script type="text/javascript"><!--
/*
Censor Text Button For Staff
Created by Triad
*/
var censoredMessage = ":censor:";
var _imgURL = "http://img233.imageshack.us/img233/6818/censoredubbchv0.gif";
function staffReplace(){
if(arguments[0]){
var t = document.postForm.message;
if(typeof t.selectionStart != "undefined"){
var start = t.value.substr(0, t.selectionStart);
var end = t.value.substr(t.selectionEnd, t.value.length);
var curSel = start + arguments[0];
t.value = curSel + end;
t.focus();
t.setSelectionRange(curSel.length, curSel.length);
} else if(document.all){
t.focus();
var curSel = document.selection.createRange();
curSel.text = arguments[0];
}
}
}
if(document.postForm){
var tb = document.getElementsByTagName("table");
for(x=2,y=tb.length; x<y; x++){
if(tb[x].cellPadding == "4" && tb[x].rows[1] && tb[x].rows[1].cells[0].innerHTML.match(/subject:/i)){
if(tb[x].rows[tb[x].rows.length-2].cells[0].innerHTML.match(/(announcement|sticky|lock)/i)){
var _img = document.createElement("img");
_img.src = _imgURL;
_img.border = 0;
_img.alt = "Staff Replace";
var _a = document.createElement("a");
_a.href = "Javascript: staffReplace(censoredMessage)";
_a.appendChild(_img);
document.postForm.color.parentNode.appendChild(_a);
break;
}
}
}
}
//--></script>
If you have any problems or suggestion for this script, please post them here.
Enjoy