Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#11 get_sky_image()/itime bug (?)

phpweather-2.x
open
Output (11)
2
2006-09-10
2002-09-01
Petteri Kettunen
No

The night flag in pw_images.php is set according to metar
timestamp. Consider that you want to show sky image
according to local time. In embedded script one can make
the following hook:

sscanf(gmdate('G', $data['time'] + 32400), "%d", $hour);
if (($hour < 6) || ($hour > 18)) {
$images->set_time('nite');
} else {
$images->set_time('day');
}
$img = $images->get_sky_image();

But then one should also change in pw_images.php/
get_sky_image():

// if itime var is set by user, it overrides night flag
if ($this->itime != '') {
if ($this->itime == 'nite') {
$night = 1;
} else {
$night = 0;
}
}
if ($night == 1) {
return $this->properties['icons_path'] .
$this->n_images[$phenomena_group][$maxcoverage];
} else {
return $this->properties['icons_path'] .
$this->images[$phenomena_group][$maxcoverage];
}
// null itime????
// $this->itime = '';

Discussion

  • Max Hammond
    Max Hammond
    2006-09-10

    • priority: 5 --> 2
    • assigned_to: nobody --> kcornwell
     
  • Max Hammond
    Max Hammond
    2006-09-10

    Logged In: YES
    user_id=81516

    dup 597732