phpBB2Refugees.com Logo
Not affiliated with or endorsed by the phpBB Group

Register •  Login 

Continue the legacy...

Welcome to all phpBB2 Refugees!Wave Smilie

This site is intended to continue support for the legacy 2.x line of the phpBB2 bulletin board package. If you are a fan of phpBB2, please, by all means register, post, and help us out by offering your suggestions. We are primarily a community and support network. Our secondary goal is to provide a phpBB2 MOD Author and Styles area.

Only allow after 24 hours?


 
Search this topic... | Search MOD Writing... | Search Box
Register or Login to Post    Index » MOD Writing  Previous TopicPrint TopicNext Topic
Author Message
Acaria
Board Member



Joined: 20 Feb 2009

Posts: 238



PostPosted: Thu Nov 05, 2009 2:21 am 
Post subject: Only allow after 24 hours?

Okay, so I want to make a game for my users that will deal out daily prizes. That'll be simple.

The only thing I'm having issues with is the 24 hour part. I literally have no idea where to start. ._.

Anyone know what I need to do?
Back to top
Ptirhiik
Board Member



Joined: 19 Nov 2008

Posts: 114


flag
PostPosted: Thu Nov 05, 2009 7:43 am 
Post subject: Re: Only allow after 24 hours?

Assuming the time is static (eg not depending a user event) : you can call a php through CRON (if your provider allows it), or use your computer (or any other) to hit this php page once a day (using ie the window scheduler). You can also rely on having at least one visit a day (google ie icon_smile.gif), and execute your day treatment during this visit if not already done.
Back to top
Acaria
Board Member



Joined: 20 Feb 2009

Posts: 238



PostPosted: Thu Nov 05, 2009 10:12 pm 
Post subject: Re: Only allow after 24 hours?

It does depend of the user, though. What I want is for them to go to a page and get a random prize. Once they go to that page, though, they must wait exactly 24 hours before they can claim the prize again.
Back to top
Ptirhiik
Board Member



Joined: 19 Nov 2008

Posts: 114


flag
PostPosted: Fri Nov 06, 2009 7:07 am 
Post subject: Re: Only allow after 24 hours?

So just store the last time the user claims his prize on the users table, adding a field, using time() to get the time.
Back to top
Display posts from previous:   
Register or Login to Post    Index » MOD Writing  Previous TopicPrint TopicNext Topic
Page 1 of 1 All times are GMT
 
Jump to:  

Index • About • FAQ • Rules • Privacy • Search •  Register •  Login 
Not affiliated with or endorsed by the phpBB Group
Powered by phpBB2 © phpBB Group
Generated in 0.0248 seconds using 15 queries. (SQL 0.0019 Parse 0.0009 Other 0.0221)
phpBB Customizations by the phpBBDoctor.com
Template Design by DeLFlo and MomentsOfLight.com Moments of Light Logo