T(-) Countdown - Version 1.4

Version Description

  • NOW, when making time calculations, refers to the local time as set by WordPress in Settings > General > Timezone.
Download this release

Release Info

Developer baden03
Plugin Icon 128x128 T(-) Countdown
Version 1.4
Comparing to
See all releases

Code changes from version 1.3 to 1.4

countdown-timer.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: jQuery T Minus Countdown Widget
4
  Plugin URI: http://www.twinpictures.de/t-countdown-widget
5
  Description: Display and configure a jQuery countdown timer as a sidebar widget.
6
- Version: 1.3
7
  Author: Twinpictures
8
  Author URI: http://www.twinpictures.de
9
  License: GPL2
@@ -41,7 +41,7 @@ function countdown_script(){
41
  $plugin_url = trailingslashit( get_bloginfo('wpurl') ).PLUGINDIR.'/'. dirname( plugin_basename(__FILE__) );
42
  if (!is_admin()){
43
  //lwtCountdown script
44
- wp_register_script('countdown-script', $plugin_url.'/js/jquery.lwtCountdown-1.0.js', array (), '1.0' );
45
  wp_enqueue_script('countdown-script');
46
  }
47
  }
@@ -116,7 +116,8 @@ function widget_countdown_timer_init() {
116
  unset($options[0]); //returned by get_option(), but we don't need it
117
 
118
  //calc the inital difference
119
- $now = time();
 
120
  $target = mktime(
121
  $options['hour'],
122
  $options['min'],
@@ -201,6 +202,9 @@ function widget_countdown_timer_init() {
201
  function jquery_countdown_js($args){
202
  $options = array_merge(widget_countdown_options(), get_option('widget_countdown'));
203
  unset($options[0]); //returned by get_option(), but we don't need it
 
 
 
204
  ?>
205
  <script language="javascript" type="text/javascript">
206
  jQuery(document).ready(function() {
@@ -212,7 +216,8 @@ function widget_countdown_timer_init() {
212
  'year': <?php echo $options['year']; ?>,
213
  'hour': <?php echo $options['hour']; ?>,
214
  'min': <?php echo $options['min']; ?>,
215
- 'sec': <?php echo $options['sec']; ?>
 
216
  },
217
  omitWeeks: <?php echo $options['omitweeks']; ?>
218
  });
3
  Plugin Name: jQuery T Minus Countdown Widget
4
  Plugin URI: http://www.twinpictures.de/t-countdown-widget
5
  Description: Display and configure a jQuery countdown timer as a sidebar widget.
6
+ Version: 1.4
7
  Author: Twinpictures
8
  Author URI: http://www.twinpictures.de
9
  License: GPL2
41
  $plugin_url = trailingslashit( get_bloginfo('wpurl') ).PLUGINDIR.'/'. dirname( plugin_basename(__FILE__) );
42
  if (!is_admin()){
43
  //lwtCountdown script
44
+ wp_register_script('countdown-script', $plugin_url.'/js/jquery.lwtCountdown-1.0.js', array (), '1.1' );
45
  wp_enqueue_script('countdown-script');
46
  }
47
  }
116
  unset($options[0]); //returned by get_option(), but we don't need it
117
 
118
  //calc the inital difference
119
+ //$now = time();
120
+ $now = time() + ( get_option( 'gmt_offset' ) * 3600);
121
  $target = mktime(
122
  $options['hour'],
123
  $options['min'],
202
  function jquery_countdown_js($args){
203
  $options = array_merge(widget_countdown_options(), get_option('widget_countdown'));
204
  unset($options[0]); //returned by get_option(), but we don't need it
205
+ //targetTime = new Date(options.targetDate.month + '/' + options.targetDate.day + '/' + options.targetDate.year + ' ' + options.targetDate.hour + ':' + options.targetDate.min + ':' + options.targetDate.sec + (options.targetDate.utc ? ' UTC' : ''));
206
+ $t = date( 'n/j/Y H:i:s', time() + ( get_option( 'gmt_offset' ) * 3600));
207
+ //$t = time() + ( get_option( 'gmt_offset' ) * 3600);
208
  ?>
209
  <script language="javascript" type="text/javascript">
210
  jQuery(document).ready(function() {
216
  'year': <?php echo $options['year']; ?>,
217
  'hour': <?php echo $options['hour']; ?>,
218
  'min': <?php echo $options['min']; ?>,
219
+ 'sec': <?php echo $options['sec']; ?>,
220
+ 'localtime': '<?php echo $t; ?>'
221
  },
222
  omitWeeks: <?php echo $options['omitweeks']; ?>
223
  });
js/jquery.lwtCountdown-1.0.js CHANGED
@@ -1,8 +1,8 @@
1
  /*!
2
- * jQuery Countdown plugin v1.0
3
  * http://www.littlewebthings.com/projects/countdown/
4
  *
5
- * Copyright 2010, Vassilis Dourdounis
6
  *
7
  * Permission is hereby granted, free of charge, to any person obtaining a copy
8
  * of this software and associated documentation files (the "Software"), to deal
@@ -71,9 +71,10 @@
71
  targetTime.setMinutes(options.targetOffset.min + targetTime.getMinutes());
72
  targetTime.setSeconds(options.targetOffset.sec + targetTime.getSeconds());
73
  }
74
-
75
- var nowTime = new Date();
76
-
 
77
  diffSecs = Math.floor((targetTime.valueOf()-nowTime.valueOf())/1000);
78
 
79
  $.data(this[0], 'diffSecs', diffSecs);
1
  /*!
2
+ * jQuery Countdown plugin v1.1
3
  * http://www.littlewebthings.com/projects/countdown/
4
  *
5
+ * Copyright 2010, Vassilis Dourdounis, Twinpictures
6
  *
7
  * Permission is hereby granted, free of charge, to any person obtaining a copy
8
  * of this software and associated documentation files (the "Software"), to deal
71
  targetTime.setMinutes(options.targetOffset.min + targetTime.getMinutes());
72
  targetTime.setSeconds(options.targetOffset.sec + targetTime.getSeconds());
73
  }
74
+
75
+ //alert(options.targetDate.localtime);
76
+ var nowTime = new Date(options.targetDate.localtime);
77
+
78
  diffSecs = Math.floor((targetTime.valueOf()-nowTime.valueOf())/1000);
79
 
80
  $.data(this[0], 'diffSecs', diffSecs);
readme.txt CHANGED
@@ -4,13 +4,13 @@ Donate link: http://www.twinpictures.de/t-minus-countdown-widget
4
  Tags: countdown, timer, clock, ticker, widget, event, counter, count down, t minus, t-minus, twinpictures, G2, spaceBros, littlewebtings
5
  Requires at least: 2.7
6
  Tested up to: 3.0.1
7
- Stable tag: 1.3
8
 
9
- jQuery T Minus CountDown Widget is a sidebar widget that will display a sexy countdown timer based on littlewebtings CountDown plugin.
10
 
11
  == Description ==
12
 
13
- jQuery T Minus CountDown Widget will display a sexy, flash-free countdown timer based on littlewebthings CountDown jQuery plugin. Perfect for informing website visitors of an upcomming event, such as a new post or even a pending space voyage. As yes, there is also a css jedi mindtrick for your viewing pleasure--intergalactic planatary thanks to G2 (Gagarin2) of SpaceBros. Own your time and space.
14
 
15
  == Installation ==
16
 
@@ -42,6 +42,9 @@ The Daily Show with John Stewart
42
 
43
  == Changelog ==
44
 
 
 
 
45
  = 1.3 =
46
  * fixed issue with 1.2 not extracting the args... therefore there was not before-widget / before-title love. Sleep is important, as it turns out.
47
 
@@ -56,6 +59,9 @@ The Daily Show with John Stewart
56
 
57
  == Upgrade Notice ==
58
 
 
 
 
59
  = 1.3 =
60
  Version 1.3 fixes the issue no before/after widget/title issues due to lack of sleep during v. 1.2.
61
 
4
  Tags: countdown, timer, clock, ticker, widget, event, counter, count down, t minus, t-minus, twinpictures, G2, spaceBros, littlewebtings
5
  Requires at least: 2.7
6
  Tested up to: 3.0.1
7
+ Stable tag: 1.4
8
 
9
+ jQuery T Minus CountDown Widget is a sidebar widget that will display a sweet countdown timer clock based on littlewebtings CountDown plugin.
10
 
11
  == Description ==
12
 
13
+ jQuery T Minus CountDown Widget will display a sweet, flash-free countdown timer clock based on littlewebthings CountDown jQuery plugin. Perfect for informing website visitors of an upcomming event, such as a new post or even a pending space voyage. As yes, there is also a css jedi mindtrick for your viewing pleasure--intergalactic planatary thanks to G2 (Gagarin2) of SpaceBros. Own your time and space.
14
 
15
  == Installation ==
16
 
42
 
43
  == Changelog ==
44
 
45
+ = 1.4 =
46
+ * NOW, when making time calculations, refers to the local time as set by WordPress in Settings > General > Timezone.
47
+
48
  = 1.3 =
49
  * fixed issue with 1.2 not extracting the args... therefore there was not before-widget / before-title love. Sleep is important, as it turns out.
50
 
59
 
60
  == Upgrade Notice ==
61
 
62
+ = 1.4 =
63
+ Version 1.4 refers to your local WordPress Timezone for time caluclations. In case the server is hosted outside of the website's local timezone. It happens.
64
+
65
  = 1.3 =
66
  Version 1.3 fixes the issue no before/after widget/title issues due to lack of sleep during v. 1.2.
67