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 |
#22
|
|||
|
|||
Quote:
User Profile Fields Add profile field http://yourwebsite.com/admincp/profilefield.php?do=add |
#23
|
|||
|
|||
Quote:
Quote:
|
#24
|
|||
|
|||
Does this not work for vB4.1PL2?
|
#25
|
|||
|
|||
Question,
Will the work for 3.8.x ??? |
#26
|
||||
|
||||
You might want to add a TXT file to the first post with the instructions in it. That way they will have it in case they need to re-install it, for whatever reason, sometime in the future.
|
#27
|
|||
|
|||
<span style="text-decoration: line-through">Sorry, I'm a little confused on how to implement this.
I have added the zip code field, and modified the code with the correct field number. I also created a new style named vbcms_widget_weather and created the new widget. I am stuck on two things: 1) Insert the following into the new template, and 2)Configure the widget to use the "vbcms_widget_weather" template. Where do you insert the code into the new template? I am using VB 4, and it looks like the "main css" area is no longer supported. Do I need to upload an XML file? And then after that is done, how do I link the style with the widget?</span> Edit: I figured it out. I was going to delete this, but in case anyone has the same problem, I will explain what I did. I was confusing "new style" with "new template" for an existing style. If you go to Style Manager > Drop-down menu for your current style > Add new template, you will be able to add vbcms_widget_weather and paste the code into the large text box. Then, when you create the new widget, click Configure. Once again paste the code into this text box (I'm not sure why it needs to be in both places, but I just started using vbulletin today so I am very new). Then below the Static html box, there is a "template name" field. Paste vbcms_widget_weather into this field. |
#28
|
|||
|
|||
|
#29
|
|||
|
|||
Quote:
|
#30
|
|||
|
|||
Quote:
I copied this into the widget which I think just calls out the template. PHP Code:
The I created the template as written, but I did it in my parent style so I didn't have to create it in all my styles. It works. Thanks. |
Благодарность от: | ||
WendM |
#31
|
|||
|
|||
works well here thanks!
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|