Author Topic: Meteotemplate - new free website template  (Read 627471 times)

0 Members and 2 Guests are viewing this topic.

Offline Jáchym

  • Meteotemplate Developer
  • Forecaster
  • *****
  • Posts: 8605
    • Meteotemplate
Re: Meteotemplate - new free website template
« Reply #50 on: August 20, 2015, 06:48:11 AM »
Hi,

thanks for answering that.

I was thinking about this when I introduced the yahoo banner. First idea was to have settings in the header.php for specifying the location, but then I thought it would again cause problems because many people would forget to fill it in etc. and so I thought I will try to use the location already specified in config.php. Unfortunately I did not realize that if you live in a smaller town or if you simply filled in whatever text, this is not going to work.

A solution to this is either hard-coding the text in the header.php or create a new variable in the PHP of the header and then, where the location is specified in the URL, change the stationLocation to whatever name you gave that variable.

Offline PaulMy

  • Forecaster
  • *****
  • Posts: 5509
    • KomokaWeather
Re: Meteotemplate - new free website template
« Reply #51 on: August 20, 2015, 07:22:36 AM »
Thanks, I will give that a try this evening.
 
Paul

Offline Jáchym

  • Meteotemplate Developer
  • Forecaster
  • *****
  • Posts: 8605
    • Meteotemplate
Re: Meteotemplate - new free website template
« Reply #52 on: August 20, 2015, 08:00:46 AM »
Or you can do it the other way around. Leave stationLocation to whatever you want to appear in the header text, but intead, hard-code the URL for retrieving the forecast from Yahoo.

In other words find the suitable location using the yahoo website and look at the address and then change this accordingly in the header.php, you will see there is a parameter called "url" which specifies the URL from which to retrieve the current conditions.

If you need help simply send me link to the place you found on yahoo that is the most suitable and I will find the URL for you. And you can then set stationLocation to anything you like.

Offline PaulMy

  • Forecaster
  • *****
  • Posts: 5509
    • KomokaWeather
Re: Meteotemplate - new free website template
« Reply #53 on: August 20, 2015, 10:59:30 PM »
I have used David's suggestion and hard coded my location to replace the echo $stationLocation. 
I am one that doesn't like weather sites that don't show a commonly understood city and State/Prov or Country and just use a local place or nickname to which I cannot identify :evil: .
 
Thanks for your suggestions.
Paul

Offline PaulMy

  • Forecaster
  • *****
  • Posts: 5509
    • KomokaWeather
Re: Meteotemplate - new free website template
« Reply #54 on: August 20, 2015, 11:17:27 PM »
Quote
If you need help simply send me link to the place you found on yahoo that is the most suitable and I will find the URL for you. And you can then set stationLocation to anything you like.
Thanks Jachym,
It may be nice to get the actual forecast for Komoka...
London, ON (nearby larger centre and international airport CYXU which is the one I am using): https://weather.yahoo.com/canada/ontario/london-4063/
Komoka village (about 20 miles west of airport): https://weather.yahoo.com/canada/ontario/komoka-23401736/
 
Thanks,
Paul

Offline Skyview

  • Forecaster
  • *****
  • Posts: 404
  • Former Aviation Weather Observer
    • Fuquay Varina Weather
Re: Meteotemplate - new free website template
« Reply #55 on: August 21, 2015, 12:17:36 AM »
I have used David's suggestion and hard coded my location to replace the echo $stationLocation. 
I am one that doesn't like weather sites that don't show a commonly understood city and State/Prov or Country and just use a local place or nickname to which I cannot identify :evil: .
 
Thanks for your suggestions.
Paul

Glad it worked for you Paul  :grin:

Offline Skyview

  • Forecaster
  • *****
  • Posts: 404
  • Former Aviation Weather Observer
    • Fuquay Varina Weather
Re: Meteotemplate - new free website template
« Reply #56 on: August 22, 2015, 03:59:27 AM »
It may be nice to get the actual forecast for Komoka...
London, ON (nearby larger centre and international airport CYXU which is the one I am using): https://weather.yahoo.com/canada/ontario/london-4063/
Komoka village (about 20 miles west of airport): https://weather.yahoo.com/canada/ontario/komoka-23401736/

Paul, in your config.php just for kicks have you tried "Komoka,ON" without the space between the two? If not, you might give that a try in the interim. If that's doesn't work you could also try "Komoka,ON,CA" again no spaces.

Also, just an FYI to anyone updating to v1.2 of the template, you need to edit this line in your config.php to add support for the additional languages included in the update. It's near the top of the file.

