Пример #1
0
     $isfree = $isdouble = $issilver = '';
     include CACHE_DIR . 'free_cache.php';
     if (isset($free)) {
         foreach ($free as $fl) {
             $isfree = ($fl['modifier'] == 1 || $fl['modifier'] == 3) && $fl['expires'] > TIME_NOW;
             $isdouble = ($fl['modifier'] == 2 || $fl['modifier'] == 3) && $fl['expires'] > TIME_NOW;
             $issilver = $fl['modifier'] == 4 && $fl['expires'] > TIME_NOW;
         }
     }
     //== Silver torrents
     if ($torrent['silver'] != 0 || $issilver) {
         $upthis = $upthis;
         $downthis = $downthis / 2;
     }
     $RatioFreeCondition = $INSTALLER09['ratio_free'] ? "downloaded = downloaded + 0" : "downloaded = downloaded + {$downthis}";
     $crazyhour_on = $INSTALLER09['crazy_hour'] ? crazyhour_announce() : false;
     //$freecountdown_on = freeleech_announce();
     if ($downthis > 0) {
         if (!($crazyhour_on || $isfree || $user['free_switch'] != 0 || $torrent['free'] != 0 || $torrent['vip'] != 0 || $torrent['freeslot'] != 0)) {
             $user_updateset[] = $RatioFreeCondition;
         }
     }
     if ($upthis > 0) {
         if (!$crazyhour_on) {
             $user_updateset[] = "uploaded = uploaded + " . ($torrent['doubleslot'] != 0 || $isdouble ? $upthis * 2 : $upthis);
         } else {
             $user_updateset[] = "uploaded = uploaded + ({$upthis}*3)";
         }
     }
 }
 //=== abnormal upload detection
Пример #2
0
     $isfree = $isdouble = $issilver = '';
     include "cache/free_cache.php";
     if (isset($free)) {
         foreach ($free as $fl) {
             $isfree = ($fl['modifier'] == 1 || $fl['modifier'] == 3) && $fl['expires'] > TIME_NOW;
             $isdouble = ($fl['modifier'] == 2 || $fl['modifier'] == 3) && $fl['expires'] > TIME_NOW;
             $issilver = $fl['modifier'] == 4 && $fl['expires'] > TIME_NOW;
         }
     }
     //== Silver torrents
     if ($torrent['silver'] != 0 || $issilver) {
         $upthis = $upthis;
         $downthis = $downthis / 2;
     }
     $RatioFreeCondition = $INSTALLER09['ratio_free'] ? "downloaded = downloaded + 0" : "downloaded = downloaded + {$downthis}";
     $crazyhour_on = crazyhour_announce();
     if (!($crazyhour_on || $isfree || $user['free_switch'] != 0 || $torrent['free'] != 0 || $torrent['vip'] != 0 || $torrent['freeslot'] != 0)) {
         $updq[0] = $RatioFreeCondition;
     }
     if ($crazyhour_on) {
         // crazyhour
         $updq[1] = "uploaded = uploaded + ({$upthis}*3)";
     } else {
         $updq[1] = "uploaded = uploaded + " . ($torrent['doubleslot'] != 0 || $isdouble ? $upthis * 2 : $upthis);
     }
     $udq = implode(',', $updq);
     mysqli_query($GLOBALS["___mysqli_ston"], "UPDATE LOW_PRIORITY users SET {$udq} WHERE id=" . $userid) or ann_sqlerr(__FILE__, __LINE__);
     $mc1->delete_value('userstats_' . $userid);
     $mc1->delete_value('user_stats_' . $userid);
 }
 //=== abnormal upload detection
Пример #3
0
     }
     if ($a['hdownEnabled'] == 1) {
         $downthis = $downthis / 2;
     }
 }
 if ($upthis > 0 || $downthis > 0) {
     $isfree = '';
     $isdouble = '';
     include "cache/free_cache.php";
     if (isset($free)) {
         foreach ($free as $fl) {
             $isfree = ($fl['modifier'] == 1 || $fl['modifier'] == 3) && $fl['expires'] > TIME_NOW;
             $isdouble = ($fl['modifier'] == 2 || $fl['modifier'] == 3) && $fl['expires'] > TIME_NOW;
         }
     }
     $crazyhour = crazyhour_announce();
     if (!($crazyhour || $user['free_switch'] != 0 || $isfree || $torrent['free'] != 0 || $SitePot['value_i'] >= 10000 || $torrent['vip'] != 0 || $torrent['freeslot'] != 0)) {
         $updq[0] = "downloaded = downloaded + {$downthis}";
     }
     if ($crazyhour) {
         // crazyhour
         $updq[1] = "uploaded = uploaded + ({$upthis}*3)";
     } else {
         $updq[1] = "uploaded = uploaded + " . ($torrent['doubleslot'] != 0 || $isdouble ? $upthis * 2 : $upthis);
     }
     $udq = implode(',', $updq);
     mysql_query("UPDATE users SET {$udq} WHERE id=" . $user['id']) or err('Tracker error 3');
     $mc1->delete_value('MyUser_' . $user['id']);
     $mc1->delete_value('user' . $user['id']);
 }
 //=== abnormal upload detection