Quote:
I want to setup a cronjob that close the chatbox automatically in (let's say 9 pm) then open it again in (11 pm) utilizing the enable/disable feature in the wonderful chatbox product
How can do that
Can Valter add this option the chatbox product ? I mean add an option that enable us to enter the opening time and close time ?
there are good reasons to do that
1. The chatbox increase server load. So it can be enabled when the server load in minimum
2. The chatbox make members leave posing in forums and just chatting
3. when there is specific period time for enabling chatbox. it will make members know when they should go the chatbox page (in case it is enabled only in full mode)
Thank you
|
Look on google on how to make a cron job that can run a php file then make a php script that runs and changes the on off status of the item, of course the php file must not be accessible client side, so keep it out of the www folder and have the cron job run that file.
in the php file have a if function like
if (date("h")=="11"){
mysql_query("UPDATE vsa_chatbox SET vsa_chatbox_status='1' WHERE id='1'");
}else{
mysql_query("UPDATE vsa_chatbox SET vsa_chatbox_status='0' WHERE id='1'");
}
of course that script there wont work without the correct table and column names along with the correct id for the where and the fact you need to connect to the database