Page 46 of 55

Re: Yet Another Dayfile Reader (PHP)

Posted: Mon 30 Mar 2020 10:18 am
by Vegit8
A question...
I have implemented this on my website, is it possible to do the same thing for the Local interface - http://localhost:8998/index.html

Cheers

Re: Yet Another Dayfile Reader (PHP)

Posted: Mon 30 Mar 2020 11:12 am
by water01
It is possible but the Dayfile Reader is written in PHP therefore you would have to have the PHP installed and have running it's own Web Server (https://www.php.net/manual/en/features. ... server.php). Then you will have to either call it from altered index.html (the one in the interface folder) or directly call it from a URL i.e. http://localhost/CumulusMX/data/betel_r ... e.php:8000 (assuming two things the PHP webserver is using the standard 8000 port and you installed the dayfile reader in the data folder of your CumulusMX install directory).

Seems a lot of work when it is available on the web in another tab?

See you live in Ditcheat, home of good cheese and Paul Nicholls!!

Re: Yet Another Dayfile Reader (PHP)

Posted: Mon 30 Mar 2020 3:52 pm
by sfws
David has got it right, the web server created by the MX engine is very basic. Much more sophisticated web servers are needed to cope with potential complexity of PHP (and databases).

In theory, you can do it the other way round, I imagine you could run the MX user interface on another web server, but there is a lot more to move than you might guess.

Re: Yet Another Dayfile Reader (PHP)

Posted: Mon 30 Mar 2020 9:33 pm
by Vegit8
Thanks guys.
I sort of thought that may be the case.
Yes, no shortage of cheese or butter here.
The horses are still riding out each day, but one behind each other instead of 2 abreast

Re: Yet Another Dayfile Reader (PHP)

Posted: Tue 31 Mar 2020 9:48 am
by mcrossley
Vegit8 wrote: Mon 30 Mar 2020 9:33 pm The horses are still riding out each day, but one behind each other instead of 2 abreast
I would have thought that is the worst way of doing it, by slipstreaming the person in front you are breathing in anything they exhale. Cyclists are being told not to slipstream.

Re: Yet Another Dayfile Reader (PHP)

Posted: Tue 31 Mar 2020 11:52 am
by HansR
I am not native English, as many have remarked here ;) , but I would interpret 'The horses are still riding out each day, but one behind each other instead of 2 abreast' that Nicholls and his horses are still alive, but not racing any more, at least not very good. (Yes, I looked up Nicholls, he's not that famous that the Dutch would know him. Just curious about the remark).

Some British remarks are quite funny actually like 'wagging the dog by the tail', another one I remember.

Re: Yet Another Dayfile Reader (PHP)

Posted: Tue 31 Mar 2020 3:05 pm
by water01
Some British remarks are quite funny actually like 'wagging the dog by the tail', another one I remember.
It's actually "The tail wagging the dog", which describes a situation in which an important or powerful person, organization, etc., is being controlled by someone or something that is much less important or powerful

Re: Yet Another Dayfile Reader (PHP)

Posted: Tue 31 Mar 2020 8:53 pm
by beteljuice
Especially for Hans ...
Some British remarks are quite funny
... and when we don't understand something it's "Double Dutch" to us :mrgreen:

Re: Yet Another Dayfile Reader (PHP)

Posted: Wed 01 Apr 2020 6:59 am
by Vegit8
For those concerned as to the well being of the stable hands. The horses and riders only walk slowly through the village. They only gallop when using one of the all weather training areas. One of which rises almost 200 feet in a very short distance.
There are 140 plus horses in training, and the National Hunt season ends at the end of April in any case. Most if not all horses will then be turned out to grass for a holiday!

Re: Yet Another Dayfile Reader (PHP)

Posted: Sat 02 May 2020 5:01 pm
by edo89
Hi to all!

I have a problem with this reader...
If I use the reader in the standalone mode I have no problem, it works well.
http://meteobernate.altervista.org/weat ... /basic.php

But if I try to use it as a link of the menu of my website (leuven template) I have the error "Failed to open dayfile"
http://meteobernate.altervista.org/weat ... #data-area

I saw that in the past some people have the same problem but I'm not able to solve it... I can't understand where is the problem... :bash:

Thank you for your help!

Re: Yet Another Dayfile Reader (PHP)

Posted: Sat 02 May 2020 5:33 pm
by sfws
edo89 wrote: Sat 02 May 2020 5:01 pm I have the error "Failed to open dayfile"
What have you said for location of dayfile.txt in the script?
If you have the same path in the script for both your web pages, it will not work.

In index.php, it will look for that file starting at http://meteobernate.altervista.org/weather28/ and presumably not find it because it needs to start looking within sub-directory inc.

in basic.php, it finds the file because it does start looking at http://meteobernate.altervista.org/weather28/inc/

Re: Yet Another Dayfile Reader (PHP)

Posted: Sat 02 May 2020 7:35 pm
by edo89
Thank you for your help, you were right because now the error was disappeared. :clap:

I also moved the betel_readDayfile (and the other files) in the main path with dayfile.txt because in a first time I was not able to switch from the parameters.
Now it works :P
http://meteobernate.altervista.org/weat ... #data-area

Re: Yet Another Update

Posted: Sat 09 May 2020 4:39 am
by beteljuice
Coming Soon ....

Yet Another Update.

No urgency, the way cookies are created (and therefore read) is changing, so need to be fixed.

The mod is simple, and if you wish to do it yourself so as you don't have to re-do all your options etc. ...

betel_readDayfile.php approx. line #1661

Code: Select all

foreach($displayUOM as $key => $val){

//$script .= "    document.cookie = 'theseUOM[".$key."] =".$val."; '+expires;\n";
$script .= "    document.cookie = 'theseUOM[".$key."] =".$val."; '+expires+'; sameSite=lax;'\n";
}
... be back soon with a new distro.

Re: Yet Another Dayfile Reader (PHP)

Posted: Sat 09 May 2020 6:28 pm
by Mapantz
Have you added the 'Feels Like' tables yet, beteljuice? :lol:

Re: Yet Another Dayfile Reader (PHP)

Posted: Sat 09 May 2020 6:35 pm
by water01
That was easy if you use Mark's original MySQL based script, just change the Apparent to Feels Like.

Code: Select all

        array(101,'MinFeelsLike','Min Feels Like',false,1,'cDewL'),
        array(102,'MaxFeelsLike','Max Feels Like',true,1,'cDewH'),