Meteoalarm script Modded by Henkka

Hi guys,
i’m here again. :roll:
I’ve done a test inserting a country with a weather alerts.
So, this is what this script shows: http://www.meteocarmignano.it/meteo_test.php?force=1

What’wrong?
Regards,

Alessandro

Without seeing what changes you made to the original script, it’ll be hard to work out what’s wrong. :wink:

Hi Alessandro,

Send it to me, using your meteo.php script.
See what’s wrong with it.

Hi Martin and Kartal,
i’m using the original script by Henkka (in attachment)…but i have the same result with kartal’s modded script.
Regards,

Alessandro


meteo_test.php.txt (22.2 KB)

http://www.finwx.net/forum/index.php/topic,1617.0.html

Hi Kartal,
sorry but it’s in finnish language and i dont’ understand anything :frowning:

Edit: I’ve downloaded the script on that forum (last post of Henkka).
Now, i’ve the alerts in my home http://www.meteocarmignano.it/index_test.php but without any rectangle box (yellow or red). Is it ok?

Other thing: At the end of alerts i still have the ) character.

Any ideas?

Many thanks,

Alessandro

Hi Alessandro,
Sorry, no idea for now.
I try to change the script.
I think the problem is with language file

Regards,

Hi guys,
i’m investigating but without any success :frowning:
I’m back to my old script (that i’ve attached)…
With this version of script the result of alert is http://www.meteocarmignano.it/meteo.php?force=1
and in my home it shows http://www.meteocarmignano.it/index_test.php?lang=en

With Henkka’s version instead the script shows a blank page http://www.meteocarmignano.it/meteo_henkka.php?force=1
like in my home page too http://www.meteocarmignano.it/index_test2.php

If you try it with an alerts to test, it works or not?
Thanks in advance,

Alessandro


meteo.php.txt (22.2 KB)

meteo_henkka.php.txt (20.3 KB)

Hi Alessandro,

$isFIN = false; // Does the warning show warnings from Finland? true/false If true, we need to crop    

The FileNet Settings php need to adjust the city

//
// For Europe only, use the meteoalarm.eu site for your area's watches/warnings on the wxadvisory page
$SITE['EUwarningURL']	= [b]'http://www.meteoalarm.eu/index3.php?area=IS001&day=0&lang=en_UK'[/b]
// EUwarningURL is used by get-meteoalarm-warning-inc.php for EU countries


##########################################################################
# end of configurable settings
##########################################################################
#
# Multilanguage support constants - please do NOT change the settings below
# DO NOT CHANGE THESE SETTINGS

http://www.huweather.com/meteo4.php

Hi Kartal,
please, could you post here your working script?
I’ve noticed that there are the differences between yours and that of Henkka.
Principally, the differences are in the traduction part of script.

