Tool: PunBB Forum
Purpose: This plugin is for administrators to remove multiple users along with their posts by the selection of checkbox.
Author: Praveen.V.Nair
Date: 15 November 2007
}
/*
else // If not, we show the "Show text" form
{
*/
// Display the admin navigation menu
// generate_admin_menu($plugin);
?>
<script language="javascript">
checked = false;
function SelectAll() {
if (checked == false){checked = true}else{checked = false}
for (var i = 0; i < document.getElementById('removeusersform').elements.length; i++) {
document.getElementById('removeusersform').elements[i].checked = checked;
}
EnableSubmit(0);
}
function EnableSubmit(s) {
if (s != 0) document.getElementById('chkSelectAll').checked = false;
for (var i = 0; i < document.getElementById('removeusersform').elements.length; i++) {
if (document.getElementById('removeusersform').elements[i].checked == true) {
document.getElementById("btnSubmit").disabled = false;
return;
}
}
document.getElementById("btnSubmit").disabled = true;
}
</script>
<div id="exampleplugin" class="blockform">
<h2><span>Remove Users </span>v1.0</h2>
<div class="box">
<div class="inbox">
<p>This plugin simply removes multiple users with posts. Useful for 'spam' cleanup. </p>
<p>Programmed by Praveen (
) </p>
</div>
</div>
<h2 class="block2">Manage</h2>
<div class="box">
<form id="removeusersform" method="post" action="<?php echo $_SERVER['REQUEST_URI'] ?>" onsubmit="return confirm('Are you sure you want to remove these users along with their posts?')">
<div class="inform">
<table cellpadding="0" cellspacing="1" border="0" style="width:500px">
<tr><th >Username</th><th style="width:50px;">Posts #</th></th><th>Email</th><th style="width:30px"><input type='checkbox' onclick="SelectAll()" id="chkSelectAll"></th></tr>
<?php
$result = $db->query('SELECT id, group_id, username, num_posts, email FROM '.$db->prefix.'users ORDER BY id') or error('Unable to fetch user info', __FILE__, __LINE__, $db->error());
if ($db->num_rows($result))
{
$cnt = 0;
while ($cur_dupe = $db->fetch_assoc($result)) {