Facebook  Twitter 

SMFHacks.com

+-

SMFHacks.com

+- User Information

Welcome, Guest.
Please login or register.
 
 
 
Forgot your password?

+- Forum Stats

Members
Total Members: 4255
Latest: andreios
New This Month: 3
New This Week: 1
New Today: 0
Stats
Total Posts: 43260
Total Topics: 7518
Most Online Today: 297
Most Online Ever: 2482
(April 09, 2011, 07:02:45 pm)
Users Online
Members: 1
Guests: 277
Total: 278

Author Topic: Incorrect download counts!  (Read 20489 times)

0 Members and 1 Guest are viewing this topic.

Offline davejo

  • Downloads Pro Customer
  • Full Member
  • *****
  • Posts: 185
    • View Profile
    • Quizland
Re: Incorrect download counts!
« Reply #15 on: May 17, 2012, 12:32:57 pm »
Thanks again

Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 16436
    • View Profile
Re: Incorrect download counts!
« Reply #16 on: May 17, 2012, 12:38:16 pm »
Glad to help.
Get your Forum Ranked! at https://www.forumrankings.net - find out how your forum compares with others!

Like What I do? Support me at https://www.patreon.com/vbgamer45/

Offline elbeer

  • Downloads Pro Customer
  • Full Member
  • *****
  • Posts: 111
    • View Profile
Re: Incorrect download counts!
« Reply #17 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.

Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 16436
    • View Profile
Re: Incorrect download counts!
« Reply #18 on: October 13, 2013, 09:48:21 am »
What code did you use to get six downloads per month?
Get your Forum Ranked! at https://www.forumrankings.net - find out how your forum compares with others!

Like What I do? Support me at https://www.patreon.com/vbgamer45/

Offline elbeer

  • Downloads Pro Customer
  • Full Member
  • *****
  • Posts: 111
    • View Profile
Re: Incorrect download counts!
« Reply #19 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.

Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 16436
    • View Profile
Re: Incorrect download counts!
« Reply #20 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?
Get your Forum Ranked! at https://www.forumrankings.net - find out how your forum compares with others!

Like What I do? Support me at https://www.patreon.com/vbgamer45/

Offline elbeer

  • Downloads Pro Customer
  • Full Member
  • *****
  • Posts: 111
    • View Profile
Re: Incorrect download counts!
« Reply #21 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

 

Related Topics

  Subject / Started by Replies Last post
2 Replies
5361 Views
Last post November 29, 2006, 10:00:34 pm
by Hawk
1 Replies
5120 Views
Last post October 07, 2007, 07:39:03 pm
by rotorsrule
9 Replies
10479 Views
Last post November 18, 2016, 01:51:12 pm
by elbeer
7 Replies
6473 Views
Last post February 25, 2015, 09:34:14 pm
by SMFHacks
5 Replies
3424 Views
Last post December 02, 2017, 06:28:54 pm
by KKOG

+- Recent Topics

No thumbnails on new uploads by Tonyvic
Today at 06:26:18 am

Display the Contact Page for guests by SMFHacks
March 27, 2024, 10:55:43 am

is it possible to add support for odysee.com by fvlog19
March 21, 2024, 08:47:51 am

Request for admin notification by davejo
March 10, 2024, 01:31:59 am

I need help with torrent upload by Ineedsmfhelp
March 09, 2024, 10:01:13 pm

an idea for new mod (( content type with different display )) by SMFHacks
February 27, 2024, 01:36:27 pm

[Mod] RSS Feed Poster by SMFHacks
February 27, 2024, 11:57:18 am

find duplicate pictures by fvlog19
February 14, 2024, 02:22:40 pm

Error uploading video. by SMFHacks
February 08, 2024, 02:04:16 pm

Gallery icon as last added image by fvlog19
February 01, 2024, 01:04:56 pm

Powered by EzPortal