Post by Moose on Aug 31, 2006 8:34:54 GMT -8
This code will add checkboxes to your request boards so when a request is filled or needs closing, all the staff member has to do is check the box and click the Post Reply button.
A preview of how it will look:
http://img./v312/gbeerbower/reqfillprev.png
Now put the code in the footers of your request boards. That simple.
Editing takes place here:
You can add and remove them just change the numbers in [] use your judgement. Now anyway first set of quotes if the title of the box, the next is the description, the next is the message added when check(use \n not return), and finally the last is a yes or no(whether or not the the thread locks or not after the post).
A preview of how it will look:
http://img./v312/gbeerbower/reqfillprev.png
Now put the code in the footers of your request boards. That simple.
<script type="text/javascript">
<!--
/*
Filled Request Checkboxes
Coded By Moose
Don't repost or edit
*/
var reqresps = new Array();
reqresps[0] = ["Request Filled","Check this if the request has been filled.","Your request has been filled.\n\nPM a staff member if you are not happy with the result.","yes"];
reqresps[1] = ["Request Closed","Check this if the request needs to be closed.","Your request has broken the rules.","yes"];
if(location.href.match(/action=post&thread=/)){
function doReqResp(){
var input = document.getElementsByTagName('input');
for(i=0;i<input.length;i++){
if(input[i].type == "checkbox" && input[i].id.match(/^reqrespinp(\d+)$/) && input[i].checked == true){
var rnum = parseInt(RegExp.$1);
document.postForm.message.value += reqresps[rnum][2];
if(reqresps[rnum][3].match(/^yes$/i)){
document.getElementsByName('lock')[0].checked = true;
}}}}
var isstaff = false;
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 Reply/)){
var td = table[t].getElementsByTagName('td');
for(g=0;g<td.length;g++){
if(td[g].width == "30%" && td[g].className == "windowbg" && td[g].innerHTML.match(/Lock Thread:/)){
isstaff = true;
break;
}}
for(r=0;r<reqresps.length;r++){
var newrow = table[t].insertRow(table[t].getElementsByTagName('tr').length - 1);
var cellone = newrow.insertCell(0);
var celltwo = newrow.insertCell(1);
cellone.width = "30%";
cellone.className = "windowbg";
cellone.innerHTML = '<font size="2">'+reqresps[r][0]+':</font>';
celltwo.width = "70%";
celltwo.className = "windowbg";
celltwo.innerHTML = '<input type="checkbox" id="reqrespinp'+r+'" /> <font size="1">'+reqresps[r][1]+'</font>';
}}}
if(document.addEventListener){
document.postForm.addEventListener('submit',doReqResp,false);
} else {
document.postForm.attachEvent('onsubmit',doReqResp);
}}
//-->
</script>
Editing takes place here:
reqresps[0] = ["Request Filled","Check this if the request has been filled.","Your request has been filled.\n\nPM a staff member if you are not happy with the result.","yes"];
reqresps[1] = ["Request Closed","Check this if the request needs to be closed.","Your request has broken the rules.","yes"];
You can add and remove them just change the numbers in [] use your judgement. Now anyway first set of quotes if the title of the box, the next is the description, the next is the message added when check(use \n not return), and finally the last is a yes or no(whether or not the the thread locks or not after the post).