Code: [Select]
$langAvailable = array("gb","cz","dk","es","it","nl","no"); // available languages (files must be included in the lang directory)

Offline PaulMy

  • Forecaster
  • *****
  • Posts: 5509
    • KomokaWeather
Re: Meteotemplate - new free website template
« Reply #57 on: August 22, 2015, 10:42:09 AM »
Thanks David for your suggestions \:D/ .
Komoka,ON works but not if there is a space after the comma
Komoka,ON,CA and Komoka,ON,CANADA both work as well but not if there is a space after the comma.
I prefer to have spaces there but will accept as is.  Doing it this way rather than hard code the stationLocation is best as it also then shows the same in the menu INFO tab rather than "London" by hard coding (will have to remember to update both the Station and Location details in INFO #-o )
 
I also found that Yahoo appears to have a different forecast for Komoka than for London (very minor but I did see a difference in hi/lo temps when testing headings.php).  Since our village is just across from the Thames River away from London city I just presumed the forecasts would be the same as taken from the Environment Canada London CYXU airport location.  But then I also recall that Environment Canada often has different Watches and Warnings for Komoka and areas west of London City, especially winter snow squalls from Lake Huron, so the different Yahoo forecast seems reasonable.
 
Again thanks for your help.
 
Enjoying,
Paul
 
edit: Lower case "On" and "Canada" also work.
« Last Edit: August 22, 2015, 10:49:53 AM by PaulMy »

Offline Skyview

  • Forecaster
  • *****
  • Posts: 404
  • Former Aviation Weather Observer
    • Fuquay Varina Weather
Re: Meteotemplate - new free website template
« Reply #58 on: August 22, 2015, 04:47:54 PM »
You're quite welcome. Glad it fixed the problem for you. I just stumbled on it as I was diagnosing my own issue getting the banner to work with v1.2. Turns out, mine was a combination issue. This, and I have to use a hyphen in my location (it's referred to both ways) for it to recognize it properly.

FYI, it's really simple/easy to change the label for the menu items in the menu.php as well. The only issue that causes really is if you want to support multiple languages.

Offline Jáchym

  • Meteotemplate Developer
  • Forecaster
  • *****
  • Posts: 8605
    • Meteotemplate
Re: Meteotemplate - new free website template
« Reply #59 on: August 22, 2015, 04:59:35 PM »
I guess the best thing to do probably is to actually find the right location using yahoo and then hard-coding the URL in header.php for the yahoo forecast and stationLocation can then be set to anything.

Offline AjaxKnights29

  • Senior Contributor
  • ****
  • Posts: 175
    • Ajax Weather
Re: Meteotemplate - new free website template
« Reply #60 on: August 22, 2015, 08:14:07 PM »
Going to be attempting to implement this today on my site :)

Offline Jáchym

  • Meteotemplate Developer
  • Forecaster
  • *****
  • Posts: 8605
    • Meteotemplate
Re: Meteotemplate - new free website template
« Reply #61 on: August 22, 2015, 09:25:13 PM »
Great, let me know if you have any problems or uncertainties :)

Offline AjaxKnights29

  • Senior Contributor
  • ****
  • Posts: 175
    • Ajax Weather
Re: Meteotemplate - new free website template
« Reply #62 on: August 22, 2015, 09:29:40 PM »
Great, let me know if you have any problems or uncertainties :)
I'm having a few problems at the moment but I'm sure its me just not doing something properly hehe.

Here is where I have the template setup at the moment http://ajaxweather.ca/template/

Offline AjaxKnights29

  • Senior Contributor
  • ****
  • Posts: 175
    • Ajax Weather
Re: Meteotemplate - new free website template
« Reply #63 on: August 22, 2015, 09:46:22 PM »
Great, let me know if you have any problems or uncertainties :)
I'm having a few problems at the moment but I'm sure its me just not doing something properly hehe.

Here is where I have the template setup at the moment http://ajaxweather.ca/template/
Here are the errors I'm getting:
Warning: fread(): Length parameter must be greater than 0 in /home/aidan/public_html/template/header.php on line 58

Warning: fopen(cache/aerisForecast.txt): failed to open stream: No such file or directory in /home/aidan/public_html/template/index.php on line 167

Warning: fwrite() expects parameter 1 to be resource, boolean given in /home/aidan/public_html/template/index.php on line 168

Warning: fclose() expects parameter 1 to be resource, boolean given in /home/aidan/public_html/template/index.php on line 169

Offline Jáchym

  • Meteotemplate Developer
  • Forecaster
  • *****
  • Posts: 8605
    • Meteotemplate
