Requested [url="http://www.torrenttrader.org/index.php?showtopic=13728&view=findpost&p=73095"]Here[/url]
Delete Your old $action of torrentmanage from admincp.php and Add this....
See Screenshot.
Delete Your old $action of torrentmanage from admincp.php and Add this....
if ($action == "torrentmanage") {
if ($do == "delete") {
if (!@count($_POST["torrentids"]))
show_error_msg("Error", "Nothing selected click <a href='admincp.php?action=torrentmanage'>here</a> to go back.", 1);
foreach ($_POST["torrentids"] as $id) {
deletetorrent(intval($id));
write_log("Torrent ID $id was deleted by $CURUSER[username]");
}
show_error_msg("Torrents Deleted", "Go <a href='admincp.php?action=torrentmanage'>back</a>?", 1);
}
$search = (!empty($_GET["search"])) ? htmlspecialchars(trim($_GET["search"])) : "";
$where = ($search == "") ? "" : "WHERE name LIKE " . sqlesc("%$search%") . "";
$count = get_row_count("torrents", $where);
list($pagertop, $pagerbottom, $limit) = pager(25, $count, "admincp.php?action=torrentmanage&");
$res = mysql_query("SELECT id, name, seeders, leechers, visible, banned, external FROM torrents $where ORDER BY name $limit");
stdhead("Torrent Management");
navmenu();
begin_frame("Torrent Management");
?>
<center>
<form method='get' action='admincp.php'>
<input type='hidden' name='action' value='torrentmanage' />
Search: <input type='text' name='search' value='<?php echo $search; ?>' size='30' />
<input type='submit' value='Search' />
</form>
<form method='post' action='admincp.php?action=torrentmanage'>
<input type='hidden' name='do' value='delete' />
<table cellpadding='5' cellspacing='3' class='table_table'>
<tr>
<th class='table_head'>Name</th>
<th class='table_head'>Visible</th>
<th class='table_head'>Banned</th>
<th class='table_head'>Seeders</th>
<th class='table_head'>Leechers</th>
<th class='table_head'>External</th>
<th class='table_head'>Edit</th>
<th class='table_head'>Del</th>
</tr>
<?php while ($row = mysql_fetch_array($res)) { ?>
<tr>
<td class='table_col1'><a href='torrents-details.php?id=<?php echo $row["id"]; ?>'><?php echo CutName(htmlspecialchars($row["name"]), 40); ?></a></td>
<td class='table_col2'><?php echo $row["visible"]; ?></td>
<td class='table_col1'><?php echo $row["banned"]; ?></td>
<td class='table_col2'><?php echo number_format($row["seeders"]); ?></td>
<td class='table_col1'><?php echo number_format($row["leechers"]); ?></td>
<td class='table_col2'><?php echo $row["external"]; ?></td>
<td class='table_col1'><a href='torrents-edit.php?id=<?php echo $row["id"]; ?>'>Edit</a></td>
<td class='table_col2'><input type='checkbox' name='torrentids[]' value='<?php echo $row["id"]; ?>' /></td>
</tr>
<?php } ?>
</table>
<br />
<input type='button' value='Check All' onclick='this.value=check(form)' />
<input type='submit' value='Delete checked' />
</form>
<br />
<?php echo $pagerbottom; ?>
</center>
<?php
end_frame();
stdfoot();
}See Screenshot.
