Author Topic: Environment Canada Weather Alerts on Main Page  (Read 7425 times)

Offline avoorpool

  • Sr. Member
  • ****
  • Posts: 372
    • http://pickeringweather.ca
Environment Canada Weather Alerts on Main Page
« on: December 27, 2012, 10:49:58 PM »
Hi Jacques,

Hopefully the Storm in Quebec hasn't effected you too much and were you able to dig yourselve out of 50 cm of snow... :o

I've added a few weather alerts to my main page in the Temp/Wind/Rain etc sections (using the Alarm settings in Cumulus + LED light), however when it comes to the 'offical' Warnings/Alerts from Envirnoment Canada (most likely many to follow during the Snow season), I always refer to my EC forecast page via the Cumulus Main screen  'Current Conditions' input.
In the 'forecast_ecl.php' there is a section that 'handles' these Alerts/Warnings.
Is there a way to 'copy/paste' this into my main page, so it will be shown under the 'Forecast' section when applicable??

Thanks,

Arthur

Offline avoorpool

  • Sr. Member
  • ****
  • Posts: 372
    • http://pickeringweather.ca
Re: Environment Canada Weather Alerts on Main Page
« Reply #1 on: January 05, 2013, 01:25:33 PM »
Hi Jacques,

Still waiting for a hint in this direction, how to implement the Environment Canada Weather Warnings/Alerts into my index page.
Is it s 'simple' copy of the string which is used in the 'forecast_ecl.php' script??

Thanks,

Arthur

Offline Mr.Meteo

  • Administrator
  • Hero Member
  • *****
  • Posts: 1116
    • http://www.meteostours.ca
Re: Environment Canada Weather Alerts on Main Page
« Reply #2 on: January 05, 2013, 04:23:30 PM »
Hi Arthur,

Yes, you could use forecast script and strip all uneeded lines,
but it is a bit big, only for that purpose! Saratoga has not
a script only for that?

Cheers,
Jacques
Please, consider supporting this site 

Offline avoorpool

  • Sr. Member
  • ****
  • Posts: 372
    • http://pickeringweather.ca
Re: Environment Canada Weather Alerts on Main Page
« Reply #3 on: January 05, 2013, 04:36:59 PM »
HI Jacques,

Thanks!!
I'll wait till a warning/alert appears on Environment Canada to see how it looks!!

In the mean time, my index page has a set of 'new' icons  :)  (in a 'blue-style'.......)

Cheers,

Arthur

Offline Mr.Meteo

  • Administrator
  • Hero Member
  • *****
  • Posts: 1116
    • http://www.meteostours.ca
Re: Environment Canada Weather Alerts on Main Page
« Reply #4 on: January 05, 2013, 05:21:01 PM »
Hi Arthur,
I see your new icons set... what a job!... real cute!  :-*

Maybe a good thing to make a page for them... and ZIP them
to not being into obligation to do 116 individual downloads!!  :-[

If you want, I host them!  ;)

Cheers,
Jacques
Please, consider supporting this site 

Offline avoorpool

  • Sr. Member
  • ****
  • Posts: 372
    • http://pickeringweather.ca
Re: Environment Canada Weather Alerts on Main Page + New Icon Set
« Reply #5 on: January 07, 2013, 11:05:52 AM »
Hi Jacques,

Thanks for the hint..!!!
When I entered my post, I realized it would be a 'job' to download all individual.
However, I've zipped them, and they're in the same folder as 1 .ZIP folder:
http://www.altonaweather.ca/downloads
Of course, please feel free to 'host' them!!!!  ;)

NEW Column on Index Page instead of 'boxes'....!!!!
Also, over the weekend I decided to make 1 column on the right side of the index page, instead of all different boxes with 'Current Weather', 'Moon Phase', 'Forecast Image' etc, etc.
It turned out very nice (it 'melts into the background when you scroll the page) and the column measures just 270 x 2340 px.....  :)
I made the 'separation' titles in colour equal to the left-side <span> title bar......

Looks better with the (mnay) different info sections on the page I think.....

Cheers,

Arthur


Offline Mr.Meteo

  • Administrator
  • Hero Member
  • *****
  • Posts: 1116
    • http://www.meteostours.ca
Re: Environment Canada Weather Alerts on Main Page
« Reply #6 on: January 07, 2013, 05:38:48 PM »
Hi Arthur,

I've seen your "new column" and found it very interesting!
Beyond a certain number of boxes, layout was less attractive!
... with that new column you put a certain "balance" with
the rest of the page

Bravo,
Jacques
Please, consider supporting this site 

Offline avoorpool

  • Sr. Member
  • ****
  • Posts: 372
    • http://pickeringweather.ca
Re: Environment Canada Weather Alerts on Main Page
« Reply #7 on: January 07, 2013, 07:26:03 PM »
Hi Jacques,

Thanks again and again  :)
Remember WHO gave all the Weather Blues enthusiasts & users a great opportunity to 'experiment' with this wonderful  template?? You, Mr.Webmaster himself!!!!!!
It turned out to be a 'more-than-expected' play-ground for me to make myself (from scratch) a bit more familiar with HTML and PHP.....

Indeed, the column contributes to a nice 'balance' on the page.

Cheers,

Arthur

Offline avoorpool

  • Sr. Member
  • ****
  • Posts: 372
    • http://pickeringweather.ca
