Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.0 > vBulletin 3.0 Full Releases
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Weather Block for vBadvanced Details »»
Weather Block for vBadvanced
Version: 1.00, by WreckRman2 WreckRman2 is offline
Developer Last Online: Jul 2014 Show Printable Version Email this Page

Version: 3.0.0 Rating:
Released: 03-29-2004 Last Update: Never Installs: 10
 
No support by the author.

This is very, very simple addon done in less than 30 minutes. It can be made much better but it's a start. If someone else want to modify it and make it better please feel free to do so!

Step 1: Open your ACP and select "Add New User Profile Field", choose single line text box. Create new field titled "Zip Code".

Step 2: Open "User Profile Field Manager" and look for the Zip Code field number. In my instance it was field 10.

Step 3: Open your "index" template and place the following code where you want the weather conditions box to appear.

Code:
<!-- Weather Block -->

<table align="center" border="0" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" class="tborder" width="100%">
<tr>
<td class="tcat"><span class="smallfont"><b>$vboptions[blockbullet] Weather Conditions</b></span></td>
</tr>
<tr>
<td class="$getbgrow"><span class="smallfont">

<if condition="!$bbuserinfo['userid']">
<span class="smallfont">$vbphrase[a_not_a_member_yet]<br /><a href="$vboptions[bburl]/register.php">$vbphrase[a_register_now]</a> to show weather conditions.</span>
<else />
<if condition="$bbuserinfo[field10] !=''">
<a href="http://www.weatherroom.com/forecast/$bbuserinfo[field10].html"><img src="http://www.weatherroom.com/weather?forecast=zone&hwvtc=black&hwvbg=E1E4F2&pands=$bbuserinfo[field10]&config=png&alt=hwivzone&daysonly=1" alt="Weather for $bbuserinfo[field10] provided by weatherroom.com." border="0"></a>
<else />
<A HREF="$vboptions[bburl]/profile.php?do=editprofile">Add Zip Code</A> to show weather conditions.
</if>
</if>
</span>
</td>
</tr>
</table>
<br/>

<!-- End Weather Block -->
Step 4: IMPORTANT! Change all instances of $bbuserinfo[field10] to whatever your field number is. If it is number 13 change it to $bbuserinfo[field13]. If you forget this step it will not work!

Step 5: Save the changes and enjoy!


If your visitor isn't a member it tells them they must register to show the weather. If they are a member but haven't filled in the Zip Code field it tells the user they must edit their profile to add a zip code. If they have a zip code in their profile it will show a 5 day forecast of the weather in their area.

You can see it live on my site at http://www.rcflying.net

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #2  
Old 03-31-2004, 06:04 AM
Choclo Choclo is offline
 
Join Date: Sep 2003
Posts: 8
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Excellent!! I love it!! Unfortunatelyl, I don't have vBadvanced... what about vBPortal?
Reply With Quote
  #3  
Old 03-31-2004, 07:40 AM
PixelFx PixelFx is offline
 
Join Date: Dec 2002
Posts: 1,117
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

it would be cool if the site support provence for canada :P otherwise cool hack even though I can't use it :P
Reply With Quote
  #4  
Old 03-31-2004, 07:47 AM
deathemperor's Avatar
deathemperor deathemperor is offline
 
Join Date: Jul 2003
Location: HOL
Posts: 1,270
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

will it display the weather conditions for Asian users (in any where )? if not can you edit for that ?
Reply With Quote
  #5  
Old 03-31-2004, 08:11 AM
DaveLogic DaveLogic is offline
 
Join Date: Jun 2003
Location: London
Posts: 51
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Choclo
Excellent!! I love it!! Unfortunatelyl, I don't have vBadvanced... what about vBPortal?
Ditto...........Also can this be used using world cities as opposed to zip codes
Reply With Quote
  #6  
Old 03-31-2004, 08:33 AM
hpwilhelm hpwilhelm is offline
 
Join Date: Mar 2002
Location: Norway
Posts: 50
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks Indy!

Apparantly the scripts gather weather data from http://www.weatherroom.com/

I found that the supply weather data from Norway also, but how do I set the link to collect the forcast? Is there a location where I could get the URL?

http://www.weatherroom.com/ works internationaly, so you could go there to see if your location is included...
Reply With Quote
  #7  
Old 03-31-2004, 08:54 AM
hpwilhelm hpwilhelm is offline
 
Join Date: Mar 2002
Location: Norway
Posts: 50
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

OK!

It works with airport codes instead of zip-codes... So the users has to enter a 4-letter airportcode instead of the us zipcode...

These airport codes are not logic, so a scrollmenu were one can preset names that correspond to the codes would make this usefull... (empty menues that we could populate ourself...) Possible?

My nearest airport is Sogndal-Haukasen - the code is ENSG and the weather is: http://www.weatherroom.com/forecast/ENSG.html
Reply With Quote
  #8  
Old 03-31-2004, 08:57 AM
joeychgo's Avatar
joeychgo joeychgo is offline
 
Join Date: Mar 2004
Location: Chicago, IL
Posts: 933
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Nice hack ---- Very nice -- BUT

2 problems......

1. What do we do with non-us members;

2. When there isnt a zip code, and someone clicks on the box where it says "Add Zip Code to show weather conditions." an error page comes up saying page not found. SO its not directing to the profile page. The reaso for this is in the code -- some people do not have the software installed in a 'forums' directory - so you should instruct people to change this to suit their setup.
Reply With Quote
  #9  
Old 03-31-2004, 09:06 AM
hpwilhelm hpwilhelm is offline
 
Join Date: Mar 2002
Location: Norway
Posts: 50
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

:ermm: For international users there would not be any forcast, just what the weather is... officially...
Reply With Quote
  #10  
Old 03-31-2004, 06:52 PM
SVTBlackLight01's Avatar
SVTBlackLight01 SVTBlackLight01 is offline
 
Join Date: Jan 2003
Location: Texas
Posts: 504
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Great hack.

I wanted to do this for my vBadvanced, but couldn't find a decent weather feed.
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 01:56 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.04908 seconds
  • Memory Usage 2,298KB
  • Queries Executed 23 (?)
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
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (9)postbit
  • (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_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
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete