You could probably create a new member profile field to hold the location code. Then just populate the location in the weather plugin with that member’s code.
I think you’ll need 1.1 for this so that you can 1) grab the custom profile field info anywhere and 2) nest that inside the weather Plugin. If might look something like:
{exp:world_weather:current
station="{exp:member:custom_profile_data}{weather}{/exp:member:custom_profile_data}"
cache_refresh="300"}
Thanks for the suggestion Chris.
Your solution seems to require human intervention to find and input the location code into the database.
The ideal situation would be to have the member/user choose their location and then store the location code in the member DB. I guess that the plug-in would need to do a lookup on the weather location code base – but I’d not sure if a plug-in can perform this type of operation. What do you think?
Plugins typically don’t interact with the database beyond simply pulling information out in order to display.
I’m not sure how you’re envisioning the user being able to “choose their location”. I really don’t see anything wrong with telling a user “if you want to have local weather info displayed, then go here, find your local source, and put the code into this field.”
redo, Two things:
1) I couldn’t quite get it to work. Here’s what I’m using:
<code> <h2 class=”sidetitle”>Your Local Weather</h2>
{exp:world_weather:current station="{exp:member:custom_profile_data}{weather}{/exp:member:custom_profile_data}” 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} </code>
type: text input format: none field width: 15px max length: 4 rows: 1
2) Is there anyway to output the real name of the City / State where the weather stats are coming from? It would be nice to have it say, “The weather in Omaha, NE”….
Any help / thoughts we be appreciated.
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.