Bravo List
Register
Go Back   > Bravo List > Source Code > Trackers > TBDev > Mods & Themes
Reply
  #1  
Old 27-02-13, 10:21
Chez's Avatar
Chez Chez is offline
Senior Member
 
Join Date: Sep 2011
P2P
Posts: 269
Default Max Leech/Seed Slots
attention

Attention

This mod is for 09 version!





Credits to pdq

in announce.php replace:


PHP Code:
define ('UC_VIP'2); 
with:


PHP Code:
$TBDEV['max_slots'] = 1//1=On 0=Off

define ('UC_USER'0);

define ('UC_POWER_USER'1);

define ('UC_VIP'2); 
then find this:


PHP Code:
if ($left && $user['class'] < UC_VIP && $TBDEV['user_ratios'])

        {

                
$gigs $user["uploaded"] / (1024*1024*1024);

                
$elapsed floor((time() - $torrent["ts"]) / 3600);

                
$ratio = (($user["downloaded"] > 0) ? ($user["uploaded"] / $user["downloaded"]) : 1);

                if (
$ratio 0.5 || $gigs 5$wait 48;

                elseif (
$ratio 0.65 || $gigs 6.5$wait 24;

                elseif (
$ratio 0.8 || $gigs 8$wait 12;

                elseif (
$ratio 0.95 || $gigs 9.5$wait 6;

                else 
$wait 0;

                if (
$elapsed $wait)

                                
err("Not authorized (" . ($wait $elapsed) . "h) - READ THE FAQ!");

        } 

replace with:


PHP Code:
if ($left && $user['class'] < UC_VIP) {

    
$ratio = (($user["downloaded"] > 0) ? ($user["uploaded"] / $user["downloaded"]) : 1);

    if (
$TBDEV['user_ratios']) {

        
$gigs $user["uploaded"] / (1024*1024*1024);

        
$elapsed floor((time() - $torrent["ts"]) / 3600);

        if (
$ratio 0.5 || $gigs 5$wait 48;

        elseif (
$ratio 0.65 || $gigs 6.5$wait 24;

        elseif (
$ratio 0.8 || $gigs 8$wait 12;

        elseif (
$ratio 0.95 || $gigs 9.5$wait 6;

        else 
$wait 0;

        if (
$elapsed $wait)

                    
err("Not authorized (" . ($wait $elapsed) . "h) - READ THE FAQ!");

    }

    if (
$TBDEV['max_slots']) {

        if (
$ratio 0.95) {

                switch (
true) {

                        case (
$ratio 0.5):

                        
$max 2;

                        break;

                        case (
$ratio 0.65):

                        
$max 3;

                        break;

                        case (
$ratio 0.8):

                        
$max 5;

                        break;

                        case (
$ratio 0.95):

                        
$max 10;

                        break;

                        default:

                   
$max 10;

                }

         }

         else {

         switch (
$user['class']) {

        
//        case UC_LEECH:

        //        $max = 10;

        //        break;

                        
case UC_USER:

                        
$max 20;

                        break;

                        case 
UC_POWER_USER:

                        
$max 30;

                        break;

        
//        case UC_X_POWER_USER:

        //        $max = 50;

        //        break;

        //        case UC_COMM_STAFF:

        //        $max = 50;

        //        break;

        //        default:

                   
$max 99;

                }       

         }   

        if (
$max 0) {

            
$res mysql_query("SELECT COUNT(*) AS num FROM peers WHERE userid='$userid' AND seeder='no'") or err("Tracker error 5");

            
$row mysql_fetch_assoc($res);

            

            if (
$row['num'] >= $max

                
err("Access denied (Torrents Limit exceeded - $max) See FAQ!");

        }

    }

    


in bittorrent.php within your StatusBar() function find:

////////////// REP SYSTEM END //////////


add this below:


PHP Code:
if ($CURUSER['class'] < UC_VIP && $TBDEV['max_slots']) {

  
$ratioq = (($CURUSER['downloaded'] > 0) ? ($CURUSER['uploaded'] / $CURUSER['downloaded']) : 1);

  

if (
$ratioq 0.95) {

        switch (
true) {

                case (
$ratioq 0.5):

                
$max 2;

                break;

                case (
$ratioq 0.65):

                
$max 3;

                break;

                case (
$ratioq 0.8):

                
$max 5;

                break;

                case (
$ratioq 0.95):

                
$max 10;

                break;

                default:

           
$max 10;

        }

 }

 else {

 switch (
$CURUSER['class']) {

//        case UC_LEECH:

//        $max = 10;

//        break;

                
case UC_USER:

                
$max 20;

                break;

                case 
UC_POWER_USER:

                
$max 30;

                break;

//        case UC_X_POWER_USER:

//        $max = 50;

//        break;

//        case UC_COMM_STAFF:

//        $max = 50;

//        break;

                
default:

           
$max 99;

        }       

 }   

}

else

$max 999
now find these lines:


PHP Code:
"&nbsp;&nbsp;<img alt='{$lang['gl_leech_torrents']}' title='{$lang['gl_leech_torrents']}' src='pic/arrowdown.gif' />&nbsp;{$seedleech['no']}</div>"
change them to like: (updated)


PHP Code:
"&nbsp;&nbsp;<img alt='{$lang['gl_leech_torrents']}' title='{$lang['gl_leech_torrents']}' src='pic/arrowdown.gif' />&nbsp;".($TBDEV['max_slots'] ? "<a title='I have ".$max." Download Slots'>{$seedleech['no']}/".$max."</a>" $seedleech['no'])."</div>"

PHP Code:
"&nbsp;&nbsp;<img alt='{$lang['gl_leech_torrents']}' title='{$lang['gl_leech_torrents']}' src='{$TBDEV['pic_base_url']}dl.png' />&nbsp;".($TBDEV['max_slots'] ? "<a title='I have ".$max." Download Slots'>{$seed['no']}/".$max."</a>" $seed['no'])."</div>"
and don't forget to add in config.php


PHP Code:
$TBDEV['max_slots'] = 1// 1=On 0=Off 
__________________
http://www.bvlist.com/images/avatars/signaturepics/sigpic16443_2.gif
Reply With Quote
  #2  
Old 04-09-17, 19:29
mpx's Avatar
mpx mpx is offline
Senior Member
 
Join Date: Jun 2009
P2P
Posts: 37
Default
Sorry for bump

but i try this mod and I get back this error Tracker error 5 (in uTorrent at status). What i doing wrong ?
Reply With Quote
Reply

Tags
leech or seed , max , slots

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



All times are GMT +2. The time now is 08:17. vBulletin skin by ForumMonkeys. Powered by vBulletin® Version 3.8.11 Beta 3
Copyright ©2000 - 2018, vBulletin Solutions Inc.