We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

plugin request- Weather Plugin...

Development and Programming

Sue Crocker's avatar
Sue Crocker
26,054 posts
20 years ago
Sue Crocker's avatar Sue Crocker

Hmmm… looks pretty calm out there right now. We had lots of rain and flooding yesterday..

I’ll go take a look and see if I messed something up. 😊

       
Halogen's avatar
Halogen
74 posts
20 years ago
Halogen's avatar Halogen

redo?

       
Halogen's avatar
Halogen
74 posts
20 years ago
Halogen's avatar Halogen

redo?

       
Halogen's avatar
Halogen
74 posts
20 years ago
Halogen's avatar Halogen

Localized weather plugin working……

Chris Curtis has come through for me.

After trying to get this weather plugin to accept a variable input of any kind without sucess, Chris wrote up a little php mysql query.

Here is the php portion that’ll go at the top of the page:

code snippet is too long.  email me at jakecovert[at]comcast[dot]net and I'll email.

And here is the plugin portion. Notice that instead of just putting the location code (such as KDET) in, Chris put in php call.

code snippet is too long.  email me at jakecovert[at]comcast[dot]net and I'll email.

The only down side (and not a big one to me, as my membership is small) is that you will have to manually create the variable in question (easy) and populate it with some data (not too bad). Someone else did mention being able to modify the “create new user” screen or such to have users do it themselves though.

I wanted to say thanks to Chris and his excellent php / mysql query skills.

       
Halogen's avatar
Halogen
74 posts
20 years ago
Halogen's avatar Halogen

Here is the first bit of code:

<?php

global $SESS;

// // Grab the location code from the database // $sql = “SELECT m_field_id_1 FROM exp_member_data WHERE member_id = ‘”.$SESS->userdata[‘member_id’].”’ LIMIT 1”;

$result = mysql_query($sql);

list($locationcode) = mysql_fetch_row($result);

?>

And here is the second little bit:

{if logged_in} <h2 class=”sidetitle”>Your Local Weather</h2>

{exp:world_weather:current station="<?php echo $locationcode; ?>" cache_refresh="300"} Temperature: {temperature_f}°F<br /> Feels Like: {feels_like_f}°F<br /> Humidity: {humidity}%<br /> Conditions: {condition}<br /> Wind: from the {wind_direction} at {wind_speed_mph} mph<br> Last Updated: {last_update format="%m/%d/%Y %g:%i %a"}<br> {/exp:world_weather:current} {/if}

       
Mr Adams's avatar
Mr Adams
18 posts
20 years ago
Mr Adams's avatar Mr Adams

Sorry Halogen I have been very busy & was away for a while. Now that the Developer Documentation is available, I can start working on “trying” to make this plugin into a module.

       
Halogen's avatar
Halogen
74 posts
20 years ago
Halogen's avatar Halogen

I completely understand. Volunteer plugin development / support should never be a full time job.

😊

       
SurfTasmania's avatar
SurfTasmania
54 posts
20 years ago
SurfTasmania's avatar SurfTasmania

Redo: thanks 4 UR efforts on this cool plug!

Question:

Time/Date localization issue?

What seems important is to know when the last weather update is / was. How is the time that is reported by the “last_update” set? It would surely want to be “local” time?

Many thanks!

       
October11's avatar
October11
183 posts
16 years ago
October11's avatar October11

This is a great plugin & I’ve got it to work right away!

Sue, any chance of giving me a hint on how you got to work an if statement showing, sun, clouds and all?

PS: I can see this post is about 4 years old, but I’m someone has still their hands dirty with this one.

Cheers!

       
stinhambo's avatar
stinhambo
1,268 posts
16 years ago
stinhambo's avatar stinhambo
This is a great plugin & I’ve got it to work right away! Sue, any chance of giving me a hint on how you got to work an if statement showing, sun, clouds and all? PS: I can see this post is about 4 years old, but I’m someone has still their hands dirty with this one. Cheers!

I was wondering the same!

       
First 2 3 4

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.