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: 43259
Total Topics: 7518
Most Online Today: 201
Most Online Ever: 2482
(April 09, 2011, 07:02:45 pm)
Users Online
Members: 0
Guests: 180
Total: 180

Author Topic: Some members receiving message of upload limit exceeded wrongly  (Read 7271 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: 16436
    • 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: 16436
    • 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: 16436
    • 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: 16436
    • 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: 16436
    • 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: 16436
    • 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: 16436
    • 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
3697 Views
Last post February 03, 2008, 07:28:33 pm
by SMFHacks
3 Replies
6626 Views
Last post May 19, 2008, 08:30:12 pm
by ApplianceJunk
3 Replies
3684 Views
Last post October 24, 2010, 01:18:42 pm
by Louise-paisley
0 Replies
2753 Views
Last post June 11, 2011, 03:17:52 am
by marcbkk
1 Replies
3956 Views
Last post September 18, 2012, 09:25:48 pm
by SMFHacks

+- Recent Topics

No thumbnails on new uploads by SMFHacks
March 27, 2024, 02:10:41 pm

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