Re: An Alternative Little day/night chart
Posted: Tue 05 Feb 2013 3:08 pm
An Alternative
The beteljuice has a great mistrust of (google) APIs and 'the cloud' etc. prefering to have some degree of control over what happens, and also reducing global internet traffic.
So here's a beteljuice plaything (not quite as neatly drawn) and with a different slant (or two) on display.
EDIT: V2.0 Incorporating drawing improvements / suggestions by Mark.
EDIT: V3.0 Incorporating logic fix by Mark Crossley.
EDIT: V3.1 hours markers option added
Midday (Civil) is 'North' and a 24 hour 'clock' hand shows 'now' time.
Midday (Civil) is 'North' and a 24 hour 'clock' hand shows 'now' time with hours markers.
'Heavens' rotate East to West through North with a 'now' marker @ North.
As you can see Civil, Nautical and Astronomical twilights are shown.
Practically everything is configurable and most things can be 'posted' on-the-fly.
You MUST be running PHP 5+
If 'safe_mode' exists it should be "off". (Maybe unimportant following tweaks - unproven)
If you are unsure of the above, unzip and run the following file in your webspace: If it suggests that safe_mode is enabled, check your web space control panel / settings and see if you can turn it "off", else contact your support.
If they say "Oh no can't do that its insecure", tell them its caused so much problems that it is depreciated in ver 5.3 and doesn't even exist in ver 5.4 ! - give them this link: http://uk.php.net/manual/en/features.safe-mode.php
GET / VIEW commented CODE
'Tis a beteljuice throwaway freebie ... enjoy or not as you wish
Edit: Forgot to mention. It's a stand-alone and no weather software is required
Edit: Basic usage ...
Using a txt editor such as Notepad++ change the timezone to YOUR location:
If you are not using saratoga / carterlake template(s) you won't have a Settings.php so you need to change the lat / long, this is MY location
To use it in an html page just call it like you would any other graphic.
Using your file name ....
EDIT:
If you really must have a bit of JavaScript to update the image on the page, please be aware that the 'resolution' of the graphic (regardless of size) is 1 degree (values rounded) which equates to 4 minutes.
So it would be pointless to have a refresh rate of less than 2 min.
The beteljuice has a great mistrust of (google) APIs and 'the cloud' etc. prefering to have some degree of control over what happens, and also reducing global internet traffic.
So here's a beteljuice plaything (not quite as neatly drawn) and with a different slant (or two) on display.
EDIT: V2.0 Incorporating drawing improvements / suggestions by Mark.
EDIT: V3.0 Incorporating logic fix by Mark Crossley.
EDIT: V3.1 hours markers option added
As you can see Civil, Nautical and Astronomical twilights are shown.
Practically everything is configurable and most things can be 'posted' on-the-fly.
You MUST be running PHP 5+
If 'safe_mode' exists it should be "off". (Maybe unimportant following tweaks - unproven)
If you are unsure of the above, unzip and run the following file in your webspace: If it suggests that safe_mode is enabled, check your web space control panel / settings and see if you can turn it "off", else contact your support.
If they say "Oh no can't do that its insecure", tell them its caused so much problems that it is depreciated in ver 5.3 and doesn't even exist in ver 5.4 ! - give them this link: http://uk.php.net/manual/en/features.safe-mode.php
GET / VIEW commented CODE
'Tis a beteljuice throwaway freebie ... enjoy or not as you wish
Edit: Forgot to mention. It's a stand-alone and no weather software is required
Edit: Basic usage ...
Using a txt editor such as Notepad++ change the timezone to YOUR location:
Code: Select all
$time_locale = "Europe/London"; // set your timezone - see: http://php.net/manual/en/timezones.php
Code: Select all
//----------------------------------------------------------------------------\\
// SETTINGS: only customise if you have no "Settings.php" \\
//----------------------------------------------------------------------------\\
if (!@(include_once "Settings.php")) {
$SITE['latitude'] = 52.512; // N+, S-
$SITE['longitude'] = -2.096; // W-, E+
}
Using your file name ....
Code: Select all
<img src="heavens.php" alt="day / night chart" title="day / night chart" />If you really must have a bit of JavaScript to update the image on the page, please be aware that the 'resolution' of the graphic (regardless of size) is 1 degree (values rounded) which equates to 4 minutes.
So it would be pointless to have a refresh rate of less than 2 min.