Facebook  Twitter 

SMFHacks.com

+- +-

SMFHacks.com

+- User Information

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

+- Forum Stats

Members
Total Members: 12361
Latest: nneocsoi
New This Month: 7
New This Week: 0
New Today: 0
Stats
Total Posts: 39803
Total Topics: 7013
Most Online Today: 54
Most Online Ever: 2482
(April 09, 2011, 07:02:45 pm)
Users Online
Members: 0
Guests: 30
Total: 30

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

0 Members and 1 Guest are viewing this topic.

Offline davejo

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

Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 14916
    • 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

  • Full Member
  • ***
  • Posts: 100
    • 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: 14916
    • 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

  • Full Member
  • ***
  • Posts: 100
    • 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: 14916
    • 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

  • Full Member
  • ***
  • Posts: 100
    • 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
4105 Views
Last post November 29, 2006, 10:00:34 pm
by Hawk
1 Replies
3876 Views
Last post October 07, 2007, 07:39:03 pm
by rotorsrule
9 Replies
7570 Views
Last post November 18, 2016, 01:51:12 pm
by elbeer
7 Replies
4005 Views
Last post February 25, 2015, 09:34:14 pm
by SMFHacks
5 Replies
1510 Views
Last post December 02, 2017, 06:28:54 pm
by KKOG

+- Recent Topics

Getting an error while installing SMF Gallery Pro by SMFHacks
August 18, 2019, 06:54:37 pm

Hashtag Mod Install Error by SMFHacks
August 15, 2019, 08:17:45 am

Rotating Image URLs by SMFHacks
August 05, 2019, 04:26:57 pm

[Mod]Block Proxy VPN On Registration by SMFHacks
August 01, 2019, 10:42:37 pm

[Mod]Nofollow Signature Links by SMFHacks
July 30, 2019, 11:52:28 am

Thinking of getting Ad Seller Pro as well by ajac63
July 28, 2019, 04:46:34 am

Just some questions about Ad Management mod by ajac63
July 26, 2019, 12:12:26 pm

[Mod]Login Menu Button by SMFHacks
July 05, 2019, 03:26:24 pm

Update by SMFHacks
June 19, 2019, 10:58:25 am

About Comments Approval by ajac63
June 12, 2019, 07:48:52 pm

Powered by EzPortal