Page 2 of 2

Re: Saratoga, CumulusMX and new trend graphs

Posted: Thu 27 Oct 2016 4:31 am
by PeterP
Thank you sir!

Re: Saratoga, CumulusMX and new trend graphs

Posted: Thu 21 Mar 2019 4:22 pm
by Dolmen
BCJKiwi wrote: Thu 08 Oct 2015 7:21 pm 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
Hallo!
I've been using cumulus1 + saratoga templates for years. Now i'm swapping to cumulusMX and I've found this useful post and attached zipfile from you.
I tweaked the .php to fit the paths of lib and js folders within my webserver and seems ok, BUT I can't find a way to write where my .json files are (in fact I manually copied them).
At present CumulusMX uploads the files in myhost/cumulus/ (where the standard cumulus website runs) while the saratoga template website stands in myhost/web/
Do you think the only way to make it work is to upload de .json files in the same directory where the wxgraphs.php is?
Thank you,
Ale.

http://genovameteo.altervista.org/cumulus/trends.htm
http://genovameteo.altervista.org/web/wxgraphs2.php

Re: Saratoga, CumulusMX and new trend graphs

Posted: Fri 22 Mar 2019 8:22 pm
by BCJKiwi
Hmm,
If you wish to to use the myhost/cumulus/xxx.json files from the myhost/web/ folder, then the way to reference them is to add ../cumulus in front to the file name.

e.g.
myhost/cumulus/js/cumuluscharts.js
myhost/web/wxgraphs2.php (or wxcharts.php - or whatever the file name is) should contain the correct path to cumuluscharts.js in wxcharts2.php

So, for saratoga in the myhosts/web folder, where you may have the reference to js/cumuluscharts.js you should instead reference ../cumulus/js/cumuluscharts.js

The ../ moves the path up one level in the website folder structure

Trust this helps.

Re: Saratoga, CumulusMX and new trend graphs

Posted: Sat 23 Mar 2019 11:08 am
by Dolmen
BCJKiwi wrote: Fri 22 Mar 2019 8:22 pm Hmm,
If you wish to to use the myhost/cumulus/xxx.json files from the myhost/web/ folder, then the way to reference them is to add ../cumulus in front to the file name.

e.g.
myhost/cumulus/js/cumuluscharts.js
myhost/web/wxgraphs2.php (or wxcharts.php - or whatever the file name is) should contain the correct path to cumuluscharts.js in wxcharts2.php

So, for saratoga in the myhosts/web folder, where you may have the reference to js/cumuluscharts.js you should instead reference ../cumulus/js/cumuluscharts.js

The ../ moves the path up one level in the website folder structure

Trust this helps.
First of all, I thank you for your fast answer :-)

Let me recap quickly:
- my saratoga-style website runs in genovameteo.altervista.org/web/
- my standard cumulus website runs in genovameteo.altervista.org/cumulus/
- CumulusMX uploads all weather data files in genovameteo.altervista.org/cumulus/
- therefore, every file which stands in /web folder and needs to read such weather data files must have their paths set to ../cumulus/


When I wrote my post, I had already set the paths for the lib and js folders, from this

Code: Select all

   <script src=<?php echo $sharedir."lib/jquery/jquery-latest.min.js";?>></script>
   <script src=<?php echo $sharedir."lib/highstock/js/highstock.js";?>></script>
   <script src=<?php echo $sharedir."lib/highstock/js/themes/grid.js";?>></script>
   <script src=<?php echo $sharedir."js/cumuluscharts.js";?>></script>   
   
to this

Code: Select all

   <script src=<?php echo $sharedir."../cumulus/lib/jquery/jquery-latest.min.js";?>></script>
   <script src=<?php echo $sharedir."../cumulus/lib/highstock/js/highstock.js";?>></script>
   <script src=<?php echo $sharedir."../cumulus/lib/highstock/js/themes/grid.js";?>></script>
   <script src=<?php echo $sharedir."../cumulus/js/cumuluscharts.js";?>></script>    
   

In fact the page structure was correctly loaded and showed in the browser, but with blank graphs (CumulusMX uploads the .json files in /cumulus/).

Now I've managed to make wxgraps.php read and show the data, tweaking the file cumuluscharts.js too, where I set the paths for all the .json files, from this (line #3)

Code: Select all

$(document).ready(function () {    
    $.ajax({url: "graphconfig.json", dataType:"json", success: function (result) {
            config=result;
			doTemp();
to this

Code: Select all

$(document).ready(function () {    
    $.ajax({url: "../cumulus/graphconfig.json", dataType:"json", success: function (result) {
            config=result;
			doTemp();
and from this (line #173)

Code: Select all

 $.ajax({
        url: 'tempdata.json',
        cache: false,
        dataType: 'json',
        
to this

Code: Select all

 $.ajax({
        url: '/cumulus/tempdata.json',
        cache: false,
        dataType: 'json',
        
...etc.... for all the other nine occurences of *.json data files in cumuluscharts.js

...and now I'm happy with this :-D

I send you many thanks again, from the opposite side of the world!

Ale