Page 1 of 2
Saratoga, CumulusMX and new trend graphs
Posted: Thu 13 Aug 2015 7:34 am
by Sadgit
Hello,
Has anyone manages to get the new trends page from CumulusMX working with Saratoga Template please?
like these
http://sanday.org.uk/weather/trends.htm
If so what do I need to do to get them working please?
Cheers
Mark
Re: Saratoga, CumulusMX and new trend graphs
Posted: Thu 08 Oct 2015 12:17 pm
by philpugh
Do you mean like this?
http://goosegate.plus.com/wxgraphsCMX.php
PLEASE NOTE. Only just installed the Saratoga templates yesterday and still fixing up the site. Also it is hosted on a Raspberry Pi and my internet connection is
VERY SLOW. I mean 512Kbps down and 256Kbps up.

Re: Saratoga, CumulusMX and new trend graphs
Posted: Thu 08 Oct 2015 7:21 pm
by BCJKiwi
Like this?
http://silveracorn.nz/weather/wxcharts.php (was wxgraphs.php)
This has been working since February
https://cumulus.hosiene.co.uk/viewtopic.php?f=28&t=13382
You will need to make changes to the attached file to suit your website layout - particularly the path settings for the lib and js folders.
Also the .json files need to be uploaded to the correct path by CumulusMX. In my layout they are in the wxshare folder which holds the lib and js folders
Re: Saratoga, CumulusMX and new trend graphs
Posted: Thu 08 Oct 2015 7:54 pm
by philpugh
That's a slightly neater presentation than mine!
I would however suggest renaming the file and altering the menu to pull in the new code. That way you don't run the risk of accidental overwrite.
Re: Saratoga, CumulusMX and new trend graphs
Posted: Thu 08 Oct 2015 9:44 pm
by BCJKiwi
Don't understand your comment.
Never had anything overwritten that was not intended.
This, like the rest of Saratoga (and my other sites as well actually) is all primarily PHP.
Virtually everything is static on the webserver - the only things being sent to the webserver by CumulusMX in relation to this page are the .json files - no other files being sent by CumulusMX - no chance of anything unintended being "overwritten".
Re: Saratoga, CumulusMX and new trend graphs
Posted: Thu 08 Oct 2015 10:36 pm
by philpugh
Just meaning that it mskes updating a bit easier. Only need to replace the menu page when templares are updated.
Re: Saratoga, CumulusMX and new trend graphs
Posted: Fri 09 Oct 2015 4:13 am
by BCJKiwi
Sorry, you don't understand. No templates are used or updated, ever, by CumulusMX. ALL the info you see on the Saratoga style (and my other websites as well) is presented by fixed never changing non-updating files which read the only thing that does change - i.e. the .json data files.
This will also be apparent from the file attached to my first post in this thread. That file resides on the webserver and contains the menu.
This is one of the main advantage of PHP - it is all server-side. The scripts on the server are all PHP and NOT uploaded from template files by CumulusMX.
Suggest you re-read this
https://cumulus.hosiene.co.uk/viewtopic.php?f=28&t=13382
If you take another look at how the Saratoga system works, this should become apparent.
While it is possible to send PHP files to the webserver from template files this is not the most efficient way to do it.
Re: Saratoga, CumulusMX and new trend graphs
Posted: Fri 09 Oct 2015 3:10 pm
by philpugh
I'm obviously not expressing myself clearly.
Yes I know how php files work but in order to do things like include the new trend graphs you need to create a new or modify an existing php file in order for it to work.
All I was pointing out was that you seem to have used the 'original' Saratoga template file wxgraphs.php and modified it to draw the graphs - no problem. I chose to create a new version of the original file (wxgraphsCMX.php) to do this. If I had to reload the Saratoga templates (e.g. updates / replace) I was less likely to overwrite my modified files.
This means you have to alter the menu pages - but this is a small price to pay and most sites seem to have customised menus in any case. I do keep a regular backup of the entire web area of my server in any case!
Re: Saratoga, CumulusMX and new trend graphs
Posted: Fri 09 Oct 2015 8:05 pm
by BCJKiwi
No, it was not apparent to me that you were referring to an update of the Saratoga templates.
Many of my Saratoga templates have been modified in some way - some extensively and some are whole new files so updated Saratoga scripts are never just copied over the top of existing ones.
Any updated scripts are downloaded into a folder on the local PC, unzipped there, then diffmerge is used to compare the new and existing files to see what has changed and to determine if there is any effect on any changes already made, and to better understand what any updates are doing.
A decision can then be made as to which changes (if any) to incorporate into a temporary test version of the working file.
Once everything is checked OK and validated with the test file, the working file is renamed and the test file changed to the working file.
Re: Saratoga, CumulusMX and new trend graphs
Posted: Fri 09 Oct 2015 9:21 pm
by philpugh
Excellent! I do have this problem of confusing people some of the time!
Keep up the good work!
Re: Saratoga, CumulusMX and new trend graphs
Posted: Mon 24 Oct 2016 12:25 am
by PeterP
Hi BCJKiwi,
Can you please advise where would I get a copy of the sunhrdata.php file that this error message talks of (attached). Also how it should it be customized if any, before uploading?
thank you
Peter
Re: Saratoga, CumulusMX and new trend graphs
Posted: Mon 24 Oct 2016 3:22 am
by jlmr731
Well atleast you got a chart to display. I do have errors on the sunhrdata.php
Looks nice when it works right
Re: Saratoga, CumulusMX and new trend graphs
Posted: Mon 24 Oct 2016 7:46 pm
by BCJKiwi
Not sure what you are using for a source for this.
The files on silveracorn.nz are modified but the standard CumulusMX .json files and scripts should work without a sunhrs.php
Re: Saratoga, CumulusMX and new trend graphs
Posted: Tue 25 Oct 2016 11:45 pm
by PeterP
Hi, the source is actually the wxgraphics.php file in the zip attachment from your earlier post, with modified paths as per the instructions.
Re: Saratoga, CumulusMX and new trend graphs
Posted: Wed 26 Oct 2016 7:28 pm
by BCJKiwi
OK,
If you are referring to the earlier post in this thread than I had forgotten I had posted that and it did not show up when I searched for anything related in my posts

.
If you simply rem out the line (around No 133);
include_once($sharedir.'sunhrdata.php');
and make sure the paths in the lines ( 119 thru 122 0 are pointing to the right place, then you should get the standard Sun Hrs chart the same as you see in the UI.
The sunhrdata.php generates a pair of different .json files to suit my preferences and is not required for the standard charts.