Weather

15th Dec 2006 Danny
Introduction

Plugin updated 20th Jan 2008 - Please ensure you have the latest version installed

Weather is a plugin for b2evolution that adds data from weather.com to your blog sidebar. Just enter your city name or zip code in the Tools tab, along with what data you want to see, then add a bit of code to your skin and you'll have automatically updating, cached weather data, including an icon.

Contents
  1. Introduction
  2. Installation (v1.8)
  3. Installation (v2.2+)
  4. Customization
 
 
 
 

52 comments

Comment from: Steve
For each skin you want the weather to appear in, add some code to the _main.php file.

1. Wherever you want the weather to appear (usually the sidebar), add this:

Code:
call_by_code( 'weather', array() ); ?>

I'm afraid I cant catch this point. Could you describe me more prescisely. I opened the mail.php. I saw the place of side bar. But I have no idea at what place, I have to paste. You said "Add this". Where Should I add? Anywhere in main_php?
 
12/18/06 @ 14:56
Comment from: Danny
Steve,
I just looked at your site and it looks like you've got this sorted out. Please let us know if you need anything else.
 
12/18/06 @ 15:09
Comment from: anna
This hapend for me:

MySQL error!

Too big column length for column 'settings' (max = 255). Use BLOB instead(Errno=1074)

Your query:

CREATE TABLE evo_plugin_weather_21_settings (
blog int(10) NOT NULL,
settings varchar(500),
PRIMARY KEY (blog)
)
 
12/18/06 @ 17:23
Comment from: Danny
I just changed that column to text. That should fix it. Download the zip again, uninstall the old version and reinstall from the new files and you'll be in good shape.
 
12/18/06 @ 17:50
Comment from: mrdav
Nice plugin. Works great. kudos.
 
12/19/06 @ 03:05
Neato! :)

When you enter "Paris, France" though... you'll get a select list to confirm between two choices... so far so good... but after that, each time you want to change any option you need to confirm again and again and again.. and each time it loses your checkboxes... :/
 
12/26/06 @ 04:44
Comment from: Danny
Francois,
Thanks for catching that. I corrected that bug and uploaded a new zip.

Danny
 
12/26/06 @ 14:58
Comment from: Sandro
Why is Today's high never shown up?
 
12/27/06 @ 23:01
Comment from: Danny
From what I remember, that's what the feed from weather.com has. It doesn't always include a high temp.
 
12/27/06 @ 23:05
Comment from: EdB
Click the link for "show all pages" then check out the link for downloading the zip. Just a bit of a heads-up there eh?
 
12/29/06 @ 10:19
Bugger :p I think it'll be easier to remove the "all pages" link ;)

¥
 
12/29/06 @ 13:23
Comment from: Chris Mann
Hi,

I'm trying to download your plugin but when I click the link I get this error:

Invalid file request.

Click here to continue


I've tried with Firefox, Safari and Opera (on Mac) so I don't think it's a browser-related issue.

Thanks,

Chris

 
01/06/07 @ 14:59
Hi Chris,
Do you use a proxy? Our logs show that you hit the site from 1 ip and then hit the download page several times but using 3 different ip's. Our download links are tied into your ip to stop hotlinking hence why you got an "invalid file request"

If you're still having difficulty then shout back and I'll email you a copy instead.

¥
 
01/07/07 @ 10:12
Comment from: Danny
YaBBa,
I already emailed the file to him. I should have copied you in or deprecated the original comment, sorry.
 
01/07/07 @ 14:49
Your plugin seems to be pretty cool, but when I installed it and selected "icons" it just shows a red X like it can't find the image. Am I supposed to get some graphics somewhere and put them on my server (that would make sense)? If so, where can I get them? Where should I put them?
 
01/24/07 @ 22:06
Comment from: Nate
Hi Danny,

I wanted to let you know that your youtube plugin is included in the 128x128 folder of the weather.zip download. I'm guessing you don't want it there. Thanks for the plugin!
 
01/26/07 @ 23:10
Lol, cheers Nate, I've removed it from the zip ;)

¥
 
01/27/07 @ 07:41
Comment from: dub27
Hi, it is working -- thank you!

