Matt's Weather
===============
1. Introduction
2. Features
3. License
4. Installation
5. Configuration
6. Credits
1. Introduction
----------------
Welcome to Matt's Weather, if your reading this then you have probably just downloaded this file and want to know what to do now, well hopefully this will help. Matt's Weather is a PHP{3,4} script which can be used to show the weather for almost anywhere in the world by using region codes and/or dropdown menus etc. It has some nifty features, most of which are listed in section 2: Features. This script is totally free, all I ask is that what ever happens to the template files, credit remains to me in one way or another.
2. Features
------------
Here is a short list of the various features which make up Matt's Weather;
* Dynamic template based web page, meaning that the script is *fully* customizable in terms of look and feel.
* METAR weather report parsing to retrieve weather details, with image support for different weather conditions.
* Drop down menus so different regions of the world can easily be navigated, all of which are fully configurable.
* METAR codes for almost every region of the world.
3. License
-----------
Matt's Weather is licensed under the GNU General Public License (GPL), for full terms and conditions of the GPL please read the file "COPYING".
4. Installation
----------------
Installation is very easy for this script, sample templates and images have already been provided meaning that it is actually ready to use in its current state, although I would imagine that you would want to alter the "weather.tmpl" to change the look of the weather report, this file is just html with the following macros in it;
Macro Meaning
----- -------
[>AREA_NAME<] Area name in words, ie. "Blackpool airport".
[>FDATE<] Date the weather was recorded in the chosen format.
[>TIME<] Time which the weather was recorded in the chosen format.
[>TEMP_C<] Temperature recorded in degrees celsius.
[>TEMP_H<] Temperature recorded in degrees farenheit.
[>TEMP_IMG<] Path to the image file associated with the temperature
(configurable, NOTE: only the filename, not an
tag).
[>HUMIDITY<] The (%) humidity.
[>WIND_INFO<] Formatted wind information
[>CLOUD_INFO<] A list of cloud types and heights.
[>CLOUD_IMG<] The filename path to the image for clouds.
[>PRECIP_INFO<] Information about precipitation, in the same form as the clouds info.
[>PRECIP_IMG<] The filename for the appropriate weather image.
[>REGION_DD<] The drop down menu code configured in dropdown.cfg
Any occurences in the template file of any of these macros would be replaced with the appropriate data.
5. Configuration
-----------------
Configuration is really very simple. There are four files which may need altering, although three of them are simply template files, and two of them may not be needed at all! Lets first of all go through the file `config.php' and configure it for our means.
Variable Meaning
-------- -------
$imagePath This sets the location of the images for the script,
relative to the scripts working directory.
$noweather Points to a HTML page which is displayed on the event of
METAR data for the requested region not being available.
$use_head_and_foot_templates This boolean value tells the script whether or not to display
the header and footer sections of the page, this is here so
that people who are going to use this script as an SSI don't
have unnecessary HTML.
$template_header The location of a plain HTML file containing the page header.
$template_footer The location of a plain HTML file containing the page footer.
$template_main The location of the main template file containing the display
MACROs which will be displayed with the weather data.
$default_region The default region to display weather for in case no region is
passed to the script.
$time_offset The time offset from GMT of where you would like the script to
run, in other words, each METAR report is recorded with the current
GMT time, so this allows you to set the localtime instead.
$date_format This string contains information on how to display the date in
the main template, information on configuring this is available
in the mktime(3) manpage or @
http://www.php3.org/manual/en/function.mktime.php
$time_format This string is the formatting options for the time displayed in
the template and follows the same rules as $date_format.
$use_dropdown_menus A boolean value which determines whether or not to display the
dropdown menu chosen by $dropdown_area.
$dropdown_area The name of one of the area configured in "dropdown.cfg", see the
dropdown.cfg file for information on adding dropdown menus.
$temp_vhot }
$temp_hot }
$temp_med }_ Integers which decide "what is what" for your area, these set the
$temp_low } temperatures for hot, cold etc. May be a good idea to look at the
$temp_vlow } next bit to understand these more.
$temp_vvlow }
$sun_vhot }
$sun_hot }
$sun_med }_ These are paths to images (relative to $imagePath) which denote
$sun_low } which images to show dependant on the temperature, for a little
$sun_vlow } more help with this one, see "config.php".
$sun_vvlow }
$cloud_types This array simply determines the names for different reported type
of cloud.
$cloud_images This array denotes which image should be used for each different
cloud type.
$precip_types/$precip_images Same as $cloud_types/$cloud_images except for precipitation.
$precip_intensities Every now and again precipitation intensity information will
appear in the METAR file, this gives a textual version for
the varying intensities.
There is also a variable in the mweather.php script itself, $mweatherDir is needed to specify the full path to the scripts directory and data files.
Credits
--------
Matt's Weather was written by Matt Wilson and release under license of
GPL.