Weather Channel widget that uses members zip code
This adds the Weather Channel widget to your CMS, pulling the weather from the user's zip code.
- Create a new style template titled "vbcms_widget_weather". - Create a new profile field named "zip code". Take note of the profile field number. - Insert the following into the new template, changing $bbuserinfo[fieldXX] to the correct field number ($bbuserinfo[field8] in my case): Code:
<div class="cms_widget"> <div class="block"> <div class="cms_widget_header"> <h3>{vb:raw widget_title}</h3> </div> <div class="cms_widget_content"> <center> <vb:if condition="is_member_of($bbuserinfo, 1)"> Registered members can see their local weather forcast here. <br /><br /> <a href="{vb:raw vboptions.bburl}/register.php">Click here to register!</a> <br /><br /> <vb:else /> <vb:if condition="$bbuserinfo[fieldXX] !=''"> <script src='http://voap.weather.com/weather/oap/{vb:raw bbuserinfo.fieldXX}?template=GENXV&par=3000000007&unit=0&key=twciweatherwidget'></script> <vb:else /> Add your <A HREF="{vb:raw vboptions.bburl}">/profile.php?do=editprofile">Zip Code</A> to show weather forcast. </vb:if> </vb:if> </center> </div> </div> </div> - Title it "Weather" or whatever else you want. - Save it. - Configure the widget to use the "vbcms_widget_weather" template. - Add the widget to your CMS where ever you like. You can customize the Weather Channel widget including F/C, background image, etc: http://www.weather.com/services/oap/weather-widgets.html EDIT: Some users are having a difficult time following my instructions. It makes sense to me, but I guess I'm the only one. Here's Octavius' version of the instructions:
Quote by Octavius.
Download No files for download. Screenshots |
Similar Mods
vB Weather: Give your members current weather and forecasts! | vBulletin 2.x Full Releases |