Post by Paper on Apr 29, 2006 12:53:19 GMT -8
EDIT: I've heard rumours that this code does not work. Sorry guys, I dunno what is up with that. I'll get around to rewriting it soon.
The idea is that instead of actually removing topics, they get moved to a board only viewable by the moderators. This means you can see which topics were removed from the forum.
Please note that credit goes to GAMEchief for the idea, but that I haven't broken any copyright since this code works using completely different methods.
It fixes several existing problems with his script.
1. Click "Admin" at the top
2. Click "Create Board"
3. It is recommended that you place the board in a category only viewable by staff members
4. Change the ID to "trash" and change the view board option to "Only Staff"
5. Create the board
6. Click "Headers and Footers"
7. Select "Global Header / Footer"
8. Place the following code into the footer:
9. Submit the footer
10. You can change "allowEmpty = 0" to "allowEmpty = 1" if you want your moderators to be able to delete topics from the recycling bin board.
The idea is that instead of actually removing topics, they get moved to a board only viewable by the moderators. This means you can see which topics were removed from the forum.
Please note that credit goes to GAMEchief for the idea, but that I haven't broken any copyright since this code works using completely different methods.
It fixes several existing problems with his script.
1. Click "Admin" at the top
2. Click "Create Board"
3. It is recommended that you place the board in a category only viewable by staff members
4. Change the ID to "trash" and change the view board option to "Only Staff"
5. Create the board
6. Click "Headers and Footers"
7. Select "Global Header / Footer"
8. Place the following code into the footer:
<script type="text/javascript">
/*
Recycle bin system by Paper (http://papercodes.proboards77.com)
Thanks to GAMEchief for the idea (www.GamingMedley.com)
Please do not remove the copyright
*/
recyclebin = "trash";
allowEmpty = 0;
var a = document.getElementsByTagName('a');
for (r=0; r<a.length; r++) {
if (a[r].href.match(/action=removethread/)) {
if (document.location.href.indexOf("board="+recyclebin) == -1) {
a[r].href=a[r].href.replace(/delete/,"recycle");
a[r].href=a[r].href.replace(/action=removethread/,"action=movetopic2&displaymessage=0&moveto="+recyclebin);
a[r].href=a[r].href.replace(/&thread=/,"&thread-");
a[r].href=a[r].href.replace(/'\);/,"=1');");
} else {
a[r].innerHTML="";
}
}
}
function recycle() {
var list="";
for(var cAi=0;cAi<document.ammForm.elements.length;cAi++) {
if(document.ammForm.elements[cAi].name.indexOf("thread-") != -1) {
if (document.ammForm.elements[cAi].checked == 1) {
list=list+"&"+document.ammForm.elements[cAi].name + "=1";
}
}
}
document.location.href+="&action=movetopic2&displaymessage=0&moveto="+recyclebin+list;
}
if (document.location.href.indexOf("board=") > -1) {
var td = document.getElementsByTagName('td');
for (r=0; r<td.length; r++) {
if (td[r].innerHTML.indexOf("javascript:popWindow") == -1) {
if (td[r].innerHTML.match(/Remove Thread/)) {
if (document.location.href.indexOf("board="+recyclebin) == -1) {
td[r].innerHTML+="<font size=\"-2\"> <a style=\"cursor:pointer;\" onMouseOver=\"setWindowStatus('Recycle Thread')\" onMouseOut=\"setWindowStatus('')\" onClick=\"recycle();\"><img src=\"http://s2.images.proboards.com/buttons/removetopic.gif\" alt=\"[Recycle Thread]\" border=\"0\"/></a></font>";
}
}
}
}
var a = document.getElementsByTagName('a');
for (r=0; r<a.length; r++) {
if (document.location.href.indexOf("board="+recyclebin) > -1 && allowEmpty==1) {
// Allow remove topic option to show
} else {
if (a[r].innerHTML.match(/Remove Thread/)) {
a[r].innerHTML="";
}
}
}
}
</script>
9. Submit the footer
10. You can change "allowEmpty = 0" to "allowEmpty = 1" if you want your moderators to be able to delete topics from the recycling bin board.