Please read the posts in the Announcements section about the current status of Cumulus development now that I have retired

Please read this post before posting

Latest Cumulus release v1.9.4 (build 1099) - Nov 28 2014
Latest Cumulus MX release - v3.0.0 build 3043 Jan 20 2017. See this post for download

PHP

Share your Cumulus MX user interface here
BCJKiwi
Posts: 845
Joined: Mon Jul 09, 2012 8:40 pm
Weather Station: Davis VP2 Cabled with Solar
Operating System: Windows 10 Pro
Location: Auckland, New Zealand
Contact:

Re: PHP

Postby BCJKiwi » Sat Aug 22, 2015 11:47 am

It seems you may need to make this change in the Cloudbase script discussed in this thread viewtopic.php?f=25&t=10414&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 Sep 24, 2015 10:42 am
Weather Station: WH1080
Operating System: mac osx
Location: Italy

Re: PHP

Postby roxbux » Fri Oct 09, 2015 10:01 am

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: 845
Joined: Mon Jul 09, 2012 8:40 pm
Weather Station: Davis VP2 Cabled with Solar
Operating System: Windows 10 Pro
Location: Auckland, New Zealand
Contact:

Re: PHP

Postby BCJKiwi » Sat Oct 10, 2015 1:52 am

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 Dec 23, 2010 1:44 pm
Weather Station: wmr 200
Operating System: xp sp3 32 bits
Location: warneton belgium
Contact:

Re: PHP

Postby michel7784 » Mon Nov 02, 2015 5:07 pm

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: 1300
Joined: Sun Dec 13, 2009 1:21 pm
Weather Station: WH1080
Operating System: Windows 10
Location: Apeldoorn The Netherlands
Contact:

Re: PHP

Postby nitrx » Mon Nov 02, 2015 7:13 pm

Do you have malware on the second link agggh :evil:

michel7784
Posts: 11
Joined: Thu Dec 23, 2010 1:44 pm
Weather Station: wmr 200
Operating System: xp sp3 32 bits
Location: warneton belgium
Contact:

Re: PHP

Postby michel7784 » Tue Nov 03, 2015 5:23 pm

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: 1300
Joined: Sun Dec 13, 2009 1:21 pm
Weather Station: WH1080
Operating System: Windows 10
Location: Apeldoorn The Netherlands
Contact:

Re: PHP

Postby nitrx » Tue Nov 03, 2015 6:10 pm

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 Dec 23, 2010 1:44 pm
Weather Station: wmr 200
Operating System: xp sp3 32 bits
Location: warneton belgium
Contact:

Re: PHP

Postby michel7784 » Tue Nov 03, 2015 6:58 pm

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: 1300
Joined: Sun Dec 13, 2009 1:21 pm
Weather Station: WH1080
Operating System: Windows 10
Location: Apeldoorn The Netherlands
Contact:

Re: PHP

Postby nitrx » Tue Nov 03, 2015 7:10 pm

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 Jan 22, 2013 9:20 pm
Weather Station: PCE-FWS 20
Operating System: Win 7 Pro
Location: Zlatina, Bulgaria

Re: PHP

Postby gluepack » Tue Nov 03, 2015 7:18 pm

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 Jan 22, 2013 9:20 pm
Weather Station: PCE-FWS 20
Operating System: Win 7 Pro
Location: Zlatina, Bulgaria

Re: PHP

Postby gluepack » Tue Nov 03, 2015 9:30 pm

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: 4979
Joined: Thu Jan 07, 2010 9:44 pm
Weather Station: Davis VP2
Operating System: Jessie Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: PHP

Postby mcrossley » Tue Nov 03, 2015 10:17 pm

I think we'd have to see the code to comment.

User avatar
beteljuice
Posts: 2455
Joined: Tue Dec 09, 2008 1:37 pm
Weather Station: None !
Operating System: XP SP3 - honest
Location: Dudley, West Midlands, UK

Re: PHP

Postby beteljuice » Wed Nov 04, 2015 1:40 am

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 Jan 22, 2013 9:20 pm
Weather Station: PCE-FWS 20
Operating System: Win 7 Pro
Location: Zlatina, Bulgaria

Re: PHP

Postby gluepack » Wed Nov 04, 2015 7:04 am

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

philpugh
Posts: 108
Joined: Tue May 24, 2011 8:34 am
Weather Station: DAVIS VantageVue
Operating System: Debian (RPi) 3.18.11-v7
Location: Antrobus, Cheshire
Contact:

Re: PHP

Postby philpugh » Tue Nov 17, 2015 9:33 pm

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!


Return to “Customisation”

Who is online

Users browsing this forum: No registered users and 1 guest