cvs: pear /Services_Weather/examples metar-extensive.php

From: Date: Sat, 10 Jul 2004 11:46:42 +0000
Subject: cvs: pear /Services_Weather/examples metar-extensive.php
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-21708@lists.php.net to get a copy of this message
eru Sat Jul 10 07:46:42 2004 EDT Modified files: /pear/Services_Weather/examples metar-extensive.php Log: o Fixed omitting of FMCs o Fixed omitting of cloud types http://cvs.php.net/diff.php/pear/Services_Weather/examples/metar-extensive.php?r1=1.5&r2=1.6&ty=u Index: pear/Services_Weather/examples/metar-extensive.php diff -u pear/Services_Weather/examples/metar-extensive.php:1.5 pear/Services_Weather/examples/metar-extensive.php:1.6 --- pear/Services_Weather/examples/metar-extensive.php:1.5 Fri Jul 9 23:59:54 2004 +++ pear/Services_Weather/examples/metar-extensive.php Sat Jul 10 07:46:42 2004 @@ -16,7 +16,7 @@ // | Authors: Alexander Wirtz <alex@pc4p.net> | // +----------------------------------------------------------------------+ // -// $Id: metar-extensive.php,v 1.5 2004/07/10 03:59:54 eru Exp $ +// $Id: metar-extensive.php,v 1.6 2004/07/10 11:46:42 eru Exp $ /* * Well, this is a more elaborate example how to create a neat little page @@ -33,7 +33,6 @@ //------------------------------------------------------------------------- // This is the area, where you can customize the script //------------------------------------------------------------------------- -//$location = "Kennedy International Airport"; // The city we want to fetch the data for. $location = "Bonn, Germany"; // The city we want to fetch the data for. // Where the search function will look for // the ICAO database (generated with the @@ -463,6 +462,7 @@ $time = $start." - ".$end; $class = ' class="bold"'; // This is for outputting "Becoming", "Temporary" and such + $fmc = isset($row["fmc"]) ? $row["fmc"] : false; $fmctype = ""; $fmccnt = 0; @@ -504,7 +504,7 @@ $clouds = ""; for ($j = 0; $j < sizeof($row["clouds"]); $j++) { $cloud = ucwords($row["clouds"][$j]["amount"]); - if (isset($val[$j]["type"])) { + if (isset($row["clouds"][$j]["type"])) { $cloud .= " ".$row["clouds"][$j]["type"]; } if (isset($row["clouds"][$j]["height"])) { @@ -539,8 +539,8 @@ // Now check for significant weather changes and move // the row accordingly... maybe ugly coding, but this // is for showing design, not for fany programming ;-) - if (isset($row["fmc"]) && $fmccnt < sizeof($row["fmc"])) { - $row = $row["fmc"][$fmccnt]; + if ($fmc && $fmccnt < sizeof($fmc)) { + $row = $fmc[$fmccnt]; $fmccnt++; $fmctype = $row["type"]; // Check if we have a timestamp, don't output if it's

« previous php.pear.cvs (#21708) next »