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

Offline avoorpool

  • Sr. Member
  • ****
  • Posts: 372
    • http://pickeringweather.ca
Re: Environment Canada Weather Alerts on Main Page
« Reply #15 on: January 29, 2013, 05:43:38 PM »
Hi Jacques,

The EC Weather Alert is coming to a 'close'.
I deleted most of the script, keeping the essential section for Alerts in tact and saved it as 'ecalerts.php'.
Used the 'include' in my index page.
I realized that the script is not the original Saratoga 'ec-forecast.php' but one that is (perfectly) modified by you into the short and long 'forecast_ecl.php' script (I use the 'ecl version).
So I asked Ken, and he gave me a small addtion to the script I use, so now when there is no Alert/Warning there is still a message displayed ("No active Weather Statements.......").
(Can't check it, since we're still under a freezing rain Warning  ;)

Cheers,

Arthur

Offline avoorpool

  • Sr. Member
  • ****
  • Posts: 372
    • http://pickeringweather.ca
Re: Environment Canada Weather Alerts on Main Page
« Reply #16 on: February 05, 2013, 12:14:47 PM »
Hi Jacques,

You know very well, I'm keen in keeping my webpages 'clean' without errors. All pages are W3C validated and 'green' except for the index page.
Since I (successfully) implemented part of the 'forecast_ecl.php' script (created for this the 'ecalerts.php' file (attached), and used $include=true within the index page), it displays the EC Weather Statements, however it shows an error  >:D  >:( (see attachments).
Most likely it's because part of the EC Alerts is taken from the 'forecast_ecl.php' script, and (already) contains the <!DOCTYPE> section which is also in place within the 'index.php' template file.
With all of your excellent expertise, is there a way to eliminate this error and have the alert messages correctly displayed???

Thanks for your help,

Cheers,

Arthur


Offline Mr.Meteo

  • Administrator
  • Hero Member
  • *****
  • Posts: 1116
    • http://www.meteostours.ca
Re: Environment Canada Weather Alerts on Main Page
« Reply #17 on: February 05, 2013, 07:25:25 PM »
Hi Arthur,
Ahhhhhh perfection is a serious disease!!   :))

But for your page, try to remove all that is not php! (ALL after ?> )
You'll loose only styling on alert and alerts, that can be moved
into your index page, or your.css file!

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 #18 on: February 05, 2013, 09:36:33 PM »
Hi Jacques,

AWESOME...!!!!

Thanks a lot.
Index.php is 'Green' again.

Just need a few adjustments to the weather statement alerts (display), but the errors are gone!!!
(I put it in <style> within the index page, but will try it in the CSS.)

Thanks again,

Arthur

Offline Mr.Meteo

  • Administrator
  • Hero Member
  • *****
  • Posts: 1116
    • http://www.meteostours.ca
Re: Environment Canada Weather Alerts on Main Page
« Reply #19 on: February 06, 2013, 11:28:34 AM »
Hi Arthur,
Happy that it help you a bit!  :)

But, for the styling move, possibly you could use that logic:
Try to always think like a woman... as being a weight paranoiac! :-X
Most visitors have fast internet, but not all! Then with styling, try
to be as "Scrooge" as possible:

1 - If it is for only 1 place in 1 page, put your style "inline":
e.g. <p style="width:300px;...">...

2 - If style is use more then 1 time, but only in one page:
Use <style type="text/css>... </style> in "head" section of that page!

3 - If used in many pages, then use the .css file

A little trick to save some little "%", but with some of them you could
be noticiably faster!

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 #20 on: February 06, 2013, 11:41:53 AM »
HI Jacques,

Thanks for the message! That makes sense!!!!

I'll give it a try, although I've entered the "no weather statements' announcement, (displayed when no warnings/alerts are in effect) into the 2 EC scripts as well. Therefore I've entered it into the CSS settings, and it all works perfectly.
However, it's definitely worth a try, to put it 'inline'

Cheers,

Arthur