phatgreenbuds Posted August 24, 2008 Share Posted August 24, 2008 Ok so I have this script that dynamically writes an XML file and saves it into a directory. Then I use actionscript to read the XML and display slideshows that update instantly as people upload new images to the MySQL db...this works great for the moment. I am stuck though...I was thinking I would like to have it use a schedule so that people could have their images appear at certain times on certain days. The problem I am having is with how to create this schedule and how to have the new XML file automatically written for the new day. How would you key these images to be included in the new XML file for that specific day at that specific time? I am trying to make this as automated as possible so family and friends will no longer call me to remove and or modify. Not asking for code here...just opinions on how you would approach something like this. Link to comment https://forums.phpfreaks.com/topic/121147-how-would-you-do-this/ Share on other sites More sharing options...
phatgreenbuds Posted August 26, 2008 Author Share Posted August 26, 2008 Wow...this is the first time no one has answered...hmmmm oh well I thought about it and I think I have a solution. It may not be pretty but here goes: In order to schedule two weeks in advance I somehow need to be able to create tables for each day. I can do this using cron to fire off a script that will basically pull the date + 14 and create a table with that date formatted into the name. So I don't end up with 365 or more tables I will also use the same script to clean up past days by deleting those old tables...theoretically I should never have more then 15 tables at anytime. The second part is breaking the day up into blocks. The image reference would be dropped into that days table with the corresponding block ID. I need to define some sort of limits and allow only so many open slots for that block of time. This would take some PHP math to count the slots already taken and display that somehow so peeps would know whats left in that block...at midnight, another cron runs another script for the next days show that uses the rand function to assign to each image in that block and output to XML in ascending order. Then my Flash proggie can use its actionscript to read the XML and TADAAA!!! I have a completely hands free, dynamic, solution. Any comments are welcome...please feel free to ridicule me if this won't work. Link to comment https://forums.phpfreaks.com/topic/121147-how-would-you-do-this/#findComment-625688 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.