This is not my work. Just sharing it.
I dont know if this mod its already posted.
Run SQL
PHP Code:
ALTER TABLE `groups` ADD `maxslots` int(10) NOT NULL DEFAULT '0';
Open admincp.php go near groups management and find...
PHP Code:
print("<td class=table_head>Download</td>\n");
Underneath add
PHP Code:
print("<td class=table_head>Download Slots</td>\n");
Abit underneath you will find...
PHP Code:
print("<td class=table_col1>".$level["can_download"]."</td>\n");
Underneath add
PHP Code:
print("<td class=table_col1>".$level["maxslots"]."</td>\n");
Find
PHP Code:
<tr><td>Can Download:</td><td> <?php echo YES;?> <input type="radio" name="down" value="yes" <?php if ($level["can_download"]=="yes") echo "checked" ?> /> <?php echo NO;?> <input type="radio" name="down" value="no" <?php if ($level["can_download"]=="no") echo "checked" ?> /></td></tr>
Underneath add
PHP Code:
<tr><td>Download Slots:</td><td><input type="text" name="downslots" value="<?php echo number_format($level["maxslots"]);?>" size="40" /></td></tr>
Find
PHP Code:
$update[]="control_panel='".$_POST["admincp"]."'";
Underneath add
PHP Code:
if (is_valid_id($_POST["downslots"]))
$update[]="maxslots='".$_POST["downslots"]."'";
Find
PHP Code:
$update[]="control_panel='".$level["control_panel"]."'";
Underneath add
PHP Code:
$update[]="maxslots='".$level["maxslots"]."'";
open announce.php find...
PHP Code:
// FILL $SELF WITH DETAILS FROM PEERS TABLE (CONNECTING PEERS DETAILS)
if (!isset($self)){
Underneath add
PHP Code:
if ($MEMBERSONLY){
$query = @mysql_fetch_row(@mysql_query("SELECT COUNT(DISTINCT torrent) FROM `peers` WHERE `userid` = '$userid' AND `seeder`='no'"));
$queries = mysql_query("SELECT `maxslots` FROM `groups` WHERE `group_id` = $user[class]");
$row = mysql_fetch_array($queries);
$maxslot = $row[0];
if ($query[0] >= $maxslot)
err("Maximum Slot exceeded! You may only download $maxslot torrent at a time.");
}
Open login_block.php
PHP Code:
$userratio = "---";
Underneath add
PHP Code:
$query = @mysql_fetch_row(@mysql_query("SELECT COUNT(DISTINCT torrent) FROM peers WHERE userid = $CURUSER[id] AND seeder='no'"));
$slots = number_format($CURUSER["maxslots"]) . "/" . number_format($query[0]);
Find
Add after
PHP Code:
<BR>Download Slots: $slots
By default the slots are 0 for every class so i as soon as u do the sql query i would enter some numbers in there for each user class.