change of php version 7.2 and does not update forecast

Hello good afternoon
Yesterday I updated my version of php to 7.2, my previous one was 5.3, and since I updated my forecast in text does not appear on my website.
If they update the icons well, but not the text.
Does anyone know what to do to modify and update it well?
Thank you.
This link is from the forecast on my website that does not update well
http://www.meteoxabia.com/previsiones_meteoxabia.htm
here in the original template:
https://www.meteoxabia.com/estacions/port/plaintext-parser1.php
And as you see the plaintext.txt if it updates well, but is not reflected in the web, I do not know if it will be necessary to change some script.
Thank you.

It looks like your plaintext-parser.php script is v1.06 from 2007. The current version is v1.31 from 2018. You might want to download the latest script here: https://saratoga-weather.org/scripts-WXSIM.php#plaintext

Steve

Thank you
I have tried and updated the new script but I have also inserted the Spanish language for the translation and it does not translate it to me.

You changed a comment

// lang=es (default) - use Spanish language
and not the actual variable further down in the script

$lang = 'en';                             // default language is 'en' = English

… change that to

$lang = 'es';                             // default language is 'en' = English

and it will default to Spanish.

Remember that script lines that start with either // or # are PHP comments (not executed).

Something I’m not doing well because I do not get the new script translated into Spanish.
http://www.meteoxabia.com/estacions/port/plaintext-parser1.php
I’m still on another server with an old php version with the previous script and it still works well in Spanish, and I would like to be able to update everything, but I can not find the mode.
This is the old model:
https://www.meteoxabia.es/prevision/plaintext-parser1.php

The script at http://www.meteoxabia.com/estacions/port/plaintext-parser1.php is still set for English. As Ken/saratogaWX posted above you need to change this line:

$lang = 'en';                             // default language is 'en' = English

to

$lang = 'es';                             // default language is 'en' = English

I have it like that, I do not know if I leave something to do


You changed a comment line.
In PHP comment start with either // or with a #

Your script can run in Spanish: http://www.meteoxabia.com/estacions/port/plaintext-parser1.php?lang=es

Now you have to set the correct line in the script.
That is line probably around line 159? or 186? and the lines around that point read like this

// Settings ---------------------------------------------------------------
$iconDir ='./forecast/images/';           // directory for carterlake icons
$iconType = '.jpg';        // default type='.jpg' -- use '.gif' for animated icons from http://www.meteotreviglio.com/
$WXSIMstation = "Saratoga-Weather.org";   // name of your weather station
$plaintextFile = './plaintext.txt';       // location of the WXSIM plaintext.txt
$lang = 'en';                             // default language is 'en' = English
$tempDegrees = '°';                   // set to '' to omit degree sign

Change

$lang = 'en';                             // default language is 'en' = English

to

$lang = 'es';           

Wim

You changed it on a documentation comment line… you have to change it where Wim pointed it out in order to have it take effect.
Comment lines are not executed by PHP.

and what can I do to make the errors disappear with the accents?
http://www.meteoxabia.com/estacions/port/plaintext-parser1.php?lang=es

Here I put some examples of words with accents that when translated they appear with error


The issue seems to be that your webserver is saying the text character set is UTF-8 – the page puts out ISO-8859-1 character set.

Can you attach the source for plaintext-parser1.php (as a .txt file) – I’ll see where a header() statement can be safely added to force the correct character set.

Thank you


plaintext-parser1.txt (45.3 KB)

Ok, the attached should work. Rename it from .txt to .php to upload to your site.


plaintext-parser1.txt (45.6 KB)

Thank you very much, I have it resolved.
I have taken advantage and I have added a txt file of a new translation to “Valencian”, it is a language very similar to Catalan but with some words that change, I attach the txt file in case you want to add it for future users.


plaintext-parser-lang-vl.txt (5.84 KB)

another little thing, now the hours appear in “am” and “pm”, personally I like more in 24 hours, is it possible? and how can it be changed?
Thank you

Change this line (around 266) from

$timeFormat = 'd-M-Y h:i a'; // default to USA format

to

$timeFormat = 'd-M-Y H:i'; // default to USA format

You can find all the time format codes here

I have made the change in the template but it does not change me, it remains the same

I see it’s set in two places. Try in http://www.meteoxabia.com/estacions/port/plaintext-parser-data.txt change this section at the top:

dateformat|d-M-Y h:i a| // USA format 31-Mar-2006 02:03 pm
#dateformat|d/m/Y H:i|   // Euro format 31/03/2006 14:03
#dateformat|Y-m-d H:i|   // ISO  format 2006-03-31 14:03

to:

#dateformat|d-M-Y h:i a| // USA format 31-Mar-2006 02:03 pm
dateformat|d/m/Y H:i|   // Euro format 31/03/2006 14:03
#dateformat|Y-m-d H:i|   // ISO  format 2006-03-31 14:03

or change to your choice of format.

One other issue is the timezone spec of

$ourTZ     = 'Europa / Madrid';          // your timezone

That needs to be

$ourTZ     = 'Europe/Madrid';          // your timezone

for PHP to know what timezone to use.