PDA

View Full Version : Comprehensive iFrame Weather Module


temabu
01-09-2005, 10:01 AM
All,
I looked at the other and thought they didnt offer the weather for the obscure international places my forum members come from.

I found this and modified it to work. Its damn cool...and has considerably more international and US locations for weather. (its pulled from MSNBC!! :eek: )

Follow instructions below, with attachments.
======================================
Weather Module

Unzip WEATHER.ZIP to a /weather directory on your forum root.
/weather
/weather/1

plus all files..

Create Adv portal template: adv_portal_weather

Template contents:

<iframe src="weather/metar.php" width="205" height="185" scrolling="no" frameborder="0" name="weather" id="weather"></iframe>

Final step: Add the module to the portal

Go to AdminCP, vBa CMPS -> Add module

Module Title: Weather
Module Identifier: leave blank
File to Include: don't touch this one
OR Template to Include: weather
Active: click on "Yes"
Colum: left or right (Note: doesnt really work for center column)
Display Order: 3 (or whatever order you want to use)
Templates Used:
Update All Pages? Yes (it's default)

I have a lot of strange places added in my metar.php file at the bottom. Edit the file to add your own places. Get the codes from MSNBC weather (see TCT file for link)

Credits

I just bodged it - real work done by:

By I Ketut Sukandia (www.balidwipa.com and www.nusa-penida.com)
License : free/donation.
info@nusa-penida.com
goto http://www.msnbc.com/news/wea_front.asp?ta=y&tab=BW&tp=&sdiv=&rgn=&ctry=&accid=
and you will find the ACID or ICAO parameter for your city. (check browser status bar when hovering over selected City, look for last parameter on the link.

the ACID for Denpasar - Bali is WRRR or IDXX0005
the ACID for New York NY is LGA or USNY0996
the ACID for Paris, Fance is LFPO or FRXX0076
the ACID for Tokyo is RJTT or JAXX0085

Now, if someone can write a control panel add-on to select Cities and places, then we're complete! ;)

temabu
01-09-2005, 10:18 AM
Whoops, since we *all* want Globals off (with security in mind), put this line at the top of metar.php:

Find

if (!$accid) {

and replace with

error_reporting(E_ALL & ~E_NOTICE);
$accid=$_REQUEST['accid'];

if (!$accid) {

Sorry 'bout that.

Our Sponsors
 

honestjohn
03-21-2005, 01:57 PM
Just a thought, I will attempt this later on - but this could be made custom user-selectable user with custom profile fields fairly easily, I think, no?

accyroy
03-21-2005, 05:47 PM
Thanks a lot for that, it's the first web weather page I've found with my town on! Works great :)

Our Sponsors
 

detalhe
03-25-2005, 08:59 AM
This is great! But how can I show a forecast instead of the weather Now? Like in your http://www.nusa-penida.com/ page.

Thank you