Update of /cvsroot/phpweather/phpweather/locales In directory usw-pr-cvs1:/tmp/cvs-serv2548 Modified Files: locale_common.php Log Message: It now parses up to three types of precipitation correctly. Index: locale_common.php =================================================================== RCS file: /cvsroot/phpweather/phpweather/locales/locale_common.php,v retrieving revision 1.5 retrieving revision 1.6 diff -u -3 -r1.5 -r1.6 --- locale_common.php 2001/07/05 16:00:09 1.5 +++ locale_common.php 2001/07/05 19:02:50 1.6 @@ -351,7 +351,20 @@ /* There can only be one of the next three items. */ if (!empty($weather_group['precipitation'])) { - $output .= $this->strings['weather'][$weather_group['precipitation']]; + /* There can be up to three types of precipitation... */ + $precip_str1 = +$this->strings['weather'][substr($weather_group['precipitation'], 0, 2)]; + if (strlen($weather_group['precipitation']) > 2) { + $precip_str2 = +$this->strings['weather'][substr($weather_group['precipitation'], 2, 2)]; + } else { + $precip_str2 = ''; + $precip_str3 = ''; + } + if (strlen($weather_group['precipitation']) > 4) { + $precip_str3 = +$this->strings['weather'][substr($weather_group['precipitation'], 4, 2)]; + } else { + $precip_str3 = ''; + } + $output .= $this->list_sentences($precip_str1, $precip_str2, $precip_str3); } elseif (!empty($weather_group['obscuration'])) { $output .= $this->strings['weather'][$weather_group['obscuration']]; } elseif (!empty($weather_group['other'])) { _______________________________________________ PHPWeather-checkins mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/phpweather-checkins