View Full Version : Weather Block for vBadvanced
WreckRman2
03-29-2004, 10:00 PM
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.
<!-- 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
Choclo
03-31-2004, 06:04 AM
Excellent!! I love it!! Unfortunatelyl, I don't have vBadvanced... what about vBPortal?
PixelFx
03-31-2004, 07:40 AM
it would be cool if the site support provence for canada :P otherwise cool hack even though I can't use it :P
deathemperor
03-31-2004, 07:47 AM
will it display the weather conditions for Asian users (in any where )? if not can you edit for that ?
DaveLogic
03-31-2004, 08:11 AM
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
hpwilhelm
03-31-2004, 08:33 AM
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... :)
hpwilhelm
03-31-2004, 08:54 AM
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 :D
joeychgo
03-31-2004, 08:57 AM
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.
hpwilhelm
03-31-2004, 09:06 AM
:ermm: For international users there would not be any forcast, just what the weather is... officially... :)
SVTBlackLight01
03-31-2004, 06:52 PM
Great hack.
I wanted to do this for my vBadvanced, but couldn't find a decent weather feed.
Tungsten
04-01-2004, 02:17 AM
This looks awfully familiar to the tip I posted over on www.vbadvanced.com about how to add the Weatherroom forecast to the portal. :rolleyes:
http://www.vbadvanced.com/forum/showpost.php?p=2273&postcount=5
WreckRman2
04-01-2004, 02:38 AM
I've never seen your "tip" until you just posted it and while they may look similar one has to ask how much different can a super simple thing like this be. Besides yours just shows one default city... mines allows the members to add their own zip code to show each members own city. I go to your website and see the weather for Nashville. What good does that do me if I line in Indianapolis?
WreckRman2
04-01-2004, 02:47 AM
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.
1. Feel free to modify it to suit your needs. There are many ways you get get the data. I simply used the zip code because I'd been using that for some time and most of my members are from the US.
2. I changed the code to $vboptions[bburl] instead of forums.
Remember guys I wrote this for my own use and the only reason I posted it here was to share it with anyone who wanted to modify it for their use. I'm not going to add to it but feel free to modify what I have already and forget this Simpons guy who thinks I stole his code.
SVTBlackLight01
04-01-2004, 02:57 AM
... and while they may look similar one has to ask how much different can a super simple thing like this be
I agree. It's hardly an original idea, so I don't think anyone can take credit for coming up with it. This is a good example of that idea.
deathemperor
04-01-2004, 03:31 AM
it's useless with anyone outside US or Euroup
SVTOA
04-01-2004, 03:48 AM
Nice job.
Installed. I wasn't using custom2, so I dumped the code into that template, works fine.
WreckRman2
04-01-2004, 04:36 AM
Then you have 2 options... move to the US or re-write it to your liking. :D
deathemperor
04-01-2004, 06:01 AM
I said it's useless meant that I've tried to rewrite it but there's no chance to make it like weather conditions for US
except there're some more sites for Asian weather conditions ( display similarly with US-EU's weather conditons )
move to US, no
Tungsten
04-01-2004, 01:57 PM
I'm not going to add to it but feel free to modify what I have already and forget this Simpons guy who thinks I stole his code.
I never said you stole any code... I said it looked suspiciously familiar to the reference I made on the vBadvanced support site.
milkmycow
04-02-2004, 01:56 PM
go cry about it?
if u had such a great idea, you should have released it. i garuntee your not the first to have thought of or mention the idea.
WreckRman2
04-02-2004, 02:00 PM
i garuntee your not the first to have thought of or mention the idea.
And that is the only reason I posted it. :)
nice... that was easy! 30 minutes is a little over exaggerated lol more like 10 tops.. and i'm pHp illiterate :)
nice job... wish there was a way for non u.s. users on my site to be able to use it though...
paratek
05-14-2004, 01:05 AM
Works with VBIndex to...nice hack
Host Visions
05-14-2004, 02:16 PM
any way to get this to show the current moon phase on vba rather than clicking the link?
ashley53680
05-28-2004, 12:37 AM
Awesome hack!!!
JTMON
06-09-2004, 05:45 PM
nice... that was easy! 30 minutes is a little over exaggerated lol more like 10 tops.. and i'm pHp illiterate :)
nice job... wish there was a way for non u.s. users on my site to be able to use it though...
Over at vbadvanced.com I believe they have a way for this to work with users outside US..
Boofo
06-09-2004, 07:56 PM
Over at vbadvanced.com I believe they have a way for this to work with users outside US..
Can you post a link to it, please? ;)
JTMON
06-09-2004, 08:18 PM
Here's the part with instructions:
1) Go here: http://www.weatherroom.com/cgi-bin/...ass&pass=tafINT
2) Select your country and city
3) Click "display Forecast/Conditions"
4) Top right you will see this "ICAO Used:" followed by a code - Place this code in your zip code field and you will see your local international forecast.
And here's a link to the hack thread:
http://www.vbadvanced.com/forum/showthread.php?t=1012
Boofo
06-09-2004, 09:47 PM
Here's the part with instructions:
1) Go here: http://www.weatherroom.com/cgi-bin/...ass&pass=tafINT
2) Select your country and city
3) Click "display Forecast/Conditions"
4) Top right you will see this "ICAO Used:" followed by a code - Place this code in your zip code field and you will see your local international forecast.
And here's a link to the hack thread:
http://www.vbadvanced.com/forum/showthread.php?t=1012
Oh, ok. That was the one I installed. But it doesn't work outside the US, does it?
JTMON
06-09-2004, 10:27 PM
Oh, ok. That was the one I installed. But it doesn't work outside the US, does it?
Not sure as I have no use for outside US, but the instructions you just quoted were what was given as a response to your very question.
Boofo
06-09-2004, 11:16 PM
Not sure as I have no use for outside US, but the instructions you just quoted were what was given as a response to your very question.
And I thank you for that, sir. ;)
MustangLisa
01-29-2005, 02:19 PM
I like this, but it says my zip isn't found . . . I live in a county with over $1m people . . .
The location you selected to search for was not found.
HAMweather 3 by default, normally can display the information for locatons with in the US that have zipcodes, and international locations which have an valid internationally reporting ICAO station.
If you entered in a location of a small town of location, it may be that this location is not in the current HAMweather 3 database. If you continue to have trouble with this location you may email the name of the location and what major city or county it is close to to the HAmweather administrator at hw3admin@hamweather.com for possible future addition to the HAMweather database.
vBulletin® v3.8.12 by vBS, Copyright ©2000-2024, vBulletin Solutions Inc.