Quote:
Originally Posted by BBR-APBT
I have made it so it uses a custom profile field and display each users local zip code. Plus the weather box will only show up if they entered their zip code.
First you have to make a new profile field.
admin >> User Profile Fields >> Add New User Profile Field
Single-Line Text Box
Title: Zip Code
Description: Put your Zip code here to display the local weather at the bottom of the forums.
Private Field: Yes
Field Searchable on Members List: NO
Show on Members List: NO
Here is the code.
Code:
<if condition="$bbuserinfo[fieldx]">
<script type="text/javascript" language="javascript1.2" src="http://weatherreports.com/jscript.html?width=234&height=60&theme=lblue_no_search_box&location=$bbuserinfo[fieldx]&units=f">
</script>
<div><a href="http://www.weatherreports.com/"><small>Weather Reports</small></a></div>
</if>
Change $bbuserinfo[fieldx] to the number of your field it is twice in the code.
Enjoy every one.
I use weather.com for mine and it is at the bottom of the forums. weather.com has a much nicer looking layout. If you sign up there and want help implanting the code just let me know.
|
For those that use this:
I went ahead and added 2 zip code fields and marked one for "f" and one for "c". This way the visitor can choose which format to see their weather in. I then placed the code in the template twice. If they leave on zip code empty then it only shows up once. If they enter zips in both fields then they will see both F and C temps.