HWS-template (WD34) beta test July version

The current conditions block displays also a one-hour “forecast”. And WD does not supply that info.

Also, when using the Google Chrome browser, the menu link in the header doesn't show. It's fine on the April version. And it works fine in my Pale Moon browser. Thanks
I could not replicate that problem with my Chrome browser. See attached screenshot === In some browsers your webcam image is not shown as the link http://182.168.1.65:82/?_1559896445 should be https also.
Mixed Content: The page at 'https://www.m82a1.us/pwstestWD/index.php' was loaded over HTTPS, 
but requested an insecure image 'http://182.168.1.65:82/?_1559896445'. 
This content should also be served over HTTPS.

Wim


Hi,

Also did the upgrade to the beta version.
I do not see the option to refresh the data every xx seconds. (Nice for wind,uv,solar)

Also the metarbox is setup good, but on click nearby it gives “EBBR Brussels” and in the same windowbox earthquacke.

Without the URL to your website there is not much I can do to inspect those things.

Be aware that you use a beta version. The whole purpose of a beta program is to find remaining errors.
Do not use this version for production as in a few weeks the official release version will be available.

All blocks have different refresh-times. Those times are set in w34_blocks.php. Example

$script = 'temp_c_block.php';
$blck_ttls[$script]     = lang('Temperature').' °'.$weather['temp_units'];
$blck_rfrs[$script]     = 110; 

The temperature block is refreshed every 110 seconds.

===

The nearby metar airport code is set in easyweather-setup. You need also to set the API key for that nearly at the bottom.

Wim

I figured out the missing ‘Menu - Settings’ in the header.

I have an add-on that displays current selected stocks at the top of Chrome pages. It pushes down the page. In the April version, the pwsWD header is below the ticker bar. In the July release, while the page is pushed below the ticker bar, the ‘Menu - Settings’ links remain under the ticker bar. Here’s with/without the ticker bar.

pwsWD: https://www.m82a1.us/pwstestWD/index.php


I have no fast solution for that.
All 1276 lines of the page are correctly contained in the < body > tags
No html errors: https://validator.w3.org/nu/?doc=https%3A%2F%2Fwww.m82a1.us%2FpwstestWD%2Findex.php

To test and see what is happening, I need to know what add-on you are using.

Wim

Wim, just curious…

Why would my WXSIM forecast indicates that it is ‘Offline’ - the WXSIM forecasts are automatically produced every six (6) hours, thus, there is no reason for showing the WXSIM forecast as being offline.

Temporary web link: Tzouhalem-Maple Bay Weather

I think that will be related to “$filemtime == == Wed, 31 Dec 1969 16:00:00 -0800”, in other words it isn’t correctly reading the timestamp of the file.

“Niko hit the nail on the top”

If you run http://24.108.124.18/weather34WDbeta/w34_module_test.php
And select middle top-row => forecastWXSIMblock.php => click “Test-it” the message reads:

