Go Back   vb.org Archive > vBulletin Modifications > vBulletin 4.x Modifications > vBulletin 4.x Add-ons

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
  #2  
Old 06-14-2010, 04:08 PM
sulasno sulasno is offline
 
Join Date: Feb 2010
Posts: 588
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

is it possible to use another country?
Reply With Quote
  #3  
Old 06-14-2010, 07:09 PM
benstillman benstillman is offline
 
Join Date: Jun 2007
Location: Ohio
Posts: 187
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by sulasno View Post
is it possible to use another country?
Sure is.

For instance, here's Munich:
http://voap.weather.com/weather/oap/...iweatherwidget

Instead of a zip code, you need to go to www.weather.com and search for your city/country. It will return a URL like:
http://www.weather.com/weather/today/Munich+Germany+GMXX0087?x=0&y=0

GMXX0087 is the code you need to put in your user profile field which this widget is referencing. Probably not the easiest way to do this, but it works.

If you have a specific country in mind, I can see what I can do.
Reply With Quote
  #4  
Old 06-15-2010, 03:45 AM
sulasno sulasno is offline
 
Join Date: Feb 2010
Posts: 588
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

thanks for the tip
Reply With Quote
  #5  
Old 06-25-2010, 11:19 PM
Sledgstone's Avatar
Sledgstone Sledgstone is offline
 
Join Date: Aug 2004
Posts: 11
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks! I've been looking for this!
Reply With Quote
  #6  
Old 07-06-2010, 04:32 PM
benstillman benstillman is offline
 
Join Date: Jun 2007
Location: Ohio
Posts: 187
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

One star, but nobody has posted any negative comments for me to follow up on. Sweet.
Reply With Quote
  #7  
Old 07-13-2010, 08:27 AM
kapii kapii is offline
 
Join Date: Apr 2008
Posts: 95
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

It might also help to give specific details on setting it up for those that are less knowledgeable about the new vB... To the average user, it's even confusing, and I've been using vB since 2008...

Reply With Quote
  #8  
Old 07-13-2010, 06:31 PM
TbChampions TbChampions is offline
 
Join Date: Jun 2005
Posts: 21
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hi Ben! This looks like a nice addition. Unfortunately, it's not working for me yet. I did everything per instructions, with the possible exception of this part:

- Configure the widget to use the "vbcms_widget_weather" template.

I don't know how/what you mean by the above, and this may be why it's not working for me yet.

Thanks!

Victoria
Reply With Quote
  #9  
Old 07-13-2010, 08:34 PM
ozzy47's Avatar
ozzy47 ozzy47 is offline
 
Join Date: Jul 2009
Location: USA
Posts: 10,929
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I got it installed, voted 5 stars!!
Reply With Quote
  #10  
Old 08-01-2010, 06:31 PM
mimi123 mimi123 is offline
 
Join Date: Jun 2010
Posts: 43
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

tell me whats the point in creating a profile field for zip code when it doesn't even work? weather.com will give the html code to put in your weather configuration after you enter "your own" city. which will appear to all members in my site, if they wanna know their weather they have to enter their zip code in that "go" box. so whats the point for the profile field tell me
Reply With Quote
Reply

Thread Tools

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 11:58 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.05175 seconds
  • Memory Usage 2,323KB
  • Queries Executed 26 (?)
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
  • (2)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
  • (10)post_thanks_box
  • (1)post_thanks_box_bit
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit
  • (10)post_thanks_postbit_info
  • (9)postbit
  • (1)postbit_attachment
  • (10)postbit_onlinestatus
  • (10)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