PDA

View Full Version : Display Member Weather


AWMGolfer
25 Sep 2009, 21:37
This is the first time I have done anything like this but it will allow you to display your members local weather using weather.com.

First you need to create a new profile field that is a single-line text box called Zip Code. It can remain a private or public field, whatever you would like. Make note of the field number.

Then, go to http://www.weather.com/services/oap/weather-widgets.html and choose from the two variations and put in just anything for a location, then select get code. You will be given something like this:

<script type="text/javascript" src="http://voap.weather.com/weather/oap/04758?template=GENXV&par=3000000007&unit=0&key=twciweatherwidget"></script></div>

You need to replace the zip code with this, $bbuserinfo[fieldXX]

Make sure to change the XX to the field number.

Then go into your templates and place the following code anywhere you want the weather to be displayed.

<if condition="$bbuserinfo['fieldXX']">
<script type="text/javascript" src="http://voap.weather.com/weather/oap/$bbuserinfo[fieldXX]?template=GENXV&par=3000000007&unit=0&key=twciweatherwidget"></script></div></if>

Again, don't forget to change both of the red parts to match the field number.

Hope people find this of use, be kind as this is the first time I've done this :)

Here is a screenshot!

http://maineforums.net/pic3.png

blackberry
27 Sep 2009, 11:25
any screen shot?

AWMGolfer
27 Sep 2009, 12:48
Thanks for reminding me, just added it!

apiasto
27 Sep 2009, 13:36
nice idea and i did exactly what you wrote but nothing is showing.my field # is ok too.any idea

ok i got it for some reason when i put this <if condition="$post['fieldXX']"> in the begining then it doesn't show,when i remove this then its ok?

AWMGolfer
27 Sep 2009, 14:11
I see what I did, change

<if condition="$post['fieldXX']">

to

<if condition="$bbuserinfo['fieldXX']">

Updated original code.

apiasto
27 Sep 2009, 14:20
all right kool its working now thnx. one thing i wanna ask how about like if i wanna put a place from asia where zip code is not common.in otherwords when i try to put just city name it shows error saying invalid location code.is there a way to over come that so user can just put their city name to get weather.thnx

apiasto
27 Sep 2009, 14:29
all right kool its working now thnx. one thing i wanna ask how about like if i wanna put a place from asia where zip code is not common.in otherwords when i try to put just city name it shows error saying invalid location code.is there a way to over come that so user can just put their city name to get weather.thnx

BigDog56
27 Sep 2009, 14:30
Not working for me either.

AWMGolfer
27 Sep 2009, 14:31
You would need to go to weather.com and put in your location. The link will show something like this..

http://www.weather.com/outlook/travel/businesstraveler/local/FRXX0076?lswe=Europe&from=searchbox_localwx

They would enter the code right before the question mark, the part in red.

AWMGolfer
27 Sep 2009, 14:32
What isn't working?

BigDog56
27 Sep 2009, 14:41
Can you be more specific on exactly what you need to put in the profile fields?

BigDog56
27 Sep 2009, 14:44
this is what I have
<if condition="$bbuserinfo['field36']">
<script type="text/javascript" src="http://voap.weather.com/weather/oap/$bbuserinfo[field36]
?template=GENXH&par=3000000007&unit=0&key=twciweatherwidget"></script></div></if>

apiasto
27 Sep 2009, 14:44
all you gotta do is put pfofile field id # which you will get after creating one

BigDog56
27 Sep 2009, 14:46
all you gotta do is put pfofile field id # which you will get after creating one

Done that and it's not showing.

apiasto
27 Sep 2009, 14:49
this is what I have
<if condition="$bbuserinfo['field36']">
<script type="text/javascript" src="http://voap.weather.com/weather/oap/$bbuserinfo[field36]
?template=GENXH&par=3000000007&unit=0&key=twciweatherwidget"></script></div></if>

it looks ok ,i guess now you have to make entry in the field by going to your cp panel and putting your zip code.it should be available where you saved it in profile field catagory like edit your details

mine is working here (http://www.hamara-forum.com/index.php)

BigDog56
27 Sep 2009, 14:54
it looks ok ,i guess now you have to make entry in the field by going to your cp panel and putting your zip code.it should be available where you saved it in profile field catagory like edit your details

mine is working here (http://www.hamara-forum.com/index.php)

That got it working. Thank you.

apiasto
27 Sep 2009, 14:58
no problem

AWMGolfer
27 Sep 2009, 15:15
Glad you got it working BigDog and thanks Apiasto!

princeedward
28 Sep 2009, 07:02
how about adding this to our profile page....is this possible?

BigDog56
28 Sep 2009, 09:58
Another question. Does this only work for the U.S. and Canadian members?

apiasto
28 Sep 2009, 11:06
how about adding this to our profile page....is this possible?

yes it is open memberinfo template scroll down to

<div id="sidebar_container">
<!-- sidebar -->
$template_hook[profile_right_first]
$blocks[stats_mini]
$template_hook[profile_right_mini]
$blocks[friends_mini]
$blocks[albums]
$template_hook[profile_right_album]
$blocks[groups]
$blocks[visitors]
$template_hook[profile_right_last]
--------------------
<!-- / sidebar -->
add the code before <!--/ sidebar -->

AWMGolfer
28 Sep 2009, 13:45
BigDog, http://www.vbulletin.org/forum/showpost.php?p=1891307&postcount=9

That will work for any location in the world! I am trying to find an easier way to do it though!

princeedward
28 Sep 2009, 15:32
yes it is open memberinfo template scroll down to

<div id="sidebar_container">
<!-- sidebar -->
$template_hook[profile_right_first]
$blocks[stats_mini]
$template_hook[profile_right_mini]
$blocks[friends_mini]
$blocks[albums]
$template_hook[profile_right_album]
$blocks[groups]
$blocks[visitors]
$template_hook[profile_right_last]
--------------------
<!-- / sidebar -->
add the code before <!--/ sidebar -->

thanks apiasto...great :p:up:

segwayon
02 Oct 2009, 15:55
Assuming a new zipcode field gets added, how does that field become populated with data?

AWMGolfer
02 Oct 2009, 17:30
When the user enters in that information in their profile.

BigDog56
03 Oct 2009, 22:26
BigDog, http://www.vbulletin.org/forum/showpost.php?p=1891307&postcount=9

That will work for any location in the world! I am trying to find an easier way to do it though!

Thank you! I have a member from England that can't get it to work. Most likely her end. I'll try and fix it for her.

AWMGolfer
05 Oct 2009, 16:17
No problem, just let me know if they can't get it working!

s-p0k
10 Oct 2009, 21:04
ok i got the code..but now wat.....

AWMGolfer
11 Oct 2009, 16:59
You need to put it in wherever you want it to be displayed.

Gav-n-Tn
27 Oct 2009, 01:34
I added it into the member's profile. You can also change the style of it by changing the code slightly. Cool and easy.

Rideharder
09 Feb 2010, 03:52
sweet!



Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------



http://www.4wx.com/webmasters/index.php?location=33417&customname=

Rideharder
09 Feb 2010, 06:16
How do I put it under ---------------------------------------------------------------------------------------->

Join Date: Jan 2008
Posts: 183
Design: White Pages,Fixed
xxxherexxx