Warning: filemtime() [function.filemtime.html: stat failed for ../plaintext.txt in E:\htdocs\weather34WDbeta\w34_util_wxsim.php on line 41

The script can not get the filemtime = last-modified-time of the file.
This filemtime check is there so that we do not run the plaintext-parser.php multiple times when there is no new file during its 6 hour life.

The first thought, maybe windows using "" and the file starts with “…/” ??.
Second thought: running Kens script directly http://24.108.124.18/weather34WDbeta/wxsimPP/plaintext-parser.php the correct date time is found.
That date time is coming from the plaintext.txt file

But I can not access that file to check, all links do not work
http://tzwd34beta.ddns.net/../plaintext.txt
http://24.108.124.18/weather34WDbeta/../plaintext.txt
Have to study this. Problem is I do not have a windows website-server available. Will take some time.

Wim

Adapted script to test with in next post!

OK, can you test this version?
It will use the date-time from the plaintext-file as parsed by Ken’s script, only if the stat fails.

===
I also found the culprit, your plaintext.txt is on a other location then expected

$plaintextFile = '../../wxsim/plaintext.txt';       // location of the WXSIM plaintext.txt

Normally the file is in the webservers root.
That is why the file-name-location in the parser is “…/…/plaintext.txt”
And in the other scripts “…/plaintext.txt”

Change line 22 in w34_util_wxsim.php from

$plaintextFile  = '../plaintext.txt'; 

to

$plaintextFile  = '../wxsim/plaintext.txt';

Will add it to the documentation
Wim


w34_util_wxsim.php.zip (3.42 KB)

The author just released an update where sites could be blacklisted - so I now don’t have it display on my m82a1.us sites.

It’s strange that April and July menus are different…


Not strange at all, the original release contained hundreds of html “notices” / problems.
I removed them all, but had to rewrite 90% of the code.

I can probably change the code in such a way that you do not have to blacklist the template. I already changed the code, but need the extension to test with.

But that is for ‘one fo these days’ later next week.
Tomorrow it is “conformation” day for the grand children, to important for them and for me to miss that large family gathering.

Wim

Hi Wim,

I see a problem with weather alerts.
It shows the distance of a discharge (Nexstorm).
Instead of 1509 km he gives an alarm because of a thunderstorm at 1,509 km.
See red blocks.

https://www.weerstation-assen.nl/actueel-weer2.php

Edit: After refresh alarm message is gone. See picture how it looked.

Furthermore, it looks great. Many thanks!

Brgds,
Oebel


Can you please PM me the link to the NSRealtime.txt file you are using? Then I can test / check.

The comma in the distance is a number_format error, I will check that.
The alert is always given if the “lightningtimeago” is less then 500 seconds.
Both the WeatherFlow or Boltek are used for that. Boltek has priority if both devices are available.

Wim

Hi Wim,

You have PM.

Brgds,
Oebel

Wim, when is the WXSIM parser ‘plaintext-parser.php’ run, meaning at which stage during the loading of all the other templates? Is the WXSIM parser ‘plaintext-parser.php’ run before the ‘w34_util_wxsim.php’? If yes, then the value of the path to the ‘plaintext.txt’ data file set in ‘plaintext-parser.php’ template should be passed on to the ‘w34_util_wxsim.php’ template and not be fixed in the ‘w34_util_wxsim.php’ template, thus preventing the current situation, that is ‘assuming’ that a file/template is in the root directory when that file/template can/could be in a totally different directory.

The WXSIM parser ‘plaintext-parser.php’ needs to be edited in order to provide the required information for its proper operation - the ‘w34_util_wxsim.php’ template should not have be edited.

Note: On all the systems I have operating on my home/office server as well as my online server, no template, no data file is place in the root directory - for me, the root directory is ‘sacred’ and not to be used for any purposes except for an .htaccess routing file.

One thing I noticed with this beta on 12 hr. clock it doesn’t change from am to pm till a screen refresh is done.
https://www.shermanctweather.org/pwsTEST/index.php
Tom

Attached correct formatted distance number.
There is only an alert when the age is less then 600 seconds

Wim


advisory_c_small.php.zip (3.37 KB)

w34_util_wxsim.php serrvices all wxsim blocks/popups,
it is loaded by all wxsim scripts as the first include
and it then
=> compares the age of plaintext.txt versus the age of the cache arrays
==> if a new file arrived
===> it loads the parser
===> and saves Ken True’s arrays to the cache
==> if no new file arrived it loads the arrays from the cache
=> and returns the arrays to the calling script
Then the normal scripts can print what they need.

The WXSIM parser 'plaintext-parser.php' needs to be edited in order to provide the required information for its proper operation -
Yes it should be edited as it is the exact copy of Ken True's script. I stopped making small changes in someone else scripts as it always resulted in large problems
the 'w34_util_wxsim.php' template should not have be edited.
As w34_util_wxsim.php starts before the parser they both should now the exact location to check the filetime and to read the file
Note: On all the systems I have operating on my home/office server as well as my online server, no template, no data file is place in the root directory - for me, the root directory is 'sacred' and not to be used for any purposes except for an .htaccess routing file.
I agree with that 100%. That is why I have all my template/scripts in separate folders.

So I will make clear in the documentation that there are 2 locations to check.
As most wxsim users upload to the root, I leave the current relative addressing as is.

Wim

Thanks for finding that, it has been the same script form months.
The 24 hour clock can not have that problem. I will test tomorrow around noon.
If possible can you test this “enhanced” version.

Wim


clock_c_small.php.zip (2.32 KB)

Hi Wim,

The problem is not solved.
A storm warning is displayed when the distance is hundreds of kilometers.
https://www.weerstation-assen.nl/actueel-weer2.php

Brgds,
Oebel