Page 1 of 1

Programming an update system that is timed based?

Posted: Fri Jan 27, 2006 6:15 pm
by jonas
So on my personal webcomic I have an update system where I put in all the comics information, write an update and such and click a button that updates the database and shows up on my pages.

What I want to do now is make it so that if I have to work late or want to go out with the girlfriend that I can write an update around 6pm (I update new content at midnight) and have it 'save' in the database and not show up until 12am.

So my site is http://www.robobo.com and it works pretty nicely so far. The newest comic has a special database field that only the newest comic has. So basically I need to setup my database and update form to 'save' an update until 12am then insert it like it does now.

Is there anyway to do this? Keep in mind, I don't want to shut down my website or make drastic modifications as I have a nice audience that I don't want to disrupt.


Thanks for any help guys. Appreciate it.

Posted: Fri Jan 27, 2006 6:28 pm
by feyd
I may have a tough time suggesting much without seeing how the backend is put together, but here goes:

Add or alter this "special" field, which sounds likely largely unused right now, such that it is a DATE field. You can then set a date when each entry becomes visible.

Now all you need to do is alter your fetch code to only pull entries that have today's date or earlier. You're done.

Posted: Fri Jan 27, 2006 7:53 pm
by jonas
I have no doubts that my system may be inefficient but it works and works well for me.

The special field is simply a yes/no that is either newest comic = yes or not. When I update, it removes the last comics yes and the newest comic gains it becoming the newest comic.

Thanks for the suggestion though, I do have date fields and didn't think about setting them as part of the fetch code. I think it'll work great.

Posted: Fri Jan 27, 2006 7:57 pm
by Roja
Use a cronjob set for 6pm to move files from a hidden/out-of-webroot "tomorrow" folder, to the webdirectory.

Then you can always update by dumping to the tomorrow folder, and the script will do it all for you. :)