The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
Weather Block for vBadvanced Details »» | |||||||||||||||||||||||||
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 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
|
Comments |
#2
|
|||
|
|||
Excellent!! I love it!! Unfortunatelyl, I don't have vBadvanced... what about vBPortal?
|
#3
|
|||
|
|||
it would be cool if the site support provence for canada :P otherwise cool hack even though I can't use it :P
|
#4
|
||||
|
||||
will it display the weather conditions for Asian users (in any where )? if not can you edit for that ?
|
#5
|
|||
|
|||
Quote:
|
#6
|
|||
|
|||
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... |
#7
|
|||
|
|||
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 |
#8
|
||||
|
||||
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. |
#9
|
|||
|
|||
:ermm: For international users there would not be any forcast, just what the weather is... officially...
|
#10
|
||||
|
||||
Great hack.
I wanted to do this for my vBadvanced, but couldn't find a decent weather feed. |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|