No Download Count

Started by mycrazy, November 26, 2013, 08:34:49 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

elephant


Quote from: cm27 on November 28, 2013, 03:23:38 PM
I think you need to write it more like this
Code (php) Select
if ($userid != '1,2,3,4,5,6'){

You are comparing $userid to a literal string. You will want to put those ids in an array and use isset(), or in_array().

cm27

I think you need to write it more like this


Code (php) Select
if ($userid != '1,2,3,4,5,6'){
$downthis = max(0, $downloaded - $self["downloaded"]);
blah blah blah
}
    {


Not sure as I dont run this but give that a try ..
Never fall to those that just sit there.. Always look for the way to the top even if you have to code it your self and mistakes and all... quote from BonZO...

mycrazy

Not Work.

Work this:

After this line:
$downthis = max(0, $downloaded - $self["downloaded"]);

add:
if ($userid == "1" || $userid=="2"){
    $downthis = 0;
}

mycrazy

#3
Quote from: MelvinMeow on November 27, 2013, 12:59:38 PM
1 would be your userid... pretty much if they are not user 1 then do download totals like normal.
    if ($userid != '1'){
$downthis = max(0, $downloaded - $self["downloaded"]);
blah blah blah
}
    {


thanks! more users change this ?

if ($userid != '1' || $userid != '2'){
$downthis = max(0, $downloaded - $self["downloaded"]);


blah blah blah ?

MelvinMeow

1 would be your userid... pretty much if they are not user 1 then do download totals like normal.
    if ($userid != '1'){
$downthis = max(0, $downloaded - $self["downloaded"]);
blah blah blah
}
    {

mycrazy

Hi,

possible in the following code

in announce.php and find:

// Get the last uploaded amount from user account for reference and store it in $last_up
   $rst = mysql_query("SELECT class, uploaded FROM users WHERE id = $userid") or err("Tracker error 5");
   $art = mysql_fetch_array($rst);
   $last_up = $art["uploaded"];
   $class = $art["class"];
$upthis = max(0, $uploaded - $self["uploaded"]);
$downthis = max(0, $downloaded - $self["downloaded"]);
//freelech
//     $downthis = 0;

$upspeed = ($upthis > 0 ? $upthis / $self["announcetime"] : 0);
$downspeed = ($downthis > 0 ? $downthis / $self["announcetime"] : 0);
$announcetime = ($self["seeder"] == "yes" ? "seedtime = seedtime + $self[announcetime]" : "leechtime = leechtime + $self[announcetime]");

if ($upthis > 0 || $downthis > 0)
mysql_query("UPDATE users SET uploaded = uploaded + $upthis". ($torrent['free']=='no'?", downloaded = downloaded + $downthis ":' '). "WHERE id=$userid") or err("Tracker error 3");

Here:
$downthis = max(0, $downloaded - $self["downloaded"]);
Becoming disable some userid that I want to exclude and not count the download this userid ?

Sorry my bad english:) :)