Re: Environment Canada Weather Alerts on Main Page
« Reply #8 on: January 25, 2013, 01:07:01 PM »
HI Jacques,

Currently there is a EC Warning in efect (see attachment) and thus the only time I can check if it works on other pages.
The part of the 'forecast_ecl.php' in regards to Warnings is:
<?php
if (isset($ec_alert)) {
for($inc = 0; $inc < count($ec_alert); $inc++) {
if ($ec_alert_type[$inc] == 'watch')
$alert_color = '#FFFF7F';
else
$alert_color = '#FF7F7F';
echo '<p class="alerts" style="background-color:'.$alert_color.'">&nbsp;'.$ec_alert_type[$inc].'</p>';
echo '<div class="alert" style="border-color:'.$alert_color.'">';
echo '<p>Priority: <strong>'.$ec_alert_priority[$inc].'</strong>&nbsp;&nbsp;&nbsp;&nbsp;Issued alert: <strong>'.$ec_alert_date[$inc].'<br /> '.$ec_alert[$inc]."</strong></p>\n";
echo '</div>';
}
}
?>

Question:
Is this the part I have to enter into my indexT page??
If so: How and where should it be implemented???

Thanks,

Arthur

Offline avoorpool

  • Sr. Member
  • ****
  • Posts: 372
    • http://pickeringweather.ca
Re: Environment Canada Weather Alerts on Main Page
« Reply #9 on: January 27, 2013, 05:37:41 PM »
Hi Jacques,

This is what it looks like on my (XAMPP) IndexT.htm page......
Not much to see. (Another Warning (Freezing Rain) is in place at the moment).

Can you give me some advise of how to implement the correct (EC Alert) code into the IndexT.htm page??

Thanks,

Arthur

Offline Mr.Meteo

  • Administrator
  • Hero Member
  • *****
  • Posts: 1116
    • http://www.meteostours.ca
Re: Environment Canada Weather Alerts on Main Page
« Reply #10 on: January 27, 2013, 08:10:50 PM »
Hi Arthur,

I haven't time to look at that these days, but you couldn't just extract
these lines from the package because other part are for parsing the
source file to give the variable that you want to use ...IF IT'S SET (issset)

Then, you could go in that way, you could strip many parts of forecast_ecl,
but no require or include!

Hope this help,

Regards,
Jacques
Please, consider supporting this site 

Offline avoorpool

  • Sr. Member
  • ****
  • Posts: 372
    • http://pickeringweather.ca
Re: Environment Canada Weather Alerts on Main Page
« Reply #11 on: January 28, 2013, 07:07:57 AM »
HI Jacques,

Thanks for your advise!!!
All worked out well. (See attachment)

One more question remains......
I upload my files every 5 mins.
Normally, Cumulus uploads the indexT.htm file.
I renmaed this file into indexT.php, to make the PHP insertion workable.
How do I change the upload of the standard Cumulus file, so it will be indexT.php every 5 mins...  ;)

Thanks,

Arthur

Offline avoorpool

  • Sr. Member
  • ****
  • Posts: 372
    • http://pickeringweather.ca
Re: Environment Canada Weather Alerts on Main Page
« Reply #12 on: January 28, 2013, 11:16:01 AM »
Hi Jacques,

Cumulus upload is all set (added the index.php file to Cumulus.ini for continuous 5 mins upload).

I've added a "Weather Statement' message before the actual EC statement (attachment).

You guess it  ;)....???

I would like to add to the 'ec-alert' script a text that says (in case there are NO warnings/alerts):
"There are currently no weather statements from Environment Canada"

I've checked the 'ec-forecast.php' but can't find such a message. (Obviously No News = Good News  :))
However, where and in what context do I add this message in the script??

Thanks,

Arthur


Offline Mr.Meteo

  • Administrator
  • Hero Member
  • *****
  • Posts: 1116
    • http://www.meteostours.ca
Re: Environment Canada Weather Alerts on Main Page
« Reply #13 on: January 28, 2013, 11:23:08 AM »
Hi Arthur,

I'm happy to see that things are going good on these alert now!
To process your new file you have to tell Cumulus to process it
like other optional pages. To do so, simply follow instructions in
"Cumulus configuration" at bottom page of This link

But a little thing to verify is a chance of page conflict. The optional
page processing you will do on this new index.php page will bring
2 index page on your site and browsers will be "fooled" by that, I don't
remember which one (php or html) will "win this fight" and if it will be
the same "winner" for every browser!

You could try to remove the old indexT.html file in C:\Cumulus\web
folder, but I don't know how Cumulus will react if he has to process/send
only 6 out of 7 files! Then, some test to do!!

Hope this help!

Regards,
Jacques
Please, consider supporting this site 

Offline avoorpool

  • Sr. Member
  • ****
  • Posts: 372
    • http://pickeringweather.ca
Re: Environment Canada Weather Alerts on Main Page
« Reply #14 on: January 28, 2013, 11:32:01 AM »
Hi Jacques,

In return to your post:

I've set a priority 'default' page on my webserver in 'htaccess' for the webaddress http://altonaweather.ca, being the 'index.php' file.
Indeed Cumulus uploads an index.htm file, but shows this a 0 KB.
The normal FTP process I've added to 'Cumulus.ini' so it will happen every 5 mins for the index.php file.

Looks lke it's working fine.

Cheers,

Arthur