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 4017) - 17 March 2024

Legacy Cumulus 1 release v1.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

PHP

Share your Cumulus MX user interface here

Moderator: mcrossley

BCJKiwi
Posts: 1255
Joined: Mon 09 Jul 2012 8:40 pm
Weather Station: Davis VP2 Cabled
Operating System: Windows 10 Pro
Location: Auckland, New Zealand
Contact:

Re: PHP

Post by BCJKiwi »

It seems you may need to make this change in the Cloudbase script discussed in this thread https://cumulus.hosiene.co.uk/viewtopic.p ... &start=120 See Steve's post of 22 Aug 2015, 22:44

Change this line in the script (around line 438);

Code: Select all

$data = explode(' ',$file[0]);
to

Code: Select all

$data = preg_split('/\s+/',$file[0]);
as your latitude will be less than 3 digits
roxbux
Posts: 4
Joined: Thu 24 Sep 2015 10:42 am
Weather Station: WH1080
Operating System: mac osx
Location: Italy

Re: PHP

Post by roxbux »

Hello BCJKiwi . I really like the first site MX ( Saratoga ) . And ' possible to have a download link ? If it is possible also for all the others, at least to learn how to edit. thank you. Sorry for my English
BCJKiwi
Posts: 1255
Joined: Mon 09 Jul 2012 8:40 pm
Weather Station: Davis VP2 Cabled
Operating System: Windows 10 Pro
Location: Auckland, New Zealand
Contact:

Re: PHP

Post by BCJKiwi »

While I am happy to (and have) shared self-contained packages and some pages, am not prepared to face the significant support issues associated with a complete site.

If you want to have similar setup then start by downloading the Saratoga template set - there is a Cumulus version of it on the Saratoga Download site and a lot of information on how to get it all going. This is probably the best place to start http://saratoga-weather.org/wxtemplates/install.php
The gauges page is well covered on this Forum
After that there are the cloudbase and Davis Console scripts available from our website.
Have already posted the Trends (Graphs) page as well.

So you already have a lot to get you started.
michel7784
Posts: 11
Joined: Thu 23 Dec 2010 1:44 pm
Weather Station: wmr 200
Operating System: xp sp3 32 bits
Location: warneton belgium
Contact:

Re: PHP

Post by michel7784 »

Hi everibody,

Id'like to thank Steeve for all these hours spended for all of us Single learning and advanced users.
I had a real pleasure to investigate and try to customize a few pages as your ModernMx site, but, fianlly, I must admit I'm quite unable to create some pages as these in php.
I'd really like to find someone giving a chance to lambda users to set up this version af dasdhboard, graphs and jauges on there website, quite as the noraml html pages given by Steeve.
I use Jacques Desroches's templates ( a little personnalized) for one of the stations, and I'd like to include the Cumulus interface pages in aother template I downloaded from Wim and his Leuven-Template.
Is there someone here to help me setting up these pages in php?

Thanks a lot

Michel

http://legheer.be/meteo
http://legheer.be/meteo3
Image
User avatar
nitrx
Posts: 1297
Joined: Sun 13 Dec 2009 1:21 pm
Weather Station: WH1080
Operating System: Windows 10
Location: Apeldoorn The Netherlands
Contact:

Re: PHP

Post by nitrx »

Do you have malware on the second link agggh :evil:
michel7784
Posts: 11
Joined: Thu 23 Dec 2010 1:44 pm
Weather Station: wmr 200
Operating System: xp sp3 32 bits
Location: warneton belgium
Contact:

Re: PHP

Post by michel7784 »

Hi Ron,
did'nt find anything, never be mentioned as source of any problem.....
which kind of problem did you encounter ?

Michel
Image
User avatar
nitrx
Posts: 1297
Joined: Sun 13 Dec 2009 1:21 pm
Weather Station: WH1080
Operating System: Windows 10
Location: Apeldoorn The Netherlands
Contact:

Re: PHP

Post by nitrx »

Hmm strange on my pc nothing happens looks good but on my android tablet I was redirected to an advertisement, and could not reach your page.

Sorry for the 'false info'anyway strange that this happens.
michel7784
Posts: 11
Joined: Thu 23 Dec 2010 1:44 pm
Weather Station: wmr 200
Operating System: xp sp3 32 bits
Location: warneton belgium
Contact:

Re: PHP

Post by michel7784 »

Don't matter Ron,

I tested on My wife's android tablet, it gave also an alert, but unable to find anything anoying at all....
Seems special and a little disturbing..

have a nice evening

Beste groetjes uit zuid belgië
Image
User avatar
nitrx
Posts: 1297
Joined: Sun 13 Dec 2009 1:21 pm
Weather Station: WH1080
Operating System: Windows 10
Location: Apeldoorn The Netherlands
Contact:

Re: PHP

Post by nitrx »

Hi Michel well I hope your wife wasnt redirected to the same ad site as i was because i just tried it again and i landed on a pron site... If you know what i mean, on my pc i had a look at your source maybe the flash from yowindow is infected anyway you better can investigate your code.

Fijne avond
User avatar
gluepack
Posts: 460
Joined: Tue 22 Jan 2013 9:20 pm
Weather Station: PCE-FWS 20
Operating System: Win 7 Pro
Location: Zlatina, Bulgaria

