SMFHacks.com

Downloads System Pro => Support => Bugs => Topic started by: Paddleducks Forum - Damien on January 29, 2010, 03:53:55 am

Title: Incorrect download counts!
Post by: Paddleducks Forum - Damien on January 29, 2010, 03:53:55 am
Regular users are limited to 10 downloads in a day, Downloads Pro is counting files incorrectly, and preventing users from getting 10 files - After LOTS of searching, the reason appears to be caused by users who have download managers to speed up file transfers..... I quote from one of my users:

Quote
Hi Eddy,

I may have figured out the miscount problem. My download manager (Internet Download Manager http://www.internetdownloadmanager.com/) uses file segmentation and multipart downloading to speed downloads. Apparently your software counts each segment as a separate attempt to get a file from Paddleducks. Even though the IDM strategy fails with your server, the attempt is still counted against my 10/day limit. I'll try to figure out a way to disable IDM when I download from Paddleducks.

Can anything be done to help prevent this behaviour in Downloads Pro?

Regards
Eddy
Title: Re: Incorrect download counts!
Post by: SMFHacks on January 29, 2010, 07:54:48 am
I could add an option to count downloading a file only once if they have downloaded it in the past for credits.
Title: Re: Incorrect download counts!
Post by: Paddleducks Forum - Damien on January 29, 2010, 01:55:08 pm
I don't use the credits system smf, only limit the number of downloads per day based on membergroup...

Regards
Eddy
Title: Re: Incorrect download counts!
Post by: SMFHacks on January 31, 2010, 10:03:41 am
Or just a setting in general that counts only one download per file. Regardless of the number of times a user downloads the same file.
Title: Re: Incorrect download counts!
Post by: Paddleducks Forum - Damien on January 31, 2010, 10:10:55 am
Or just a setting in general that counts only one download per file. Regardless of the number of times a user downloads the same file.

That would do it, but what about using the time function in the daily limits? So that a file was only counted once in a 24hr period, but would be recounted if they downloaded the same file a week later....

I think that would give the best solution if it was possible?

Regards
Eddy
Title: Re: Incorrect download counts!
Post by: SMFHacks on January 31, 2010, 10:12:15 am
It can be done as long as the download logs aren't cleared I can check how many times a file was downloaded in the last 24 hours.
Title: Re: Incorrect download counts!
Post by: Paddleducks Forum - Damien on January 31, 2010, 10:22:47 am
That would do perfectly for me...... As far as I can see it gives the most accurate solution to the problem.

Regards
Eddy
Title: Re: Incorrect download counts!
Post by: SMFHacks on February 03, 2010, 11:06:27 am
Added a setting for 1.0.13
"Do not count the same file for downloads per day member group quota"
Title: Re: Incorrect download counts!
Post by: davejo on April 27, 2012, 05:29:04 am
I could add an option to count downloading a file only once if they have downloaded it in the past for credits.

Hi

I'm having the same problem with this as members are losing multiple credits for downloading one file. I think the idea of people using download managers is not going away especially for users in the UK as in some areas the download speeds are still appalling.

 Is there any chance you could add this function you mention here as I do use the credit system.

Thanks very much

regards

Dave
Title: Re: Incorrect download counts!
Post by: SMFHacks on April 28, 2012, 10:58:03 am
Do you want it to never count another download if they already downloaded a file? or have a limit of last 24 hours?
Title: Re: Incorrect download counts!
Post by: davejo on April 29, 2012, 01:02:03 am
Do you want it to never count another download if they already downloaded a file? or have a limit of last 24 hours?

never count the same file again please.

changed my mind and now I realsie why you asked me

can i have
 
 a limit of last 24 hours, please?

Thanks VB
Title: Re: Incorrect download counts!
Post by: davejo on May 01, 2012, 02:12:50 pm
updated reply...sorry if you started this VB
Title: Re: Incorrect download counts!
Post by: SMFHacks on May 01, 2012, 02:15:33 pm
Ok no problem haven't had time yet to work on it.
Title: Re: Incorrect download counts!
Post by: davejo on May 01, 2012, 02:26:28 pm
Ok no problem haven't had time yet to work on it.


phew...;)
Title: Re: Incorrect download counts!
Post by: SMFHacks on May 16, 2012, 08:54:09 pm
Ok no problem haven't had time yet to work on it.


phew...;)
2.1.4 update
Added setting "Duplicate downloads within 24hours do not use credits" under credit system settings.
Title: Re: Incorrect download counts!
Post by: davejo on May 17, 2012, 12:32:57 pm
Thanks again
Title: Re: Incorrect download counts!
Post by: SMFHacks on May 17, 2012, 12:38:16 pm
Glad to help.
Title: Re: Incorrect download counts!
Post by: elbeer on October 12, 2013, 01:57:10 pm
I still get this problem but I am not using credits.

I have it set for 6 downloads per month ( changed the code from 24*60*60 ) but can only download 1 file per 24 hours.

If the user tries to download before the 24 hours is up they get an error message saying x amount of minutes remain but then the script adds a download to the database so it is counting as a download when they havent actually received a download.

Also, a count down timer of time remaining to wait before the next download would be good.
Title: Re: Incorrect download counts!
Post by: SMFHacks on October 13, 2013, 09:48:21 am
What code did you use to get six downloads per month?
Title: Re: Incorrect download counts!
Post by: elbeer on October 13, 2013, 10:22:52 am
This is the code I used.

 // Get the end date of the subscription
global $smcFunc, $user_info;



$request = $smcFunc['db_query']('', '
  SELECT end_time
  FROM {db_prefix}log_subscribed
  WHERE id_member = {int:member}',
  array(
    'member' => $user_info['id'],
  )
);
if ($smcFunc['db_num_rows']($request) != 0)
{
  list ($result) = $smcFunc['db_fetch_row']($request);
}
else
  $result = false;
$smcFunc['db_free_result']($request);

$enddate=$result;


   // Find total downloads for the last 24 hours
   $currenttime = time();
   
   //$last24hourstime = $currenttime  -  (1* 24 * 60 * 60);

$last24hourstime= $enddate - (30*24*60 *60);


Basically it is for paid subscriptions. It gets the end date of the susbscription and deducts 30 days from that date.

Just commented out
   //$last24hourstime = $currenttime  -  (1* 24 * 60 * 60);

And added the new code.
Title: Re: Incorrect download counts!
Post by: SMFHacks on October 13, 2013, 10:25:53 am
Just dis part doesn't give six downloads a month
$last24hourstime= $enddate - (30*24*60 *60);

Right now I think that would only allow one download a month?
Title: Re: Incorrect download counts!
Post by: elbeer on October 13, 2013, 10:30:23 am
In admin you can set how many downloads per day.

I just changed the code but not the variable.

My site is solely monthly subscriptions - so the $enddate gets the end date of the subscription and takes 30 from before that to get the period