Version Description
- Add countdown timers from Widgets area
Download this release
Release Info
Developer | ujimoto |
Plugin | Uji Countdown |
Version | 1.0.6 |
Comparing to | |
See all releases |
Code changes from version 1.0.5 to 1.0.6
- images/ujic-ps2.jpg +0 -0
- images/ujic-ps3.jpg +0 -0
- images/ujic-ps3.png +0 -0
- images/wprelease.jpg +0 -0
- readme.txt +8 -1
- uji-countdown-add.php +16 -8
- uji-countdown-front.php +6 -3
- uji-countdown-widget.php +109 -0
- uji-countdown.php +7 -3
images/ujic-ps2.jpg
ADDED
Binary file
|
images/ujic-ps3.jpg
ADDED
Binary file
|
images/ujic-ps3.png
ADDED
Binary file
|
images/wprelease.jpg
DELETED
Binary file
|
readme.txt
CHANGED
@@ -4,7 +4,7 @@ Donate link: http://wpmanage.com/Uji-countdown
|
|
4 |
Tags: countdown, counter, html5 countdown, animated countdown, countdown timer, count down, countdown clock, jQuery countdown, clock, timer
|
5 |
Requires at least: 3.0
|
6 |
Tested up to: 3.4.1
|
7 |
-
Stable tag: 1.0.
|
8 |
|
9 |
Uji Countdown - HTML5 Customizable Countdown Timer
|
10 |
|
@@ -23,6 +23,9 @@ Features:
|
|
23 |
* Create unlimited styles
|
24 |
* Simple using shortcode
|
25 |
* Multilanguage support for date
|
|
|
|
|
|
|
26 |
|
27 |
http://www.youtube.com/watch?v=NMDoUU8CQIs
|
28 |
|
@@ -44,6 +47,10 @@ WPmanage [(http://www.wpmanage.com/uji-countdown/)](http://www.wpmanage.com/uji-
|
|
44 |
|
45 |
== Changelog ==
|
46 |
|
|
|
|
|
|
|
|
|
47 |
= 1.0.5 =
|
48 |
|
49 |
* Fix several bugs.
|
4 |
Tags: countdown, counter, html5 countdown, animated countdown, countdown timer, count down, countdown clock, jQuery countdown, clock, timer
|
5 |
Requires at least: 3.0
|
6 |
Tested up to: 3.4.1
|
7 |
+
Stable tag: 1.0.6
|
8 |
|
9 |
Uji Countdown - HTML5 Customizable Countdown Timer
|
10 |
|
23 |
* Create unlimited styles
|
24 |
* Simple using shortcode
|
25 |
* Multilanguage support for date
|
26 |
+
* Add countdown timers from Widgets area
|
27 |
+
|
28 |
+
<a href="http://wpmanage.com/uji-countdown">Uji Countdown Premium</a> is now available with new features.
|
29 |
|
30 |
http://www.youtube.com/watch?v=NMDoUU8CQIs
|
31 |
|
47 |
|
48 |
== Changelog ==
|
49 |
|
50 |
+
= 1.0.6 =
|
51 |
+
|
52 |
+
* Add countdown timers from Widgets area
|
53 |
+
|
54 |
= 1.0.5 =
|
55 |
|
56 |
* Fix several bugs.
|
uji-countdown-add.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
////////////////////////////////////ADD NEW STYLE////////////////////////////////////
|
4 |
|
5 |
function sel_size($sz){
|
6 |
-
$ujic_txt_sz = array("Very Small"=>"15", "Small"=>"25", "Medium"=>"35", "Large"=>"45", "Very Large"=>"55");
|
7 |
$select = '<option value="" class="seltit"> - Select Countdown Size - </option>';
|
8 |
foreach($ujic_txt_sz as $size=>$key){
|
9 |
$sel = ((int)$key == $sz) ? ' selected="selected"' : '';
|
@@ -177,6 +177,20 @@ function ujic_add_new(){
|
|
177 |
<img src="<?php echo UJI_PLUGIN_URL. '/images/ujic-ps.jpg'; ?>" />
|
178 |
</div>
|
179 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
180 |
<div class="postbox">
|
181 |
<div class="handlediv" title="Click to toggle"><br /></div>
|
182 |
<h3 class="hndle"><span>Support this plugin</span></h3>
|
@@ -192,13 +206,7 @@ function ujic_add_new(){
|
|
192 |
<a href="http://wpmanage.com/Contact-Us" target="_blank" id="hire">HIRE ME ›</a>
|
193 |
</div>
|
194 |
</div>
|
195 |
-
|
196 |
-
<div class="handlediv" title="Click to toggle"><br /></div>
|
197 |
-
<h3 class="hndle"><span>Wordpress Theme Gallery</span></h3>
|
198 |
-
<div class="inside">
|
199 |
-
<a href="http://www.wprelease.com/" target="_blank"><img src="<?php echo UJI_PLUGIN_URL. '/images/wprelease.jpg'; ?>" style="padding-left:28px" /></a>
|
200 |
-
</div>
|
201 |
-
</div>
|
202 |
</div>
|
203 |
<?php }
|
204 |
function ujic_save_newstyle(){
|
3 |
////////////////////////////////////ADD NEW STYLE////////////////////////////////////
|
4 |
|
5 |
function sel_size($sz){
|
6 |
+
$ujic_txt_sz = array("Ultra Small"=>"12", "Very Small"=>"15", "Small"=>"25", "Medium"=>"35", "Large"=>"45", "Very Large"=>"55");
|
7 |
$select = '<option value="" class="seltit"> - Select Countdown Size - </option>';
|
8 |
foreach($ujic_txt_sz as $size=>$key){
|
9 |
$sel = ((int)$key == $sz) ? ' selected="selected"' : '';
|
177 |
<img src="<?php echo UJI_PLUGIN_URL. '/images/ujic-ps.jpg'; ?>" />
|
178 |
</div>
|
179 |
</div>
|
180 |
+
<div class="postbox">
|
181 |
+
<div class="handlediv" title="Click to toggle"><br /></div>
|
182 |
+
<h3 class="hndle"><span>Add Countdown From Widgets</span></h3>
|
183 |
+
<div class="inside">
|
184 |
+
<img src="<?php echo UJI_PLUGIN_URL. '/images/ujic-ps2.jpg'; ?>" />
|
185 |
+
</div>
|
186 |
+
</div>
|
187 |
+
<div class="postbox">
|
188 |
+
<div class="handlediv" title="Click to toggle"><br /></div>
|
189 |
+
<h3 class="hndle"><span>Uji Countdown Premium</span></h3>
|
190 |
+
<div class="inside">
|
191 |
+
<a href="http://wpmanage.com/uji-countdown" target="_blank"><img src="<?php echo UJI_PLUGIN_URL. '/images/ujic-ps3.png'; ?>" style="padding-left:28px" /></a>
|
192 |
+
</div>
|
193 |
+
</div>
|
194 |
<div class="postbox">
|
195 |
<div class="handlediv" title="Click to toggle"><br /></div>
|
196 |
<h3 class="hndle"><span>Support this plugin</span></h3>
|
206 |
<a href="http://wpmanage.com/Contact-Us" target="_blank" id="hire">HIRE ME ›</a>
|
207 |
</div>
|
208 |
</div>
|
209 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
210 |
</div>
|
211 |
<?php }
|
212 |
function ujic_save_newstyle(){
|
uji-countdown-front.php
CHANGED
@@ -78,6 +78,8 @@ function add_ujic_popup(){
|
|
78 |
<span>
|
79 |
Please select your style below to add it to your post or page.
|
80 |
</span>
|
|
|
|
|
81 |
</div>
|
82 |
<div style="padding:15px 15px 0 15px;">
|
83 |
<h3 style="display:block; font-size:14px; margin-bottom:10px">Select style:</h3>
|
@@ -112,7 +114,7 @@ function add_ujic_popup(){
|
|
112 |
<?php
|
113 |
}
|
114 |
|
115 |
-
function ujic_forms(){
|
116 |
global $wpdb;
|
117 |
$table_name = $wpdb->prefix ."uji_counter";
|
118 |
$ujic_datas = $wpdb->get_results("SELECT * FROM $table_name ORDER BY `time` DESC");
|
@@ -120,9 +122,10 @@ function ujic_forms(){
|
|
120 |
$ujictab='';
|
121 |
foreach($ujic_datas as $ujic)
|
122 |
{
|
123 |
-
$
|
|
|
124 |
}
|
125 |
-
|
126 |
}
|
127 |
}
|
128 |
|
78 |
<span>
|
79 |
Please select your style below to add it to your post or page.
|
80 |
</span>
|
81 |
+
<p style="font-size:11px">Just one counter on page is allowed. <br>Check <a href="http://wpmanage.com/uji-countdown" target="_blank">Premium version</a> for multiple countdown timers on the same page.
|
82 |
+
</p>
|
83 |
</div>
|
84 |
<div style="padding:15px 15px 0 15px;">
|
85 |
<h3 style="display:block; font-size:14px; margin-bottom:10px">Select style:</h3>
|
114 |
<?php
|
115 |
}
|
116 |
|
117 |
+
function ujic_forms($sel=NULL){
|
118 |
global $wpdb;
|
119 |
$table_name = $wpdb->prefix ."uji_counter";
|
120 |
$ujic_datas = $wpdb->get_results("SELECT * FROM $table_name ORDER BY `time` DESC");
|
122 |
$ujictab='';
|
123 |
foreach($ujic_datas as $ujic)
|
124 |
{
|
125 |
+
$select = (isset($sel) && !empty($sel) && $sel == $ujic->title ) ? ' selected="selected"' : '';
|
126 |
+
$ujictab .='<option value="'.$ujic->title.'" '.$select.'> '.$ujic->title.' </option>';
|
127 |
}
|
128 |
+
return $ujictab;
|
129 |
}
|
130 |
}
|
131 |
|
uji-countdown-widget.php
ADDED
@@ -0,0 +1,109 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php class UJI_countdown extends WP_Widget {
|
2 |
+
|
3 |
+
function UJI_countdown(){
|
4 |
+
$widget_ops = array('description' => 'Uji Countdown widget');
|
5 |
+
$control_ops = array('width' => 300, 'height' => 400);
|
6 |
+
parent::WP_Widget('UJI_countdown_widget', $name='..:: Uji Countdown ::..', $widget_ops, $control_ops);
|
7 |
+
}
|
8 |
+
|
9 |
+
function widget($args, $instance) {
|
10 |
+
extract($args);
|
11 |
+
$UJI_style = $instance['UJI_style'];
|
12 |
+
$UJI_date = $instance['UJI_date'];
|
13 |
+
$UJI_exp = $instance['UJI_exp'];
|
14 |
+
$UJI_link = $instance['UJI_link'];
|
15 |
+
|
16 |
+
$shtval = '';
|
17 |
+
$shtval .= (!empty($UJI_style)) ? ' id="'.$UJI_style.'"' : $shtval;
|
18 |
+
$shtval .= (!empty($UJI_date)) ? ' expire="'.$UJI_date.'"' : $shtval;
|
19 |
+
$shtval .= (!empty($UJI_exp)) ? ' hide = "true"' : $shtval;
|
20 |
+
$shtval .= (empty($UJI_exp) && !empty($UJI_link)) ? ' url = "'.$UJI_link.'"' : $shtval;
|
21 |
+
$shortcode = (!empty($shtval)) ? '[ujicountdown'.$shtval.']' : '';
|
22 |
+
|
23 |
+
if(!empty($shortcode)) echo do_shortcode($shortcode);
|
24 |
+
|
25 |
+
} // widget
|
26 |
+
|
27 |
+
function update($new_instance, $old_instance){
|
28 |
+
$instance = $old_instance;
|
29 |
+
$instance['UJI_style'] = stripslashes($new_instance['UJI_style']);
|
30 |
+
$instance['UJI_date'] = stripslashes($new_instance['UJI_date']);
|
31 |
+
$instance['UJI_exp'] = stripslashes($new_instance['UJI_exp']);
|
32 |
+
$instance['UJI_link'] = stripslashes($new_instance['UJI_link']);
|
33 |
+
return $instance;
|
34 |
+
} // save
|
35 |
+
|
36 |
+
function form($instance){
|
37 |
+
$instance = wp_parse_args( (array) $instance, array('UJI_style'=>'', 'UJI_date'=>'', 'UJI_exp'=>'', 'UJI_countdown'=>'') );
|
38 |
+
$UJI_style = htmlspecialchars($instance['UJI_style']);
|
39 |
+
$UJI_date = htmlspecialchars($instance['UJI_date']);
|
40 |
+
$UJI_exp = htmlspecialchars($instance['UJI_exp']);
|
41 |
+
$UJI_link = htmlspecialchars($instance['UJI_link']);
|
42 |
+
|
43 |
+
wp_enqueue_script ( 'ujic_jquery_date_js' , UJI_PLUGIN_URL . '/inc/js/jquery-ui.min.js' , array ( 'jquery' ) , '1.4' , true );
|
44 |
+
wp_enqueue_script ( 'ujic_date_js' , UJI_PLUGIN_URL . '/inc/js/jquery-ui-timepicker.js' , array ( 'ujic_jquery_date_js' ) , '1.4' , true );
|
45 |
+
wp_register_style('ujic-jqueryui-css', "http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.14/themes/base/jquery-ui.css");
|
46 |
+
wp_enqueue_style( 'ujic-jqueryui-css');
|
47 |
+
?>
|
48 |
+
|
49 |
+
<?php
|
50 |
+
echo '<p style="font-size:11px">Just one counter on page is allowed. <br>Check <a href="http://wpmanage.com/uji-countdown" target="_blank">Premium version</a> for multiple countdown timers on the same page. <p>';
|
51 |
+
echo '<p><label>' . 'Select your style:' . '</label>
|
52 |
+
<select class="widefat" id="'.$this->get_field_id('UJI_style').'" name="'.$this->get_field_name('UJI_style').'">
|
53 |
+
<option value=""> Select a Style </option>'
|
54 |
+
.ujic_forms($UJI_style).
|
55 |
+
'</select></p>';
|
56 |
+
echo '<p><label>' . 'Countdown Expire In:' . '</label>
|
57 |
+
<input type="text" value="'. $UJI_date .'" width="200px" id="'.$this->get_field_id('UJI_date').'" class="UJI_date widefat" name="' . $this->get_field_name('UJI_date') . '" />
|
58 |
+
</p>';
|
59 |
+
|
60 |
+
echo '<p><h3>After expiry:</h3>
|
61 |
+
<label>' . 'Hide countdown:' . '</label>
|
62 |
+
<input type="checkbox" ', ($UJI_exp==1) ? ' checked="checked"' : '' ,' value="1" id="'.$this->get_field_id('UJI_exp').'" class="ujic_exp" name="' . $this->get_field_name('UJI_exp') . '" />
|
63 |
+
</p>';
|
64 |
+
|
65 |
+
echo '<p><label>' . 'Or go to link:' . '</label>
|
66 |
+
<input type="text" value="'. $UJI_link .'" width="200px" id="'.$this->get_field_id('UJI_link').'" class="ujic_link widefat" name="' . $this->get_field_name('UJI_link') . '" />
|
67 |
+
</p>';
|
68 |
+
?>
|
69 |
+
<script language="javascript">
|
70 |
+
jQuery(function() {
|
71 |
+
|
72 |
+
jQuery('.UJI_date').each(function() {
|
73 |
+
jQuery(this).datetimepicker({
|
74 |
+
timeFormat: 'hh:mm',
|
75 |
+
dateFormat: 'yy/mm/dd'
|
76 |
+
});
|
77 |
+
});
|
78 |
+
|
79 |
+
jQuery('.ujic_link').each(function() {
|
80 |
+
jQuery(this).keyup(function () {
|
81 |
+
var value = jQuery(this).val();
|
82 |
+
var cname = jQuery(this).parent().parent().find('.ujic_exp').attr("name");
|
83 |
+
jQuery(this).parent().parent().find('.ujic_exp').css('border', 'red');
|
84 |
+
//alert(cname);
|
85 |
+
|
86 |
+
if(value){
|
87 |
+
jQuery('input[name="'+cname+'"]').attr('checked', false);
|
88 |
+
}else{
|
89 |
+
|
90 |
+
jQuery('input[name="'+cname+'"]').attr('checked', true);
|
91 |
+
}
|
92 |
+
|
93 |
+
});
|
94 |
+
});
|
95 |
+
|
96 |
+
});
|
97 |
+
|
98 |
+
</script>
|
99 |
+
<?php
|
100 |
+
} // form
|
101 |
+
|
102 |
+
} // class
|
103 |
+
|
104 |
+
function UJI_countdownWidget() {
|
105 |
+
register_widget('UJI_countdown');
|
106 |
+
}
|
107 |
+
|
108 |
+
add_action('widgets_init', 'UJI_countdownWidget');
|
109 |
+
?>
|
uji-countdown.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
Plugin Name: Uji Countdown
|
4 |
Plugin URI: http://www.wpmanage.com/uji-countdown/
|
5 |
Description: HTML5 Countdown.
|
6 |
-
Version: 1.0.
|
7 |
Author: Ujog Raul
|
8 |
Author URI: http://www.wpmanage.com
|
9 |
|
@@ -29,7 +29,7 @@ if (!defined('UJI_VERSION_KEY'))
|
|
29 |
define('UJI_VERSION_KEY', 'UJI_version');
|
30 |
|
31 |
if (!defined('UJI_VERSION_NUM'))
|
32 |
-
define('UJI_VERSION_NUM', '1.0.
|
33 |
|
34 |
///////////////////////////////////DB///////////////////////////////////////
|
35 |
|
@@ -64,6 +64,10 @@ require_once(dirname( __FILE__ ) . "/uji-countdown-add.php");
|
|
64 |
|
65 |
require_once(dirname( __FILE__ ) . "/uji-countdown-front.php");
|
66 |
|
|
|
|
|
|
|
|
|
67 |
///////////////////////////////////CSS///////////////////////////////////////
|
68 |
|
69 |
function UJI__stylesheet() {
|
@@ -133,7 +137,7 @@ add_filter('plugin_action_links_'.UJI_PLUGIN_BASE, 'UJI_set_links', 10, 2 );
|
|
133 |
|
134 |
function ujic_form_button($context){
|
135 |
$image_btn = UJI_PLUGIN_URL. '/images/icon.png';
|
136 |
-
$out = '<a href="#TB_inline?width=300&height=
|
137 |
return $context . $out;
|
138 |
}
|
139 |
add_action('media_buttons_context', 'ujic_form_button');
|
3 |
Plugin Name: Uji Countdown
|
4 |
Plugin URI: http://www.wpmanage.com/uji-countdown/
|
5 |
Description: HTML5 Countdown.
|
6 |
+
Version: 1.0.6
|
7 |
Author: Ujog Raul
|
8 |
Author URI: http://www.wpmanage.com
|
9 |
|
29 |
define('UJI_VERSION_KEY', 'UJI_version');
|
30 |
|
31 |
if (!defined('UJI_VERSION_NUM'))
|
32 |
+
define('UJI_VERSION_NUM', '1.0.6');
|
33 |
|
34 |
///////////////////////////////////DB///////////////////////////////////////
|
35 |
|
64 |
|
65 |
require_once(dirname( __FILE__ ) . "/uji-countdown-front.php");
|
66 |
|
67 |
+
////////////////////////////////////Widget//////////////////////////////////////
|
68 |
+
|
69 |
+
require_once(dirname( __FILE__ ) . "/uji-countdown-widget.php");
|
70 |
+
|
71 |
///////////////////////////////////CSS///////////////////////////////////////
|
72 |
|
73 |
function UJI__stylesheet() {
|
137 |
|
138 |
function ujic_form_button($context){
|
139 |
$image_btn = UJI_PLUGIN_URL. '/images/icon.png';
|
140 |
+
$out = '<a href="#TB_inline?width=300&height=480&inlineId=select_countdown_form" class="thickbox" id="add_ujic" title="Add Countdown"><img src="'.$image_btn.'" alt="Add Counter" /></a>';
|
141 |
return $context . $out;
|
142 |
}
|
143 |
add_action('media_buttons_context', 'ujic_form_button');
|