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
  #12  
Old 08-05-2010, 05:43 PM
benstillman benstillman is offline
 
Join Date: Jun 2007
Location: Ohio
Posts: 187
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by mimi123 View Post
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
No idea what you're talking about.

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.
Reply With Quote
  #13  
Old 09-28-2010, 05:09 AM
8thos's Avatar
8thos 8thos is offline
 
Join Date: Aug 2010
Location: Pensacola, FL
Posts: 772
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

*subs*
Reply With Quote
  #14  
Old 11-12-2010, 05:38 PM
aenable aenable is offline
 
Join Date: Jan 2010
Posts: 3
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
to this:
Code:
Add your <A HREF="{vb:raw vboptions.bburl}/profile.php?do=editprofile">Zip Code</A> to show weather forecast.
to fix the link in the widget when there is no zip code showing.

(VB4.0.7)

Thanks!
Reply With Quote
  #15  
Old 12-11-2010, 11:06 PM
8thos's Avatar
8thos 8thos is offline
 
Join Date: Aug 2010
Location: Pensacola, FL
Posts: 772
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Works great! Dude gave bad directions though.
Reply With Quote
  #16  
Old 12-12-2010, 06:57 AM
OldSchoolDSL OldSchoolDSL is offline
 
Join Date: Oct 2010
Posts: 1,196
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Octavius. View Post
Works great! Dude gave bad directions though.
Found it a little hard to understand also.

Would you please be so kind as to maybe clear up the details?
Reply With Quote
  #17  
Old 12-12-2010, 08:13 PM
8thos's Avatar
8thos 8thos is offline
 
Join Date: Aug 2010
Location: Pensacola, FL
Posts: 772
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by OldSchoolDSL View Post
Found it a little hard to understand also.

Would you please be so kind as to maybe clear up the details?
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.
Reply With Quote
  #18  
Old 12-15-2010, 06:23 PM
Richard Evans Richard Evans is offline
 
Join Date: Apr 2010
Posts: 7
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

How to you add the profile field (Zip Code). I am unfamiliar with where that is.
thanks in advance
Reply With Quote
  #19  
Old 12-15-2010, 06:53 PM
paulvev's Avatar
paulvev paulvev is offline
 
Join Date: Mar 2007
Posts: 73
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Agreed. I'm no newb, but this thread needs some serious step by step instructions or guidance.
Reply With Quote
  #20  
Old 12-24-2010, 12:52 AM
nick_n_ii nick_n_ii is offline
 
Join Date: Sep 2010
Location: Michigan
Posts: 5
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Installed setup but not working at all..
Reply With Quote
  #21  
Old 01-05-2011, 02:03 PM
benstillman benstillman is offline
 
Join Date: Jun 2007
Location: Ohio
Posts: 187
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by paulvev View Post
Agreed. I'm no newb, but this thread needs some serious step by step instructions or guidance.
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.
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 06:19 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.05043 seconds
  • Memory Usage 2,339KB
  • 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
  • (3)bbcode_code
  • (5)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
  • (3)pagenav_pagelink
  • (11)post_thanks_box
  • (1)post_thanks_box_bit
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (1)postbit_attachment
  • (11)postbit_onlinestatus
  • (11)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_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