PDA

View Full Version : Open and close forum by cronjobs?


Goodspeed
10-06-2004, 11:51 AM
Can you please tell me how can I write a script that will use cronjobs and will be able to make a forum open and visible at a certain time and close it and make invisible at a certain time as well?

Thank you!

Colin F
10-06-2004, 11:53 AM
Your cronscript will have to change the forums database entry so that it's invisible/closed.

I would recommand making two scripts, one to open and one to close the forums.

Goodspeed
10-06-2004, 02:34 PM
I'm not too good in PHP, maybe you show me simple example of that script?

Thank you!

Colin F
10-06-2004, 02:54 PM
it would have to have
require_once(global.php);

and would need to do something like:

$DB_site->query("UPDATE " . TABLE_PREFIX . "forums SET x = y WHERE forumid = z");

Goodspeed
10-07-2004, 01:43 PM
Thank you! Now I got it!