Go Back   vb.org Archive > vBulletin Modifications > vBulletin 4.x Modifications > vBulletin 4.x Add-ons
Weather Block Works Internationally Not Just USA Details »»
Weather Block Works Internationally Not Just USA
Version: 1.00, by ScratchMang ScratchMang is offline
Developer Last Online: Aug 2016 Show Printable Version Email this Page

Category: Miscellaneous Hacks - Version: 4.0.6 Rating:
Released: 09-22-2010 Last Update: Never Installs: 7
Template Edits
Re-useable Code Translations  
No support by the author.

I have been trying out all of the other weather blocks and for the most part, they are excellent with one major flaw, and that's the ability for users to change the location of the weather forecast for their local area. As such here's my first and simple (Successful) attempt at making one that does exactly that.

the install is a bit long winded, but I'm not a programmer. just thought this might be useful for others.

First things first, you need to goto http://www.weather.com and get yourself setup there. it's a fairly simple process, and at the end of it all you can grab the required code etc...

Setup your profile and subscribe to the "Weather on my Website", configure it for your tastes, and get the code from them which should look something like this...

Code:
<div id="wx_module_XXXX">
   <a href="http://www.weather.com/weather/local/CAXX0126">Edmonton Weather Forecast, Canada</a>
</div>

<script type="text/javascript">

   /* Locations can be edited manually by updating 'wx_locID' below.  Please also update */
   /* the location name and link in the above div (wx_module) to reflect any changes made. */
   var wx_locID = 'CAXX0126';

   /* If you are editing locations manually and are adding multiple modules to one page, each */
   /* module must have a unique div id.  Please append a unique # to the div above, as well */
   /* as the one referenced just below.  If you use the builder to create individual modules  */
   /* you will not need to edit these parameters. */
   var wx_targetDiv = 'wx_module_XXXX';

   /* Please do not change the configuration value [wx_config] manually - your module */
   /* will no longer function if you do.  If at any time you wish to modify this */
   /* configuration please use the graphical configuration tool found at */
   /* https://registration.weather.com/ursa/wow/step2 */
   var wx_config='SZ=180x150*WX=FHW*LNK=SSNL*UNT=C*BGI=fall*MAP=null|null*DN=albertadualsport.ca*TIER=0*PID=1210511278*MD5=c7ee34060594c2089d62227199b7a52a';

   document.write('<scr'+'ipt src="'+document.location.protocol+'//wow.weather.com/weather/wow/module/'+wx_locID+'?config='+wx_config+'&proto='+document.location.protocol+'&target='+wx_targetDiv+'"></scr'+'ipt>');  
</script>
Note the CAXX0126, that's the killer part of the script which each user will need to change.

So, you will need to add a custom Profile field to your users profile.

NOTE: Users in the U.S. can use ZIP CODES all other Non-U.S. users need a specific Identifier.

Modify the script you received from weather.com

Change

var wx_locID = 'CAXX0126';

To

var wx_locID = '{vb:raw bbuserinfo.fieldX}';

Where the X is the Custom Filed number you added.

Take the Modded script and add a Module to the CMPS

ADMIN --> vBa CMPS --> Add Module

Module Title : Weather
Active : YES
CSS Template to Include : Leave Blank
Template to Include : weather
Style : Your Choice
Template Content : Paste your Edited Script

Save and you should be done. You can get the different codes for locations by going to weather.com and in the main page simply enter in your location, each country has them, for example,

Leatherhead in the U.K. = UKXX1275
Darwin Australia = ASXX0032
Hamburg Germany = GMXX0049
Rome Italy = ITXX0067

Here's a screenshot from weather.com showing George Airport, South Africa, SFXX0066

Hopefully this helps. I know it's not the best explination, if you have questions please feel free to ask....


Scratch

Screenshots

File Type: jpg george.jpg (63.2 KB, 0 views)

Show Your Support

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

Comments
  #2  
Old 09-23-2010, 06:44 PM
thedvs thedvs is offline
 
Join Date: May 2002
Posts: 353
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

thats great, hoping someone does it as a sideblock, tried the weather code and it doesnt align properly in the blocks, but this works great in cmps so many thanks
Reply With Quote
  #3  
Old 09-23-2010, 06:53 PM
ScratchMang ScratchMang is offline
 
Join Date: Sep 2010
Posts: 22
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Your Welcome,

Reply With Quote
  #4  
Old 09-27-2010, 08:06 PM
benstillman benstillman is offline
 
Join Date: Jun 2007
Location: Ohio
Posts: 187
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

<a href="https://vborg.vbsupport.ru/showthread.php?t=244605" target="_blank">https://vborg.vbsupport.ru/showthread.php?t=244605</a>

Already made one, and mine doesn't require signing up on the Weather Channel website to do it.
Reply With Quote
  #5  
Old 09-28-2010, 12:54 PM
ScratchMang ScratchMang is offline
 
Join Date: Sep 2010
Posts: 22
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by benstillman View Post
https://vborg.vbsupport.ru/showthread.php?t=244605

Already made one, and mine doesn't require signing up on the Weather Channel website to do it.
Yes You did, yours works (I assume) with VBCMS, Yours specifically states you require a "Zip Code" Only the United States has "Zip Codes".

I do like your Widget setup, however I simply modified mine (for people who do not happen to be in the United States) to use it on their forums and provided clear instructions on how to configure it for where ever on the planet they happen to be.

If you would care to expand on your module and include other countries and provide a bit of information on how to get it working in countries other than the U.S. perhaps your comment would be more well received.

There are many bit's of code here, and many of them provide similar functionality.
Reply With Quote
  #6  
Old 10-01-2010, 10:42 PM
benstillman benstillman is offline
 
Join Date: Jun 2007
Location: Ohio
Posts: 187
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by ScratchMang View Post
Yes You did, yours works (I assume) with VBCMS, Yours specifically states you require a "Zip Code" Only the United States has "Zip Codes".

I do like your Widget setup, however I simply modified mine (for people who do not happen to be in the United States) to use it on their forums and provided clear instructions on how to configure it for where ever on the planet they happen to be.

If you would care to expand on your module and include other countries and provide a bit of information on how to get it working in countries other than the U.S. perhaps your comment would be more well received.

There are many bit's of code here, and many of them provide similar functionality.
Read further down. It does the same thing as your's, using Weather Channel's region codes.

Quote:
Originally Posted by sulasno View Post
is it possible to use another country?
Quote:
Originally Posted by benstillman View Post
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.
It's the first two posts. I didn't figure I needed to explain any further than that.
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 02:57 AM.


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.04115 seconds
  • Memory Usage 2,276KB
  • Queries Executed 22 (?)
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
  • (4)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (4)navbar_link
  • (120)option
  • (6)post_thanks_box
  • (6)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (6)post_thanks_postbit_info
  • (5)postbit
  • (1)postbit_attachment
  • (6)postbit_onlinestatus
  • (6)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
  • 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_attachment
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete