Plugin Directory

Changeset 523366


Ignore:
Timestamp:
03/25/2012 10:02:07 AM (14 years ago)
Author:
jonlynch
Message:

DST fix

Location:
suntimes-widget
Files:
4 added
2 edited

Legend:

Unmodified
Added
Removed
  • suntimes-widget/trunk/readme.txt

    r522740 r523366  
    55Requires at least: 3.0
    66Tested up to: 3.3.1
    7 Stable tag: 0.9.1
     7Stable tag: 0.9.2
    88
    99Displays sunrise and sunset times in a widget
     
    3939
    4040== Changelog ==
     41= 0.9.2 =
     42DST related bugfix
    4143
    4244= 0.9.1 =
     
    4850== Upgrade Notice ==
    4951
     52= 0.9.2 =
     53Daylight Savings Bugfix
     54
    5055= 0.9.1 =
    51 Stupid Bugfix, sorry
     56Bugfix, sorry
    5257
    5358= 0.9 =
  • suntimes-widget/trunk/suntimes-widget.php

    r522740 r523366  
    55Description: Widget to display sunrise and sunset times.
    66Author: Jon Lynch
    7 Version: 0.9.1
     7Version: 0.9.2
    88Author URI: http://www.jonlynch.co.uk
    99*/
     
    7878  // set suntimes to be the array stored in the transients table if it exists
    7979  if (  false === ( $suntimes = get_transient( 'suntime' ) ) ) {
    80     $suntimes = jl_suntimes_generate_data($lat, $lon, $day, $month, $timezone, $dst);
     80    $suntimes = jl_suntimes_generate_data($lat, $lon, $day, $month, $timezone);
    8181  }
    8282  //if it is not up to date regenerate
    8383  if ($suntimes['day'].$suntimes['month'] != $day.$month ) {
    84     $suntimes = jl_suntimes_generate_data($lat, $lon, $day, $month, $timezone, $dst);
     84    $suntimes = jl_suntimes_generate_data($lat, $lon, $day, $month, $timezone);
    8585    }
    8686  // if we have the suntimes then we add the table contained in a div
     
    9191}
    9292
    93 function jl_suntimes_generate_data($lat, $lon, $day, $month, $timezone, $dst) {
    94   $dst = date('I'); //finds out if we are in dst 1 if dst 0 otherwise
    95   $url = "http://www.earthtools.org/sun/$lat/$lon/$day/$month/$timezone/$dst" ; //fetches an xml page for west cumbria
     93function jl_suntimes_generate_data($lat, $lon, $day, $month, $timezone) {
     94  //$dst = date('I'); //finds out if we are in dst 1 if dst 0 otherwise
     95  $url = "http://www.earthtools.org/sun/$lat/$lon/$day/$month/$timezone/0" ; //fetches an xml page for west cumbria
    9696  $request = new WP_Http;
    9797  $result = $request->request($url);
Note: See TracChangeset for help on using the changeset viewer.