Wxsim 3in1 script

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?

That line of code should go into the <head section of the main page http://newsite.meteocarmignano.it

With the normal 3in1 scripts such as sivu2.php and probably your http://newsite.meteocarmignano.it/previsioni-pistoia.php the needed lines are generated with

echo $wxallhead;

You can not use that with a <div so you have to manualy copy the link of the css to the head section of your main script.

This is from the readme:

On every page where 3in1 are used are this needed in header inside and : <?php $lang = $_GET[lang]; // not nessessary in Saratoga Templates where $lang defined include 'wxall.settings.php'; echo $wxsimhead; ?>
But instead of this you can write that one line yourself.

Wim

Hi Wim,
thanks for your patience :slight_smile:
I’ve put this string:

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

on header section of my site.
Result is the same :frowning:

Fixed!!!
Thank you so much Wim !!!

Hi!
This time I wounder about the icons in the top. I have read all posts but cant find any answer. The icons show snow but here is nearly 10


[quote author=janove link=topic=47139.msg512647#msg512647 date=1479402843]
Hi!
This time I wounder about the icons in the top. I have read all posts but cant find any answer. The icons show snow but here is nearly 10


Hi,
I check the settings and there was no C so I changed it and now it works perfect.
Thank you very much for your help Wim. :signthanks: :occasion5:

Best regards
Jan-Ove

Hi guys,
do you know where could i fix degrees symbol?

http://i.imgur.com/1wAOuCU.png

On the popup shows ok but not in graphics window.
Thanks in advance.
Regards,

Alessandro