Welcome to the Cumulus Support forum.

Latest Cumulus MX V4 release 4.4.2 (build 4085) - 12 March 2025

Latest Cumulus MX V3 release 3.28.6 (build 3283) - 21 March 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

If you are posting a new Topic about an error or if you need help PLEASE read this first viewtopic.php?p=164080#p164080

URL options for Trends Page.

From build 3044 the development baton passed to Mark Crossley. Mark has been responsible for all the Builds since. He has made the code available on GitHub. It is Mark's hope that others will join in this development, but at the very least he welcomes your ideas for future developments (see Cumulus MX Development suggestions).

Moderator: mcrossley

Post Reply
Phil23
Posts: 888
Joined: Sat 16 Jul 2016 11:59 pm
Weather Station: Davis VP2+ & GW1000 (Standalone)
Operating System: Win10 Pro / rPi Buster
Location: Australia

URL options for Trends Page.

Post by Phil23 »

I'm sure I'd read this before, but having no luck with searches.

It is possible I assume to specify a Chart type for the Trends.htm page?

Much like with Beteljuice's dayfile readers http://weather.inverellit.com/datasumma ... a=rainfall

Tried a few things as well & not hitting the right thing.

Thanks

Phil
:Now: :Today/Yesterday:

Image

Main Station Davis VP2+ Running Via Win10 Pro.
Secondary Stations, Ecowitt HP2551/GW1000 Via rPi 3 & 4 Running Buster GUI.
:Local Inverell Ecowitt Station: :Remote Ashford Ecowitt Station:
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: URL options for Trends Page.

Post by beteljuice »

If you mean change the default chart ...

Top of cumuluscharts.js

Code: Select all

$(document).ready(function () {    
    $.ajax({url: "graphconfig.json", dataType:"json", success: function (result) {
            config=result;
			doTemp();
			changeImage(window.location.href.split('?')[1]);
            
        }});
});
Change DoTemp(); to whatever your heart desires ...

@mark, It says you moderate this twice :shock:
Image
......................Imagine, what you will KNOW tomorrow !
Phil23
Posts: 888
Joined: Sat 16 Jul 2016 11:59 pm
Weather Station: Davis VP2+ & GW1000 (Standalone)
Operating System: Win10 Pro / rPi Buster
Location: Australia

Re: URL options for Trends Page.

Post by Phil23 »

beteljuice wrote: Thu 30 Apr 2020 2:28 am If you mean change the default chart ...
No I don't want to change default chart, but send a URL that will go directly to the rainrall page in say an email.
http://weather.inverellit.com/graphs.htm [rain or whatever here]

Similar to how I can send.....
http://weather.inverellit.com/datasumma ... a=rainfall
and the link opens the rain page instead of the default Max Temp page.


Phil
:Now: :Today/Yesterday:

Image

Main Station Davis VP2+ Running Via Win10 Pro.
Secondary Stations, Ecowitt HP2551/GW1000 Via rPi 3 & 4 Running Buster GUI.
:Local Inverell Ecowitt Station: :Remote Ashford Ecowitt Station:
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: URL options for Trends Page.

Post by beteljuice »

You would have to make the page .php

Then write some php code to look for posted request, and then that 'writes' javascript to execute changeGraph("postedchoice");

... but you would have to ensure charts has loaded before execution.

something like this toward the bottom of your page ..

Code: Select all

<?php

if(isset($_REQUEST['type'])) {
echo "
<script>
function waitforit() {
	if (!typeof changeGraph === \"function\") {
 		setTimeout( waitforit, 200);
		return;
	}
	changeGraph('".$_REQUEST['type']."');
}
waitforit();
</script>
";
};
?>
usage would be: graphs.php?type=rain

UNTESTED - might crash and burn :roll:
Image
......................Imagine, what you will KNOW tomorrow !
User avatar
mcrossley
Posts: 14388
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2/WLL
Operating System: Bullseye Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: URL options for Trends Page.

Post by mcrossley »

beteljuice wrote: Thu 30 Apr 2020 2:28 am @mark, It says you moderate this twice :shock:
So good they list me twice!
No idea, I'm not a forum admin. @freddie?
water01
Posts: 3670
Joined: Sat 13 Aug 2011 9:33 am
Weather Station: Ecowitt HP2551
Operating System: Windows 10/11 64bit Synology NAS
Location: Burnham-on-Sea
Contact:

Re: URL options for Trends Page.

Post by water01 »

Not a problem Mark, just ignore it, a permissions glitch. Take a look at all the forums in Web Development and you will see exactly the same.
David
Image
Phil23
Posts: 888
Joined: Sat 16 Jul 2016 11:59 pm
Weather Station: Davis VP2+ & GW1000 (Standalone)
Operating System: Win10 Pro / rPi Buster
Location: Australia

Re: URL options for Trends Page.

Post by Phil23 »

beteljuice wrote: Thu 30 Apr 2020 6:47 am You would have to make the page .php
As I understand, I can simply rename the htm file to php & it would need no initial changes to still work.
Then add some php code later...

Then create an entry in the extra webfiles etc.......

That does bring me to a though I've always had about MX having an option to "Upload Standard files as PHP".
I'd assume with the right settings on the host, a users site could then have ALL the standard files uploaded with a php extension & then make the additional changes in their original indexT.htm etc files, but not be required to setup the 10 standard files under extra webfiles.

Phil.
:Now: :Today/Yesterday:

Image

Main Station Davis VP2+ Running Via Win10 Pro.
Secondary Stations, Ecowitt HP2551/GW1000 Via rPi 3 & 4 Running Buster GUI.
:Local Inverell Ecowitt Station: :Remote Ashford Ecowitt Station:
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: URL options for Trends Page.

Post by beteljuice »

you wrote:As I understand, I can simply rename the htm file to php & it would need no initial changes to still work.
Then add some php code later...
Correct ..
MX having an option to "Upload Standard files as PHP".
Is that a wish list thing ?
Image
......................Imagine, what you will KNOW tomorrow !
Post Reply