Thanks Ken…made the changes… everything seems to be working well!
Steve
Thanks Ken…made the changes… everything seems to be working well!
Steve
Thanks for the fix Ken!
Everything seems to be working fine but when I go to validate the page I gets errors.
Is this something I messed up or is this something that needs changing in the new script?
Example of the error I get for each icon on the page.
Line 166, Column 192: end tag for "img" omitted, but OMITTAG NO was specified
Thanks to Ken also for the quick fix. Much appreciated.
On XHTML Validation: yes the image tag is not being closed properly…one way to fix is is shown below in red.
Ken is a better programmer than me so there is probably a better way to do this. I also noticed that the NWS has a wider page layout and they are using longer words like Thunderstorms instead of TStorms. One way to fix this is shown in orange below because Thunderstorms was too long a word for my forecast icons row.
The routine in green below is a custom PoP routine I developed to only show the main icons instead of the %icons and to create a PoP row underneath them (example shown below). If anyone wants to use this feel free to use it. It was just a personal preference of mine since I’m using different icons.
//
for ($i = 0; $i < count($forecasticons); $i++) {
$forecasticons[$i] = preg_replace(‘|/images/wtf/small|Uis’, ‘/forecast/images’, $forecasticons[$i]);
$forecasticons[$i] = preg_replace(‘|/forecast/images/|Uis’, $iconDir, $forecasticons[$i]);
$forecasticons[$i] = preg_replace(‘|.jpg|Uis’, $iconType, $forecasticons[$i]);
$forecasticons[$i] = preg_replace(‘|.png|Uis’, $iconType, $forecasticons[$i]); // support .gif icons
$forecasticons[$i] = preg_replace('|
\s+$|is’, “”, $forecasticons[$i]);
$forecasticons[$i] = preg_replace(‘|Thunderstorms|Uis’, “TStorms”, $forecasticons[$i]);
// $forecasticons[$i] = preg_replace(‘|\\" >
|is’, '" />
', $forecasticons[$i]);
$forecasticons[$i] = preg_replace(‘| >
|Uis’, " />
", $forecasticons[$i]);
$forecasticons[$i] = preg_replace(‘|(.)|Uis’, “<span style="color: $1;">$2”, $forecasticons[$i]);
$forecasticons[$i] = preg_replace(‘||Uis’, “<span style="color: $hiColor;">”, $forecasticons[$i]); // JJR Added
preg_match_all('|
([^<]+)(<span..*)|is’, $forecasticons[$i], $matches);
[color=green]//region <!-- CHIPPERDOG POP ROUTINE: Replace %PoP icon w\ plain icon & add PoP field for output -->
$forecastprec[$i] = ""; // string is blank if no %icon is found
$pos = strripos($forecasticons[$i], "0.jpg"); // find position of 0.jpg signifying a %icon is used
if ($pos) {
$icon_file = substr(strrchr(substr($forecasticons[$i], 0, $pos + 5), "/"), 1); // get full image filename
preg_match('/\d{3}|\d{2}/', $icon_file, $pop); // match xx or xxx number for 10 - 100%
$pop = $pop[0];
// replace matched number with blank so %icon is NOT used, limit to 1 replacement so text isn't changed
$forecasticons[$i] = preg_replace("/$pop/", "", $forecasticons[$i], 1);
$forecastprec[$i] = "<span style=\"font-size: 1em; color: #009900;\">PoP " . $pop . "%</span>";
} else {
// add a
if no PoP to line up everything in table
$forecastprec[$i] = "
";
}[/color]
…
Thanks for the thunderstorm fix, Chipperdog!
Tony
Thanks for the fix Ken. Donation on the way …
Also, thanks to Pat for the Thunderstorm overflow fix.
Not validating but looking good …
Jeff