Klapaucius
02-04-2006, 08:05 AM
On my board I would like to have a forum in which there is one topic open, and at the end of the day, that topic closes, and a new topic is started for the next day. It seems to me the easiest way to implement this idea is with a cron job ("Scheduled Task"). In fact, it seems like it would be very simple to do, except that I do not know PHP. What I need is a cron job to run at, say, midnight, which does the following:
1. Close the thread from the previous day, and
2. Start a new thread containing specific text, possibly with a date string.
Details aside, the most obvious way I can see to do this is to write a file that contains the information needed to identify the previous post, so that it can be closed the next time the cron job is run. Obviously, the first time the script is run, this file wouldn't exist (and hence, there would be no previous post to close), so that case would have to be checked. Those of you experienced with PHP, SQL, and the vB API might know of a better way.
Can anybody help me out and write a script that I can run via the Scheduled Tasks that will do this?
1. Close the thread from the previous day, and
2. Start a new thread containing specific text, possibly with a date string.
Details aside, the most obvious way I can see to do this is to write a file that contains the information needed to identify the previous post, so that it can be closed the next time the cron job is run. Obviously, the first time the script is run, this file wouldn't exist (and hence, there would be no previous post to close), so that case would have to be checked. Those of you experienced with PHP, SQL, and the vB API might know of a better way.
Can anybody help me out and write a script that I can run via the Scheduled Tasks that will do this?