Facebook  Twitter 

SMFHacks.com

+-

SMFHacks.com

+- User Information

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

+- Forum Stats

Members
Total Members: 11803
Latest: VXP
New This Month: 2
New This Week: 0
New Today: 0
Stats
Total Posts: 41605
Total Topics: 7273
Most Online Today: 98
Most Online Ever: 2482
(April 09, 2011, 07:02:45 pm)
Users Online
Members: 0
Guests: 53
Total: 53

Author Topic: Some members receiving message of upload limit exceeded wrongly  (Read 4630 times)

0 Members and 1 Guest are viewing this topic.

Offline Jonas1975

  • Sr. Member
  • ****
  • Posts: 318
    • View Profile
    • The Mobile Photography Blog
Some members receiving message of upload limit exceeded wrongly
« on: February 02, 2015, 10:53:22 am »
Not sure what is happening but I have some members complaining that they are receiving an error message that they have exceeded their daily upload limit (that I set to 3 pics) even if they didn't upload any pics on the last days.

Don't know what to do about this, so I need some help here.

Edit: Is the restriction made by member account or IP?  If it is the IP, I think I have the explanation for it...
« Last Edit: February 02, 2015, 10:58:30 am by Jonas1975 »

Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 15752
    • View Profile
Re: Some members receiving message of upload limit exceeded wrongly
« Reply #1 on: February 02, 2015, 11:06:40 am »
It's based on server time. Here is the code for 2.0.x do not see anything with it.
Code: [Select]
function CheckMaxUploadPerDay()
{
global $gallerySettings, $smcFunc, $user_info, $txt;

if (empty($gallerySettings['gallery_set_maxuploadperday']))
return true;

if (allowedTo('smfgallery_manage'))
return true;

// Find total uploads for the last 24 hours for the user
$currenttime = time();

$last24hourstime = $currenttime  -  (1* 24 * 60 * 60);


$dbresult = $smcFunc['db_query']('', "
SELECT
id_picture
FROM {db_prefix}gallery_pic
WHERE id_member = " .$user_info['id'] . " AND date > $last24hourstime");

$totalRow['total'] = $smcFunc['db_num_rows']($dbresult);

if ($totalRow['total'] >= $gallerySettings['gallery_set_maxuploadperday'])
fatal_error($txt['gallery_err_upload_day_limit'] .  $gallerySettings['gallery_set_maxuploadperday'], false);
else
return true;

}
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 Jonas1975

  • Sr. Member
  • ****
  • Posts: 318
    • View Profile
    • The Mobile Photography Blog
Re: Some members receiving message of upload limit exceeded wrongly
« Reply #2 on: February 02, 2015, 11:17:12 am »
Strange...  I think the server time is correct. What else might lead to the message to be shown?

Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 15752
    • View Profile
Re: Some members receiving message of upload limit exceeded wrongly
« Reply #3 on: February 02, 2015, 11:24:32 am »
I can only think of it the server time got changed pictures uploaded with the wrong date could throw it off.

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 Jonas1975

  • Sr. Member
  • ****
  • Posts: 318
    • View Profile
    • The Mobile Photography Blog
Re: Some members receiving message of upload limit exceeded wrongly
« Reply #4 on: February 02, 2015, 11:34:39 am »
But that would mean that comments and posts would have also the time messed up, right?  And they are correct...

There must be something else...  I will keep searching and will do some tests.

Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 15752
    • View Profile
Re: Some members receiving message of upload limit exceeded wrongly
« Reply #5 on: February 02, 2015, 11:59:01 am »
I would test this code $totalRow['total'] = $smcFunc['db_num_rows']($dbresult);
Remember to test without using a gallery admin as they are allowed to exceed limits
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 Jonas1975

  • Sr. Member
  • ****
  • Posts: 318
    • View Profile
    • The Mobile Photography Blog
Re: Some members receiving message of upload limit exceeded wrongly
« Reply #6 on: February 02, 2015, 12:03:15 pm »
Where and how do I test that code?

Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 15752
    • View Profile
Re: Some members receiving message of upload limit exceeded wrongly
« Reply #7 on: February 02, 2015, 01:23:15 pm »
Sources/Gallery2.php is where you modify.

Then test with a normal member account.
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 Jonas1975

  • Sr. Member
  • ****
  • Posts: 318
    • View Profile
    • The Mobile Photography Blog
Re: Some members receiving message of upload limit exceeded wrongly
« Reply #8 on: February 02, 2015, 02:35:54 pm »
Ok, I located that exact code on Gallery2.php but I still don't understand what to do... Do I need to modify it? What should I expect as to see when accessing the site as normal user?

Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 15752
    • View Profile
Re: Some members receiving message of upload limit exceeded wrongly
« Reply #9 on: February 02, 2015, 02:37:04 pm »
Well you should try to upload images and see if you hit a limit or after max of 3 per day.
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 Jonas1975

  • Sr. Member
  • ****
  • Posts: 318
    • View Profile
    • The Mobile Photography Blog
Re: Some members receiving message of upload limit exceeded wrongly
« Reply #10 on: February 02, 2015, 02:44:20 pm »
I managed to upload my 3 photos as limit and then I got the warning.

Edit: After deleting the images, I'm able again to upload. I think I might ask a member to let me use his profile once the error occurs to check it.
« Last Edit: February 02, 2015, 02:45:54 pm by Jonas1975 »

Offline Jonas1975

  • Sr. Member
  • ****
  • Posts: 318
    • View Profile
    • The Mobile Photography Blog
Re: Some members receiving message of upload limit exceeded wrongly
« Reply #11 on: February 06, 2015, 05:03:31 am »
I managed to enter with the account of the member who was reporting this issue and have confirmed that he's receiving the upload limit error even if he hasn't posted any photo in the last 24 hours (and the limit is 3).

I tried with a Testing profile to make 3 comments to check if comments on the gallery could be counting for the photo upload limit and seems it's not.

The server time must be correct as the posts shows the correct date and time.

I'm clueless on what is the origin of this problem.

Edit: Btw, would be interesting to have a log on this "error". I still have uploads on the gallery but have no idea if this is an isolated problem or a common one.
« Last Edit: February 06, 2015, 05:32:42 am by Jonas1975 »

Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 15752
    • View Profile
Re: Some members receiving message of upload limit exceeded wrongly
« Reply #12 on: February 06, 2015, 12:06:40 pm »
I am at a loss too. It is by date time.  How days have passed since he last uploaded pictures....
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 Jonas1975

  • Sr. Member
  • ****
  • Posts: 318
    • View Profile
    • The Mobile Photography Blog
Re: Some members receiving message of upload limit exceeded wrongly
« Reply #13 on: February 06, 2015, 12:22:52 pm »
I am at a loss too. It is by date time.  How days have passed since he last uploaded pictures....
It was 2 days and only 1 pic. The other pic was the day or 2 before. So I can't understand what's causing the issue. If posts are made with correct time, it means that server has the correct time too, right? Can the Database be messed up?

Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 15752
    • View Profile
Re: Some members receiving message of upload limit exceeded wrongly
« Reply #14 on: February 06, 2015, 12:29:00 pm »
Database could be if you had wrong date/time upload for that member
Here is the sql query
Code: [Select]
SELECT
*
FROM smf_gallery_pic
WHERE id_member = ####REPLACEMEMBERID#### AND date > ####REPLACEWITHUNIXSTAMP####
The unix time stamp should be 23 hours ago
That will return what pictures it is checking against.
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/

 

Related Topics

  Subject / Started by Replies Last post
1 Replies
2483 Views
Last post February 03, 2008, 07:28:33 pm
by SMFHacks
3 Replies
5188 Views
Last post May 19, 2008, 08:30:12 pm
by ApplianceJunk
3 Replies
2601 Views
Last post October 24, 2010, 01:18:42 pm
by Louise-paisley
0 Replies
1956 Views
Last post June 11, 2011, 03:17:52 am
by marcbkk
1 Replies
2684 Views
Last post September 18, 2012, 09:25:48 pm
by SMFHacks

+- Recent Topics

How to change the font on a photo in SMF Gallery Pro? by SMFHacks
November 18, 2021, 09:28:11 am

Bulk Upload Many Pictures - File Name by SMFHacks
November 17, 2021, 08:58:50 am

Schedule or direct download link by SMFHacks
November 16, 2021, 10:57:33 am

Download Expire by Vincent Volmer
November 16, 2021, 02:40:47 am

prettyurls - TroubleShooting.wiki by SMFHacks
November 14, 2021, 02:18:59 pm

Error With Delete Download by mickjav
November 10, 2021, 04:49:12 pm

No ads on left or right by coyote
November 08, 2021, 04:57:13 pm

Now accepting Cryptocurrency by SMFHacks
November 05, 2021, 05:33:27 pm

Latest Version Pretty Urls SEO Pro by SMFHacks
November 04, 2021, 03:46:53 pm

Downloads Pro 6.0 Released by mickjav
November 03, 2021, 05:13:47 pm

Powered by EzPortal