Re: Meteotemplate - new free website template
« Reply #64 on: August 22, 2015, 10:06:00 PM »
Possible problems:
unrecognized stationLocation by Yahoo weather - try finding a location closest to your place in yahoo weather, then hard-code this location in the URL of header.php

unrecognized Aeris weather API key - get one at aeris weather (see wiki)

Offline AjaxKnights29

  • Senior Contributor
  • ****
  • Posts: 175
    • Ajax Weather
Re: Meteotemplate - new free website template
« Reply #65 on: August 22, 2015, 10:09:14 PM »
Possible problems:
unrecognized stationLocation by Yahoo weather - try finding a location closest to your place in yahoo weather, then hard-code this location in the URL of header.php

unrecognized Aeris weather API key - get one at aeris weather (see wiki)
would this be the link? https://ca.weather.yahoo.com/canada/ontario/ajax-6/

Offline Jáchym

  • Meteotemplate Developer
  • Forecaster
  • *****
  • Posts: 8605
    • Meteotemplate
Re: Meteotemplate - new free website template
« Reply #66 on: August 22, 2015, 10:32:28 PM »
Its atmosfér 5am i will look at it tomorrow

Offline PaulMy

  • Forecaster
  • *****
  • Posts: 5509
    • KomokaWeather
Re: Meteotemplate - new free website template
« Reply #67 on: August 22, 2015, 11:26:55 PM »
Quote
would this be the link? https://ca.weather.yahoo.com/canada/ontario/ajax-6/
If you don't know the url that Jachym suggests then in your config.php for stationLocation try Ajax or Ajax,On without any spaces; and using the template zip original header.php. 

Paul

Offline AjaxKnights29

  • Senior Contributor
  • ****
  • Posts: 175
    • Ajax Weather
Re: Meteotemplate - new free website template
« Reply #68 on: August 22, 2015, 11:39:36 PM »
Quote
would this be the link? https://ca.weather.yahoo.com/canada/ontario/ajax-6/
If you don't know the url that Jachym suggests then in your config.php for stationLocation try Ajax or Ajax,On without any spaces; and using the template zip original header.php. 

Paul
Thanks for the response! Like this: $stationLocation = 'Ajax,On'; ?

Offline AjaxKnights29

  • Senior Contributor
  • ****
  • Posts: 175
    • Ajax Weather
Re: Meteotemplate - new free website template
« Reply #69 on: August 22, 2015, 11:53:00 PM »
Quote
would this be the link? https://ca.weather.yahoo.com/canada/ontario/ajax-6/
If you don't know the url that Jachym suggests then in your config.php for stationLocation try Ajax or Ajax,On without any spaces; and using the template zip original header.php. 

Paul
Ah it worked! Thx!

Offline Skyview

  • Forecaster
  • *****
  • Posts: 404
  • Former Aviation Weather Observer
    • Fuquay Varina Weather
Re: Meteotemplate - new free website template
« Reply #70 on: August 23, 2015, 03:19:55 AM »
Well, that's at least 3 people who have had issues with space or no space. Might be worthy of making a change to the blog post for v1.2 so that people know (i.e. bold it) to not use a space.

Offline Jáchym

  • Meteotemplate Developer
  • Forecaster
  • *****
  • Posts: 8605
    • Meteotemplate
Re: Meteotemplate - new free website template
« Reply #71 on: August 23, 2015, 06:21:11 AM »
Hi,
I agree, and it might also be worth automatically removing spaces by the script in 1.3 lol

Offline PaulMy

  • Forecaster
  • *****
  • Posts: 5509
    • KomokaWeather
Re: Meteotemplate - new free website template
« Reply #72 on: August 23, 2015, 09:35:21 AM »
Quote
Ah it worked! Thx!
That's great and you've made tremendous progress...
The plugins are next...
 
Enjoy,
Paul

Offline AjaxKnights29

  • Senior Contributor
  • ****
  • Posts: 175
    • Ajax Weather
Re: Meteotemplate - new free website template
« Reply #73 on: August 23, 2015, 01:44:01 PM »
I'm now getting this error in meteobridge: no   HTTP Upload:   2015-08-23 13:40:44 Error: (no more tries)

Offline Jáchym

  • Meteotemplate Developer
  • Forecaster
  • *****
  • Posts: 8605
    • Meteotemplate
Re: Meteotemplate - new free website template
« Reply #74 on: August 23, 2015, 02:11:42 PM »
copy the URL for your HTTP upload you have set in meteobridge