Wxsim 3in1 script

Dst ?

The problem was there before this week-end.
Plus, this is correct in the meteogram.

There are two sources of forecast data used in nearly every WXSIM script.
The plaintext.txt => icons and the text on the first table
Either lastret.txt or latest.csv for the meteogram and other tables.

Your http://www.meteomelin.be/weather-data/wxsim/plaintext.txt file contains the information as displayed.

WXSIM text forecast for Melin, initialized at 11:00 28 Mar, 2016 _______________________________________________________________________________

This afternoon: Mostly cloudy. A chance of rain. Very windy. High 53. UV index
up to 2. Wind southwest around 39 kph, gusting to 60 kph. Chance of
precipitation 30 percent. Precipitation mostly less than a tenth of an inch.
. . . shortened . . .


No conversion is done on the data for temperature.
Temps and rain are in “imperial” (F) in your plaintext.txt, other values are in “metric”

Your lastret.txt http://www.meteomelin.be/weather-data/wxsim/lastret.txt is “metric” for all values.

Probably the only thing you have to do is to set the output settings for plaintext.txt correct in your wxsim/wret program on your PC.

Wim


Hello Wim,

Wret is set to use celcius.
Problem still there.

What do you exactly mean:
Did you set wret from F to Celcius
or
was it already on Celcius?

===

if it is not wret, then it is wrong in wxsim.exe itself.

See screenshot.

Wim


I wanted to make the graph area a little higher. I attach the result. Everything is fine except that the wind arrows are still in the original place. I have tried to find out how to move them to the bottom, but I haven’t found it so far. Any tips?
Also I think the direction arrow on the wind speed circles look strange. Any idea?


I also have this problem, since I moved to PHP 5.6.21!

Any ideas?

Thanos

First, the message it is not an error, it is a notice. Telling the owner of the site that this script will cease to function in the future as the instruction used will not be supported in future PHP versions.

Second, it is your php ini file which decides which notices/warnings/errors are written into the log. So you could set a different logging level, omitting notices and deprecated messages from the log.

Third, you could contact the author of the script. As @atsio removed those essential lines, I have them here for your convenience so you can add them back into your script.

<small>Script by <a rel="external" href="http://www.nordicweather.net">nordicweather.net</a>.

Powered by <a rel="external" href="http://www.wxsim.com">WXSIM</a>.</small>

As a service to you and maybe others having this same “problem”, I used the Ken True / Saratoga script plaintext-parser.php to borrow the current version for that line 481. The wxall.plaintext.php is partly based on Ken’s script.

How to install:

  1. rename your current wxall.plaintext.php script. Be sure to find the one which is used on your website pages as often there are multiple folders (wxsim / wxsim_wxall)
  2. unzip attachement and put it in the same folder as the renamed one.

If other readers or you modified this wxall.plaintext.php script I add the changes here also:
The line raising the preg-replace /e notice in the current version reads:

  $fixedtxt = preg_replace('!\.\s+([a-z])!es',"'.  ' . strtoupper('\\1')",$fixedtxt);

it is replaced using Ken’s code with

	if(!function_exists('wxsim_repl')) {
	  function wxsim_repl($m) {
        return ('.  ' . strtoupper($m[1])); // function does what deprecated /e did for us before
      }
	}
  $fixedtxt = preg_replace_callback('!\.\s+([a-z])!s','wxsim_repl',$fixedtxt);

Succes, Wim

EDIT: 2016-05-22removed a type, thanks goes to @youhead for finding it.


wxall.plaintext.php.zip (14.1 KB)

Thanks Wim, that did the trick!

Fixed the credits too! :roll:

Thanos

Hi and thank You too Wim! :smiley:

However there is, i think a mismatch…
$fixedtxt = preg_replace_callback(‘!.\s+([a-z])!s’,‘wxsim_repl’,$text);
should be…
$fixedtxt = preg_replace_callback(‘!.\s+([a-z])!s’,‘wxsim_repl’,$fixedtxt);

Thank You again for Your solution!
Angelos Vidalis

Are any of you running PHP V7? My web host just upgraded PHP from V5.6 to 7.0.7. That has lead to several problems. One of them is that the text from plaintext.txt in the column “Description and notes” doesn’t show anything.
I thought that I should check the PHP error logs, but my web host doesn’t have error logs.
Have any of you experienced this problem and maybe solved it?
I have temporary downgraded to PHP V5.6 and it’s working again.

Hi Runar,

The error is caused by line 481 in wxall.plaintext.php. Comment out that line and it will work in PHP7 too.

Change

$fixedtxt = preg_replace('!\.\s+([a-z])!es',"'.  ' . strtoupper('\\1')",$fixedtxt);

to

//$fixedtxt = preg_replace('!\.\s+([a-z])!es',"'.  ' . strtoupper('\\1')",$fixedtxt);

I have PHP running on one of the domains of my server and a PHP7-compatible update of 3in1 will be released soon.

// Henkka

Thanks, Henkka. It’s working now :slight_smile:

Hi all, I dont sure if I should open a new topic or not.
The problem is the meteogram dont show up in 3-1 wxsim_wxall and no buttons works. Lastret.txt is upploading ok. But I’m not sure if the file it’s okey. I appends the file if any one will take a look at it. My url is http://www.janove.se/wxsim_wxall.php.
I dont have any weatherstation of my own yet, so I use metar in wdisplay.

Thank you
Jan-Ove


lastret.txt (34.3 KB)

Again, as always, the same cause for your missing graphs a.s.o.

Currently, All data shown on your page => the icons part and the overview tab => comes from plaintext.txt.

Problem: Your lastret.txt is read by the script but all lines are skipped as they are not on the hour. They are 5 or 35 minutes past the hour.

Also a problem: it is not the cause of the missing data but I think some of the needed fields are missing also.
Check the wret.png which is contained in your script download.
That png shows which settings should be set in wret.exe in your wxsim folder correctly.

Wim


Thank you very much. I will go true everything all over again. But now I have something to check even moore.

Best regards
Jan-Ove

Hi!
Thank you so much Wim for your help. Now it’s working. :smiley: :smiley: :signthanks:

Best regards
Jan-Ove

Hi guys,
i’ve manage to insert graphic wxsim icon only on my home page.
But it shows black icons.
Do you know something about this issue?
I’ve used an include_one function, while if i use an iframe, all work as it should.
Link: http://newsite.meteocarmignano.it
Link to graphic icons only: http://newsite.meteocarmignano.it/previsioni-pistoia.php

Thanks for your support.
Regards,

Alessandro

The link to the stylesheet is missing.

<link rel="stylesheet" type="text/css" media="screen" href="./wxsim_wxall/css/wxall.css" />

When you use an iframe all needed information is included. When you want to do it your way you have to add that css to the thead section of your page.
Wim

Thanks for your quick reply.
In which file have you tried the link to styleshhet?

Should i put css file on the root?