Post by Moose on Jan 16, 2007 12:38:34 GMT -8
This code will add a Disable UBBC row above the current Disable Smilies row with a checkbox that will disable UBBC in your post.
Global Footer:
Global Footer:
<script type="text/javascript">
<!--
/*
Disable UBBC Checkbox In Posts
Coded By Greg/Moose
Requested By Tech Geek
Don't edit or repost
*/
if(document.postForm){
var posting = document.postForm.message;
function noubbcIt(){
var disubbcch = document.getElementById('disubbcch');
if(disubbcch.checked){
if(!posting.value.match(/^\[noubbc\]/i) && !posting.value.match(/\[\/noubbc\]$/i)){
posting.value = '['+'noubbc'+']'+posting.value+'['+'/noubbc'+']';
}} else {
if(posting.value.match(/^\[noubbc\]/i) && posting.value.match(/\[\/noubbc\]$/i)){
posting.value = posting.value.replace(/^\[noubbc\]/i,'');
posting.value = posting.value.replace(/\[\/noubbc\]$/i,'');
}}}
var table = document.getElementsByTagName('table');
for(t=0;t<table.length;t++){
if(table[t].cellPadding == "4" && table[t].cellSpacing == "1" && table[t].width == "100%" && table[t].getElementsByTagName('b')[0] && table[t].innerHTML.match(/Post Message|Post Reply|Modify Post|Send Personal Message/)){
var tr = table[t].getElementsByTagName('tr');
for(r=0;r<tr.length;r++){
if(tr[r].cells[0] && tr[r].cells[0].width == "30%" && tr[r].cells[0].className == "windowbg" && tr[r].cells[0].innerHTML.match(/Disable Smilies:/)){
var newrow = table[t].insertRow(r);
var cellone = newrow.insertCell(0);
var celltwo = newrow.insertCell(1);
cellone.width = "30%";
cellone.className = "windowbg";
cellone.innerHTML = '<font size="2">Disable UBBC:</font>';
celltwo.width = "70%";
celltwo.className = "windowbg";
celltwo.innerHTML = '<input type="checkbox" id="disubbcch" /> <font size="1">If this box is checked, ubbc tags will be disabled in your message.</font>';
break;
}}
var disubbcch = document.getElementById('disubbcch');
}}
if(posting.value.match(/^\[noubbc\]/i) && posting.value.match(/\[\/noubbc\]$/i)){
disubbcch.checked = true;
}
if(document.addEventListener){
document.postForm.addEventListener('submit',noubbcIt,false);
} else {
document.postForm.attachEvent('onsubmit',noubbcIt);
}}
//-->
</script>