Meteoalarm script Modded by Henkka

Hi to all,
two months ago Henkka gave me the script in object.
I would insert it on my home page to show the meteo-alarm in a red rectangle box.
This script is a mod of the original script of Ken…it catches the data from meteoalarm.eu site and paste the results wherever you want.
Unfortunately i’ve a problem with lang function that i don’t manage to fix.
Here is the link: http://www.meteocarmignano.it/meteo.php

I didn’t see Henkka on this forum and he didn’t answer by email anymore so i would ask here if any php guru fix this little problem.
Thank you very much,

Alessandro

What’s on line 187and 375?

Hi!

Line 187: if(($lang == “dk”) or ($lang == ‘’)) {

and line 375: if(($acva == true && $frontpage == true) || $frontpage == false) {

Thanks in advance for your support,

Alessandro

I’m not an expert (not even a newbe) :oops:

But it looks like there is something missing on line 187 if(($lang == “dk”) or ($lang == ‘’)) {

should it not be something like this, if(($lang == “dk”) or ($lang == ‘’")) {

I think the problem is that the script is expecting $lang to have been defined before that line. Can you save the whole script as .txt and attach or post it?

(php can usually accept either single ’ or double quotes ", there is a subtle difference, but it’s not usually critical.)

Hi Niko,
here it is :smiley:
Thanks,

Alessandro


meteo.php.txt (23.1 KB)

Alessandro, line 187 fails because there is a mix of $Lang and $lang being used in the script. Variable names are case sensitive so $Lang is not the same as $lang. I suggest you replace all the $lang with $Lang and see if it runs for you.

Also on line 28 remove the spaces before $Lang.

Many thanks Niko…but now i’ve others errors:

Notice: Undefined offset: 0 in /web/htdocs/www.meteocarmignano.it/home/meteo.php on line 329

Notice: Undefined offset: 1 in /web/htdocs/www.meteocarmignano.it/home/meteo.php on line 336

Notice: Undefined variable: acva in /web/htdocs/www.meteocarmignano.it/home/meteo.php on line 375

:? :?

Any ideas?
Thanks,

Alessandro

I don’t get any errors so maybe you have a typo. I don’t get any output either but there are no alarms for IT so maybe that’s OK. I’ve attached my code.

Update: It’s alive :smiley: I had to uncomment line 378

print “$EUAwarning”;

There’s still something wrong with the file caching that I haven’t fixed, but it’ll work if you force it to read the website so that’s progress:


meteo.php.txt (23.1 KB)

Thanks Niko!
You’ve fixed all errors :smiley:

Last thing: Now, this script shows “Non e’ richiesta alcuna attenzione speciale” because there isn’t any alarm on italy.
http://www.meteocarmignano.it/meteo.php

But if i include the script like so:

<?php
$frontpage = true;
include 'meteo.php';
echo $requiredNoteEUA;
?>

it doesn’t show anything in the orange box…why?
http://www.meteocarmignano.it/index_test.php

It should showing the results of script…“Non e’ richiesta alcuna attenzione speciale”. Isn’ t it?
Thanks again,

Alessandro

Hi Alessandro,

Very good script.
Can you send me?
Thank you very much.

Hi Alessandro,
Try this version.


meteo.php.txt (18.8 KB)

WOW! :smiley:
Very nice Kartal…thank you very much!!
Which are the differences?

It remains one issue.
I don’t still manage to include meteo.php on my home page.
Look here: http://www.meteocarmignano.it/index_test.php

I’ve put this code

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

on that page but without success.
How have you done?
Regards,

Alessandro

Alessandro

Please wait while working on it :smiley:

Hi Alessandro,

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

Bingo! :smiley:
Now it works without any issue…i’ll wait my first advice to test it.
http://www.meteocarmignano.it/index.php

Thank you very much (Niko and Kartal), :slight_smile: :slight_smile:

Alessandro

I’m glad you managed to do it :multi: :smiley:

I made a special version of the character as well.
Utf-8, ISO 8859-2, ISO 8859-1


meteo.php.txt (20.8 KB)

Thanks again Kartal,
i’ll try it tonight.
Regards,

Alessandro

Hi Kartal :smiley:
i’ve tried your version but i don’t found any differences as well as others characters.
Please, could you tell me which differences are there?
Many thanks,

Alessandro

Hi Alessandro,

The Hungarian characters