Well here is something that'll work for TF2.1b2. Let me know if there is any problems with it as I've a fairly hacked up version of TF running right now.
First, add this to dir.php
Added under
function ConfirmDelete(file)
{
return confirm("You are about to delete: " + file)
}
function checkCheck(thisIn)
{
var form = thisIn.form, i = 0;
for(i=0; i < form.length; i++)
{
if( form[i].type == 'checkbox' && form[i].name != 'checkall')
{
form[i].checked = thisIn.checked;
}
}
}
Added under
//get the real parentURL
if (preg_match("/^(.+)\/.+$/",$dir,$matches) == 1)
{
$parentURL="dir.php?dir=" . urlencode($matches[1]);
}
/* --- Multi Delete Hack --- */
echo "<table cellpadding=2 width=740>";
echo '<form action="multi.php" method="post" name="multidir">';
echo '<input type="hidden" name="action" value="fileDelete" />';
echo '<tr><td colspan="3"><a href="'.$parentURL.'"><img src="images/up_dir.gif" width="16" height="16" title="'._BACKTOPARRENT.'" border=0>['._BACKTOPARRENT.']</a></td>';
echo '<td align="right"><a href="javascript:document.multidir.submit()" onclick="return ConfirmDelete(\'Multiple Files\')"><img src="images/delete_on.gif" title="Delete" border="0" height="16" width="16"></a><input type="checkbox" onclick="checkCheck(this);" /></td></tr>';
/* --- Multi Delete Hack --- */
You need to comment out the following line too.
echo "<table cellpadding=2 width=740>";
Then add the following in dir.php also. It's found in two places.
/* --- Multi Delete Hack --- */
/* checkbox appended to line */
echo "<a href=\"dir.php?del=".urlencode($dir.$entry)."\" onclick=\"return ConfirmDelete('".addslashes($entry)."')\"><img src=\"images/delete_on.gif\" width=16 height=16 title=\""._DELETE."\" border=0></a><input type=\"checkbox\" name=\"file[]\" value=\"".urlencode($dir.$entry)."\">";
/* --- Multi Delete Hack --- */
Then in functions.php
/* --- Multi Delete Hack --- */
/* Closing form tag added */
echo "[<a href=\"index.php\">"._RETURNTOTORRENTS."</a>]";
echo "</form>";
/* --- Multi Delete Hack --- */
Attached is multi.php (modified) which is needed to make this work. I'll be fixing dir.php so that the multi delete link will appear above the checkboxes later on and will edit the post then.