Page 2 of 2

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

Posted: Mon 16 Mar 2020 9:04 pm
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.

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

Posted: Mon 16 Mar 2020 10:13 pm
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.

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

Posted: Mon 16 Mar 2020 10:40 pm
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.

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

Posted: Tue 17 Mar 2020 2:02 am
by beteljuice
Ah good ...

So there are no php7 problems with the 'old' code ?

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

Posted: Sun 28 Jan 2024 1:14 pm
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?

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

Posted: Sun 28 Jan 2024 1:31 pm
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?!

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

Posted: Sun 28 Jan 2024 1:39 pm
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.

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

Posted: Sun 28 Jan 2024 1:47 pm
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.

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

Posted: Sun 28 Jan 2024 2:34 pm
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?