The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
Weather Channel widget that uses members zip code Details »» | ||||||||||||||||||||||||||||||
Weather Channel widget that uses members zip code
Developer Last Online: May 2014
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/...r-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:
Screenshots
Show Your Support
|
Благодарность от: | ||
WendM |
Comments |
#12
|
|||
|
|||
Quote:
This passes your zip code to the url, so users with their zip code entered in the profile field will just see their weather without having to type in their zip code each time. Try it, you'll see what I mean. |
#13
|
||||
|
||||
*subs*
|
#14
|
|||
|
|||
FWIW, I had to change this line:
Code:
Add your <A HREF="{vb:raw vboptions.bburl}">$/profile.php?do=editprofile">Zip Code</A> to show weather forcast. Code:
Add your <A HREF="{vb:raw vboptions.bburl}/profile.php?do=editprofile">Zip Code</A> to show weather forecast. (VB4.0.7) Thanks! |
#15
|
||||
|
||||
Works great! Dude gave bad directions though.
|
#16
|
|||
|
|||
Found it a little hard to understand also.
Would you please be so kind as to maybe clear up the details? |
#17
|
||||
|
||||
Quote:
Replace both fieldXX and field8 with the profile field number that you created for the zip code. That's the fist part. Second part, do what aenable did in his post. 3rd part, Take that whole code and put it inside the new vbcms_widget_weather template Then create your static html widget and copy that same code into Configure. If you have more than one forum skin, you'll have to create a vbcms_widget_weather for each template. For instance, I have 11 skins so I had to make 11 new templates but configure the widget only one time. |
#18
|
|||
|
|||
How to you add the profile field (Zip Code). I am unfamiliar with where that is.
thanks in advance |
#19
|
||||
|
||||
Agreed. I'm no newb, but this thread needs some serious step by step instructions or guidance.
|
#20
|
|||
|
|||
Installed setup but not working at all..
|
#21
|
|||
|
|||
The first post is nothing but step by step instructions. I'm not sure how to make it any clearer than that. Not trying to sound rude, but I really don't know what else to say.
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|