Go Back   vb.org Archive > vBulletin Modifications > vBulletin 4.x Modifications > vBulletin 4.x Add-ons
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Weather Channel widget that uses members zip code Details »»
Weather Channel widget that uses members zip code
Version: 1.00, by benstillman benstillman is offline
Developer Last Online: May 2014 Show Printable Version Email this Page

Category: vBulletin CMS Widgets - Version: 4.0.x Rating:
Released: 06-13-2010 Last Update: Never Installs: 36
Re-useable Code Translations  
No support by the author.

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>
- Create a new widget with type "Static HTML".
- 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:
Originally Posted by Octavius. View Post
In that code he posted you will see fieldXX and if you look a little further you'll see field8

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.

Screenshots

File Type: jpg weather_widget.JPG (51.0 KB, 0 views)

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.
Благодарность от:
WendM

Comments
  #32  
Old 09-04-2011, 07:18 AM
Krusty1231's Avatar
Krusty1231 Krusty1231 is offline
 
Join Date: Jul 2010
Location: Canada
Posts: 366
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Works great on VBadvanced as well.

Thanks for this!
Reply With Quote
  #33  
Old 09-05-2015, 07:21 AM
mradlin's Avatar
mradlin mradlin is offline
 
Join Date: Nov 2008
Posts: 43
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Is anyone having a problem getting the widget to show with Google Chrome? It works for IE and Firefox, just not Chrome.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 07:47 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04899 seconds
  • Memory Usage 2,251KB
  • Queries Executed 20 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)bbcode_code
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (4)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (3)post_thanks_box
  • (1)post_thanks_box_bit
  • (3)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit
  • (3)post_thanks_postbit_info
  • (2)postbit
  • (1)postbit_attachment
  • (3)postbit_onlinestatus
  • (3)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • fetch_musername
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • post_thanks_function_fetch_thanks_bit_start
  • post_thanks_function_show_thanks_date_start
  • post_thanks_function_show_thanks_date_end
  • post_thanks_function_fetch_thanks_bit_end
  • post_thanks_function_fetch_post_thanks_template_start
  • post_thanks_function_fetch_post_thanks_template_end
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_attachment
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete