Shutdown timer functionality
myke - December 10, 2007 - 19:28
| Project: | Countdown |
| Version: | 5.x-1.x-dev |
| Component: | Code |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | needs work |
Description
I would like to see the Countdown module patched to allow the option of shutting down the site for maintenance at the designated time automatically. I would also like to see an email notification go out when the site has gone offline.

#1
The CVS applications list suggested you already wrote the functionality for this request. If you emailed me about this before sometime, I have totally forgotten about it. Please attach your patch here so I can work it into the Drupal 6 upgrade.
#2
Here is the patch file... I also added some extras (such as email notification when the countdown is reached, whether or not to show the countdown to all users, and whether or not to hide the countdown when finished...
(As well as worked on the wording in the code a little bit, as far as having it say second when it's 1 second, seconds when it's non 1 seconds remaining, same with minutes and hours..)
-Myke
#3
} else {: http://drupal.org/coding-standardst()strings are inconsistent - some have EMail vs Email (e-mail is standard), some end with ? and some don't (prefer without)hook_init()variable_get()calls are missing default values and I require them. For example,$to = variable_get('countdown_notification_email_address');email should default to site_mail.variable_set('countdown_locksite', 0);not immediately aftervariable_set('site_offline', 1);?#4
I worked on all those issues you raised.. when trying to put the shutdown check into hook_init it didn't work properly.. if no longer shuts the site down.. It also seems to slow Drupal down a little bit..
I read something about hook_init not having common functions enabled, such as t() url() etc. Could this have something to do with it not working properly?
-Myke
#5
I will be back on this feature attempt when I get a chance, I'm preparing a bunch of sites for upgrading to Drupal 6, when my schedule is more freed up I will clean up the code fully, and resubmit it..
-Myke