Welcome to the Cumulus Support forum.

Latest Cumulus MX V3 release 3.28.6 (build 3283) - 21 March 2024

Cumulus MX V4 beta test release 4.0.0 (build 4019) - 03 April 2024

Legacy Cumulus 1 release 1.9.4 (build 1099) - 28 November 2014
(a patch is available for 1.9.4 build 1099 that extends the date range of drop-down menus to 2030)

Download the Software (Cumulus MX / Cumulus 1 and other related items) from the Wiki

A Little Day / night Chart Revisited ...

Other discussion about creating web sites for Cumulus that doesn't have a specific subforum

Moderator: daj

sfws
Posts: 1183
Joined: Fri 27 Jul 2012 11:29 am
Weather Station: Chas O, Maplin N96FY, N25FR
Operating System: rPi 3B+ with Buster (full)

Re: A Little Day / night Chart Revisited ...

Post by sfws »

Thank you Ken.
saratogaWX wrote: Mon 16 Mar 2020 7:20 pm you can put error_reporting(0); at the start of the script.
I have tried it with nothing, with error_reporting(0);, and with error_reporting(E_ALL);.
saratogaWX wrote: Mon 16 Mar 2020 7:20 pm You can try doing a view-source on the local URL to the script
That tells me the script contains errors that prevent displaying the image. It does not list any errors.


There does not seem to be a script anywhere in this thread for me to download and swap to, the first post links to http://www.beteljuice.co.uk/DEMOS/_astro.php but I cannot manage to download from there.
mine has

Code: Select all

############################################################################
#    Project: heavens.php                                                  #
#     Module: Replacement for graphics-sun-chart.php  or similar           #
#    Purpose: Draw a graphic sun chart.                                    #
#    Version: 0.1 - Feb 2013, original - beteljuice                        #
#       info: Requires PHP 5+ and GD library                               #
#                                                                          #
#             Now correctly draws events that span midnight                #
#             Now correctly draws events that span more than 24hrs         #
#             Can use date_sun_info OR date_sunrise (different results ! ) #
#             24hr clock dial Position OR                                  #
#             'heavens' revolve (anti-clock) East 'rise'                   #
#             Lat, Lon, date, TZ, method can all be 'posted' (see code)    #
#    Version: 3.0 - June 2013, Incorporating improvements by Mark Crossley #
#    Version: 3.1 - Sept 2013, optional hour markers added - beteljuice    #
#    Authors: beteljuice  Feb 2013, Mark Crossley June 2013                #
#                                                                          #
From searching my computer back ups again I found
day_night_graphic (v3.1 Beteljuice).zip
attached here in case anyone else wants it.
EDIT: beteljuice tells me this is not his latest script, see his reply to this post
Having swapped to using that and got an image, I see that what I added was some text to show the times, so sometime, I will try reapplying my previous changes, but I am in no hurry.
You do not have the required permissions to view the files attached to this post.
Last edited by sfws on Mon 16 Mar 2020 10:44 pm, edited 1 time in total.
User avatar
beteljuice
Posts: 3292
Joined: Tue 09 Dec 2008 1:37 pm
Weather Station: None !
Operating System: W10 - Threadripper 16core, etc
Location: Dudley, West Midlands, UK

Re: A Little Day / night Chart Revisited ...

Post by beteljuice »

@sfws ...
That's from the 'old version' thread, in which you itemized it's chequered history viewtopic.php?f=14&t=9235&hilit=day+%2F ... 60#p100145

As far as I know, no one has updated that for PHP 7+

What was your problem with downloading from: http://www.beteljuice.co.uk/DEMOS/_astro.php ?

You need to put sufficient data in before 'zip' icon becomes active.
Image
......................Imagine, what you will KNOW tomorrow !
sfws
Posts: 1183
Joined: Fri 27 Jul 2012 11:29 am
Weather Station: Chas O, Maplin N96FY, N25FR
Operating System: rPi 3B+ with Buster (full)

Re: A Little Day / night Chart Revisited ...

Post by sfws »

My problem is solved, I had edited the lat and long wrongly - see end of this post.
beteljuice wrote: Mon 16 Mar 2020 10:13 pm That's from the 'old version' thread,
Right, my use of search on this forum did not bring my contribution at viewtopic.php?f=14&t=9235&hilit=day+%2F ... rt#p100145 up. Fascinating to be reminded all that I did in the past. I was younger and more clever then. Some of those links are out of date now of course.

beteljuice wrote: Mon 16 Mar 2020 10:13 pm You need to put sufficient data in before 'zip' icon becomes active
That is where I went wrong in my hurry.