but there is an error in the plugin panel under the weather tab..

Notice: unserialize(): Argument is not a string in C:\Documents and Settings\HP_Administrator\My Documents\websites\b2evolution\blogs\plugins\weather_plugin\_weather.plugin.php on line 212

Any ideas on this?

thanks for the plugin!
 
03/01/07 @ 00:09
Comment from: Paul
Hello and thanks for the great plugin! everything seems to be working just fine except for the icon for some reason is appearing in a blue background instead of transparent.

is there a way to fix this?

Thanks!
 
03/15/07 @ 02:18
Comment from: Paul
sorry its http://www.josegarzarealtor.com/blog not http://www.josegarzarealtor.com/
 
03/15/07 @ 02:19
Hi Paul,
I'm guessing that you use IE6 which doesn't support png's so you'd either need to make all of the images gif's and change the references in the plugin ( approx line 408 ), or, you could add a background to the png's that match your blogs background and then just reupload them ( you'd need to press ctrl-f5 to force a refresh in your browser to see the changes though)

¥
 
03/15/07 @ 09:50
Comment from: Madrigal Maniac
Doesn't weather.com have a bit of code that you can insert into your site that does the same thing, only better?
 
03/17/07 @ 15:55
Comment from: PJ
Can i use this plugin twice?
Im setting up a holiday blog and wnat the weather home and on the holiday location both in the sidebar.

PJ (from Holland).
 
03/17/07 @ 18:06
Comment from: Danny
Madrigal,
Weather.com didn't have that over a year ago when I made this plugin. It does look pretty cool, but there are some advantages my plugin still has.

No weather.com registration required.
Caching, so that you don't have to connect to weather.com for every page view
Can be configured in the b2evolution back office
No JavaScript required
No defined width and height, so it can fit in with your layout more naturally

They do have a fancier config page, I'll give them that. As far as I'm concerned people should use what works best for them.

Danny
 
03/17/07 @ 18:31
About this comment from dub27:
> but there is an error in the plugin panel under the weather tab..

> Notice: unserialize(): Argument is not a string in C:\Documents and Settings\HP_Administrator\My
> Documents\websites\b2evolution\blogs\plugins\weather_plugin\_weather.plugin.php on line 212

The only time this doesn't appear for me is when the blog selected in the weather tab matches the blog in the weather_plugin_settings table. FWIW.

I haven't seen a high temp displayed yet.

I'm globalized. How can I display more than one city? How can I list the temperature as "°C/°F"? If the units are metric, why are times not 24hr?

I love to have the plugin as is, but I would love it more if I could do all this other stuff too. (I just calculated today that if my 6-y.o. daughter had a frequent flyer account, she'd have 121,800 miles by now! I need a bigger view than the sky over my house!)
 
07/13/07 @ 21:10
Here's how I got it to show both temps:
// Current temp
echo $params['temp_start'].
$weather['cc']['tmp'].
'°'.
$weather['head']['ut'].
// $params['temp_end'];
// Current temp
// $params['temp_start'].
'/'.
round((((($weather['cc']['tmp']) - 32) / 9) * 5),0).
'°C'.
$params['temp_end'];

And
// Show today's low temp, if there is one
if ( ($weather['dayf']['low'] != 'N/A') and ($weather['low']) ) {
echo T_('Low').': '.
$weather['dayf']['low'].
'°'.
$weather['head']['ut'].
'/'.
round((((($weather['dayf']['low']) - 32) / 9) * 5),0).
'°C'.'
';
}
 
07/19/07 @ 15:41
Comment from: wwucomm
Danny,

First of all, cheers on a great plugin. I've got it working just fine, but would like to shrink the text just a bit, and perhaps display the current data in a different color. Is this possible? I've already shrunk down the current temp a little and chnaged its color, but can't seem to find the rest, and am obviously a bit of a neophyte.
 
08/31/07 @ 21:11
Danny,

thanks for a great plugin!

Questions:

1. Can I bump the text size down a smidge, and if so, how?

2. Can I display the temps and current data in another color, and if so, how?

I figured out how to shrink the size of the current temp - but can't find the others.

Thanks in advance!
 
08/31/07 @ 22:42
Comment from: Danny
wwucomm,
You can edit your site's css to change the text if you like.
 
08/31/07 @ 23:16
Will that change the text in all the sidebars, or just the weather sidebar?
 
09/06/07 @ 23:24
Comment from: Phil
Danny,
Thanks for this great plug-in. Installed in just minutes and works like a charm! Thank you for all your hard work. - Phil
 
10/10/07 @ 17:40
Is there a way that I could add 2 weather widgets to the sidebar that would show 2 different locations ?

i.e "1 for Pa and 1 for somewhere in Va'
 
12/15/07 @ 09:16
I'm sure I'm missing something very obvious. When I load & configure the plug in on b2evo 2.3, I get the following:


Weather
Notice: Undefined index: cc in blog/plugins/weather_plugin/_weather.plugin.php on line 323
Notice: Undefined index: cc in blog/plugins/weather_plugin/_weather.plugin.php on line 325
Notice: Undefined index: cc in blog/plugins/weather_plugin/_weather.plugin.php on line 330
Notice: Undefined index: head in blog/plugins/weather_plugin/_weather.plugin.php on line 332
°
Notice: Undefined index: loc in blog/plugins/weather_plugin/_weather.plugin.php on line 336
Notice: Undefined index: cc in blog/plugins/weather_plugin/_weather.plugin.php on line 343
Notice: Undefined index: head in blog/plugins/weather_plugin/_weather.plugin.php on line 345
Feels like: °
Notice: Undefined index: wind in blog/plugins/weather_plugin/_weather.plugin.php on line 351
Notice: Undefined index: wind in blog/plugins/weather_plugin/_weather.plugin.php on line 352
Notice: Undefined index: head in blog/plugins/weather_plugin/_weather.plugin.php on line 353
Wind:
Notice: Undefined index: dayf in blog/plugins/weather_plugin/_weather.plugin.php on line 357
Notice: Undefined index: dayf in blog/plugins/weather_plugin/_weather.plugin.php on line 359
Notice: Undefined index: head in blog/plugins/weather_plugin/_weather.plugin.php on line 361
Today's high: °
Notice: Undefined index: dayf in blog/plugins/weather_plugin/_weather.plugin.php on line 365
Notice: Undefined index: dayf in blog/plugins/weather_plugin/_weather.plugin.php on line 367
Notice: Undefined index: head in blog/plugins/weather_plugin/_weather.plugin.php on line 369
Today's low: °
Notice: Undefined index: loc in blog/plugins/weather_plugin/_weather.plugin.php on line 380
More...


Why are all these indices undeclared? Or did I mess something up on the install?
 
01/03/08 @ 21:55
Comment from: Danny
Are you using a widget or calling it directly in your skin? What version of b2evolution are you using?
 
01/03/08 @ 22:51
Comment from: christian
I'm getting the same errors as MaxHedrm when I'm installing it now, the strange thing is that I installed the plugin in the same blog just a week ago -- without any errors.

I've downloaded the newest version of the weather plugin, and I'm using b2evolution version 2.2.0. I've copied the weather_plugin folder to the plugins folder, and I'm using it as a widget.

The last time I installed it, I was asked to confirm which city (multiple hits), now this doesn't happen.

 
01/04/08 @ 02:01
Comment from: Danny
I just installed on my 2.3.0 blog and it works fine. Are either of you getting any javascript errors? Can you install Firebug in Firefox and see what happens when it tries to do the ajax connection? Do both of you have cURL installed an enabled? (link me to your phpinfo file if you're not sure.)
 
01/04/08 @ 02:16
Comment from: christian
Indeed, it is the city lookup that fails (I've tried several places, some with multiple hits (like bergen), and some who should be unique (like haugesund), they both fail).

A workaround is to go to weather.com and do the lookup yourself manually, and take the weather.com city key (NOXX0004 for bergen, look for it in the URI) and paste that into the weather widget. This will work.
 
01/04/08 @ 02:17
Comment from: christian
...And now it works again! I've used the same mysql database the whole time. When the problem was, the "search" after the city name did not do anything.
 
01/04/08 @ 02:19
Comment from: Danny
Hmm, glad to hear it's working now.
 
01/04/08 @ 02:24
Comment from: christian
It was strange, if you need any information from my server, I'll happily provide whatever you need. But as I tried to explain in my awkward way, the city lookup feature did not work at all, there was no response from the ajax script (i guess, i know absolutely nothing about ajax or anything like it) did not look up. Now, when I type whatever city name, the text "searching..." is displayed, shortly thereafter replaced by a green text saying "The city is valid (8-digit city code)".

In the short amount of time from the problem presentet itself, 'til it worked again, I did not do any changes either to the OS (debian) or any software (lamp).

 
01/04/08 @ 02:32
Comment from: Paco
Hi!
very good plugin, thanks a lot!
Is it possible to change the language in french, change the mesure for "celsius",...
Should it be possible to have some explanations about it, or to have some more editable caracteristics?
thanks one more ;)
 
02/01/08 @ 20:44
Very nice plugin. Thank you.
 
02/23/08 @ 00:25
I really like your plugin, excellent work!!

I want to know if it is possible to get more information like barometric pressure, visibility, humidity. Since I live in the caribbean (Dominican Republic), that information is important particulary in the hurricane season. :)

Thanks and keep this plugin alive!!
 
04/05/08 @ 23:54
Comment from: Skynet
Since 2 days this wonderful plugin stopped working.
I suppose there's something wrong in foreca servers, but don't know what to do to make it running fine again....
 
05/08/08 @ 11:56
Comment from: a.christian
hy
i have got the same problem than MaxHedrm

what could be the problem ?
 
05/30/08 @ 12:54
I found this plugin just now, installed it and got the same error that MaxHedrm got. After I typed in the zip code and clicked on the update button, I was able to see the city name and zip code shown on the setting page.

I use version 2.4.2 and curl is enabled.
 
06/08/08 @ 20:38
I've used an older version of the plugin in the past and loved it. I've since upgraded to the latest version (after letting it slip a few versions during site re-designs), but it's not recognizing ANY locations - it just says "No matches found. Please try another city or zip code.

This is regardless of what I put in. I've tried putting in Paris, Kalamazoo (my city), New York, Detroit, 49004 (my zip), K (in hopes there would be a list), 49 (ditto).

Troubleshooting steps: I've tried deleting the the plugin folder, deleting the plugin from B2, re-downloading the latest version (2.3.1), reinstalling in B2 and then adding the widget to a blog. When I try to put my Zip (or the others listed above), I get the same error.

I'm anything but a coder, unfortunately, so I don't even know where to start looking.

I'm running Windows 2003/IIS/MySQL 5.0.

Let me know if there is any other information that you need to help solve this puppy.

Thanks in advance for your help!

Mike
 
07/08/08 @ 03:55
I'm having errors as well, no city/state or zip code will work.
 
09/12/08 @ 19:53
Comment from: Luc
Hello,
If i put the city,country in the field city i always get a warning which tell to return to the setting, if i put the city,country in the city hidden field then i get the display of the label without any data and icons (only text + °)
I'am using the last version of both b2evo and plugin downloaded yesterday...
Any idea ?
Thanks and best regards
Luc
 
10/10/08 @ 10:54
No city or zip recognized either.

As a K-12 school district, that information is imperative and comes from several sources. Just trying to add another one.

I think if I lived in the caribbean, like Luis F. Vidal, I'd spend less time on the computer, but understand how the weather forecast would be much more important that "snow flurries, again".
 
04/21/09 @ 15:33
Comment from: kmac
This seems like a popular location for folks having problems with the weather plugin, specifically not being able to verify a city or zip.

In my situation, the problem was the my php.ini line for "allow_url_fopen =" was set to Off. Once I changed this to On, my weather plugin works perfectly.
 
04/25/09 @ 12:23
Comment from: Rp
Worked great for me first time... ABout as simple as it gets to install...

blog.rpzkingdom.com
 
10/05/09 @ 23:51

Comments are closed for this post.

 

B.O.P.I.T