Re: PHP

Post by gluepack »

Talking about php...

I had a piece of code inline that worked fine. I wanted to use it multiple times so put it in a function but it isn't returning anything.

What I don't understand is, in trying to debug it, as part of the function, there is a for loop and if I put an echo of the string that is being (appended to and) returned, they show and also an echo outside the for loop shows.
However, if I remove the echo from the for loop, the one outside it doesn't show...

for (....) {... echo $string; ...} echo $string; return $string;

shows all iterations plus final one

for (....) {...} echo $string; return $string;

doesn't show any. How is that possible? In neither case is the data returned.
Image

PWS links: WundergroundIVARNAPR3CWOP/APRSE(W)2048PWSWeatherZLATINABGAwekas10631Twitter@Zlatina_weather
Station type: PCE-FWS 20…Webcam link: View south to edge of Provadisko plateau
User avatar
gluepack
Posts: 460
Joined: Tue 22 Jan 2013 9:20 pm
Weather Station: PCE-FWS 20
Operating System: Win 7 Pro
Location: Zlatina, Bulgaria

Re: PHP

Post by gluepack »

It is really confusing.
So, I have this chunk of text that I have modified to look like this.
...
...
<pre>
...
</pre>
...
...
<pre>
...
</pre>
...
...
<pre>
...
</pre>
....

The function in the above post gets everything between the <pre></pre> pair and massages it.
The calling code uses strpos to set up a substr to pass the data.
The function returns the massaged data and the code then preg_replaces the 1st occurrence of <pre> thru </pre> (i.e. including those tags) with it.
As I said in the previous post nothing was being returned when I was only testing for one occurrence. Now I see, having modified it to do the same thing three times (i.e. 1st time would remove 1st <pre></pre> pair so next one would be picked up, etc.), what is happening is 1st occurrence is being replaced with null, 2nd occurrence is being replaced with what should have been result of 1st and 3rd occurrence is being replaced with what should have been result of 2nd.
I just don't understand, how is that possible? The string is being generated correctly by the function, just not returned, however it is being returned on the next invocation. Arrgghhh!
i.e. I give it A, it works on it and it gives back nothing; I give it B, it works on it and it gives back massaged A; I give it C, it works on it and it gives back massaged B.
Image

PWS links: WundergroundIVARNAPR3CWOP/APRSE(W)2048PWSWeatherZLATINABGAwekas10631Twitter@Zlatina_weather
Station type: PCE-FWS 20…Webcam link: View south to edge of Provadisko plateau
User avatar
mcrossley
Posts: 12686
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2/WLL
Operating System: Bullseye Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: PHP

Post by mcrossley »

I think we'd have to see the code to comment.
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: PHP

Post by beteljuice »

The most obvious things to look for as you have made it a function:

1/ Are you passing some 'input' to it ...
... or ...
2/ have you remembered to make some var 'global' ?
Image
......................Imagine, what you will KNOW tomorrow !
User avatar
gluepack
Posts: 460
Joined: Tue 22 Jan 2013 9:20 pm
Weather Station: PCE-FWS 20
Operating System: Win 7 Pro
Location: Zlatina, Bulgaria

Re: PHP

Post by gluepack »

OK, this seems completely illogical to me but...

The pre's were to be replaced with a table (the returned string) in each case.
So, I took out virtually all the code from the function and assigned "aaaaaaaaaa" to the returning string and each pair of pre's were replaced correctly (i.e. with aaaaaaaaaa).
I was then going to work through the function adding a line at a time to see what sort of effect that would have so I then put my first line of code, which was exploding the input text, and my second line of code that established the returning variable with the <table> tag (and a caption).
Then, I thought "oops! I never add the </table> tag at the end before returning it." Sure enough, going back to the original code and doing $strtable .= '</table>'; prior to returning $strtable resolved it.

However, I can't believe that the lack of the </table> tag caused that effect. I can't prove (don't know how to) that nothing was being returned first time but, if that isn't the case, that means a table with no end tag will not be displayed until it hits a new <table> and yet anything in between behaves normally. Sorry for my ignorance but is that really the case? I'll have to try it some time.
Image

PWS links: WundergroundIVARNAPR3CWOP/APRSE(W)2048PWSWeatherZLATINABGAwekas10631Twitter@Zlatina_weather
Station type: PCE-FWS 20…Webcam link: View south to edge of Provadisko plateau
User avatar
philpugh
Posts: 380
Joined: Tue 24 May 2011 8:34 am
Weather Station: See Signature
Operating System: Debian 11 (RPi4)
Location: Antrobus, Cheshire, UK
Contact:

Re: PHP

Post by philpugh »

HTML 5 requires tags to be closed correctly - it's not entirely consistent yet :lol: but it will continue to get stricter I guess.

Also they are trying to discourage the use of the <table></table> entity to format layout preferring the 'new' layout tags to be used instead - along with appropriate CSS. The <table></table> entity should be used for tabulation of data only. It's difficult to make the change though!
Phil Pugh
GW1000 + WH65/WH57/WH31; HP2551 + WS68/WH40A; GW2001 WittBoy
cumulusutils generating website
http://goosegate.uk/
Post Reply