Yours:

} else if($lang == "it") {
$intensity = array("Vento", "Neve/Ghiaccio", "Temporali", "Incendi","Nebbia","Temperature estremamente alte","Temperature estremamente basse","Eventi Costieri","Valanghe","Pioggia");
$levels = array("","Giallo","Arancio","Rosso");
$requiredNoteEUA = "Si ringrazia <a href=\"$EUA_URLLink\" rel=\"external\">EUMETNET-MeteoAlarm&copy;</a> per la pubblicazione degli Allarmi Meteo. Sono tuttavia possibili ritardi di pubblicazione tra Meteocarmignano.it e www.meteoalarm.eu; Per avere maggiori notizie sui livelli di allerta pubblicati dal Servizio Meteorologico Nazionale &egrave; consigliabile utilizzare <a href=\"$EUA_URLLink\" rel=\"external\">www.meteoalarm.eu</a>. I dati sulle informazioni locali sono forniti da <a href=\"http://www.meteoam.it\"  rel=\"external\">Servizio Meteorologico dell&acute;Aeronautica</a>. Utilizzo tramite autorizzazione.";

Henkka:

} else if($lang == "it") {
$intensity = array("Vento", "Neve/Ghiaccio", "Temporali", "Incendi","Nebbia","Temperature estremamente alte","Temperature estremamente basse","Eventi Costieri","Valanghe","Pioggia");
$levels = array("","Giallo","Arancio","Rosso");
$requiredNoteEUA = '[b]<div class="faqbox rounded" style="text-align:justify;margin-top:15px;"><span class="ui-icon ui-icon-info" style="float: left; margin-right: .3em;"></span>[/b]Si ringrazia <a href="'.$EUA_URLLink.'"  rel="external">EUMETNET-MeteoAlarm&copy;</a> per la pubblicazione degli Allarmi Meteo. Sono tuttavia possibili ritardi di pubblicazione tra Meteocarmignano.it e www.meteoalarm.eu; Per avere maggiori notizie sui livelli di allerta pubblicati dal Servizio Meteorologico Nazionale &egrave; consigliabile utilizzare <a href="'.$EUA_URLLink.'" rel="external">www.meteoalarm.eu</a>. I dati sulle informazioni locali sono forniti da <a href="http://www.meteoam.it"  rel="external">Servizio Meteorologico dell&acute;Aeronautica</a>. Utilizzo tramite autorizzazione.</div>';

Is it possible that these differences causing the error in the script?
Even your script does not display the icon and the yellow or orange rectangle about relativ alert :frowning:

Thanks again,

Alessandro

Edit: Now, with your latest script, there are the alerts icons and no alerts words.!!
Look here: http://www.meteocarmignano.it/meteo.php?force=1
While in Home i have double alerts!! http://www.meteocarmignano.it/index_test.php
I’m confused!
:?

I’m completely confused.
I do not know what a good script.
This is the last working script


meteo4.php.txt (15.7 KB)

Could you send me the final script?

Which part of script do you refer?
Traduction part, function part or entire script?

The full script, please.
I’m trying to convert him.

Hi Kartal,
i’m working on that … probably i’ve found the issue :lol: :lol:
Wait please!

[b]Edit: Ok…i’ve attached my meteo.php script with some fix. The alert icons didn’t show because it had the broken links!
Now the script works ok :smiley:
Look here: http://www.meteocarmignano.it/meteo.php?force=1

But, and i don’t know why at the moment, if i put this script on my home i still have the link to the icons broken.
Could you investigate for me please?
I am not a php guru :frowning:
The issue is in this part of code:[/b]

// wxicon
   preg_match_all('|<b>(.*)</b>|Uis',$matches[0][1],$ic);
   $rawic = str_replace("&nbsp;",'',$ic[1][0]);
   $wxic = str_replace($intensity, $wxicon, $rawic);
   if($wxic <> '') {
   $wxic = '
<img style="padding:3px" src="http://www.meteoalarm.eu/Bilder/wf/'.$wxic.'" alt=""/>';
   }

   // level
   $rawle = str_replace("&nbsp;",'',$ic[1][1]);
   $leic = str_replace($levels, $levelicon, trim($rawle));
   if($wxic <> '') {
   $acva = true;
   $leic = '<img style="padding:3px" src="http://www.meteoalarm.eu/theme/style1/rssimg/'.$leic.'" alt=""/>';
   } else {
   $leic = '<img style="padding:3px" src="http://www.meteoalarm.eu/theme/style1/rssimg/'.$levelicon[0].'" alt=""/>';
   }

Regards,

Alessandro


meteo.php.txt (21.2 KB)

Congratulations Alessandro,
very well resolved.
I look at the attached script, and I mean

Regards,

Hi Alessandro,

In this paste to file index.php

<?php
$frontpage = true;
include_once 'meteo.php';
echo $EUAwarning;
?>

The settings.php to file this

$SITE['fcstscript']	= 'WU-forecast.php';    // Non-USA, Non-Canada Wunderground Forecast Script
$SITE['fcstorg']		= 'WU';    // set to 'WU' for WeatherUnderground

// Uncomment the two lines below to use WXSIM as the ONLY forecast script to use
// $SITE['fcstscript']	= 'plaintext-parser.php';    // WXSIM forecast (if only forecast script)
// $SITE['fcstorg']		= 'WXSIM';    // set to 'WXSIM' for WXSIM forecast

//
// For Europe only, use the meteoalarm.eu site for your area's watches/warnings on the wxadvisory page
[b]$SITE['EUwarningURL']	='http://www.meteoalarm.eu/index3.php?area=ES041&day=0&lang=';[/b]
// EUwarningURL is used by get-meteoalarm-warning-inc.php for EU countries


##########################################################################
# end of configurable settings
##########################################################################
#
http://www.meteoalarm.eu/index3.php?area=ES041&day=0&lang=

Now I can work that way

http://www.huweather.com/index2.php

Glad for you Kartal :smiley: :smiley:

But i still having the issue :frowning: :frowning:
Incredible!
I’ve the same settings like you but on my home page the script doesn’t show the alerts icons.
In my Settings.php:

// For Europe only, use the meteoalarm.eu site for your area's watches/warnings on the wxadvisory page
$SITE['EUwarningURL']	= 'http://www.meteoalarm.eu/index3.php?area=ES041&day=0&lang=';
// EUwarningURL is used by get-meteoalarm-warning-inc.php for EU countries

In my index_test.php:

<?php
$frontpage = true;
include_once 'meteo.php';
echo $EUAwarning;
?>

Any ideas? :?

Edit: Find it! :smiley:
It should be a language problem. Because if i change the language on your page the icon doesn’t show anymore.
Mhhmhmh…i’m investigating 8) 8)

Hi,
ok…now it works perfectly if there is an alerts
But…if there isn’t any alerts…it doesn’t show anymore on my home :frowning: :frowning:
http://www.meteocarmignano.it/meteo.php?force=1

Any ideas?