Version Description
- Countdown date duration option(new)
- WooCommerce Countdown (new)
- Countdown create bug fixed
- Countdown issue on iPhone
- Code improvement
Download this release
Release Info
Developer | adamskaat |
Plugin | Countdown, Coming Soon – Countdown & Clock |
Version | 1.3.4 |
Comparing to | |
See all releases |
Code changes from version 1.3.3 to 1.3.4
- assets/css/admin.css +10 -0
- assets/img/Woo.png +0 -0
- assets/js/Countdown.js +58 -5
- assets/views/cricleMainView.php +1 -5
- assets/views/generalOptions.php +41 -16
- assets/views/subscriptionSection.php +3 -3
- classes/RegisterPostType.php +5 -0
- classes/YcdWidget.php +3 -1
- classes/countdown/CircleCountdown.php +29 -11
- classes/countdown/Countdown.php +24 -1
- classes/countdown/TimerCountdown.php +0 -7
- config/config.php +4 -3
- config/optionsConfig.php +171 -163
- config/proOptionsConfig.php +11 -2
- countdown-builder.php +1 -1
- helpers/AdminHelper.php +113 -0
- readme.txt +12 -8
assets/css/admin.css
CHANGED
@@ -108,6 +108,12 @@
|
|
108 |
background-size: 100% 100%;
|
109 |
}
|
110 |
|
|
|
|
|
|
|
|
|
|
|
|
|
111 |
.circlePopup-countdown:hover,
|
112 |
.circlePopup-countdown-pro:hover {
|
113 |
background-color: black;
|
@@ -480,4 +486,8 @@ div.ycd-tabs-text-header > div.ycd-toggle-icon-open {
|
|
480 |
|
481 |
.ycd-sub-options-settings label {
|
482 |
font-weight: 500 !important;
|
|
|
|
|
|
|
|
|
483 |
}
|
108 |
background-size: 100% 100%;
|
109 |
}
|
110 |
|
111 |
+
.woo-countdown,
|
112 |
+
.woo-countdown-pro {
|
113 |
+
background-image: url("../img/woo.png");
|
114 |
+
background-size: 100% 100%;
|
115 |
+
}
|
116 |
+
|
117 |
.circlePopup-countdown:hover,
|
118 |
.circlePopup-countdown-pro:hover {
|
119 |
background-color: black;
|
486 |
|
487 |
.ycd-sub-options-settings label {
|
488 |
font-weight: 500 !important;
|
489 |
+
}
|
490 |
+
|
491 |
+
.select2-container {
|
492 |
+
width: 100% !important;
|
493 |
}
|
assets/img/Woo.png
ADDED
Binary file
|
assets/js/Countdown.js
CHANGED
@@ -135,6 +135,8 @@ YcdCountdown.prototype.minicolors = function() {
|
|
135 |
};
|
136 |
|
137 |
YcdCountdown.prototype.livePreview = function() {
|
|
|
|
|
138 |
this.changeDate();
|
139 |
this.changeTimeZone();
|
140 |
this.changeCountsAnimation();
|
@@ -155,6 +157,44 @@ YcdCountdown.prototype.livePreview = function() {
|
|
155 |
this.changeNumberStyles();
|
156 |
};
|
157 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
158 |
YcdCountdown.prototype.changeAlignment = function() {
|
159 |
var alignment = jQuery('.ycd-circle-alignment');
|
160 |
|
@@ -193,7 +233,7 @@ YcdCountdown.prototype.changeTextColor = function() {
|
|
193 |
change: function() {
|
194 |
var color = jQuery(this).val();
|
195 |
var type = jQuery(this).data('time-type');
|
196 |
-
jQuery('.textDiv_'+type).css({
|
197 |
}
|
198 |
});
|
199 |
};
|
@@ -511,11 +551,24 @@ YcdCountdown.prototype.startTimeCircle = function() {
|
|
511 |
};
|
512 |
|
513 |
YcdCountdown.prototype.addTimeToClock = function(options, countDown) {
|
514 |
-
|
515 |
-
|
516 |
-
|
517 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
518 |
countDown.data('timer', seconds);
|
|
|
|
|
519 |
};
|
520 |
|
521 |
YcdCountdown.prototype.render = function(currentCountdown) {
|
135 |
};
|
136 |
|
137 |
YcdCountdown.prototype.livePreview = function() {
|
138 |
+
this.changeDateType();
|
139 |
+
this.chnageDateDuration();
|
140 |
this.changeDate();
|
141 |
this.changeTimeZone();
|
142 |
this.changeCountsAnimation();
|
157 |
this.changeNumberStyles();
|
158 |
};
|
159 |
|
160 |
+
YcdCountdown.prototype.changeDateType = function() {
|
161 |
+
var types = jQuery('.ycd-date-duration');
|
162 |
+
|
163 |
+
if(!types.length) {
|
164 |
+
return false;
|
165 |
+
}
|
166 |
+
that = this;
|
167 |
+
var countdowns = jQuery('.ycd-time-circle');
|
168 |
+
types.bind('change', function() {
|
169 |
+
var val = jQuery(this).val();
|
170 |
+
var timeName = jQuery(this).attr('name');
|
171 |
+
var options = countdowns.data('options');
|
172 |
+
options[timeName] = val;
|
173 |
+
countdowns.data('options', options);
|
174 |
+
countdowns = that.addTimeToClock(options, countdowns);
|
175 |
+
jQuery('.ycd-time-circle').TimeCircles().restart();
|
176 |
+
});
|
177 |
+
}
|
178 |
+
|
179 |
+
YcdCountdown.prototype.chnageDateDuration = function() {
|
180 |
+
var types = jQuery('.ycd-timer-time-settings');
|
181 |
+
|
182 |
+
if(!types.length) {
|
183 |
+
return false;
|
184 |
+
}
|
185 |
+
that = this;
|
186 |
+
var countdowns = jQuery('.ycd-time-circle');
|
187 |
+
types.bind('change', function() {
|
188 |
+
var val = jQuery(this).val();
|
189 |
+
var timeName = jQuery(this).attr('name');
|
190 |
+
var options = countdowns.data('options');
|
191 |
+
options[timeName] = val;
|
192 |
+
countdowns.data('options', options);
|
193 |
+
that.addTimeToClock(options, countdowns);
|
194 |
+
jQuery('.ycd-time-circle').TimeCircles().restart();
|
195 |
+
});
|
196 |
+
}
|
197 |
+
|
198 |
YcdCountdown.prototype.changeAlignment = function() {
|
199 |
var alignment = jQuery('.ycd-circle-alignment');
|
200 |
|
233 |
change: function() {
|
234 |
var color = jQuery(this).val();
|
235 |
var type = jQuery(this).data('time-type');
|
236 |
+
jQuery('.textDiv_'+type+' h4, '+'.textDiv_'+type+' span').css({color: color});
|
237 |
}
|
238 |
});
|
239 |
};
|
551 |
};
|
552 |
|
553 |
YcdCountdown.prototype.addTimeToClock = function(options, countDown) {
|
554 |
+
|
555 |
+
if(options['ycd-countdown-date-type'] == 'dueDate') {
|
556 |
+
var val = options['ycd-date-time-picker']+':00';
|
557 |
+
val = val.replace(/-/g, '/');
|
558 |
+
var selectedTimezone = options['ycd-circle-time-zone'];
|
559 |
+
var seconds = this.setCounterTime(val, selectedTimezone);
|
560 |
+
}
|
561 |
+
else {
|
562 |
+
var hours = parseInt(options['ycd-countdown-duration-hours']);
|
563 |
+
var minutes = parseInt(options['ycd-countdown-duration-minutes']);
|
564 |
+
var secondsSaved = parseInt(options['ycd-countdown-duration-seconds']);
|
565 |
+
|
566 |
+
var seconds = hours*60*60 + minutes*60 + secondsSaved;
|
567 |
+
}
|
568 |
+
|
569 |
countDown.data('timer', seconds);
|
570 |
+
|
571 |
+
return countDown;
|
572 |
};
|
573 |
|
574 |
YcdCountdown.prototype.render = function(currentCountdown) {
|
assets/views/cricleMainView.php
CHANGED
@@ -24,7 +24,7 @@ $countdownMinutesText = $typeObj->getOptionValue('ycd-countdown-minutes-text');
|
|
24 |
$countdownSeconds = $typeObj->getOptionValue('ycd-countdown-seconds');
|
25 |
$countdownSecondsText = $typeObj->getOptionValue('ycd-countdown-seconds-text');
|
26 |
$countdownDirection = $typeObj->getOptionValue('ycd-countdown-direction');
|
27 |
-
$type = $
|
28 |
$countdownDaysTextColor = $typeObj->getOptionValue('ycd-countdown-days-text-color');
|
29 |
$countdownMonthsTextColor = $typeObj->getOptionValue('ycd-countdown-months-text-color');
|
30 |
$countdownYearsTextColor = $typeObj->getOptionValue('ycd-countdown-years-text-color');
|
@@ -56,10 +56,6 @@ if (YCD_PKG_VERSION > YCD_FREE_VERSION) {
|
|
56 |
die();
|
57 |
}
|
58 |
}
|
59 |
-
|
60 |
-
if(empty($type)) {
|
61 |
-
$type = $_GET['ycd_type'];
|
62 |
-
}
|
63 |
?>
|
64 |
<div class="ycd-bootstrap-wrapper">
|
65 |
<div class="row">
|
24 |
$countdownSeconds = $typeObj->getOptionValue('ycd-countdown-seconds');
|
25 |
$countdownSecondsText = $typeObj->getOptionValue('ycd-countdown-seconds-text');
|
26 |
$countdownDirection = $typeObj->getOptionValue('ycd-countdown-direction');
|
27 |
+
$type = $this->getCurrentTypeFromOptions();
|
28 |
$countdownDaysTextColor = $typeObj->getOptionValue('ycd-countdown-days-text-color');
|
29 |
$countdownMonthsTextColor = $typeObj->getOptionValue('ycd-countdown-months-text-color');
|
30 |
$countdownYearsTextColor = $typeObj->getOptionValue('ycd-countdown-years-text-color');
|
56 |
die();
|
57 |
}
|
58 |
}
|
|
|
|
|
|
|
|
|
59 |
?>
|
60 |
<div class="ycd-bootstrap-wrapper">
|
61 |
<div class="row">
|
assets/views/generalOptions.php
CHANGED
@@ -1,25 +1,50 @@
|
|
1 |
<?php
|
|
|
2 |
use ycd\AdminHelper;
|
3 |
$defaultData = AdminHelper::defaultData();
|
4 |
$dueDate = $this->getOptionValue('ycd-date-time-picker');
|
5 |
?>
|
6 |
<div class="ycd-bootstrap-wrapper">
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
23 |
<div class="row">
|
24 |
<div class="col-md-6">
|
25 |
<label for="ycd-countdown-end-sound" class="ycd-label-of-switch"><?php _e('Timer End Sound', YCD_TEXT_DOMAIN); ?></label>
|
1 |
<?php
|
2 |
+
use ycd\MultipleChoiceButton;
|
3 |
use ycd\AdminHelper;
|
4 |
$defaultData = AdminHelper::defaultData();
|
5 |
$dueDate = $this->getOptionValue('ycd-date-time-picker');
|
6 |
?>
|
7 |
<div class="ycd-bootstrap-wrapper">
|
8 |
+
<?php
|
9 |
+
$multipleChoiceButton = new MultipleChoiceButton($defaultData['countdown-date-type'], esc_attr($this->getOptionValue('ycd-countdown-date-type')));
|
10 |
+
echo $multipleChoiceButton;
|
11 |
+
?>
|
12 |
+
<div id="ycd-countdown-due-date" class="ycd-countdown-show-text ycd-hide">
|
13 |
+
<div class="row form-group">
|
14 |
+
<div class="col-md-6">
|
15 |
+
<label for="ycd-date-time-picker" class="ycd-label-of-input"></label>
|
16 |
+
</div>
|
17 |
+
<div class="col-md-3">
|
18 |
+
<input type="text" id="ycd-date-time-picker" class="form-control ycd-date-time-picker" name="ycd-date-time-picker" value="<?php echo esc_attr($dueDate); ?>">
|
19 |
+
</div>
|
20 |
+
</div>
|
21 |
+
<div class="row form-group">
|
22 |
+
<div class="col-md-6">
|
23 |
+
<label for="ycd-date-time-picker" class="ycd-label-of-input"><?php _e('Time Zone', YCD_TEXT_DOMAIN); ?></label>
|
24 |
+
</div>
|
25 |
+
<div class="col-md-3">
|
26 |
+
<?php echo AdminHelper::selectBox($defaultData['time-zone'], esc_attr($this->getOptionValue('ycd-circle-time-zone')), array('name' => 'ycd-circle-time-zone', 'class' => 'js-ycd-select js-circle-time-zone')); ?>
|
27 |
+
</div>
|
28 |
+
</div>
|
29 |
+
</div>
|
30 |
+
<div id="ycd-date-duration" class="ycd-countdown-show-text ycd-hide">
|
31 |
+
<div class="row form-group">
|
32 |
+
<div class="col-md-6">
|
33 |
+
</div>
|
34 |
+
<div class="col-md-2">
|
35 |
+
<label for="ycdCountdownTimeHours"><?php _e('Hrs', YCD_TEXT_DOMAIN); ?></label>
|
36 |
+
<input type="number" name="ycd-countdown-duration-hours" id="ycdCountdownTimeHours" min="0" max="60" class="form-control ycd-timer-time-settings" data-type="hours" value="<?php echo esc_attr($this->getOptionValue('ycd-countdown-duration-hours'))?>">
|
37 |
+
</div>
|
38 |
+
<div class="col-md-2">
|
39 |
+
<label for="ycdCountdownTimeMinutes"><?php _e('Mins', YCD_TEXT_DOMAIN); ?></label>
|
40 |
+
<input type="number" name="ycd-countdown-duration-minutes" id="ycdCountdownTimeMinutes" min="0" max="60" class="form-control ycd-timer-time-settings" data-type="minutes" value="<?php echo esc_attr($this->getOptionValue('ycd-countdown-duration-minutes'))?>">
|
41 |
+
</div>
|
42 |
+
<div class="col-md-2">
|
43 |
+
<label for="ycdCountdownTimeSeconds"><?php _e('Secs', YCD_TEXT_DOMAIN); ?></label>
|
44 |
+
<input type="number" name="ycd-countdown-duration-seconds" id="ycdCountdownTimeSeconds" min="0" max="60" class="form-control ycd-timer-time-settings" data-type="seconds" value="<?php echo esc_attr($this->getOptionValue('ycd-countdown-duration-seconds'))?>">
|
45 |
+
</div>
|
46 |
+
</div>
|
47 |
+
</div>
|
48 |
<div class="row">
|
49 |
<div class="col-md-6">
|
50 |
<label for="ycd-countdown-end-sound" class="ycd-label-of-switch"><?php _e('Timer End Sound', YCD_TEXT_DOMAIN); ?></label>
|
assets/views/subscriptionSection.php
CHANGED
@@ -68,11 +68,11 @@
|
|
68 |
<input type="text" name="ycd-subscribe-error-message" class="form-control" id="ycd-subscribe-error-message" value="<?php echo esc_attr($this->getOptionValue('ycd-subscribe-error-message'))?>">
|
69 |
</div>
|
70 |
</div>
|
71 |
-
<? if(YCD_PKG_VERSION == YCD_FREE_VERSION): ?>
|
72 |
-
<a href="
|
73 |
<div class="ycd-pro ycd-pro-options-div">
|
74 |
<p class="ycd-pro-options-title"><?php _e('PRO Features', YCD_TEXT_DOMAIN); ?></p>
|
75 |
</div>
|
76 |
</a>
|
77 |
-
<? endif;?>
|
78 |
</div>
|
68 |
<input type="text" name="ycd-subscribe-error-message" class="form-control" id="ycd-subscribe-error-message" value="<?php echo esc_attr($this->getOptionValue('ycd-subscribe-error-message'))?>">
|
69 |
</div>
|
70 |
</div>
|
71 |
+
<?php if(YCD_PKG_VERSION == YCD_FREE_VERSION): ?>
|
72 |
+
<a href="<?php echo YCD_COUNTDOWN_PRO_URL; ?>" target="_blank">
|
73 |
<div class="ycd-pro ycd-pro-options-div">
|
74 |
<p class="ycd-pro-options-title"><?php _e('PRO Features', YCD_TEXT_DOMAIN); ?></p>
|
75 |
</div>
|
76 |
</a>
|
77 |
+
<?php endif;?>
|
78 |
</div>
|
classes/RegisterPostType.php
CHANGED
@@ -42,6 +42,11 @@ class RegisterPostType {
|
|
42 |
}
|
43 |
|
44 |
public function init() {
|
|
|
|
|
|
|
|
|
|
|
45 |
$postType = YCD_COUNTDOWN_POST_TYPE;
|
46 |
add_filter('ycdPostTypeSupport', array($this, 'postTypeSupports'), 10, 1);
|
47 |
$args = $this->getPostTypeArgs();
|
42 |
}
|
43 |
|
44 |
public function init() {
|
45 |
+
|
46 |
+
if (!empty($_GET['post_type']) && $_GET['post_type'] == YCD_COUNTDOWN_POST_TYPE) {
|
47 |
+
wp_deregister_script('autosave');
|
48 |
+
}
|
49 |
+
|
50 |
$postType = YCD_COUNTDOWN_POST_TYPE;
|
51 |
add_filter('ycdPostTypeSupport', array($this, 'postTypeSupports'), 10, 1);
|
52 |
$args = $this->getPostTypeArgs();
|
classes/YcdWidget.php
CHANGED
@@ -28,10 +28,12 @@ class ycd_countdown_widget extends WP_Widget {
|
|
28 |
$popups = Countdown::getPopupsObj();
|
29 |
$idTitle = Countdown::shapeIdTitleData($popups);
|
30 |
// Widget admin form
|
|
|
|
|
31 |
?>
|
32 |
<p>
|
33 |
<label><?php _e('Select countdown', YCD_TEXT_DOMAIN); ?>:</label>
|
34 |
-
<?php echo HelperFunctions::createSelectBox($idTitle, $
|
35 |
</p>
|
36 |
<?php
|
37 |
}
|
28 |
$popups = Countdown::getPopupsObj();
|
29 |
$idTitle = Countdown::shapeIdTitleData($popups);
|
30 |
// Widget admin form
|
31 |
+
$optionSaved = @$this->get_field_name('ycdOption');
|
32 |
+
$optionName = @$instance['ycdOption'];
|
33 |
?>
|
34 |
<p>
|
35 |
<label><?php _e('Select countdown', YCD_TEXT_DOMAIN); ?>:</label>
|
36 |
+
<?php echo HelperFunctions::createSelectBox($idTitle, $optionName, array('name' => $optionSaved)); ?>
|
37 |
</p>
|
38 |
<?php
|
39 |
}
|
classes/countdown/CircleCountdown.php
CHANGED
@@ -48,6 +48,11 @@ class CircleCountdown extends Countdown {
|
|
48 |
|
49 |
public function prepareOptions() {
|
50 |
$options = array();
|
|
|
|
|
|
|
|
|
|
|
51 |
$options['animation'] = $this->getOptionValue('ycd-circle-animation');
|
52 |
$options['direction'] = $this->getOptionValue('ycd-countdown-direction');
|
53 |
$options['fg_width'] = $this->getOptionValue('ycd-circle-width');
|
@@ -128,6 +133,8 @@ class CircleCountdown extends Countdown {
|
|
128 |
$fontStyleNumber = $this->getOptionValue('ycd-countdown-number-font-style');
|
129 |
$fontFamilyNumber = $this->getOptionValue('ycd-countdown-number-font');
|
130 |
|
|
|
|
|
131 |
$daysTextColor = $this->getOptionValue('ycd-countdown-days-text-color');
|
132 |
$hoursTextColor = $this->getOptionValue('ycd-countdown-hours-text-color');
|
133 |
$minutesTextColor = $this->getOptionValue('ycd-countdown-minutes-text-color');
|
@@ -135,6 +142,7 @@ class CircleCountdown extends Countdown {
|
|
135 |
$circleAlignment = $this->getOptionValue('ycd-circle-alignment');
|
136 |
$padding = $this->getOptionValue('ycd-countdown-padding').'px';
|
137 |
|
|
|
138 |
ob_start();
|
139 |
?>
|
140 |
<style type="text/css">
|
@@ -155,19 +163,32 @@ class CircleCountdown extends Countdown {
|
|
155 |
font-style: <?php echo $fontStyleNumber; ?> !important;
|
156 |
font-family: <?php echo $fontFamilyNumber; ?> !important;
|
157 |
}
|
158 |
-
#ycd-circle-<?php echo $id; ?> .
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
159 |
color: <?php echo $daysTextColor; ?>
|
160 |
}
|
161 |
|
162 |
-
#ycd-circle-<?php echo $id; ?> .textDiv_Hours
|
|
|
163 |
color: <?php echo $hoursTextColor; ?>
|
164 |
}
|
165 |
|
166 |
-
#ycd-circle-<?php echo $id; ?> .textDiv_Minutes
|
|
|
167 |
color: <?php echo $minutesTextColor; ?>
|
168 |
}
|
169 |
|
170 |
-
#ycd-circle-<?php echo $id; ?> .textDiv_Seconds
|
|
|
171 |
color: <?php echo $secondsTextColor; ?>
|
172 |
}
|
173 |
|
@@ -176,7 +197,7 @@ class CircleCountdown extends Countdown {
|
|
176 |
}
|
177 |
|
178 |
.ycd-circle-<?php echo $id; ?>-wrapper {
|
179 |
-
text-align:
|
180 |
}
|
181 |
</style>
|
182 |
<?php
|
@@ -189,12 +210,9 @@ class CircleCountdown extends Countdown {
|
|
189 |
public function getViewContent() {
|
190 |
$this->includeStyles();
|
191 |
$id = $this->getId();
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
$timeDate = new \DateTime('now', new \DateTimeZone($timezone));
|
196 |
-
$timeNow = strtotime($timeDate->format('Y-m-d H:i:s'));
|
197 |
-
$seconds = strtotime($dueDate)-$timeNow;
|
198 |
$bgImageStyleStr = $this->getBgImageStyleStr();
|
199 |
$bgImageStyleStr .= $this->renderStyles();
|
200 |
$allDataOptions = $this->getDataAllOptions();
|
48 |
|
49 |
public function prepareOptions() {
|
50 |
$options = array();
|
51 |
+
$options['ycd-seconds'] = $this->getCircleSeconds();
|
52 |
+
$options['ycd-countdown-date-type'] = $this->getOptionValue('ycd-countdown-date-type');
|
53 |
+
$options['ycd-countdown-duration-hours'] = $this->getOptionValue('ycd-countdown-duration-hours');
|
54 |
+
$options['ycd-countdown-duration-minutes'] = $this->getOptionValue('ycd-countdown-duration-minutes');
|
55 |
+
$options['ycd-countdown-duration-seconds'] = $this->getOptionValue('ycd-countdown-duration-seconds');
|
56 |
$options['animation'] = $this->getOptionValue('ycd-circle-animation');
|
57 |
$options['direction'] = $this->getOptionValue('ycd-countdown-direction');
|
58 |
$options['fg_width'] = $this->getOptionValue('ycd-circle-width');
|
133 |
$fontStyleNumber = $this->getOptionValue('ycd-countdown-number-font-style');
|
134 |
$fontFamilyNumber = $this->getOptionValue('ycd-countdown-number-font');
|
135 |
|
136 |
+
$yearsColor = $this->getOptionValue('ycd-countdown-years-text-color');
|
137 |
+
$monthsColor = $this->getOptionValue('ycd-countdown-months-text-color');
|
138 |
$daysTextColor = $this->getOptionValue('ycd-countdown-days-text-color');
|
139 |
$hoursTextColor = $this->getOptionValue('ycd-countdown-hours-text-color');
|
140 |
$minutesTextColor = $this->getOptionValue('ycd-countdown-minutes-text-color');
|
142 |
$circleAlignment = $this->getOptionValue('ycd-circle-alignment');
|
143 |
$padding = $this->getOptionValue('ycd-countdown-padding').'px';
|
144 |
|
145 |
+
|
146 |
ob_start();
|
147 |
?>
|
148 |
<style type="text/css">
|
163 |
font-style: <?php echo $fontStyleNumber; ?> !important;
|
164 |
font-family: <?php echo $fontFamilyNumber; ?> !important;
|
165 |
}
|
166 |
+
#ycd-circle-<?php echo $id; ?> .textDiv_Years h4,
|
167 |
+
#ycd-circle-<?php echo $id; ?> .textDiv_Years span {
|
168 |
+
|
169 |
+
color: <?php echo $yearsColor; ?>
|
170 |
+
}
|
171 |
+
#ycd-circle-<?php echo $id; ?> .textDiv_Months h4,
|
172 |
+
#ycd-circle-<?php echo $id; ?> .textDiv_Months span {
|
173 |
+
color: <?php echo $monthsColor; ?>
|
174 |
+
}
|
175 |
+
#ycd-circle-<?php echo $id; ?> .textDiv_Days h4,
|
176 |
+
#ycd-circle-<?php echo $id; ?> .textDiv_Days span {
|
177 |
color: <?php echo $daysTextColor; ?>
|
178 |
}
|
179 |
|
180 |
+
#ycd-circle-<?php echo $id; ?> .textDiv_Hours h4,
|
181 |
+
#ycd-circle-<?php echo $id; ?> .textDiv_Hours span {
|
182 |
color: <?php echo $hoursTextColor; ?>
|
183 |
}
|
184 |
|
185 |
+
#ycd-circle-<?php echo $id; ?> .textDiv_Minutes h4,
|
186 |
+
#ycd-circle-<?php echo $id; ?> .textDiv_Minutes span {
|
187 |
color: <?php echo $minutesTextColor; ?>
|
188 |
}
|
189 |
|
190 |
+
#ycd-circle-<?php echo $id; ?> .textDiv_Seconds h4,
|
191 |
+
#ycd-circle-<?php echo $id; ?> .textDiv_Seconds span {
|
192 |
color: <?php echo $secondsTextColor; ?>
|
193 |
}
|
194 |
|
197 |
}
|
198 |
|
199 |
.ycd-circle-<?php echo $id; ?>-wrapper {
|
200 |
+
text-align: <?php echo $circleAlignment; ?>;
|
201 |
}
|
202 |
</style>
|
203 |
<?php
|
210 |
public function getViewContent() {
|
211 |
$this->includeStyles();
|
212 |
$id = $this->getId();
|
213 |
+
|
214 |
+
$seconds = 0;
|
215 |
+
|
|
|
|
|
|
|
216 |
$bgImageStyleStr = $this->getBgImageStyleStr();
|
217 |
$bgImageStyleStr .= $this->renderStyles();
|
218 |
$allDataOptions = $this->getDataAllOptions();
|
classes/countdown/Countdown.php
CHANGED
@@ -180,6 +180,9 @@ abstract class Countdown {
|
|
180 |
public function getDefaultDataByName($optionName) {
|
181 |
global $YCD_OPTIONS;
|
182 |
|
|
|
|
|
|
|
183 |
foreach ($YCD_OPTIONS as $option) {
|
184 |
if ($option['name'] == $optionName) {
|
185 |
return $option;
|
@@ -538,7 +541,7 @@ abstract class Countdown {
|
|
538 |
|
539 |
public function getCurrentTypeFromOptions() {
|
540 |
$type = $this->getOptionValue('ycd-type');
|
541 |
-
if(empty($
|
542 |
$type = $_GET['ycd_type'];
|
543 |
}
|
544 |
|
@@ -561,4 +564,24 @@ abstract class Countdown {
|
|
561 |
|
562 |
return $isAllow;
|
563 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
564 |
}
|
180 |
public function getDefaultDataByName($optionName) {
|
181 |
global $YCD_OPTIONS;
|
182 |
|
183 |
+
if(empty($YCD_OPTIONS)) {
|
184 |
+
return array();
|
185 |
+
}
|
186 |
foreach ($YCD_OPTIONS as $option) {
|
187 |
if ($option['name'] == $optionName) {
|
188 |
return $option;
|
541 |
|
542 |
public function getCurrentTypeFromOptions() {
|
543 |
$type = $this->getOptionValue('ycd-type');
|
544 |
+
if(!empty($_GET['ycd_type'])) {
|
545 |
$type = $_GET['ycd_type'];
|
546 |
}
|
547 |
|
564 |
|
565 |
return $isAllow;
|
566 |
}
|
567 |
+
|
568 |
+
protected function getCircleSeconds() {
|
569 |
+
if($this->getOptionValue('ycd-countdown-date-type') == 'dueDate') {
|
570 |
+
$dueDate = $this->getOptionValue('ycd-date-time-picker');
|
571 |
+
$timezone = $this->getOptionValue('ycd-circle-time-zone');
|
572 |
+
$dueDate .= ':00';
|
573 |
+
$timeDate = new \DateTime('now', new \DateTimeZone($timezone));
|
574 |
+
$timeNow = strtotime($timeDate->format('Y-m-d H:i:s'));
|
575 |
+
$seconds = strtotime($dueDate)-$timeNow;
|
576 |
+
}
|
577 |
+
else {
|
578 |
+
$hours = (int)$this->getOptionValue('ycd-countdown-duration-hours');
|
579 |
+
$minutes = (int)$this->getOptionValue('ycd-countdown-duration-minutes');
|
580 |
+
$secondsSaved = (int)$this->getOptionValue('ycd-countdown-duration-seconds');
|
581 |
+
|
582 |
+
$seconds = $hours*60*60 + $minutes*60 + $secondsSaved;
|
583 |
+
}
|
584 |
+
|
585 |
+
return $seconds;
|
586 |
+
}
|
587 |
}
|
classes/countdown/TimerCountdown.php
CHANGED
@@ -1,11 +1,4 @@
|
|
1 |
<?php
|
2 |
-
/**
|
3 |
-
* Created by PhpStorm.
|
4 |
-
* User: yepo
|
5 |
-
* Date: 8/17/2018
|
6 |
-
* Time: 2:04 AM
|
7 |
-
*/
|
8 |
-
|
9 |
namespace ycd;
|
10 |
|
11 |
|
1 |
<?php
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
namespace ycd;
|
3 |
|
4 |
|
config/config.php
CHANGED
@@ -42,11 +42,12 @@ class YcdCountdownConfig {
|
|
42 |
self::addDefine('YCD_COUNTDOWN_WIDGET', 'ycd_countdown_widget');
|
43 |
self::addDefine('YCD_TEXT_DOMAIN', 'ycdCountdown');
|
44 |
self::addDefine('YCD_COUNTDOWN_PRO_URL', 'https://edmonsoft.com/countdown');
|
45 |
-
|
|
|
46 |
self::addDefine('YCD_CRON_REPEAT_INTERVAL', 1);
|
47 |
self::addDefine('YCD_TABLE_LIMIT', 15);
|
48 |
-
self::addDefine('YCD_VERSION', 1.
|
49 |
-
self::addDefine('YCD_VERSION_PRO', 1.
|
50 |
self::addDefine('YCD_FREE_VERSION', 1);
|
51 |
self::addDefine('YCD_SILVER_VERSION', 2);
|
52 |
self::addDefine('YCD_GOLD_VERSION', 3);
|
42 |
self::addDefine('YCD_COUNTDOWN_WIDGET', 'ycd_countdown_widget');
|
43 |
self::addDefine('YCD_TEXT_DOMAIN', 'ycdCountdown');
|
44 |
self::addDefine('YCD_COUNTDOWN_PRO_URL', 'https://edmonsoft.com/countdown');
|
45 |
+
self::addDefine('YCD_FILTER_REPEAT_INTERVAL', 50);
|
46 |
+
self::addDefine('YCD_PRODUCTS_LIMIT', 1000);
|
47 |
self::addDefine('YCD_CRON_REPEAT_INTERVAL', 1);
|
48 |
self::addDefine('YCD_TABLE_LIMIT', 15);
|
49 |
+
self::addDefine('YCD_VERSION', 1.34);
|
50 |
+
self::addDefine('YCD_VERSION_PRO', 1.21);
|
51 |
self::addDefine('YCD_FREE_VERSION', 1);
|
52 |
self::addDefine('YCD_SILVER_VERSION', 2);
|
53 |
self::addDefine('YCD_GOLD_VERSION', 3);
|
config/optionsConfig.php
CHANGED
@@ -2,175 +2,183 @@
|
|
2 |
|
3 |
class YcdCountdownOptionsConfig {
|
4 |
|
5 |
-
|
6 |
-
|
7 |
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
|
|
23 |
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
$YCD_TYPES['titles'] = apply_filters('ycdTitles', array(
|
41 |
-
'circle' => __('Circle', YCD_TEXT_DOMAIN),
|
42 |
-
'timer' => __('Digital', YCD_TEXT_DOMAIN),
|
43 |
-
'clock1' => __('Clock 1', YCD_TEXT_DOMAIN),
|
44 |
-
'clock2' => __('Clock 2', YCD_TEXT_DOMAIN),
|
45 |
-
'clock3' => __('Clock 3', YCD_TEXT_DOMAIN),
|
46 |
-
'clock4' => __('Clock 4', YCD_TEXT_DOMAIN),
|
47 |
-
'clock5' => __('Clock 5', YCD_TEXT_DOMAIN),
|
48 |
-
'clock6' => __('Clock 6', YCD_TEXT_DOMAIN),
|
49 |
-
'clock7' => __('Clock 7', YCD_TEXT_DOMAIN),
|
50 |
-
'sticky' => __('Sticky countdown', YCD_TEXT_DOMAIN),
|
51 |
-
'circlePopup' => __('Circle Popup', YCD_TEXT_DOMAIN),
|
52 |
-
'flipClock' => __('Flip Clock', YCD_TEXT_DOMAIN),
|
53 |
-
'flipClockPopup' => __('Flip Clock Popup', YCD_TEXT_DOMAIN)
|
54 |
-
));
|
55 |
-
}
|
56 |
-
|
57 |
-
public static function optionsValues() {
|
58 |
-
global $YCD_OPTIONS;
|
59 |
-
$options = array();
|
60 |
-
$options[] = array('name' => 'ycd-date-time-picker', 'type' => 'text', 'defaultValue' => date('Y-m-d H:i', strtotime(' +1 day')));
|
61 |
-
$options[] = array('name' => 'ycd-circle-time-zone', 'type' => 'text', 'defaultValue' => self::getDefaultTimezone());
|
62 |
-
$options[] = array('name' => 'ycd-circle-animation', 'type' => 'text', 'defaultValue' => 'smooth');
|
63 |
-
$options[] = array('name' => 'ycd-countdown-width', 'type' => 'text', 'defaultValue' => '500');
|
64 |
-
$options[] = array('name' => 'ycd-dimension-measure', 'type' => 'text', 'defaultValue' => 'px');
|
65 |
-
$options[] = array('name' => 'ycd-countdown-background-circle', 'type' => 'checkbox', 'defaultValue' => 'on');
|
66 |
-
$options[] = array('name' => 'ycd-countdown-months', 'type' => 'checkbox', 'defaultValue' => '');
|
67 |
-
$options[] = array('name' => 'ycd-countdown-months-text', 'type' => 'text', 'defaultValue' => __('Months', YCD_TEXT_DOMAIN));
|
68 |
-
$options[] = array('name' => 'ycd-countdown-years', 'type' => 'checkbox', 'defaultValue' => '');
|
69 |
-
$options[] = array('name' => 'ycd-countdown-years-text', 'type' => 'text', 'defaultValue' => __('Years', YCD_TEXT_DOMAIN));
|
70 |
-
$options[] = array('name' => 'ycd-countdown-days', 'type' => 'checkbox', 'defaultValue' => 'on');
|
71 |
-
$options[] = array('name' => 'ycd-countdown-days-text', 'type' => 'text', 'defaultValue' => __('DAYS', YCD_TEXT_DOMAIN));
|
72 |
-
$options[] = array('name' => 'ycd-countdown-hours', 'type' => 'checkbox', 'defaultValue' => 'on');
|
73 |
-
$options[] = array('name' => 'ycd-countdown-hours-text', 'type' => 'text', 'defaultValue' => __('HOURS', YCD_TEXT_DOMAIN));
|
74 |
-
$options[] = array('name' => 'ycd-countdown-minutes', 'type' => 'checkbox', 'defaultValue' => 'on');
|
75 |
-
$options[] = array('name' => 'ycd-countdown-minutes-text', 'type' => 'text', 'defaultValue' => __('MINUTES', YCD_TEXT_DOMAIN));
|
76 |
-
$options[] = array('name' => 'ycd-countdown-seconds', 'type' => 'checkbox', 'defaultValue' => 'on');
|
77 |
-
$options[] = array('name' => 'ycd-countdown-seconds-text', 'type' => 'text', 'defaultValue' => __('SECONDS', YCD_TEXT_DOMAIN));
|
78 |
-
$options[] = array('name' => 'ycd-countdown-direction', 'type' => 'text', 'defaultValue' => __('Clockwise', YCD_TEXT_DOMAIN));
|
79 |
-
$options[] = array(
|
80 |
-
'name' => 'ycd-countdown-expire-behavior',
|
81 |
-
'type' => 'text',
|
82 |
-
'defaultValue' => __('hideCountdown', YCD_TEXT_DOMAIN),
|
83 |
-
'ver' => YCD_SILVER_VERSION,
|
84 |
-
'allow' => array('hideCountdown', 'default')
|
85 |
-
);
|
86 |
-
$options[] = array('name' => 'ycd-expire-text', 'type' => 'html', 'defaultValue' => __('', YCD_TEXT_DOMAIN), 'ver' => YCD_SILVER_VERSION);
|
87 |
-
$options[] = array('name' => 'ycd-expire-url', 'type' => 'text', 'defaultValue' => __('', YCD_TEXT_DOMAIN), 'ver' => YCD_SILVER_VERSION);
|
88 |
-
$options[] = array('name' => 'ycd-countdown-months-color', 'type' => 'text', 'defaultValue' => '#8A2BE2', 'ver' => YCD_SILVER_VERSION);
|
89 |
-
$options[] = array('name' => 'ycd-countdown-months-text-color', 'type' => 'text', 'defaultValue' => '#000000', 'ver' => YCD_SILVER_VERSION);
|
90 |
-
$options[] = array('name' => 'ycd-countdown-years-color', 'type' => 'text', 'defaultValue' => '#A52A2A', 'ver' => YCD_SILVER_VERSION);
|
91 |
-
$options[] = array('name' => 'ycd-countdown-years-text-color', 'type' => 'text', 'defaultValue' => '#000000', 'ver' => YCD_SILVER_VERSION);
|
92 |
-
$options[] = array('name' => 'ycd-countdown-days-color', 'type' => 'text', 'defaultValue' => '#FFCC66', 'ver' => YCD_SILVER_VERSION);
|
93 |
-
$options[] = array('name' => 'ycd-countdown-days-text-color', 'type' => 'text', 'defaultValue' => '#000000', 'ver' => YCD_SILVER_VERSION);
|
94 |
-
$options[] = array('name' => 'ycd-countdown-hours-color', 'type' => 'text', 'defaultValue' => '#99CCFF', 'ver' => YCD_SILVER_VERSION);
|
95 |
-
$options[] = array('name' => 'ycd-countdown-hours-text-color', 'type' => 'text', 'defaultValue' => '#000000', 'ver' => YCD_SILVER_VERSION);
|
96 |
-
$options[] = array('name' => 'ycd-countdown-minutes-color', 'type' => 'text', 'defaultValue' => '#BBFFBB', 'ver' => YCD_SILVER_VERSION);
|
97 |
-
$options[] = array('name' => 'ycd-countdown-minutes-text-color', 'type' => 'text', 'defaultValue' => '#000000', 'ver' => YCD_SILVER_VERSION);
|
98 |
-
$options[] = array('name' => 'ycd-countdown-seconds-color', 'type' => 'text', 'defaultValue' => '#FF9999', 'ver' => YCD_SILVER_VERSION);
|
99 |
-
$options[] = array('name' => 'ycd-countdown-seconds-text-color', 'type' => 'text', 'defaultValue' => '#000000', 'ver' => YCD_SILVER_VERSION);
|
100 |
-
$options[] = array('name' => 'ycd-circle-width', 'type' => 'text', 'defaultValue' => '0.1');
|
101 |
-
$options[] = array('name' => 'ycd-circle-bg-width', 'type' => 'text', 'defaultValue' => '1.2');
|
102 |
-
$options[] = array('name' => 'ycd-circle-start-angle', 'type' => 'text', 'defaultValue' => 0);
|
103 |
-
$options[] = array('name' => 'ycd-countdown-bg-image', 'type' => 'checkbox', 'defaultValue' => 0, 'ver' => YCD_SILVER_VERSION);
|
104 |
-
$options[] = array('name' => 'ycd-bg-image-size', 'type' => 'text', 'defaultValue' => 'cover', 'ver' => YCD_SILVER_VERSION);
|
105 |
-
$options[] = array('name' => 'ycd-bg-image-repeat', 'type' => 'text', 'defaultValue' => 'no-repeat', 'ver' => YCD_SILVER_VERSION);
|
106 |
-
$options[] = array('name' => 'ycd-bg-image-url', 'type' => 'text', 'defaultValue' => '', 'ver' => YCD_SILVER_VERSION);
|
107 |
-
$options[] = array('name' => 'ycd-countdown-bg-circle-color', 'type' => 'text', 'defaultValue' => '#60686F', 'ver' => YCD_SILVER_VERSION);
|
108 |
-
$options[] = array('name' => 'ycd-text-font-size', 'type' => 'text', 'defaultValue' => '9');
|
109 |
-
$options[] = array('name' => 'ycd-countdown-number-size', 'type' => 'text', 'defaultValue' => '35');
|
110 |
-
$options[] = array('name' => 'ycd-countdown-number-font-weight', 'type' => 'text', 'defaultValue' => 'bold');
|
111 |
-
$options[] = array('name' => 'ycd-countdown-font-weight', 'type' => 'text', 'defaultValue' => 'normal');
|
112 |
-
$options[] = array('name' => 'ycd-countdown-font-style', 'type' => 'text', 'defaultValue' => 'initial');
|
113 |
-
$options[] = array('name' => 'ycd-text-font-family', 'type' => 'text', 'defaultValue' => 'Century Gothic', 'ver' => YCD_SILVER_VERSION);
|
114 |
-
$options[] = array('name' => 'ycd-countdown-padding', 'type' => 'text', 'defaultValue' => 0);
|
115 |
-
$options[] = array('name' => 'ycd-flip-time-zone', 'type' => 'text', 'defaultValue' => self::getDefaultTimezone());
|
116 |
-
$options[] = array('name' => 'ycd-flip-date-time-picker', 'type' => 'text', 'defaultValue' => date('Y-m-d H:i', strtotime(' +1 day')));
|
117 |
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
126 |
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
|
172 |
-
|
173 |
-
|
174 |
|
175 |
public static function getDefaultTimezone() {
|
176 |
$timezone = get_option('timezone_string');
|
2 |
|
3 |
class YcdCountdownOptionsConfig {
|
4 |
|
5 |
+
public static function init() {
|
6 |
+
global $YCD_TYPES;
|
7 |
|
8 |
+
$YCD_TYPES['typeName'] = apply_filters('ycdTypes', array(
|
9 |
+
'circle' => YCD_FREE_VERSION,
|
10 |
+
'timer' => YCD_FREE_VERSION,
|
11 |
+
'clock1' => YCD_FREE_VERSION,
|
12 |
+
'clock2' => YCD_FREE_VERSION,
|
13 |
+
'clock3' => YCD_FREE_VERSION,
|
14 |
+
'clock4' => YCD_SILVER_VERSION,
|
15 |
+
'clock5' => YCD_SILVER_VERSION,
|
16 |
+
'clock6' => YCD_SILVER_VERSION,
|
17 |
+
'clock7' => YCD_SILVER_VERSION,
|
18 |
+
'sticky' => YCD_SILVER_VERSION,
|
19 |
+
'woo' => YCD_GOLD_VERSION,
|
20 |
+
'circlePopup' => YCD_SILVER_VERSION,
|
21 |
+
'flipClock' => YCD_SILVER_VERSION,
|
22 |
+
'flipClockPopup' => YCD_SILVER_VERSION
|
23 |
+
));
|
24 |
|
25 |
+
$YCD_TYPES['typePath'] = apply_filters('ycdTypePaths', array(
|
26 |
+
'circle' => YCD_COUNTDOWNS_PATH,
|
27 |
+
'timer' => YCD_COUNTDOWNS_PATH,
|
28 |
+
'clock1' => YCD_COUNTDOWNS_PATH,
|
29 |
+
'clock2' => YCD_COUNTDOWNS_PATH,
|
30 |
+
'clock3' => YCD_COUNTDOWNS_PATH,
|
31 |
+
'clock4' => YCD_COUNTDOWNS_PATH,
|
32 |
+
'clock5' => YCD_COUNTDOWNS_PATH,
|
33 |
+
'clock6' => YCD_COUNTDOWNS_PATH,
|
34 |
+
'clock7' => YCD_COUNTDOWNS_PATH,
|
35 |
+
'sticky' => YCD_COUNTDOWNS_PATH,
|
36 |
+
'woo' => YCD_COUNTDOWNS_PATH,
|
37 |
+
'circlePopup' => YCD_COUNTDOWNS_PATH,
|
38 |
+
'flipClock' => YCD_COUNTDOWNS_PATH,
|
39 |
+
'flipClockPopup' => YCD_COUNTDOWNS_PATH
|
40 |
+
));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
41 |
|
42 |
+
$YCD_TYPES['titles'] = apply_filters('ycdTitles', array(
|
43 |
+
'circle' => __('Circle', YCD_TEXT_DOMAIN),
|
44 |
+
'timer' => __('Digital', YCD_TEXT_DOMAIN),
|
45 |
+
'clock1' => __('Clock 1', YCD_TEXT_DOMAIN),
|
46 |
+
'clock2' => __('Clock 2', YCD_TEXT_DOMAIN),
|
47 |
+
'clock3' => __('Clock 3', YCD_TEXT_DOMAIN),
|
48 |
+
'clock4' => __('Clock 4', YCD_TEXT_DOMAIN),
|
49 |
+
'clock5' => __('Clock 5', YCD_TEXT_DOMAIN),
|
50 |
+
'clock6' => __('Clock 6', YCD_TEXT_DOMAIN),
|
51 |
+
'clock7' => __('Clock 7', YCD_TEXT_DOMAIN),
|
52 |
+
'sticky' => __('Sticky countdown', YCD_TEXT_DOMAIN),
|
53 |
+
'woo' => __('WooCommerce countdown', YCD_TEXT_DOMAIN),
|
54 |
+
'circlePopup' => __('Circle Popup', YCD_TEXT_DOMAIN),
|
55 |
+
'flipClock' => __('Flip Clock', YCD_TEXT_DOMAIN),
|
56 |
+
'flipClockPopup' => __('Flip Clock Popup', YCD_TEXT_DOMAIN)
|
57 |
+
));
|
58 |
+
}
|
59 |
+
|
60 |
+
public static function optionsValues() {
|
61 |
+
global $YCD_OPTIONS;
|
62 |
+
$options = array();
|
63 |
+
$options[] = array('name' => 'ycd-type', 'type' => 'text', 'defaultValue' => 'circle');
|
64 |
+
$options[] = array('name' => 'ycd-countdown-date-type', 'type' => 'text', 'defaultValue' => 'dueDate');
|
65 |
+
$options[] = array('name' => 'ycd-date-time-picker', 'type' => 'text', 'defaultValue' => date('Y-m-d H:i', strtotime(' +1 day')));
|
66 |
+
$options[] = array('name' => 'ycd-circle-time-zone', 'type' => 'text', 'defaultValue' => self::getDefaultTimezone());
|
67 |
+
$options[] = array('name' => 'ycd-circle-animation', 'type' => 'text', 'defaultValue' => 'smooth');
|
68 |
+
$options[] = array('name' => 'ycd-countdown-width', 'type' => 'text', 'defaultValue' => '500');
|
69 |
+
$options[] = array('name' => 'ycd-dimension-measure', 'type' => 'text', 'defaultValue' => 'px');
|
70 |
+
$options[] = array('name' => 'ycd-countdown-background-circle', 'type' => 'checkbox', 'defaultValue' => 'on');
|
71 |
+
$options[] = array('name' => 'ycd-countdown-months', 'type' => 'checkbox', 'defaultValue' => '');
|
72 |
+
$options[] = array('name' => 'ycd-countdown-months-text', 'type' => 'text', 'defaultValue' => __('Months', YCD_TEXT_DOMAIN));
|
73 |
+
$options[] = array('name' => 'ycd-countdown-years', 'type' => 'checkbox', 'defaultValue' => '');
|
74 |
+
$options[] = array('name' => 'ycd-countdown-years-text', 'type' => 'text', 'defaultValue' => __('Years', YCD_TEXT_DOMAIN));
|
75 |
+
$options[] = array('name' => 'ycd-countdown-days', 'type' => 'checkbox', 'defaultValue' => 'on');
|
76 |
+
$options[] = array('name' => 'ycd-countdown-days-text', 'type' => 'text', 'defaultValue' => __('DAYS', YCD_TEXT_DOMAIN));
|
77 |
+
$options[] = array('name' => 'ycd-countdown-hours', 'type' => 'checkbox', 'defaultValue' => 'on');
|
78 |
+
$options[] = array('name' => 'ycd-countdown-hours-text', 'type' => 'text', 'defaultValue' => __('HOURS', YCD_TEXT_DOMAIN));
|
79 |
+
$options[] = array('name' => 'ycd-countdown-minutes', 'type' => 'checkbox', 'defaultValue' => 'on');
|
80 |
+
$options[] = array('name' => 'ycd-countdown-minutes-text', 'type' => 'text', 'defaultValue' => __('MINUTES', YCD_TEXT_DOMAIN));
|
81 |
+
$options[] = array('name' => 'ycd-countdown-seconds', 'type' => 'checkbox', 'defaultValue' => 'on');
|
82 |
+
$options[] = array('name' => 'ycd-countdown-seconds-text', 'type' => 'text', 'defaultValue' => __('SECONDS', YCD_TEXT_DOMAIN));
|
83 |
+
$options[] = array('name' => 'ycd-countdown-direction', 'type' => 'text', 'defaultValue' => __('Clockwise', YCD_TEXT_DOMAIN));
|
84 |
+
$options[] = array(
|
85 |
+
'name' => 'ycd-countdown-expire-behavior',
|
86 |
+
'type' => 'text',
|
87 |
+
'defaultValue' => __('hideCountdown', YCD_TEXT_DOMAIN),
|
88 |
+
'ver' => YCD_SILVER_VERSION,
|
89 |
+
'allow' => array('hideCountdown', 'default')
|
90 |
+
);
|
91 |
+
$options[] = array('name' => 'ycd-expire-text', 'type' => 'html', 'defaultValue' => __('', YCD_TEXT_DOMAIN), 'ver' => YCD_SILVER_VERSION);
|
92 |
+
$options[] = array('name' => 'ycd-expire-url', 'type' => 'text', 'defaultValue' => __('', YCD_TEXT_DOMAIN), 'ver' => YCD_SILVER_VERSION);
|
93 |
+
$options[] = array('name' => 'ycd-countdown-months-color', 'type' => 'text', 'defaultValue' => '#8A2BE2', 'ver' => YCD_SILVER_VERSION);
|
94 |
+
$options[] = array('name' => 'ycd-countdown-months-text-color', 'type' => 'text', 'defaultValue' => '#000000', 'ver' => YCD_SILVER_VERSION);
|
95 |
+
$options[] = array('name' => 'ycd-countdown-years-color', 'type' => 'text', 'defaultValue' => '#A52A2A', 'ver' => YCD_SILVER_VERSION);
|
96 |
+
$options[] = array('name' => 'ycd-countdown-years-text-color', 'type' => 'text', 'defaultValue' => '#000000', 'ver' => YCD_SILVER_VERSION);
|
97 |
+
$options[] = array('name' => 'ycd-countdown-days-color', 'type' => 'text', 'defaultValue' => '#FFCC66', 'ver' => YCD_SILVER_VERSION);
|
98 |
+
$options[] = array('name' => 'ycd-countdown-days-text-color', 'type' => 'text', 'defaultValue' => '#000000', 'ver' => YCD_SILVER_VERSION);
|
99 |
+
$options[] = array('name' => 'ycd-countdown-hours-color', 'type' => 'text', 'defaultValue' => '#99CCFF', 'ver' => YCD_SILVER_VERSION);
|
100 |
+
$options[] = array('name' => 'ycd-countdown-hours-text-color', 'type' => 'text', 'defaultValue' => '#000000', 'ver' => YCD_SILVER_VERSION);
|
101 |
+
$options[] = array('name' => 'ycd-countdown-minutes-color', 'type' => 'text', 'defaultValue' => '#BBFFBB', 'ver' => YCD_SILVER_VERSION);
|
102 |
+
$options[] = array('name' => 'ycd-countdown-minutes-text-color', 'type' => 'text', 'defaultValue' => '#000000', 'ver' => YCD_SILVER_VERSION);
|
103 |
+
$options[] = array('name' => 'ycd-countdown-seconds-color', 'type' => 'text', 'defaultValue' => '#FF9999', 'ver' => YCD_SILVER_VERSION);
|
104 |
+
$options[] = array('name' => 'ycd-countdown-seconds-text-color', 'type' => 'text', 'defaultValue' => '#000000', 'ver' => YCD_SILVER_VERSION);
|
105 |
+
$options[] = array('name' => 'ycd-circle-width', 'type' => 'text', 'defaultValue' => '0.1');
|
106 |
+
$options[] = array('name' => 'ycd-circle-bg-width', 'type' => 'text', 'defaultValue' => '1.2');
|
107 |
+
$options[] = array('name' => 'ycd-circle-start-angle', 'type' => 'text', 'defaultValue' => 0);
|
108 |
+
$options[] = array('name' => 'ycd-countdown-bg-image', 'type' => 'checkbox', 'defaultValue' => 0, 'ver' => YCD_SILVER_VERSION);
|
109 |
+
$options[] = array('name' => 'ycd-bg-image-size', 'type' => 'text', 'defaultValue' => 'cover', 'ver' => YCD_SILVER_VERSION);
|
110 |
+
$options[] = array('name' => 'ycd-bg-image-repeat', 'type' => 'text', 'defaultValue' => 'no-repeat', 'ver' => YCD_SILVER_VERSION);
|
111 |
+
$options[] = array('name' => 'ycd-bg-image-url', 'type' => 'text', 'defaultValue' => '', 'ver' => YCD_SILVER_VERSION);
|
112 |
+
$options[] = array('name' => 'ycd-countdown-bg-circle-color', 'type' => 'text', 'defaultValue' => '#60686F', 'ver' => YCD_SILVER_VERSION);
|
113 |
+
$options[] = array('name' => 'ycd-text-font-size', 'type' => 'text', 'defaultValue' => '9');
|
114 |
+
$options[] = array('name' => 'ycd-countdown-number-size', 'type' => 'text', 'defaultValue' => '35');
|
115 |
+
$options[] = array('name' => 'ycd-countdown-number-font-weight', 'type' => 'text', 'defaultValue' => 'bold');
|
116 |
+
$options[] = array('name' => 'ycd-countdown-font-weight', 'type' => 'text', 'defaultValue' => 'normal');
|
117 |
+
$options[] = array('name' => 'ycd-countdown-font-style', 'type' => 'text', 'defaultValue' => 'initial');
|
118 |
+
$options[] = array('name' => 'ycd-text-font-family', 'type' => 'text', 'defaultValue' => 'Century Gothic', 'ver' => YCD_SILVER_VERSION);
|
119 |
+
$options[] = array('name' => 'ycd-countdown-padding', 'type' => 'text', 'defaultValue' => 0);
|
120 |
+
$options[] = array('name' => 'ycd-flip-time-zone', 'type' => 'text', 'defaultValue' => self::getDefaultTimezone());
|
121 |
+
$options[] = array('name' => 'ycd-flip-date-time-picker', 'type' => 'text', 'defaultValue' => date('Y-m-d H:i', strtotime(' +1 day')));
|
122 |
+
$options[] = array('name' => 'ycd-countdown-duration-hours', 'type' => 'number', 'defaultValue' => 0);
|
123 |
+
$options[] = array('name' => 'ycd-countdown-duration-minutes', 'type' => 'number', 'defaultValue' => 0);
|
124 |
+
$options[] = array('name' => 'ycd-countdown-duration-seconds', 'type' => 'number', 'defaultValue' => 30);
|
125 |
+
|
126 |
+
// timer clock
|
127 |
+
$options[] = array('name' => 'ycd-timer-hours', 'type' => 'number', 'defaultValue' => 0);
|
128 |
+
$options[] = array('name' => 'ycd-timer-minutes', 'type' => 'number', 'defaultValue' => 0);
|
129 |
+
$options[] = array('name' => 'ycd-timer-seconds', 'type' => 'number', 'defaultValue' => 30);
|
130 |
+
$options[] = array('name' => 'ycd-timer-font-size', 'type' => 'number', 'defaultValue' => 6);
|
131 |
+
$options[] = array('name' => 'ycd-timer-content-padding', 'type' => 'number', 'defaultValue' => 0);
|
132 |
+
$options[] = array('name' => 'ycd-timer-bg-image', 'type' => 'checkbox', 'defaultValue' => 0);
|
133 |
+
$options[] = array('name' => 'ycd-timer-content-alignment', 'type' => 'text', 'defaultValue' => 'center');
|
134 |
|
135 |
+
// clock
|
136 |
+
$options[] = array('name' => 'ycd-clock1-time-zone', 'type' => 'text', 'defaultValue' => '');
|
137 |
+
$options[] = array('name' => 'ycd-clock1-width', 'type' => 'text', 'defaultValue' => 200);
|
138 |
+
$options[] = array('name' => 'ycd-clock1-alignment', 'type' => 'text', 'defaultValue' => 'center');
|
139 |
+
$options[] = array('name' => 'ycd-clock2-width', 'type' => 'text', 'defaultValue' => 200);
|
140 |
+
$options[] = array('name' => 'ycd-clock2-alignment', 'type' => 'text', 'defaultValue' => 'center');
|
141 |
+
$options[] = array('name' => 'ycd-clock3-width', 'type' => 'text', 'defaultValue' => 200);
|
142 |
+
$options[] = array('name' => 'ycd-clock3-alignment', 'type' => 'text', 'defaultValue' => 'center');
|
143 |
+
$options[] = array('name' => 'ycd-clock4-width', 'type' => 'text', 'defaultValue' => 200);
|
144 |
+
$options[] = array('name' => 'ycd-clock4-alignment', 'type' => 'text', 'defaultValue' => 'center');
|
145 |
+
$options[] = array('name' => 'ycd-clock5-width', 'type' => 'text', 'defaultValue' => 200);
|
146 |
+
$options[] = array('name' => 'ycd-clock5-alignment', 'type' => 'text', 'defaultValue' => 'center');
|
147 |
+
$options[] = array('name' => 'ycd-clock6-width', 'type' => 'text', 'defaultValue' => 200);
|
148 |
+
$options[] = array('name' => 'ycd-clock6-alignment', 'type' => 'text', 'defaultValue' => 'center');
|
149 |
+
$options[] = array('name' => 'ycd-clock7-width', 'type' => 'text', 'defaultValue' => 200);
|
150 |
+
$options[] = array('name' => 'ycd-clock7-alignment', 'type' => 'text', 'defaultValue' => 'center');
|
151 |
+
|
152 |
+
$options[] = array('name' => 'ycd-sticky-button-text', 'type' => 'text', 'defaultValue' => __('Checkout', YCD_TEXT_DOMAIN));
|
153 |
+
$options[] = array('name' => 'ycd-sticky-bg-color', 'type' => 'text', 'defaultValue' => '#000000');
|
154 |
+
$options[] = array('name' => 'ycd-sticky-button-color', 'type' => 'text', 'defaultValue' => '#fff');
|
155 |
+
$options[] = array('name' => 'ycd-sticky-text-color', 'type' => 'text', 'defaultValue' => '#fff');
|
156 |
+
$options[] = array('name' => 'ycd-sticky-text-background-color', 'type' => 'text', 'defaultValue' => '#555');
|
157 |
+
$options[] = array('name' => 'ycd-sticky-countdown-text-color', 'type' => 'text', 'defaultValue' => '#fff');
|
158 |
+
$options[] = array('name' => 'ycd-sticky-all-pages', 'type' => 'checkbox', 'defaultValue' => '');
|
159 |
+
|
160 |
+
if(YCD_PKG_VERSION > YCD_FREE_VERSION) {
|
161 |
+
require_once dirname(__FILE__) . '/proOptionsConfig.php';
|
162 |
+
}
|
163 |
|
164 |
+
$options[] = array('name' => 'ycd-countdown-hide-mobile', 'type' => 'checkbox', 'defaultValue' => '');
|
165 |
+
$options[] = array('name' => 'ycd-countdown-show-mobile', 'type' => 'checkbox', 'defaultValue' => '');
|
166 |
+
$options[] = array('name' => 'ycd-countdown-selected-countries', 'type' => 'checkbox', 'defaultValue' => '', 'available' => YCD_PLATINUM_VERSION);
|
167 |
+
$options[] = array('name' => 'ycd-counties-names', 'type' => 'array', 'defaultValue' => '');
|
168 |
+
$options[] = array('name' => 'ycd-countdown-end-sound', 'type' => 'checkbox', 'defaultValue' => '');
|
169 |
+
$options[] = array('name' => 'ycd-countdown-end-sound-url', 'type' => 'text', 'defaultValue' => YCD_COUNTDOWN_LIB_URL.'alarm.mp3');
|
170 |
+
$options[] = array('name' => 'ycd-enable-subscribe-form', 'type' => 'checkbox', 'defaultValue' => '');
|
171 |
+
$options[] = array('name' => 'ycd-subscribe-width', 'type' => 'text', 'defaultValue' => '100%');
|
172 |
+
$options[] = array('name' => 'ycd-form-above-text', 'type' => 'text', 'defaultValue' => __('Join Our Newsletter', YCD_TEXT_DOMAIN));
|
173 |
+
$options[] = array('name' => 'ycd-form-input-text', 'type' => 'text', 'defaultValue' => __('Enter your email here', YCD_TEXT_DOMAIN));
|
174 |
+
$options[] = array('name' => 'ycd-form-submit-text', 'type' => 'text', 'defaultValue' => __('Subscribe', YCD_TEXT_DOMAIN));
|
175 |
+
$options[] = array('name' => 'ycd-subscribe-success-message', 'type' => 'text', 'defaultValue' => __('Thanks for subscribing.', YCD_TEXT_DOMAIN));
|
176 |
+
$options[] = array('name' => 'ycd-subscribe-error-message', 'type' => 'text', 'defaultValue' => __('Invalid email address.', YCD_TEXT_DOMAIN));
|
177 |
+
$options[] = array('name' => 'ycd-form-submit-color', 'type' => 'text', 'defaultValue' => __('#3274d1', YCD_TEXT_DOMAIN));
|
178 |
+
$options[] = array('name' => 'ycd-stick-countdown-font-size', 'type' => 'text', 'defaultValue' => __('25', YCD_TEXT_DOMAIN));
|
179 |
|
180 |
+
$YCD_OPTIONS = apply_filters('ycdCountdownDefaultOptions', $options);
|
181 |
+
}
|
182 |
|
183 |
public static function getDefaultTimezone() {
|
184 |
$timezone = get_option('timezone_string');
|
config/proOptionsConfig.php
CHANGED
@@ -9,9 +9,9 @@ class proOptionsConfig {
|
|
9 |
// flip clock
|
10 |
$defaults[] = array('name' => 'ycd-flip-countdown-alignment', 'type' => 'text', 'defaultValue' => 'left');
|
11 |
$defaults[] = array('name' => 'ycd-flip-countdown-year', 'type' => 'checkbox', 'defaultValue' => '');
|
12 |
-
$defaults[] = array('name' => 'ycd-flip-countdown-year-text', 'type' => 'text', 'defaultValue' => __('
|
13 |
$defaults[] = array('name' => 'ycd-flip-countdown-week', 'type' => 'checkbox', 'defaultValue' => '');
|
14 |
-
$defaults[] = array('name' => 'ycd-flip-countdown-week-text', 'type' => 'text', 'defaultValue' => __('
|
15 |
$defaults[] = array('name' => 'ycd-flip-countdown-days', 'type' => 'checkbox', 'defaultValue' => 'on');
|
16 |
$defaults[] = array('name' => 'ycd-flip-countdown-days-text', 'type' => 'text', 'defaultValue' => __('DAYS', YCD_TEXT_DOMAIN));
|
17 |
$defaults[] = array('name' => 'ycd-flip-countdown-hours', 'type' => 'checkbox', 'defaultValue' => 'on');
|
@@ -23,6 +23,15 @@ class proOptionsConfig {
|
|
23 |
$defaults[] = array('name' => 'ycd-flip-countdown-expire-behavior', 'type' => 'text', 'defaultValue' => 'hideCountdown');
|
24 |
$defaults[] = array('name' => 'ycd-flip-expire-text', 'type' => 'html', 'defaultValue' => '');
|
25 |
$defaults[] = array('name' => 'ycd-flipclock-column-size', 'type' => 'html', 'defaultValue' => '1');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
26 |
|
27 |
return $defaults;
|
28 |
}
|
9 |
// flip clock
|
10 |
$defaults[] = array('name' => 'ycd-flip-countdown-alignment', 'type' => 'text', 'defaultValue' => 'left');
|
11 |
$defaults[] = array('name' => 'ycd-flip-countdown-year', 'type' => 'checkbox', 'defaultValue' => '');
|
12 |
+
$defaults[] = array('name' => 'ycd-flip-countdown-year-text', 'type' => 'text', 'defaultValue' => __('YEARS', YCD_TEXT_DOMAIN));
|
13 |
$defaults[] = array('name' => 'ycd-flip-countdown-week', 'type' => 'checkbox', 'defaultValue' => '');
|
14 |
+
$defaults[] = array('name' => 'ycd-flip-countdown-week-text', 'type' => 'text', 'defaultValue' => __('WEEKS', YCD_TEXT_DOMAIN));
|
15 |
$defaults[] = array('name' => 'ycd-flip-countdown-days', 'type' => 'checkbox', 'defaultValue' => 'on');
|
16 |
$defaults[] = array('name' => 'ycd-flip-countdown-days-text', 'type' => 'text', 'defaultValue' => __('DAYS', YCD_TEXT_DOMAIN));
|
17 |
$defaults[] = array('name' => 'ycd-flip-countdown-hours', 'type' => 'checkbox', 'defaultValue' => 'on');
|
23 |
$defaults[] = array('name' => 'ycd-flip-countdown-expire-behavior', 'type' => 'text', 'defaultValue' => 'hideCountdown');
|
24 |
$defaults[] = array('name' => 'ycd-flip-expire-text', 'type' => 'html', 'defaultValue' => '');
|
25 |
$defaults[] = array('name' => 'ycd-flipclock-column-size', 'type' => 'html', 'defaultValue' => '1');
|
26 |
+
|
27 |
+
$defaults[] = array('name' => 'ycd-woo-countdown-position', 'type' => 'text', 'defaultValue' => 'woocommerce_single_product_summary');
|
28 |
+
$defaults[] = array('name' => 'ycd-woo-countdown-text-color', 'type' => 'text', 'defaultValue' => '#ffffff');
|
29 |
+
$defaults[] = array('name' => 'ycd-woo-countdown-font-size', 'type' => 'text', 'defaultValue' => '25');
|
30 |
+
$defaults[] = array('name' => 'ycd-woo-show-products', 'type' => 'text', 'defaultValue' => 'showOnAll');
|
31 |
+
$defaults[] = array('name' => 'ycd-woo-enable-to-products', 'type' => 'checkbox', 'defaultValue' => '');
|
32 |
+
$defaults[] = array('name' => 'ycd-woo-selected-products', 'type' => 'html', 'defaultValue' => '');
|
33 |
+
$defaults[] = array('name' => 'ycd-woo-countdown-after-countdown', 'type' => 'html', 'defaultValue' => '');
|
34 |
+
$defaults[] = array('name' => 'ycd-woo-countdown-before-countdown', 'type' => 'html', 'defaultValue' => '');
|
35 |
|
36 |
return $defaults;
|
37 |
}
|
countdown-builder.php
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
/**
|
3 |
* Plugin Name: Countdown builder
|
4 |
* Description: The best countdown plugin
|
5 |
-
* Version: 1.3.
|
6 |
* Author: Adam Skaat
|
7 |
* Author URI: https://edmonsoft.com/countdown
|
8 |
* License: GPLv2
|
2 |
/**
|
3 |
* Plugin Name: Countdown builder
|
4 |
* Description: The best countdown plugin
|
5 |
+
* Version: 1.3.4
|
6 |
* Author: Adam Skaat
|
7 |
* Author URI: https://edmonsoft.com/countdown
|
8 |
* License: GPLv2
|
helpers/AdminHelper.php
CHANGED
@@ -56,6 +56,26 @@ class AdminHelper {
|
|
56 |
return $content;
|
57 |
}
|
58 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
59 |
public static function defaultData() {
|
60 |
|
61 |
$data = array();
|
@@ -120,6 +140,14 @@ class AdminHelper {
|
|
120 |
'italic' => __('Italic', YCD_TEXT_DOMAIN),
|
121 |
'initial' => __('Initial', YCD_TEXT_DOMAIN)
|
122 |
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
123 |
|
124 |
$data['font-family'] = array(
|
125 |
'inherit' => 'Inherit',
|
@@ -140,6 +168,91 @@ class AdminHelper {
|
|
140 |
'Montserrat' => 'Montserrat'
|
141 |
);
|
142 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
143 |
$data['countdownExpireTime'] = array(
|
144 |
'template' => array(
|
145 |
'fieldWrapperAttr' => array(
|
56 |
return $content;
|
57 |
}
|
58 |
|
59 |
+
private static function getAllProducts() {
|
60 |
+
$args = array(
|
61 |
+
'post_type' => 'product',
|
62 |
+
'posts_per_page' => YCD_PRODUCTS_LIMIT
|
63 |
+
);
|
64 |
+
$products = array();
|
65 |
+
|
66 |
+
$productsObj = get_posts($args);
|
67 |
+
|
68 |
+
if (empty($productsObj)) {
|
69 |
+
return $products;
|
70 |
+
}
|
71 |
+
|
72 |
+
foreach($productsObj as $product) {
|
73 |
+
$products[$product->ID] = $product->post_title;
|
74 |
+
}
|
75 |
+
|
76 |
+
return $products;
|
77 |
+
}
|
78 |
+
|
79 |
public static function defaultData() {
|
80 |
|
81 |
$data = array();
|
140 |
'italic' => __('Italic', YCD_TEXT_DOMAIN),
|
141 |
'initial' => __('Initial', YCD_TEXT_DOMAIN)
|
142 |
);
|
143 |
+
|
144 |
+
$data['woo-countdown-positions'] = array(
|
145 |
+
1 => __('Above the Title', YCD_TEXT_DOMAIN),
|
146 |
+
2 => __('Below the Title', YCD_TEXT_DOMAIN),
|
147 |
+
10 => __('Below the Price', YCD_TEXT_DOMAIN),
|
148 |
+
20 => __('Below Short Description', YCD_TEXT_DOMAIN),
|
149 |
+
30 => __('Below Add to Cart Button', YCD_TEXT_DOMAIN),
|
150 |
+
);
|
151 |
|
152 |
$data['font-family'] = array(
|
153 |
'inherit' => 'Inherit',
|
168 |
'Montserrat' => 'Montserrat'
|
169 |
);
|
170 |
|
171 |
+
$data['woo-products'] = self::getAllProducts();
|
172 |
+
|
173 |
+
$data['woo-show-products'] = array(
|
174 |
+
'template' => array(
|
175 |
+
'fieldWrapperAttr' => array(
|
176 |
+
'class' => 'col-md-6 ycd-choice-option-wrapper'
|
177 |
+
),
|
178 |
+
'labelAttr' => array(
|
179 |
+
'class' => 'col-md-6 ycd-choice-option-wrapper'
|
180 |
+
),
|
181 |
+
'groupWrapperAttr' => array(
|
182 |
+
'class' => 'row form-group ycd-choice-wrapper'
|
183 |
+
)
|
184 |
+
),
|
185 |
+
'buttonPosition' => 'right',
|
186 |
+
'nextNewLine' => true,
|
187 |
+
'fields' => array(
|
188 |
+
array(
|
189 |
+
'attr' => array(
|
190 |
+
'type' => 'radio',
|
191 |
+
'name' => 'ycd-woo-show-products',
|
192 |
+
'class' => 'ycd-woo-show-products',
|
193 |
+
'value' => 'showOnAll'
|
194 |
+
),
|
195 |
+
'label' => array(
|
196 |
+
'name' => __('Show on all products', YCD_TEXT_DOMAIN)
|
197 |
+
)
|
198 |
+
),
|
199 |
+
array(
|
200 |
+
'attr' => array(
|
201 |
+
'type' => 'radio',
|
202 |
+
'name' => 'ycd-woo-show-products',
|
203 |
+
'class' => 'ycd-woo-show-products',
|
204 |
+
'data-attr-href' => 'ycd-woo-selected-products',
|
205 |
+
'value' => 'selectedProducts'
|
206 |
+
),
|
207 |
+
'label' => array(
|
208 |
+
'name' => __('Show on all selected products', YCD_TEXT_DOMAIN)
|
209 |
+
)
|
210 |
+
)
|
211 |
+
)
|
212 |
+
);
|
213 |
+
|
214 |
+
$data['countdown-date-type'] = array(
|
215 |
+
'template' => array(
|
216 |
+
'fieldWrapperAttr' => array(
|
217 |
+
'class' => 'col-md-6 ycd-choice-option-wrapper'
|
218 |
+
),
|
219 |
+
'labelAttr' => array(
|
220 |
+
'class' => 'col-md-6 ycd-choice-option-wrapper'
|
221 |
+
),
|
222 |
+
'groupWrapperAttr' => array(
|
223 |
+
'class' => 'row form-group ycd-choice-wrapper'
|
224 |
+
)
|
225 |
+
),
|
226 |
+
'buttonPosition' => 'right',
|
227 |
+
'nextNewLine' => true,
|
228 |
+
'fields' => array(
|
229 |
+
array(
|
230 |
+
'attr' => array(
|
231 |
+
'type' => 'radio',
|
232 |
+
'name' => 'ycd-countdown-date-type',
|
233 |
+
'class' => 'ycd-date-duration',
|
234 |
+
'data-attr-href' => 'ycd-countdown-due-date',
|
235 |
+
'value' => 'dueDate'
|
236 |
+
),
|
237 |
+
'label' => array(
|
238 |
+
'name' => __('Due Date', YCD_TEXT_DOMAIN)
|
239 |
+
)
|
240 |
+
),
|
241 |
+
array(
|
242 |
+
'attr' => array(
|
243 |
+
'type' => 'radio',
|
244 |
+
'name' => 'ycd-countdown-date-type',
|
245 |
+
'class' => 'ycd-date-duration',
|
246 |
+
'data-attr-href' => 'ycd-date-duration',
|
247 |
+
'value' => 'duration'
|
248 |
+
),
|
249 |
+
'label' => array(
|
250 |
+
'name' => __('Duration', YCD_TEXT_DOMAIN)
|
251 |
+
)
|
252 |
+
)
|
253 |
+
)
|
254 |
+
);
|
255 |
+
|
256 |
$data['countdownExpireTime'] = array(
|
257 |
'template' => array(
|
258 |
'fieldWrapperAttr' => array(
|
readme.txt
CHANGED
@@ -2,8 +2,8 @@
|
|
2 |
Contributors: adamskaat
|
3 |
Tags: countdown, timer, countdown timer
|
4 |
Requires at least: 3.8
|
5 |
-
Tested up to: 5.0.
|
6 |
-
Stable tag: 1.3.
|
7 |
Requires PHP: 5.3
|
8 |
License: GPLv2 or later
|
9 |
License URI: https://www.gnu.org/licenses/gpl-2.0.html
|
@@ -32,12 +32,9 @@ Countdown types
|
|
32 |
* Clock 7
|
33 |
* Sticky Countdown
|
34 |
* Circle countdown & popup
|
35 |
-
*
|
36 |
-
*
|
37 |
-
|
38 |
-
Coming soon
|
39 |
-
|
40 |
-
WooCommerce countdown
|
41 |
|
42 |
How to create Countdown example
|
43 |
|
@@ -55,6 +52,13 @@ Coming soon
|
|
55 |
|
56 |
== Changelog ==
|
57 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
58 |
= 1.3.3 =
|
59 |
* Circle countdown months and year support
|
60 |
* Time zone change issue on the Internet Explorer
|
2 |
Contributors: adamskaat
|
3 |
Tags: countdown, timer, countdown timer
|
4 |
Requires at least: 3.8
|
5 |
+
Tested up to: 5.0.3
|
6 |
+
Stable tag: 1.3.4
|
7 |
Requires PHP: 5.3
|
8 |
License: GPLv2 or later
|
9 |
License URI: https://www.gnu.org/licenses/gpl-2.0.html
|
32 |
* Clock 7
|
33 |
* Sticky Countdown
|
34 |
* Circle countdown & popup
|
35 |
+
* Flipclock countdwon
|
36 |
+
* Flipclock countdwon & popup
|
37 |
+
* WooCommerce countdown
|
|
|
|
|
|
|
38 |
|
39 |
How to create Countdown example
|
40 |
|
52 |
|
53 |
== Changelog ==
|
54 |
|
55 |
+
= 1.3.4 =
|
56 |
+
* Countdown date duration option(new)
|
57 |
+
* WooCommerce Countdown (new)
|
58 |
+
* Countdown create bug fixed
|
59 |
+
* Countdown issue on iPhone
|
60 |
+
* Code improvement
|
61 |
+
|
62 |
= 1.3.3 =
|
63 |
* Circle countdown months and year support
|
64 |
* Time zone change issue on the Internet Explorer
|