I ran the module through the coder module and tidied bits and pieces up. Here is the patch.
I converted the .123 to 0.123 as this appears to make things a bit more readable in the calculations, but otherwise it was fairly much just following the coder suggestions.
| Comment | File | Size | Author |
|---|---|---|---|
| #14 | almanac.tar_.gz | 20.35 KB | nhwebworker |
| #14 | almanac.zip | 22.41 KB | nhwebworker |
| #11 | almanac.zip | 22.6 KB | alan d. |
| #10 | almanac-block-page.jpg | 53.77 KB | alan d. |
| #10 | almanac-block-settings.jpg | 44.84 KB | alan d. |
Comments
Comment #1
nhwebworker commentedComment #2
alan d. commentedOne of the changes created an error, this was reverted.
An unused hour variable was being passed around and this has been removed.
With the newer features of Drupal 7, the Date module should no longer be required. This patch removes the dependency.
Default timzone:
Current timestamp:
Current datetime object & offset
Timezone options list
Finally, switching to format_date() rather than date_format_date()
Comment #3
nhwebworker commentedThank you! Will review within next few days and update the release.
Comment #4
alan d. commentedAnd theme handling improvements. Eg: Using theme('xyz') & template files
Comment #5
alan d. commentedNo worries. Wanting to use this in a personal project.
Sorry for rolling everything into a huge patch, please make sure that I haven't broken anything in the output. The last patch requires update.php to be run as it defines new theming template files.
Comment #6
alan d. commentedFinally, fix to the page title:
Comment #7
alan d. commentedAdded moon phases functionality, and more consistent timezone usage. Testing against dates / times from http://www.timeanddate.com/
Comment #8
alan d. commentedChanges are getting so massive, here is a zip of the above changes :) Maybe a bit easier to review.
Note that I'm using date_sun_info(), for PHP 5 >= 5.1.2. The Drupal 7 PHP min requirement is PHP 5.2.5
Comment #9
alan d. commentedBumping to critical as it would be best to implement before there are too many D7 users.....
I could list the changes, but it is a complete overhaul now. The attached zip & images should speak for themselves!! [Edit: The upload field isn't working, I'll upload individually or email them through]
Comment #10
alan d. commentedThe files...
Comment #11
alan d. commentedSome minor bug fixes....
An example of the callback block. New Drupal 7 WTF, an object must be returned, otherwise the array values are merged.
Comment #12
nhwebworker commentedThanks. Under review and will release soon.
Comment #13
alan d. commentedCool. It is functional and running on a sandbox site of mine, but needs a second pair of eyes on it to make sure that nothing is broken. Almost all code, with the exception of the original moon rise code, has been tidyed, modified, or totally refactored!
The callback block hook seems strange, but it has allowed me to display data for any location automaticaly. This was the top level country page, a custom menu callback that uses data saved in the countries module. This same idea works on the sub-level pages for regions, etc.
Comment #14
nhwebworker commentedThis is an updated version of the Almanac module. A few minor updates have been made to correct the inputs to the moonrise/set algorithm. Posted here pending upload to CVS.
Comment #15
nhwebworker commented