PDA

View Full Version : Omegatrons upload limit hack


Rids
March 14th, 2004, 08:29 AM
The forum in which the hack is posted is closed for new posts and I can't see any mention of the hack on the dev site so I will throw it in here. :D

I've been using the hack ever since it came out and it works well, though some members are confused as to whether it is limited by date or a running 24 hour period. I'm no PHP programmer myself so am unable to give them a definitive answer.

What I would like to do is to modify the hack so that it limits the uploads to one every three hours, to avoid the problem of members dumping multiple images at once but still allowing them to upload several images per day.

I would be very grateful for any advice :)

Chuck S
March 14th, 2004, 11:35 AM
Rids,

That forum is closed and all hacking questions belong on photopostdev.com

I should just move that there.

Why do you not just tweak the mysql UNIXTIMESTAMP variable as we did before. Change it to

-3 HOUR and then place the upload limit to 1

That should allow only 1 upload every three hours from the current time they are on.

Rids
March 14th, 2004, 05:38 PM
Thanks for the advice, I will try that out ASAP :)

Chuck S
March 14th, 2004, 05:43 PM
I beleive you were using the NOW variable if I am not mistaken so -3 HOUR from NOW would keep it so there was only whatever upload limit you set from the admin section

Rids
March 15th, 2004, 05:18 AM
I've been using it as originally posted:

AND date > UNIX_TIMESTAMP( DATE_SUB(CURDATE(), INTERVAL 1 DAY) )";

I've had the limit set to 5 per day and for me it has been working but one of my members (at least one) have been having trouble posting 5. Several times she has only been able to post 4 and I have checked the database timestamps and it turned out to be 4 in both a calendar day and a 24 hour period so I still have no idea whats going on there. She lives in California (so does the server) and I have the gallery offset at 8 hours to bring it back to GMT so maybe it it something to do with this?

The senior members at the site have vetoed the idea of 1 every 3 hours and I can see their point (most only visit once or twice per day). What I would really like to do at this point is get it working so that each member can post 5 images in any running 24 hour period, irrespective of date or timezone.

Rids
March 15th, 2004, 05:31 AM
ps. Thank you so much for your help :)

Chuck S
March 15th, 2004, 10:38 AM
Rids,

Photos are written to the database at server time so time offsets have nothing to do with this. I can not reproduce what you are doing. The query is rather simple. What happened to the change we made using the NOW statement since your server did not like the standard DATE_SUB arguement?

Chuck S
March 15th, 2004, 10:38 AM
Rids,

Photos are written to the database at server time so time offsets have nothing to do with this. I can not reproduce what you are doing. The query is rather simple. What happened to the change we made using the NOW statement since your server did not like the standard DATE_SUB arguement?

Rids
March 15th, 2004, 11:17 AM
I think you are mixing me up with someone else, I never used anything except the version you posted in the hacks forum. :D

iloco
July 10th, 2004, 04:16 PM
omegatron, would it be possible in future upgrade to add an option so that we can set uploads on a daily(24hr) in cpanel.
I would like to set my gallery to one image per day or 24 hrs per member.

Chuck S
July 10th, 2004, 06:58 PM
Well the hack you are talking about is posted on Photopostdev.com

Set daily limit in cpanel??

If you use the version posted over at Photopostdev.com you should be able to set one upload per day.

For the next version I think I will add the option to specify the time range.