Project:Countdown
Version:5.x-1.x-dev
Component:Code
Category:feature request
Priority:normal
Assigned:Unassigned
Status:needs work

Issue Summary

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.

Comments

#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

AttachmentSize
countdown_5.x-1.0.shutdown.patch 7.28 KB

#3

Status:active» needs work
  • Please re-evaluate your coding standards, in particular tabs vs spaces, if( vs if (, spaces between function parameters, break up } else {: http://drupal.org/coding-standards
  • your t() strings are inconsistent - some have EMail vs Email (e-mail is standard), some end with ? and some don't (prefer without)
  • I think the site shutdown check is better in hook_init()
  • The notification should be editable
  • Why 256 on the email length? Why not 100 or 1000? Remove it if you don't have a reason.
  • many 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.
  • Why is variable_set('countdown_locksite', 0); not immediately after variable_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