day_night_graphic.php.png
Anyway, I've got it working again as it used to with my colours and times labelled. The error was me attempting to change the lat and long wrongly

Code: Select all

if(isset($_REQUEST['lat'])){
   $lat = $_REQUEST['lat'];
} else {
   $lat = 52.65;
}
if(isset($_REQUEST['lon'])){
   $long = $_REQUEST['lon'];
} else {
   $long = -2.83;
}

Editing it back to

Code: Select all

require_once   'SiteSettings.php';
// check for posted overrides
if(isset($_REQUEST['lat'])){
   $lat = $_REQUEST['lat'];
} else {
   $lat = $SITE['latitude'];
}
if(isset($_REQUEST['lon'])){
   $lng = $_REQUEST['lon'];
} else {
   $lng = $SITE['longitude'];  
}
got it working.
You do not have the required permissions to view the files attached to this post.
User avatar
beteljuice
Posts: 3292
Joined: Tue 09 Dec 2008 1:37 pm
Weather Station: None !
Operating System: W10 - Threadripper 16core, etc
Location: Dudley, West Midlands, UK

Re: A Little Day / night Chart Revisited ...

Post by beteljuice »

Ah good ...

So there are no php7 problems with the 'old' code ?
Image
......................Imagine, what you will KNOW tomorrow !
RayProudfoot
Posts: 3390
Joined: Wed 06 May 2009 6:29 pm
Weather Station: Davis VP2 with Daytime FARS
Operating System: Windows XP SP3
Location: Cheadle Hulme, Cheshire, England
Contact:

Re: A Little Day / night Chart Revisited ...

Post by RayProudfoot »

Having received help to get my day/night/twilight image displaying correctly I'm revisiting this as I would like to use the enhanced version created by the late, great beteljuice.

I have copied sun_banner.php into my public_html folder and edited the code on my IndexT.html as follows:-

<td rowspan="5"><img id="img_sun"
src="http://cheadlehulmeweather.co.uk/sun_banner.php?t=<?php echo time();?>"
width="115" height="115"
alt="Day/Night/Twilight" title="Day/Night/Twilight" style="text-align:center" border="1"/></td>
<td rowspan="5">

But the original heavens.php is still current when "View Page Source" is viewed. I'm struggling to understand why my change isn't working. Can anyone help please?
Cheers,
Ray, Cheshire.

Image
Mapantz
Posts: 1822
Joined: Sat 17 Dec 2011 11:55 am
Weather Station: Davis Vantage Pro2
Operating System: Windows 11 x64
Location: Dorset - UK
Contact:

Re: A Little Day / night Chart Revisited ...

Post by Mapantz »

The changes to the index file cannot have been changed, otherwise the new one would be showing.

It's something your end, like editing the wrong file or something?!
Image
RayProudfoot
Posts: 3390
Joined: Wed 06 May 2009 6:29 pm
Weather Station: Davis VP2 with Daytime FARS
Operating System: Windows XP SP3
Location: Cheadle Hulme, Cheshire, England
Contact:

Re: A Little Day / night Chart Revisited ...

Post by RayProudfoot »

I was positive I used FileZilla to upload the new IndexT.html but I’ll recheck later. Thanks.

Lots of footie to watch today.
Cheers,
Ray, Cheshire.

Image
sutne
Posts: 383
Joined: Sun 14 Oct 2012 4:23 pm
Weather Station: HP2553 (WS80) and HP2564 (WS90)
Operating System: Raspbian Bullseye and Bookworm
Location: Rjoanddalen and Kronstad, Norway
Contact:

Re: A Little Day / night Chart Revisited ...

Post by sutne »

edited the code on my IndexT.html as follows
You have edited the template file. This file must be edited on your computer and then prosessed by Cumulus and uploded to your website as index.html.

If you look at http://www.cheadlehulmeweather.co.uk/indexT.htm
you will see the change, but since it is a template, there is no valid data.
RayProudfoot
Posts: 3390
Joined: Wed 06 May 2009 6:29 pm
Weather Station: Davis VP2 with Daytime FARS
Operating System: Windows XP SP3
Location: Cheadle Hulme, Cheshire, England
Contact:

Re: A Little Day / night Chart Revisited ...

Post by RayProudfoot »

@sutne, thanks, I've worked out what I was missing. I edit web files on a laptop, not my Cumulus netbook. I'd forgotten to to copy the updated file to my netbook.

All is now well but I have a discrepancy in sunrise / sunset times. Do I need to enter my lat/lon in the php file?
Cheers,
Ray, Cheshire.

Image
Post Reply