Version Description
Current Version of Popup Builder is 2.3.6
Download this release
Release Info
Developer | Sygnoos |
Plugin | Popup Builder – Responsive WordPress Pop up |
Version | 2.3.6 |
Comparing to | |
See all releases |
Code changes from version 2.3.5 to 2.3.6
- classes/SGFblikePopup.php +1 -1
- classes/SGHtmlPopup.php +1 -1
- classes/SGPopup.php +7 -7
- classes/SGPopupBuilderMain.php +11 -8
- classes/SGShortcodePopup.php +1 -1
- config.php +1 -1
- files/sg_admin_post.php +20 -5
- files/sg_functions.php +57 -9
- files/sg_popup_ajax.php +15 -6
- files/sg_popup_create_new.php +49 -4
- files/sg_popup_save.php +35 -14
- files/sg_popup_settings.php +36 -10
- helpers/SgPopupGetData.php +63 -2
- img/proOptions.png +0 -0
- javascript/sg_popup_backend.js +1 -1
- javascript/sg_popup_frontend.js +23 -0
- popup-builder.php +14 -15
- readme.txt +42 -12
- style/sg_popup_style.css +23 -19
- style/sg_popup_style.php +2 -0
classes/SGFblikePopup.php
CHANGED
@@ -112,7 +112,7 @@ class SGFblikePopup extends SGPopup
|
|
112 |
/*Append to body for shortcode break to new line*/
|
113 |
echo "<script type=\"text/javascript\">
|
114 |
jQuery(document).ready(function() {
|
115 |
-
jQuery('body').append(
|
116 |
});
|
117 |
</script>";
|
118 |
$content = ' ';
|
112 |
/*Append to body for shortcode break to new line*/
|
113 |
echo "<script type=\"text/javascript\">
|
114 |
jQuery(document).ready(function() {
|
115 |
+
jQuery('body').append(jQuery('".$currentPopupContent."'));
|
116 |
});
|
117 |
</script>";
|
118 |
$content = ' ';
|
classes/SGHtmlPopup.php
CHANGED
@@ -62,7 +62,7 @@ class SGHtmlPopup extends SGPopup {
|
|
62 |
/*Append to body for shortcode break to new line*/
|
63 |
echo "<script type=\"text/javascript\">
|
64 |
jQuery(document).ready(function() {
|
65 |
-
jQuery('body').append(
|
66 |
});
|
67 |
</script>";
|
68 |
$content = ' ';
|
62 |
/*Append to body for shortcode break to new line*/
|
63 |
echo "<script type=\"text/javascript\">
|
64 |
jQuery(document).ready(function() {
|
65 |
+
jQuery('body').append(jQuery('".$currentPopupContent."'));
|
66 |
});
|
67 |
</script>";
|
68 |
$content = ' ';
|
classes/SGPopup.php
CHANGED
@@ -317,7 +317,7 @@ abstract class SGPopup {
|
|
317 |
return $isInArray;
|
318 |
}
|
319 |
|
320 |
-
public static function addPopupForAllPages($id = '', $selectedData = '') {
|
321 |
global $wpdb;
|
322 |
|
323 |
$values = array();
|
@@ -326,21 +326,21 @@ abstract class SGPopup {
|
|
326 |
//Remove page if it is in use for another popup
|
327 |
//self::deleteAllPagesPopup($selectedData);
|
328 |
|
329 |
-
$insertQuery = "INSERT INTO ". $wpdb->prefix ."sg_popup_in_pages(popupId, pageId) VALUES ";
|
330 |
|
331 |
foreach ($selectedData as $value) {
|
332 |
-
$insertPreapre[] .= $wpdb->prepare( "(%d,%d)", $id, $value );
|
333 |
}
|
334 |
$insertQuery .= implode( ",\n", $insertPreapre );
|
335 |
$res = $wpdb->query($insertQuery);
|
336 |
}
|
337 |
|
338 |
-
public static function removePopupFromPages($popupId)
|
339 |
{
|
340 |
global $wpdb;
|
341 |
/*Remove all pages and posts from the array*/
|
342 |
self::removeFromAllPages($popupId);
|
343 |
-
$query = $wpdb->prepare('DELETE FROM '.$wpdb->prefix.'sg_popup_in_pages WHERE popupId = %d', $popupId);
|
344 |
$wpdb->query($query);
|
345 |
}
|
346 |
|
@@ -382,10 +382,10 @@ abstract class SGPopup {
|
|
382 |
$deleteRes = $wpdb->query($deleteQuery);
|
383 |
}
|
384 |
|
385 |
-
public static function findInAllSelectedPages($pageId) {
|
386 |
global $wpdb;
|
387 |
|
388 |
-
$st = $wpdb->prepare("SELECT * FROM ". $wpdb->prefix ."sg_popup_in_pages WHERE pageId = %d", $pageId);
|
389 |
$arr = $wpdb->get_results($st, ARRAY_A);
|
390 |
if(!$arr) return false;
|
391 |
return $arr;
|
317 |
return $isInArray;
|
318 |
}
|
319 |
|
320 |
+
public static function addPopupForAllPages($id = '', $selectedData = '', $type) {
|
321 |
global $wpdb;
|
322 |
|
323 |
$values = array();
|
326 |
//Remove page if it is in use for another popup
|
327 |
//self::deleteAllPagesPopup($selectedData);
|
328 |
|
329 |
+
$insertQuery = "INSERT INTO ". $wpdb->prefix ."sg_popup_in_pages(popupId, pageId, type) VALUES ";
|
330 |
|
331 |
foreach ($selectedData as $value) {
|
332 |
+
$insertPreapre[] .= $wpdb->prepare( "(%d,%d,%s)", $id, $value, $type);
|
333 |
}
|
334 |
$insertQuery .= implode( ",\n", $insertPreapre );
|
335 |
$res = $wpdb->query($insertQuery);
|
336 |
}
|
337 |
|
338 |
+
public static function removePopupFromPages($popupId, $type)
|
339 |
{
|
340 |
global $wpdb;
|
341 |
/*Remove all pages and posts from the array*/
|
342 |
self::removeFromAllPages($popupId);
|
343 |
+
$query = $wpdb->prepare('DELETE FROM '.$wpdb->prefix.'sg_popup_in_pages WHERE popupId = %d and type=%s', $popupId, $type);
|
344 |
$wpdb->query($query);
|
345 |
}
|
346 |
|
382 |
$deleteRes = $wpdb->query($deleteQuery);
|
383 |
}
|
384 |
|
385 |
+
public static function findInAllSelectedPages($pageId, $type) {
|
386 |
global $wpdb;
|
387 |
|
388 |
+
$st = $wpdb->prepare("SELECT * FROM ". $wpdb->prefix ."sg_popup_in_pages WHERE pageId = %d and type=%s", $pageId, $type);
|
389 |
$arr = $wpdb->get_results($st, ARRAY_A);
|
390 |
if(!$arr) return false;
|
391 |
return $arr;
|
classes/SGPopupBuilderMain.php
CHANGED
@@ -13,16 +13,19 @@ class SGPopupBuilderMain {
|
|
13 |
}
|
14 |
|
15 |
public function sgAddMenu($args) {
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
add_submenu_page("PopupBuilder", "
|
|
|
|
|
|
|
22 |
if (POPUP_BUILDER_PKG > POPUP_BUILDER_PKG_SILVER) {
|
23 |
-
add_submenu_page("PopupBuilder", "Subscribers", "Subscribers", '
|
24 |
}
|
25 |
-
add_submenu_page("PopupBuilder", "More plugins", "More plugins", '
|
26 |
}
|
27 |
|
28 |
public function sgPopupMenu() {
|
13 |
}
|
14 |
|
15 |
public function sgAddMenu($args) {
|
16 |
+
$showCurrentUser = SGFunctions::isShowMenuForCurrentUser();
|
17 |
+
if(!$showCurrentUser) {
|
18 |
+
return false;
|
19 |
+
}
|
20 |
+
add_menu_page("Popup Builder", "Popup Builder", "read","PopupBuilder", array($this, "sgPopupMenu"),"dashicons-welcome-widgets-menus");
|
21 |
+
add_submenu_page("PopupBuilder", "All Popups", "All Popups", 'read', "PopupBuilder", array($this, "sgPopupMenu"));
|
22 |
+
add_submenu_page("PopupBuilder", "Add New", "Add New", 'read', "create-popup", array($this,"sgCreatePopup"));
|
23 |
+
add_submenu_page("PopupBuilder", "Edit Popup", "Edit Popup", 'read', "edit-popup", array($this,"sgEditPopup"));
|
24 |
+
add_submenu_page("PopupBuilder", "Settings", "Settings", 'read', "popup-settings", array($this,"sgPopupSettings"));
|
25 |
if (POPUP_BUILDER_PKG > POPUP_BUILDER_PKG_SILVER) {
|
26 |
+
add_submenu_page("PopupBuilder", "Subscribers", "Subscribers", 'read', "subscribers", array($this,"sgSubscribers"));
|
27 |
}
|
28 |
+
add_submenu_page("PopupBuilder", "More plugins", "More plugins", 'read', "more-plugins", array($this,"showMorePlugins"));
|
29 |
}
|
30 |
|
31 |
public function sgPopupMenu() {
|
classes/SGShortcodePopup.php
CHANGED
@@ -54,7 +54,7 @@ class SGShortcodePopup extends SGPopup {
|
|
54 |
/*Append to body for shortcode break to new line*/
|
55 |
echo "<script type=\"text/javascript\">
|
56 |
jQuery(document).ready(function() {
|
57 |
-
jQuery('body').append(
|
58 |
});
|
59 |
</script>";
|
60 |
|
54 |
/*Append to body for shortcode break to new line*/
|
55 |
echo "<script type=\"text/javascript\">
|
56 |
jQuery(document).ready(function() {
|
57 |
+
jQuery('body').append(jQuery('".$currentPopupContent."'));
|
58 |
});
|
59 |
</script>";
|
60 |
|
config.php
CHANGED
@@ -9,7 +9,7 @@ define('SG_APP_POPUP_CLASSES', SG_APP_POPUP_PATH . '/classes');
|
|
9 |
define('SG_APP_POPUP_JS', SG_APP_POPUP_PATH . '/javascript');
|
10 |
define('SG_APP_POPUP_HELPERS', SG_APP_POPUP_PATH . '/helpers/');
|
11 |
define('SG_APP_POPUP_TABLE_LIMIT', 15);
|
12 |
-
define('SG_POPUP_VERSION', 2.
|
13 |
define('SG_POPUP_PRO_URL', 'http://popup-builder.com/');
|
14 |
define('SG_POPUP_EXTENTIONS_URL', 'http://popup-builder.com/extensions');
|
15 |
define('SG_MAILCHIMP_EXTENTION_URL', 'http://popup-builder.com/mailchimp/');
|
9 |
define('SG_APP_POPUP_JS', SG_APP_POPUP_PATH . '/javascript');
|
10 |
define('SG_APP_POPUP_HELPERS', SG_APP_POPUP_PATH . '/helpers/');
|
11 |
define('SG_APP_POPUP_TABLE_LIMIT', 15);
|
12 |
+
define('SG_POPUP_VERSION', 2.36);
|
13 |
define('SG_POPUP_PRO_URL', 'http://popup-builder.com/');
|
14 |
define('SG_POPUP_EXTENTIONS_URL', 'http://popup-builder.com/extensions');
|
15 |
define('SG_MAILCHIMP_EXTENTION_URL', 'http://popup-builder.com/mailchimp/');
|
files/sg_admin_post.php
CHANGED
@@ -85,7 +85,7 @@ add_action('admin_post_popup_clone', 'sgPopupClone');
|
|
85 |
|
86 |
function sgPopupDataExport() {
|
87 |
global $wpdb;
|
88 |
-
|
89 |
$allData = array();
|
90 |
$exportArray = array();
|
91 |
$wpOptions = array();
|
@@ -111,6 +111,9 @@ function sgPopupDataExport() {
|
|
111 |
else if($type == 'contactForm') {
|
112 |
$type = "contact_form";
|
113 |
}
|
|
|
|
|
|
|
114 |
$table = "sg_".$type."_popup";
|
115 |
$tableName = $wpdb->prefix.$table;
|
116 |
|
@@ -156,7 +159,7 @@ function sgPopupDataExport() {
|
|
156 |
$allData['customData'] = $customTablesData;
|
157 |
$allData['customTablesColumsName'] = $customTablesColumsName;
|
158 |
$allData['wpOptions'] = $wpOptions;
|
159 |
-
|
160 |
header("Pragma: public");
|
161 |
header("Expires: 0");
|
162 |
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
|
@@ -168,6 +171,16 @@ function sgPopupDataExport() {
|
|
168 |
}
|
169 |
|
170 |
add_action('admin_post_popup_export', 'sgPopupDataExport');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
171 |
|
172 |
function sgPopupSaveSettings() {
|
173 |
|
@@ -175,11 +188,13 @@ function sgPopupSaveSettings() {
|
|
175 |
|
176 |
$st = $wpdb->prepare("SELECT options FROM ". $wpdb->prefix ."sg_popup_settings WHERE id = %d",1);
|
177 |
$options = $wpdb->get_row($st, ARRAY_A);
|
178 |
-
|
179 |
$settingsOptions = array(
|
180 |
-
'
|
|
|
|
|
181 |
);
|
182 |
-
|
183 |
$settingsOptions = json_encode($settingsOptions);
|
184 |
if(is_null($options) || empty($options)) {
|
185 |
|
85 |
|
86 |
function sgPopupDataExport() {
|
87 |
global $wpdb;
|
88 |
+
|
89 |
$allData = array();
|
90 |
$exportArray = array();
|
91 |
$wpOptions = array();
|
111 |
else if($type == 'contactForm') {
|
112 |
$type = "contact_form";
|
113 |
}
|
114 |
+
else if($type == 'shortcode') {
|
115 |
+
$type = "shortCode";
|
116 |
+
}
|
117 |
$table = "sg_".$type."_popup";
|
118 |
$tableName = $wpdb->prefix.$table;
|
119 |
|
159 |
$allData['customData'] = $customTablesData;
|
160 |
$allData['customTablesColumsName'] = $customTablesColumsName;
|
161 |
$allData['wpOptions'] = $wpOptions;
|
162 |
+
|
163 |
header("Pragma: public");
|
164 |
header("Expires: 0");
|
165 |
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
|
171 |
}
|
172 |
|
173 |
add_action('admin_post_popup_export', 'sgPopupDataExport');
|
174 |
+
function sgSanitizeField($key, $isTextField = false) {
|
175 |
+
|
176 |
+
if (isset($_POST[$key])) {
|
177 |
+
if($isTextField) {
|
178 |
+
return wp_kses_post($_POST[$key]);
|
179 |
+
}
|
180 |
+
return sanitize_text_field($_POST[$key]);
|
181 |
+
}
|
182 |
+
return "";
|
183 |
+
}
|
184 |
|
185 |
function sgPopupSaveSettings() {
|
186 |
|
188 |
|
189 |
$st = $wpdb->prepare("SELECT options FROM ". $wpdb->prefix ."sg_popup_settings WHERE id = %d",1);
|
190 |
$options = $wpdb->get_row($st, ARRAY_A);
|
191 |
+
|
192 |
$settingsOptions = array(
|
193 |
+
'plugin_users_role' => sgSanitizeField('plugin_users_role', true),
|
194 |
+
'tables-delete-status' => sgSanitizeField('tables-delete-status'),
|
195 |
+
'sg-popup-time-zone' => sgSanitizeField('sg-popup-time-zone')
|
196 |
);
|
197 |
+
|
198 |
$settingsOptions = json_encode($settingsOptions);
|
199 |
if(is_null($options) || empty($options)) {
|
200 |
|
files/sg_functions.php
CHANGED
@@ -19,21 +19,21 @@ class SGFunctions
|
|
19 |
$arr = $wpdb->get_row($st,ARRAY_A);
|
20 |
$options = json_decode($arr['options'], true);
|
21 |
$deleteStatus = ($options['tables-delete-status'] == 'on' ? true: false);
|
22 |
-
|
23 |
return $deleteStatus;
|
24 |
}
|
25 |
|
26 |
public static function addReview()
|
27 |
{
|
28 |
return '<div class="updated updated notice is-dismissible reviewPanel sg-review-panel">
|
29 |
-
<div class="reviewPanelContent">
|
30 |
<span class="reviewPanelSpan">
|
31 |
-
Dear user, we always do our best to help you and your opinion is very important for us!
|
32 |
</span></br>
|
33 |
<span class="reviewPanelSpan">
|
34 |
So if you liked our <b>Popup Builder Plugin</b> and if our support was helpful for you, we\'ll be thankful if you go ahead and leave a review.
|
35 |
</span>
|
36 |
-
<span class="reviewPanelSpan">
|
37 |
Please <a class="reviewPanelHref" href="https://wordpress.org/support/view/plugin-reviews/popup-builder?filter=5" target=\"_blank\">rate it 5 stars.</a>
|
38 |
</span>
|
39 |
</div>
|
@@ -47,6 +47,42 @@ class SGFunctions
|
|
47 |
return $notice;
|
48 |
}
|
49 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
50 |
public static function sgCreateRadioElements($radioElements, $checkedValue)
|
51 |
{
|
52 |
$content = '';
|
@@ -93,9 +129,9 @@ class SGFunctions
|
|
93 |
public static function getCountryName($ip)
|
94 |
{
|
95 |
if(empty($_COOKIE['SG_POPUP_USER_COUNTRY_NAME'])) {
|
96 |
-
|
97 |
try {
|
98 |
-
|
99 |
$details = wp_remote_get(SG_IP_TO_COUNTRY_SERVICE_URL.$ip."&".SG_IP_TO_COUNTRY_SERVICE_TOKEN, array( 'timeout' => SG_IP_TO_COUNTRY_SERVICE_TIMEOUT));$details = wp_remote_get(SG_IP_TO_COUNTRY_SERVICE_URL.$ip."&".SG_IP_TO_COUNTRY_SERVICE_TOKEN, array( 'timeout' => SG_IP_TO_COUNTRY_SERVICE_TIMEOUT));
|
100 |
$dataIp = json_decode($details['body'], true);
|
101 |
if(!is_array($dataIp)) {
|
@@ -106,12 +142,12 @@ class SGFunctions
|
|
106 |
catch ( Exception $ex ) {
|
107 |
return true;
|
108 |
}
|
109 |
-
|
110 |
}
|
111 |
else {
|
112 |
$counrty = $_COOKIE['SG_POPUP_USER_COUNTRY_NAME'];
|
113 |
}
|
114 |
-
|
115 |
return $counrty;
|
116 |
}
|
117 |
|
@@ -135,6 +171,18 @@ class SGFunctions
|
|
135 |
return false;
|
136 |
}
|
137 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
138 |
public static function countrisSelect() {
|
139 |
|
140 |
return '<select id="sameWidthinputs" name="countris" class="optionsCountry" data-role="tagsinput">
|
@@ -389,4 +437,4 @@ class SGFunctions
|
|
389 |
<option value="ZW">Zimbabwe</option>
|
390 |
</select>';
|
391 |
}
|
392 |
-
}
|
19 |
$arr = $wpdb->get_row($st,ARRAY_A);
|
20 |
$options = json_decode($arr['options'], true);
|
21 |
$deleteStatus = ($options['tables-delete-status'] == 'on' ? true: false);
|
22 |
+
|
23 |
return $deleteStatus;
|
24 |
}
|
25 |
|
26 |
public static function addReview()
|
27 |
{
|
28 |
return '<div class="updated updated notice is-dismissible reviewPanel sg-review-panel">
|
29 |
+
<div class="reviewPanelContent">
|
30 |
<span class="reviewPanelSpan">
|
31 |
+
Dear user, we always do our best to help you and your opinion is very important for us!
|
32 |
</span></br>
|
33 |
<span class="reviewPanelSpan">
|
34 |
So if you liked our <b>Popup Builder Plugin</b> and if our support was helpful for you, we\'ll be thankful if you go ahead and leave a review.
|
35 |
</span>
|
36 |
+
<span class="reviewPanelSpan">
|
37 |
Please <a class="reviewPanelHref" href="https://wordpress.org/support/view/plugin-reviews/popup-builder?filter=5" target=\"_blank\">rate it 5 stars.</a>
|
38 |
</span>
|
39 |
</div>
|
47 |
return $notice;
|
48 |
}
|
49 |
|
50 |
+
public static function createSelectBox($data, $selectedValue, $attrs) {
|
51 |
+
|
52 |
+
$attrString = '';
|
53 |
+
$selected = '';
|
54 |
+
|
55 |
+
if(!empty($attrs) && isset($attrs)) {
|
56 |
+
|
57 |
+
foreach ($attrs as $attrName => $attrValue) {
|
58 |
+
$attrString .= ''.$attrName.'="'.$attrValue.'" ';
|
59 |
+
}
|
60 |
+
}
|
61 |
+
|
62 |
+
$selectBox = '<select '.$attrString.'>';
|
63 |
+
|
64 |
+
foreach ($data as $value => $label) {
|
65 |
+
|
66 |
+
/*When is multiselect*/
|
67 |
+
if(is_array($selectedValue)) {
|
68 |
+
$isSelected = in_array($value, $selectedValue);
|
69 |
+
if($isSelected) {
|
70 |
+
$selected = 'selected';
|
71 |
+
}
|
72 |
+
}
|
73 |
+
else if($selectedValue == $value) {
|
74 |
+
$selected = 'selected';
|
75 |
+
}
|
76 |
+
|
77 |
+
$selectBox .= '<option value="'.$value.'" '.$selected.'>'.$label.'</option>';
|
78 |
+
$selected = '';
|
79 |
+
}
|
80 |
+
|
81 |
+
$selectBox .= '</select>';
|
82 |
+
|
83 |
+
return $selectBox;
|
84 |
+
}
|
85 |
+
|
86 |
public static function sgCreateRadioElements($radioElements, $checkedValue)
|
87 |
{
|
88 |
$content = '';
|
129 |
public static function getCountryName($ip)
|
130 |
{
|
131 |
if(empty($_COOKIE['SG_POPUP_USER_COUNTRY_NAME'])) {
|
132 |
+
|
133 |
try {
|
134 |
+
|
135 |
$details = wp_remote_get(SG_IP_TO_COUNTRY_SERVICE_URL.$ip."&".SG_IP_TO_COUNTRY_SERVICE_TOKEN, array( 'timeout' => SG_IP_TO_COUNTRY_SERVICE_TIMEOUT));$details = wp_remote_get(SG_IP_TO_COUNTRY_SERVICE_URL.$ip."&".SG_IP_TO_COUNTRY_SERVICE_TOKEN, array( 'timeout' => SG_IP_TO_COUNTRY_SERVICE_TIMEOUT));
|
136 |
$dataIp = json_decode($details['body'], true);
|
137 |
if(!is_array($dataIp)) {
|
142 |
catch ( Exception $ex ) {
|
143 |
return true;
|
144 |
}
|
145 |
+
|
146 |
}
|
147 |
else {
|
148 |
$counrty = $_COOKIE['SG_POPUP_USER_COUNTRY_NAME'];
|
149 |
}
|
150 |
+
|
151 |
return $counrty;
|
152 |
}
|
153 |
|
171 |
return false;
|
172 |
}
|
173 |
|
174 |
+
public static function isShowMenuForCurrentUser() {
|
175 |
+
$usersSelectedRoles = SgPopupGetData::getValue('plugin_users_role', 'settings');
|
176 |
+
|
177 |
+
$currentUserRole = SgPopupGetData::getCurrentUserRole();
|
178 |
+
|
179 |
+
/*When user is admintrator or this user is in selected rules*/
|
180 |
+
if(@in_array($currentUserRole, $usersSelectedRoles) || $currentUserRole == 'sgpb_administrator') {
|
181 |
+
return true;
|
182 |
+
}
|
183 |
+
return false;
|
184 |
+
}
|
185 |
+
|
186 |
public static function countrisSelect() {
|
187 |
|
188 |
return '<select id="sameWidthinputs" name="countris" class="optionsCountry" data-role="tagsinput">
|
437 |
<option value="ZW">Zimbabwe</option>
|
438 |
</select>';
|
439 |
}
|
440 |
+
}
|
files/sg_popup_ajax.php
CHANGED
@@ -121,13 +121,22 @@ function sgImportPopups()
|
|
121 |
//Foreach throw child popups
|
122 |
foreach ($childPopupData as $childPopup) {
|
123 |
//Child popup table columns
|
|
|
124 |
$columns = implode(array_keys($childPopup), ', ');
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
$
|
130 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
131 |
echo 'ChildRes: '.$resa;
|
132 |
}
|
133 |
echo 'MainRes: '.$res;
|
121 |
//Foreach throw child popups
|
122 |
foreach ($childPopupData as $childPopup) {
|
123 |
//Child popup table columns
|
124 |
+
$values = '';
|
125 |
$columns = implode(array_keys($childPopup), ', ');
|
126 |
+
//$values = "'".implode(array_values($childPopup), "','")."'";
|
127 |
+
foreach (array_values($childPopup) as $value) {
|
128 |
+
$values .= "'".addslashes($value)."', ";
|
129 |
+
}
|
130 |
+
$values = rtrim($values, ', ');
|
131 |
+
|
132 |
+
$queryValues = str_repeat("%s, ", count(array_keys($childPopup)));
|
133 |
+
$queryValues = "%d, ".rtrim($queryValues, ', ');
|
134 |
+
|
135 |
+
$queryStr = 'INSERT INTO '.$wpdb->prefix.$childPopupTableName.'(id, '.$columns.') VALUES ('.$lastInsertId.','. $values.')';
|
136 |
+
//$sql = $wpdb->prepare($queryStr,$lastInsertId, $valuess);
|
137 |
+
|
138 |
+
$resa = $wpdb->query($queryStr);
|
139 |
+
|
140 |
echo 'ChildRes: '.$resa;
|
141 |
}
|
142 |
echo 'MainRes: '.$res;
|
files/sg_popup_create_new.php
CHANGED
@@ -63,6 +63,7 @@
|
|
63 |
$sgCountdownLang = $countdownOptions['counts-language'];
|
64 |
@$sgCountdownPosition = $countdownOptions['coundown-position'];
|
65 |
@$sgSelectedTimeZone = $countdownOptions['sg-time-zone'];
|
|
|
66 |
break;
|
67 |
case 'social':
|
68 |
$sgSocialContent = ($result->getSocialContent());
|
@@ -99,6 +100,8 @@
|
|
99 |
$sgPopupFixed = @$jsonData['popupFixed'];
|
100 |
$sgFixedPostion = @$jsonData['fixedPostion'];
|
101 |
$sgOnScrolling = @$jsonData['onScrolling'];
|
|
|
|
|
102 |
$beforeScrolingPrsent = @$jsonData['beforeScrolingPrsent'];
|
103 |
$duration = @$jsonData['duration'];
|
104 |
$delay = @$jsonData['delay'];
|
@@ -114,6 +117,7 @@
|
|
114 |
$sgOpenOnMobile = @$jsonData['openMobile'];
|
115 |
$sgAllPagesStatus = @$jsonData['allPagesStatus'];
|
116 |
$sgAllPostsStatus = @$jsonData['allPostsStatus'];
|
|
|
117 |
$sgRepeatPopup = @$jsonData['repeatPopup'];
|
118 |
$sgPopupAppearNumberLimit = @$jsonData['popup-appear-number-limit'];
|
119 |
$sgDisablePopup = @$jsonData['disablePopup'];
|
@@ -132,8 +136,13 @@
|
|
132 |
$sgCountryName = @$jsonData['countryName'];
|
133 |
$sgCountryIso = @$jsonData['countryIso'];
|
134 |
$sgPopupTimerStatus = @$jsonData['popup-timer-status'];
|
|
|
|
|
|
|
|
|
135 |
$sgPopupFinishTimer = @$jsonData['popup-finish-timer'];
|
136 |
$sgPopupStartTimer = @$jsonData['popup-start-timer'];
|
|
|
137 |
$sgColorboxTheme = @$jsonData['theme'];
|
138 |
$sgOverlayCustomClasss = @$jsonData['sgOverlayCustomClasss'];
|
139 |
$sgContentCustomClasss = @$jsonData['sgContentCustomClasss'];
|
@@ -243,8 +252,8 @@
|
|
243 |
'scrolling'=> true,
|
244 |
'opacity'=>0.8,
|
245 |
'reposition' => true,
|
246 |
-
'width' =>
|
247 |
-
'height' =>
|
248 |
'initialWidth' => '300',
|
249 |
'initialHeight' => '100',
|
250 |
'maxWidth' => false,
|
@@ -265,6 +274,8 @@
|
|
265 |
$popupProDefaultValues = array(
|
266 |
'closeType' => false,
|
267 |
'onScrolling' => false,
|
|
|
|
|
268 |
'video-autoplay' => false,
|
269 |
'forMobile' => false,
|
270 |
'openMobile' => false,
|
@@ -298,10 +309,14 @@
|
|
298 |
'countdownNumbersBgColor' => '',
|
299 |
'countDownLang' => 'English',
|
300 |
'popup-timer-status' => false,
|
|
|
301 |
'countdown-position' => true,
|
|
|
302 |
'time-zone' => 'Etc/GMT',
|
|
|
303 |
'due-date' => date('M d y H:i', strtotime(' +1 day')),
|
304 |
-
'popup-start-timer' => date('M d
|
|
|
305 |
'exit-intent-type' => "soft",
|
306 |
'exit-intent-expire-time' => '1',
|
307 |
'subs-first-name-status' => true,
|
@@ -350,10 +365,12 @@
|
|
350 |
|
351 |
$closeType = sgBoolToChecked($popupProDefaultValues['closeType']);
|
352 |
$onScrolling = sgBoolToChecked($popupProDefaultValues['onScrolling']);
|
|
|
353 |
$userSeperate = sgBoolToChecked($popupProDefaultValues['sg-user-status']);
|
354 |
$forMobile = sgBoolToChecked($popupProDefaultValues['forMobile']);
|
355 |
$openMobile = sgBoolToChecked($popupProDefaultValues['openMobile']);
|
356 |
$popupTimerStatus = sgBoolToChecked($popupProDefaultValues['popup-timer-status']);
|
|
|
357 |
$repetPopup = sgBoolToChecked($popupProDefaultValues['repetPopup']);
|
358 |
$disablePopup = sgBoolToChecked($popupProDefaultValues['disablePopup']);
|
359 |
$disablePopupOverlay = sgBoolToChecked($popupProDefaultValues['disablePopupOverlay']);
|
@@ -366,6 +383,7 @@
|
|
366 |
$pinterestStatus = sgBoolToChecked($popupProDefaultValues['pinterestStatus']);
|
367 |
$socialLabel = sgBoolToChecked($popupProDefaultValues['sgSocialLabel']);
|
368 |
$roundButtons = sgBoolToChecked($popupProDefaultValues['roundButtons']);
|
|
|
369 |
$shareUrl = $popupProDefaultValues['sgShareUrl'];
|
370 |
$pushToBottom = sgBoolToChecked($popupProDefaultValues['pushToBottom']);
|
371 |
$allPages = $popupProDefaultValues['allPages'];
|
@@ -387,8 +405,11 @@
|
|
387 |
$countdownLang = $popupProDefaultValues['countDownLang'];
|
388 |
$countdownPosition = $popupProDefaultValues['countdown-position'];
|
389 |
$timeZone = $popupProDefaultValues['time-zone'];
|
|
|
390 |
$dueDate = $popupProDefaultValues['due-date'];
|
391 |
$popupStartTimer = $popupProDefaultValues['popup-start-timer'];
|
|
|
|
|
392 |
$exitIntentType = $popupProDefaultValues['exit-intent-type'];
|
393 |
$exitIntentExpireTime = $popupProDefaultValues['exit-intent-expire-time'];
|
394 |
$subsFirstNameStatus = sgBoolToChecked($popupProDefaultValues['subs-first-name-status']);
|
@@ -456,13 +477,16 @@
|
|
456 |
$sgOverlayClose = @sgSetChecked($sgOverlayClose, $overlayClose);
|
457 |
$sgReposition = @sgSetChecked($sgReposition, $reposition);
|
458 |
$sgScrolling = @sgSetChecked($sgScrolling, $scrolling);
|
|
|
459 |
|
460 |
$sgCloseType = @sgSetChecked($sgCloseType, $closeType);
|
461 |
$sgOnScrolling = @sgSetChecked($sgOnScrolling, $onScrolling);
|
|
|
462 |
$sgForMobile = @sgSetChecked($sgForMobile, $forMobile);
|
463 |
$sgOpenOnMobile = @sgSetChecked($sgOpenOnMobile, $openMobile);
|
464 |
$sgUserSeperate = @sgSetChecked($sgUserSeperate, $userSeperate);
|
465 |
$sgPopupTimerStatus = @sgSetChecked($sgPopupTimerStatus, $popupTimerStatus);
|
|
|
466 |
$sgRepeatPopup = @sgSetChecked($sgRepeatPopup, $repetPopup);
|
467 |
$sgDisablePopup = @sgSetChecked($sgDisablePopup, $disablePopup);
|
468 |
$sgDisablePopupOverlay = @sgSetChecked($sgDisablePopupOverlay, $disablePopupOverlay);
|
@@ -519,9 +543,11 @@
|
|
519 |
$sgOnceExpiresTime = @sgGetValue($sgOnceExpiresTime, $onceExpiresTime);
|
520 |
$sgPopupAppearNumberLimit = @sgGetValue($sgPopupAppearNumberLimit, $popupAppearNumberLimit);
|
521 |
$delay = @sgGetValue($delay, $defaultDelay);
|
|
|
522 |
$sgContentClickBehavior = @sgGetValue($sgContentClickBehavior, $contentClickBehavior);
|
523 |
$sgPopupStartTimer = @sgGetValue($sgPopupStartTimer, $popupStartTimer);
|
524 |
$sgPopupFinishTimer = @sgGetValue($sgPopupFinishTimer, '');
|
|
|
525 |
$sgPopupDataIframe = @sgGetValue($sgPopupDataIframe, 'http://');
|
526 |
$sgShareUrl = @sgGetValue($sgShareUrl, $shareUrl);
|
527 |
$sgPopupDataHtml = @sgGetValue($sgPopupDataHtml, '');
|
@@ -534,6 +560,7 @@
|
|
534 |
$sgCountdownNumbersBgColor = @sgGetValue($sgCountdownNumbersBgColor, $countdownNumbersBgColor);
|
535 |
$sgCountdownLang = @sgGetValue($sgCountdownLang, $countdownLang);
|
536 |
$sgSelectedTimeZone = @sgGetValue($sgSelectedTimeZone, $timeZone);
|
|
|
537 |
$sgDueDate = @sgGetValue($sgDueDate, $dueDate);
|
538 |
$sgExitIntentTpype = @sgGetValue($sgExitIntentTpype, $exitIntentType);
|
539 |
$sgExitIntntExpire = @sgGetValue($sgExitIntntExpire, $exitIntentExpireTime);
|
@@ -704,6 +731,14 @@
|
|
704 |
"data-selectbox-role" => "js-all-posts"
|
705 |
)
|
706 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
707 |
)
|
708 |
);
|
709 |
|
@@ -876,7 +911,17 @@
|
|
876 |
'inherit' => 'Inherit'
|
877 |
);
|
878 |
|
879 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
880 |
require_once(SG_APP_POPUP_FILES ."/sg_params_arrays.php");
|
881 |
}
|
882 |
|
63 |
$sgCountdownLang = $countdownOptions['counts-language'];
|
64 |
@$sgCountdownPosition = $countdownOptions['coundown-position'];
|
65 |
@$sgSelectedTimeZone = $countdownOptions['sg-time-zone'];
|
66 |
+
@$sgCountdownAutoclose = $countdownOptions['countdown-autoclose'];
|
67 |
break;
|
68 |
case 'social':
|
69 |
$sgSocialContent = ($result->getSocialContent());
|
100 |
$sgPopupFixed = @$jsonData['popupFixed'];
|
101 |
$sgFixedPostion = @$jsonData['fixedPostion'];
|
102 |
$sgOnScrolling = @$jsonData['onScrolling'];
|
103 |
+
$sgInActivityStatus = @$jsonData['inActivityStatus'];
|
104 |
+
$sgInactivityTimout = @$jsonData['inactivity-timout'];
|
105 |
$beforeScrolingPrsent = @$jsonData['beforeScrolingPrsent'];
|
106 |
$duration = @$jsonData['duration'];
|
107 |
$delay = @$jsonData['delay'];
|
117 |
$sgOpenOnMobile = @$jsonData['openMobile'];
|
118 |
$sgAllPagesStatus = @$jsonData['allPagesStatus'];
|
119 |
$sgAllPostsStatus = @$jsonData['allPostsStatus'];
|
120 |
+
$sgPostsAllCategories = @$jsonData['posts-all-categories'];
|
121 |
$sgRepeatPopup = @$jsonData['repeatPopup'];
|
122 |
$sgPopupAppearNumberLimit = @$jsonData['popup-appear-number-limit'];
|
123 |
$sgDisablePopup = @$jsonData['disablePopup'];
|
136 |
$sgCountryName = @$jsonData['countryName'];
|
137 |
$sgCountryIso = @$jsonData['countryIso'];
|
138 |
$sgPopupTimerStatus = @$jsonData['popup-timer-status'];
|
139 |
+
$sgPopupScheduleStatus = @$jsonData['popup-schedule-status'];
|
140 |
+
$sgPopupScheduleStartWeeks = @$jsonData['schedule-start-weeks'];
|
141 |
+
$sgPopupScheduleStartTime = @$jsonData['schedule-start-time'];
|
142 |
+
$sgPopupScheduleEndTime = @$jsonData['schedule-end-time'];
|
143 |
$sgPopupFinishTimer = @$jsonData['popup-finish-timer'];
|
144 |
$sgPopupStartTimer = @$jsonData['popup-start-timer'];
|
145 |
+
$sgTimeRangeTimezone = @$jsonData['time-range-time-zone'];
|
146 |
$sgColorboxTheme = @$jsonData['theme'];
|
147 |
$sgOverlayCustomClasss = @$jsonData['sgOverlayCustomClasss'];
|
148 |
$sgContentCustomClasss = @$jsonData['sgContentCustomClasss'];
|
252 |
'scrolling'=> true,
|
253 |
'opacity'=>0.8,
|
254 |
'reposition' => true,
|
255 |
+
'width' => '640px',
|
256 |
+
'height' => '480px',
|
257 |
'initialWidth' => '300',
|
258 |
'initialHeight' => '100',
|
259 |
'maxWidth' => false,
|
274 |
$popupProDefaultValues = array(
|
275 |
'closeType' => false,
|
276 |
'onScrolling' => false,
|
277 |
+
'inactivity-timout' => '0',
|
278 |
+
'inActivityStatus' => false,
|
279 |
'video-autoplay' => false,
|
280 |
'forMobile' => false,
|
281 |
'openMobile' => false,
|
309 |
'countdownNumbersBgColor' => '',
|
310 |
'countDownLang' => 'English',
|
311 |
'popup-timer-status' => false,
|
312 |
+
'popup-schedule-status' => false,
|
313 |
'countdown-position' => true,
|
314 |
+
'countdown-autoclose' => true,
|
315 |
'time-zone' => 'Etc/GMT',
|
316 |
+
'time-range-time-zone' => 'Etc/GMT',
|
317 |
'due-date' => date('M d y H:i', strtotime(' +1 day')),
|
318 |
+
'popup-start-timer' => date('M d y H:i'),
|
319 |
+
'schedule-start-time' => date("H:i"),
|
320 |
'exit-intent-type' => "soft",
|
321 |
'exit-intent-expire-time' => '1',
|
322 |
'subs-first-name-status' => true,
|
365 |
|
366 |
$closeType = sgBoolToChecked($popupProDefaultValues['closeType']);
|
367 |
$onScrolling = sgBoolToChecked($popupProDefaultValues['onScrolling']);
|
368 |
+
$inActivityStatus = sgBoolToChecked($popupProDefaultValues['inActivityStatus']);
|
369 |
$userSeperate = sgBoolToChecked($popupProDefaultValues['sg-user-status']);
|
370 |
$forMobile = sgBoolToChecked($popupProDefaultValues['forMobile']);
|
371 |
$openMobile = sgBoolToChecked($popupProDefaultValues['openMobile']);
|
372 |
$popupTimerStatus = sgBoolToChecked($popupProDefaultValues['popup-timer-status']);
|
373 |
+
$popupScheduleStatus = sgBoolToChecked($popupProDefaultValues['popup-schedule-status']);
|
374 |
$repetPopup = sgBoolToChecked($popupProDefaultValues['repetPopup']);
|
375 |
$disablePopup = sgBoolToChecked($popupProDefaultValues['disablePopup']);
|
376 |
$disablePopupOverlay = sgBoolToChecked($popupProDefaultValues['disablePopupOverlay']);
|
383 |
$pinterestStatus = sgBoolToChecked($popupProDefaultValues['pinterestStatus']);
|
384 |
$socialLabel = sgBoolToChecked($popupProDefaultValues['sgSocialLabel']);
|
385 |
$roundButtons = sgBoolToChecked($popupProDefaultValues['roundButtons']);
|
386 |
+
$countdownAutoclose = sgBoolToChecked($popupProDefaultValues['countdown-autoclose']);
|
387 |
$shareUrl = $popupProDefaultValues['sgShareUrl'];
|
388 |
$pushToBottom = sgBoolToChecked($popupProDefaultValues['pushToBottom']);
|
389 |
$allPages = $popupProDefaultValues['allPages'];
|
405 |
$countdownLang = $popupProDefaultValues['countDownLang'];
|
406 |
$countdownPosition = $popupProDefaultValues['countdown-position'];
|
407 |
$timeZone = $popupProDefaultValues['time-zone'];
|
408 |
+
$timeRangeTimeZone = $popupProDefaultValues['time-range-time-zone'];
|
409 |
$dueDate = $popupProDefaultValues['due-date'];
|
410 |
$popupStartTimer = $popupProDefaultValues['popup-start-timer'];
|
411 |
+
$scheduleStartTime = $popupProDefaultValues['schedule-start-time'];
|
412 |
+
$inactivityTimout = $popupProDefaultValues['inactivity-timout'];
|
413 |
$exitIntentType = $popupProDefaultValues['exit-intent-type'];
|
414 |
$exitIntentExpireTime = $popupProDefaultValues['exit-intent-expire-time'];
|
415 |
$subsFirstNameStatus = sgBoolToChecked($popupProDefaultValues['subs-first-name-status']);
|
477 |
$sgOverlayClose = @sgSetChecked($sgOverlayClose, $overlayClose);
|
478 |
$sgReposition = @sgSetChecked($sgReposition, $reposition);
|
479 |
$sgScrolling = @sgSetChecked($sgScrolling, $scrolling);
|
480 |
+
$sgCountdownAutoclose = @sgSetChecked($sgCountdownAutoclose, $countdownAutoclose);
|
481 |
|
482 |
$sgCloseType = @sgSetChecked($sgCloseType, $closeType);
|
483 |
$sgOnScrolling = @sgSetChecked($sgOnScrolling, $onScrolling);
|
484 |
+
$sgInActivityStatus = @sgSetChecked($sgInActivityStatus, $inActivityStatus);
|
485 |
$sgForMobile = @sgSetChecked($sgForMobile, $forMobile);
|
486 |
$sgOpenOnMobile = @sgSetChecked($sgOpenOnMobile, $openMobile);
|
487 |
$sgUserSeperate = @sgSetChecked($sgUserSeperate, $userSeperate);
|
488 |
$sgPopupTimerStatus = @sgSetChecked($sgPopupTimerStatus, $popupTimerStatus);
|
489 |
+
$sgPopupScheduleStatus = @sgSetChecked($sgPopupScheduleStatus, $popupScheduleStatus);
|
490 |
$sgRepeatPopup = @sgSetChecked($sgRepeatPopup, $repetPopup);
|
491 |
$sgDisablePopup = @sgSetChecked($sgDisablePopup, $disablePopup);
|
492 |
$sgDisablePopupOverlay = @sgSetChecked($sgDisablePopupOverlay, $disablePopupOverlay);
|
543 |
$sgOnceExpiresTime = @sgGetValue($sgOnceExpiresTime, $onceExpiresTime);
|
544 |
$sgPopupAppearNumberLimit = @sgGetValue($sgPopupAppearNumberLimit, $popupAppearNumberLimit);
|
545 |
$delay = @sgGetValue($delay, $defaultDelay);
|
546 |
+
$sgInactivityTimout = @sgGetValue($sgInactivityTimout, $inactivityTimout);
|
547 |
$sgContentClickBehavior = @sgGetValue($sgContentClickBehavior, $contentClickBehavior);
|
548 |
$sgPopupStartTimer = @sgGetValue($sgPopupStartTimer, $popupStartTimer);
|
549 |
$sgPopupFinishTimer = @sgGetValue($sgPopupFinishTimer, '');
|
550 |
+
$sgPopupScheduleStartTime = @sgGetValue($sgPopupScheduleStartTime, $scheduleStartTime);
|
551 |
$sgPopupDataIframe = @sgGetValue($sgPopupDataIframe, 'http://');
|
552 |
$sgShareUrl = @sgGetValue($sgShareUrl, $shareUrl);
|
553 |
$sgPopupDataHtml = @sgGetValue($sgPopupDataHtml, '');
|
560 |
$sgCountdownNumbersBgColor = @sgGetValue($sgCountdownNumbersBgColor, $countdownNumbersBgColor);
|
561 |
$sgCountdownLang = @sgGetValue($sgCountdownLang, $countdownLang);
|
562 |
$sgSelectedTimeZone = @sgGetValue($sgSelectedTimeZone, $timeZone);
|
563 |
+
$sgTimeRangeTimezone = @sgGetValue($sgTimeRangeTimezone, $timeRangeTimeZone);
|
564 |
$sgDueDate = @sgGetValue($sgDueDate, $dueDate);
|
565 |
$sgExitIntentTpype = @sgGetValue($sgExitIntentTpype, $exitIntentType);
|
566 |
$sgExitIntntExpire = @sgGetValue($sgExitIntntExpire, $exitIntentExpireTime);
|
731 |
"data-selectbox-role" => "js-all-posts"
|
732 |
)
|
733 |
|
734 |
+
),
|
735 |
+
array(
|
736 |
+
"title" => "Show on selected categories",
|
737 |
+
"value" => "allCategories",
|
738 |
+
"info" => "",
|
739 |
+
"data-attributes" => array(
|
740 |
+
"class" => 'js-all-categories'
|
741 |
+
)
|
742 |
)
|
743 |
);
|
744 |
|
911 |
'inherit' => 'Inherit'
|
912 |
);
|
913 |
|
914 |
+
$sgWeekDaysArray = array(
|
915 |
+
'Mon' => 'Monday',
|
916 |
+
'Tue' => 'Tuesday',
|
917 |
+
'Wed' => 'Wendnesday',
|
918 |
+
'Thu' => 'Thursday',
|
919 |
+
'Fri' => 'Friday',
|
920 |
+
'Sat' => 'Saturday',
|
921 |
+
'Sun' => 'Sunday'
|
922 |
+
);
|
923 |
+
|
924 |
+
if (POPUP_BUILDER_PKG != POPUP_BUILDER_PKG_FREE) {
|
925 |
require_once(SG_APP_POPUP_FILES ."/sg_params_arrays.php");
|
926 |
}
|
927 |
|
files/sg_popup_save.php
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
<?php
|
2 |
add_action('admin_post_save_popup', 'sgPopupSave');
|
3 |
|
4 |
-
function sgSanitize($optionsKey)
|
5 |
{
|
6 |
if (isset($_POST[$optionsKey])) {
|
7 |
if ($optionsKey == "sg_popup_html"||
|
@@ -13,7 +13,8 @@ function sgSanitize($optionsKey)
|
|
13 |
$optionsKey == "sg_subscription" ||
|
14 |
$optionsKey == "sg_contactForm" ||
|
15 |
$optionsKey == "all-selected-page" ||
|
16 |
-
$optionsKey == "all-selected-posts"
|
|
|
17 |
) {
|
18 |
if(POPUP_BUILDER_PKG > POPUP_BUILDER_PKG_FREE) {
|
19 |
$sgPopupData = $_POST[$optionsKey];
|
@@ -44,6 +45,7 @@ function sgPopupSave()
|
|
44 |
$showAllPosts = sgSanitize('allPosts');
|
45 |
$allSelectedPages = "";
|
46 |
$allSelectedPosts = "";
|
|
|
47 |
|
48 |
/* if popup check for all pages it is not needed for save all pages all posts */
|
49 |
if($showAllPages !== "all") {
|
@@ -54,6 +56,7 @@ function sgPopupSave()
|
|
54 |
$allSelectedPosts = explode(",", sgSanitize('all-selected-posts'));
|
55 |
}
|
56 |
|
|
|
57 |
$socialOptions = array(
|
58 |
'sgSocialTheme' => sgSanitize('sgSocialTheme'),
|
59 |
'sgSocialButtonsSize' => sgSanitize('sgSocialButtonsSize'),
|
@@ -90,6 +93,7 @@ function sgPopupSave()
|
|
90 |
'counts-language'=> sgSanitize('counts-language'),
|
91 |
'sg-time-zone' => sgSanitize('sg-time-zone'),
|
92 |
'sg-countdown-type' => sgSanitize('sg-countdown-type'),
|
|
|
93 |
);
|
94 |
|
95 |
$videoOptions = array(
|
@@ -188,6 +192,8 @@ function sgPopupSave()
|
|
188 |
'closeButton' => sgSanitize('closeButton'),
|
189 |
'theme' => sgSanitize('theme'),
|
190 |
'onScrolling' => sgSanitize('onScrolling'),
|
|
|
|
|
191 |
'beforeScrolingPrsent' => (int)sgSanitize('beforeScrolingPrsent'),
|
192 |
'forMobile' => sgSanitize('forMobile'),
|
193 |
'openMobile' => sgSanitize('openMobile'), // open only for mobile
|
@@ -201,11 +207,17 @@ function sgPopupSave()
|
|
201 |
'allSelectedPages' => $allSelectedPages,
|
202 |
'showAllPosts' => $showAllPosts,
|
203 |
'allSelectedPosts' => $allSelectedPosts,
|
|
|
204 |
'sg-user-status' => sgSanitize('sg-user-status'),
|
205 |
'loggedin-user' => sgSanitize('loggedin-user'),
|
206 |
'popup-timer-status' => sgSanitize('popup-timer-status'),
|
|
|
207 |
'popup-start-timer' => sgSanitize('popup-start-timer'),
|
208 |
'popup-finish-timer' => sgSanitize('popup-finish-timer'),
|
|
|
|
|
|
|
|
|
209 |
'allowCountries' => sgSanitize('allowCountries'),
|
210 |
'countryName' => sgSanitize('countryName'),
|
211 |
'countryIso' => sgSanitize('countryIso'),
|
@@ -272,8 +284,8 @@ function sgPopupSave()
|
|
272 |
'contactFormOptions' => json_encode($contactFormOptions)
|
273 |
);
|
274 |
|
275 |
-
function setPopupForAllPages($id, $data) {
|
276 |
-
SGPopup::addPopupForAllPages($id, $data);
|
277 |
}
|
278 |
|
279 |
function setOptionPopupType($id, $type) {
|
@@ -294,10 +306,11 @@ function sgPopupSave()
|
|
294 |
$lastId = $wpdb->get_var("SELECT LAST_INSERT_ID() FROM ". $wpdb->prefix."sg_popup");
|
295 |
|
296 |
if(POPUP_BUILDER_PKG != POPUP_BUILDER_PKG_FREE) {
|
297 |
-
SGPopup::removePopupFromPages($lastId);
|
|
|
298 |
if($options['allPagesStatus']) {
|
299 |
if(!empty($showAllPages) && $showAllPages != 'all') {
|
300 |
-
setPopupForAllPages($lastId, $allSelectedPages);
|
301 |
}
|
302 |
else {
|
303 |
|
@@ -306,12 +319,16 @@ function sgPopupSave()
|
|
306 |
}
|
307 |
|
308 |
if($options['allPostsStatus']) {
|
309 |
-
if(!empty($showAllPosts) && $showAllPosts
|
310 |
-
|
|
|
311 |
}
|
312 |
-
else {
|
313 |
addPopupToAllPosts($lastId);
|
314 |
}
|
|
|
|
|
|
|
315 |
}
|
316 |
|
317 |
}
|
@@ -378,11 +395,12 @@ function sgPopupSave()
|
|
378 |
break;
|
379 |
}
|
380 |
if(POPUP_BUILDER_PKG != POPUP_BUILDER_PKG_FREE) {
|
381 |
-
SGPopup::removePopupFromPages($id);
|
|
|
382 |
if(!empty($options['allPagesStatus'])) {
|
383 |
if($showAllPages && $showAllPages != 'all') {
|
384 |
removePopupFromAllPages($id);
|
385 |
-
setPopupForAllPages($id, $allSelectedPages);
|
386 |
}
|
387 |
else {
|
388 |
addPopupToAllPages($id);
|
@@ -393,13 +411,16 @@ function sgPopupSave()
|
|
393 |
}
|
394 |
|
395 |
if(!empty($options['allPostsStatus'])) {
|
396 |
-
if(!empty($showAllPosts) && $showAllPosts
|
397 |
removePopupFromAllPosts($id);
|
398 |
-
setPopupForAllPages($id, $allSelectedPosts);
|
399 |
}
|
400 |
-
else {
|
401 |
addPopupToAllPosts($id);
|
402 |
}
|
|
|
|
|
|
|
403 |
}
|
404 |
else {
|
405 |
removePopupFromAllPosts($id);
|
1 |
<?php
|
2 |
add_action('admin_post_save_popup', 'sgPopupSave');
|
3 |
|
4 |
+
function sgSanitize($optionsKey, $isTextField = false)
|
5 |
{
|
6 |
if (isset($_POST[$optionsKey])) {
|
7 |
if ($optionsKey == "sg_popup_html"||
|
13 |
$optionsKey == "sg_subscription" ||
|
14 |
$optionsKey == "sg_contactForm" ||
|
15 |
$optionsKey == "all-selected-page" ||
|
16 |
+
$optionsKey == "all-selected-posts" ||
|
17 |
+
$isTextField == true
|
18 |
) {
|
19 |
if(POPUP_BUILDER_PKG > POPUP_BUILDER_PKG_FREE) {
|
20 |
$sgPopupData = $_POST[$optionsKey];
|
45 |
$showAllPosts = sgSanitize('allPosts');
|
46 |
$allSelectedPages = "";
|
47 |
$allSelectedPosts = "";
|
48 |
+
$allSelectedCategories = sgSanitize("posts-all-categories", true);
|
49 |
|
50 |
/* if popup check for all pages it is not needed for save all pages all posts */
|
51 |
if($showAllPages !== "all") {
|
56 |
$allSelectedPosts = explode(",", sgSanitize('all-selected-posts'));
|
57 |
}
|
58 |
|
59 |
+
|
60 |
$socialOptions = array(
|
61 |
'sgSocialTheme' => sgSanitize('sgSocialTheme'),
|
62 |
'sgSocialButtonsSize' => sgSanitize('sgSocialButtonsSize'),
|
93 |
'counts-language'=> sgSanitize('counts-language'),
|
94 |
'sg-time-zone' => sgSanitize('sg-time-zone'),
|
95 |
'sg-countdown-type' => sgSanitize('sg-countdown-type'),
|
96 |
+
'countdown-autoclose' => sgSanitize('countdown-autoclose')
|
97 |
);
|
98 |
|
99 |
$videoOptions = array(
|
192 |
'closeButton' => sgSanitize('closeButton'),
|
193 |
'theme' => sgSanitize('theme'),
|
194 |
'onScrolling' => sgSanitize('onScrolling'),
|
195 |
+
'inActivityStatus' => sgSanitize('inActivityStatus'),
|
196 |
+
'inactivity-timout' => sgSanitize('inactivity-timout'),
|
197 |
'beforeScrolingPrsent' => (int)sgSanitize('beforeScrolingPrsent'),
|
198 |
'forMobile' => sgSanitize('forMobile'),
|
199 |
'openMobile' => sgSanitize('openMobile'), // open only for mobile
|
207 |
'allSelectedPages' => $allSelectedPages,
|
208 |
'showAllPosts' => $showAllPosts,
|
209 |
'allSelectedPosts' => $allSelectedPosts,
|
210 |
+
'posts-all-categories'=> $allSelectedCategories,
|
211 |
'sg-user-status' => sgSanitize('sg-user-status'),
|
212 |
'loggedin-user' => sgSanitize('loggedin-user'),
|
213 |
'popup-timer-status' => sgSanitize('popup-timer-status'),
|
214 |
+
'popup-schedule-status' => sgSanitize('popup-schedule-status'),
|
215 |
'popup-start-timer' => sgSanitize('popup-start-timer'),
|
216 |
'popup-finish-timer' => sgSanitize('popup-finish-timer'),
|
217 |
+
'time-range-time-zone' => sgSanitize('time-range-time-zone'),
|
218 |
+
'schedule-start-weeks' => sgSanitize('schedule-start-weeks', true),
|
219 |
+
'schedule-start-time' => sgSanitize('schedule-start-time'),
|
220 |
+
'schedule-end-time' => sgSanitize('schedule-end-time'),
|
221 |
'allowCountries' => sgSanitize('allowCountries'),
|
222 |
'countryName' => sgSanitize('countryName'),
|
223 |
'countryIso' => sgSanitize('countryIso'),
|
284 |
'contactFormOptions' => json_encode($contactFormOptions)
|
285 |
);
|
286 |
|
287 |
+
function setPopupForAllPages($id, $data, $type) {
|
288 |
+
SGPopup::addPopupForAllPages($id, $data, $type);
|
289 |
}
|
290 |
|
291 |
function setOptionPopupType($id, $type) {
|
306 |
$lastId = $wpdb->get_var("SELECT LAST_INSERT_ID() FROM ". $wpdb->prefix."sg_popup");
|
307 |
|
308 |
if(POPUP_BUILDER_PKG != POPUP_BUILDER_PKG_FREE) {
|
309 |
+
SGPopup::removePopupFromPages($lastId,'page');
|
310 |
+
SGPopup::removePopupFromPages($lastId,'categories');
|
311 |
if($options['allPagesStatus']) {
|
312 |
if(!empty($showAllPages) && $showAllPages != 'all') {
|
313 |
+
setPopupForAllPages($lastId, $allSelectedPages, 'page');
|
314 |
}
|
315 |
else {
|
316 |
|
319 |
}
|
320 |
|
321 |
if($options['allPostsStatus']) {
|
322 |
+
if(!empty($showAllPosts) && $showAllPosts == "selected") {
|
323 |
+
|
324 |
+
setPopupForAllPages($lastId, $allSelectedPosts, 'page');
|
325 |
}
|
326 |
+
else if($showAllPosts == "all") {
|
327 |
addPopupToAllPosts($lastId);
|
328 |
}
|
329 |
+
if($showAllPosts == "allCategories") {
|
330 |
+
setPopupForAllPages($lastId, $allSelectedCategories, 'categories');
|
331 |
+
}
|
332 |
}
|
333 |
|
334 |
}
|
395 |
break;
|
396 |
}
|
397 |
if(POPUP_BUILDER_PKG != POPUP_BUILDER_PKG_FREE) {
|
398 |
+
SGPopup::removePopupFromPages($id, 'page');
|
399 |
+
SGPopup::removePopupFromPages($id, 'categories');
|
400 |
if(!empty($options['allPagesStatus'])) {
|
401 |
if($showAllPages && $showAllPages != 'all') {
|
402 |
removePopupFromAllPages($id);
|
403 |
+
setPopupForAllPages($id, $allSelectedPages, 'page');
|
404 |
}
|
405 |
else {
|
406 |
addPopupToAllPages($id);
|
411 |
}
|
412 |
|
413 |
if(!empty($options['allPostsStatus'])) {
|
414 |
+
if(!empty($showAllPosts) && $showAllPosts == "selected") {
|
415 |
removePopupFromAllPosts($id);
|
416 |
+
setPopupForAllPages($id, $allSelectedPosts, 'page');
|
417 |
}
|
418 |
+
else if($showAllPosts == "all"){
|
419 |
addPopupToAllPosts($id);
|
420 |
}
|
421 |
+
if($showAllPosts == "allCategories") {
|
422 |
+
setPopupForAllPages($id, $allSelectedCategories, 'categories');
|
423 |
+
}
|
424 |
}
|
425 |
else {
|
426 |
removePopupFromAllPosts($id);
|
files/sg_popup_settings.php
CHANGED
@@ -1,20 +1,46 @@
|
|
1 |
<?php
|
|
|
2 |
$tableDeleteValue = SgPopupGetData::getValue('tables-delete-status','settings');
|
|
|
|
|
3 |
$tableDeleteSatatus = SgPopupGetData::sgSetChecked($tableDeleteValue);
|
|
|
4 |
if (isset($_GET['saved']) && $_GET['saved']==1) {
|
5 |
echo '<div id="default-message" class="updated notice notice-success is-dismissible" ><p>Popup updated.</p></div>';
|
6 |
}
|
7 |
?>
|
8 |
<div class="crud-wrapper">
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
17 |
</div>
|
18 |
-
</
|
|
|
19 |
</div>
|
20 |
-
|
1 |
<?php
|
2 |
+
$defaultVaules = SgPopupGetData::getDefaultValues();
|
3 |
$tableDeleteValue = SgPopupGetData::getValue('tables-delete-status','settings');
|
4 |
+
$usrsSelectedRoles = SgPopupGetData::getValue('plugin_users_role', 'settings');
|
5 |
+
$sgSelectedTimeZone = SgPopupGetData::getValue('sg-popup-time-zone','settings');
|
6 |
$tableDeleteSatatus = SgPopupGetData::sgSetChecked($tableDeleteValue);
|
7 |
+
|
8 |
if (isset($_GET['saved']) && $_GET['saved']==1) {
|
9 |
echo '<div id="default-message" class="updated notice notice-success is-dismissible" ><p>Popup updated.</p></div>';
|
10 |
}
|
11 |
?>
|
12 |
<div class="crud-wrapper">
|
13 |
+
<div class="sg-settings-wrapper">
|
14 |
+
<div id="special-options">
|
15 |
+
<div id="post-body" class="metabox-holder columns-2">
|
16 |
+
<div id="postbox-container-2" class="postbox-container">
|
17 |
+
<div id="normal-sortables" class="meta-box-sortables ui-sortable">
|
18 |
+
<div class="postbox popup-builder-special-postbox">
|
19 |
+
<div class="handlediv js-special-title" title="Click to toggle"><br></div>
|
20 |
+
<h3 class="hndle ui-sortable-handle js-special-title">
|
21 |
+
<span>General Settings</span>
|
22 |
+
</h3>
|
23 |
+
<div class="special-options-content">
|
24 |
+
<form method="POST" action="<?php echo SG_APP_POPUP_ADMIN_URL;?>admin-post.php?action=save_settings" id="sg-settings-form">
|
25 |
+
<span class="liquid-width">Delete popup data:</span>
|
26 |
+
<input type="checkbox" name="tables-delete-status" <?php echo $tableDeleteSatatus;?>>
|
27 |
+
<br><span class="liquid-width sg-aligin-with-multiselect">User role who can use plugin:</span>
|
28 |
+
<?php echo SGFunctions::createSelectBox($defaultVaules['usersRoleList'], @$usrsSelectedRoles, array("name"=>"plugin_users_role[]","multiple"=>"multiple","class"=>"sg-selectbox","size"=>count($defaultVaules['usersRoleList']))); ?><br>
|
29 |
+
|
30 |
+
<?php if(POPUP_BUILDER_PKG != POPUP_BUILDER_PKG_FREE) {
|
31 |
+
require_once(SG_APP_POPUP_FILES ."/sg_params_arrays.php");
|
32 |
+
?>
|
33 |
+
<span class="liquid-width">Popup time zone:</span><?php echo SGFunctions::createSelectBox($sgTimeZones,@$sgSelectedTimeZone, array('name'=>'sg-popup-time-zone','class'=>'sg-selectbox'))?>
|
34 |
+
<?php }?>
|
35 |
+
<div class="setting-submit-wrraper">
|
36 |
+
<input type="submit" class="button-primary" value="<?php echo 'Save Changes'; ?>">
|
37 |
+
</div>
|
38 |
+
</form>
|
39 |
+
</div>
|
40 |
+
</div>
|
41 |
+
</div>
|
42 |
+
</div>
|
43 |
</div>
|
44 |
+
</div>
|
45 |
+
</div>
|
46 |
</div>
|
|
helpers/SgPopupGetData.php
CHANGED
@@ -4,11 +4,16 @@ class SgPopupGetData {
|
|
4 |
public static function getDefaultValues() {
|
5 |
|
6 |
$settingsParamas = array(
|
7 |
-
'tables-delete-status' => 'on'
|
|
|
|
|
8 |
);
|
9 |
|
|
|
|
|
10 |
$deafultParams = array(
|
11 |
-
'settingsParamas' => $settingsParamas
|
|
|
12 |
);
|
13 |
|
14 |
return $deafultParams;
|
@@ -47,6 +52,36 @@ class SgPopupGetData {
|
|
47 |
return $options;
|
48 |
}
|
49 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
50 |
public static function sgSetChecked($value) {
|
51 |
|
52 |
if($value == '') {
|
@@ -54,4 +89,30 @@ class SgPopupGetData {
|
|
54 |
}
|
55 |
return 'checked';
|
56 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
57 |
}
|
4 |
public static function getDefaultValues() {
|
5 |
|
6 |
$settingsParamas = array(
|
7 |
+
'tables-delete-status' => 'on',
|
8 |
+
'plugin_users_role' => array(),
|
9 |
+
'sg-popup-time-zone' => 'Pacific/Midway'
|
10 |
);
|
11 |
|
12 |
+
$usersRoleList = self::getAllUserRoles();
|
13 |
+
|
14 |
$deafultParams = array(
|
15 |
+
'settingsParamas' => $settingsParamas,
|
16 |
+
'usersRoleList' => $usersRoleList
|
17 |
);
|
18 |
|
19 |
return $deafultParams;
|
52 |
return $options;
|
53 |
}
|
54 |
|
55 |
+
public static function getPopupTimeZone() {
|
56 |
+
|
57 |
+
$options = self::getSettingsOptions();
|
58 |
+
|
59 |
+
$popupImeZone = $options['sg-popup-time-zone'];
|
60 |
+
|
61 |
+
return $popupImeZone;
|
62 |
+
}
|
63 |
+
|
64 |
+
public static function getPostsAllCategories() {
|
65 |
+
|
66 |
+
$cats = get_categories(
|
67 |
+
array(
|
68 |
+
"hide_empty" => 0,
|
69 |
+
"type" => "post",
|
70 |
+
"orderby" => "name",
|
71 |
+
"order" => "ASC"
|
72 |
+
)
|
73 |
+
);
|
74 |
+
$catsParams = array();
|
75 |
+
foreach ($cats as $cat) {
|
76 |
+
|
77 |
+
$id = $cat->term_id;
|
78 |
+
$name = $cat->name;
|
79 |
+
$catsParams[$id] = $name;
|
80 |
+
}
|
81 |
+
|
82 |
+
return $catsParams;
|
83 |
+
}
|
84 |
+
|
85 |
public static function sgSetChecked($value) {
|
86 |
|
87 |
if($value == '') {
|
89 |
}
|
90 |
return 'checked';
|
91 |
}
|
92 |
+
|
93 |
+
public static function getAllUserRoles() {
|
94 |
+
|
95 |
+
$rulesArray = array();
|
96 |
+
if(!function_exists('get_editable_roles')){
|
97 |
+
return $rulesArray;
|
98 |
+
}
|
99 |
+
|
100 |
+
$roles = get_editable_roles();
|
101 |
+
foreach ($roles as $role_name => $role_info) {
|
102 |
+
if($role_name == 'administrator') {
|
103 |
+
continue;
|
104 |
+
}
|
105 |
+
$rulesArray["sgpb_".$role_name] = $role_name;
|
106 |
+
|
107 |
+
}
|
108 |
+
return $rulesArray;
|
109 |
+
}
|
110 |
+
|
111 |
+
public static function getCurrentUserRole() {
|
112 |
+
global $current_user, $wpdb;
|
113 |
+
$role = $wpdb->prefix . 'capabilities';
|
114 |
+
$current_user->role = array_keys($current_user->$role);
|
115 |
+
$role = $current_user->role[0];
|
116 |
+
return "sgpb_".$role;
|
117 |
+
}
|
118 |
}
|
img/proOptions.png
CHANGED
Binary file
|
javascript/sg_popup_backend.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
jQuery(document).ready(function($){
|
2 |
this.titleNotEmpty(); /* Check title is Empty */
|
3 |
this.showThemePicture(); /* Show themes pictures */
|
4 |
this.showEffects(); /* Show effect type */
|
5 |
this.pageAcordion(); /* For page acordion divs */
|
6 |
this.fixedPostionSelection(); /* Fuctionality for selected postion */
|
7 |
this.showInfo(); /* Show description options */
|
8 |
this.opasictyRange(); /* Opcity range */
|
9 |
this.subOptionContents();
|
10 |
this.addCountris();
|
11 |
this.showCloseTextFieldForTheme();
|
12 |
this.popupReview();
|
13 |
this.popupTimer();
|
14 |
this.colorPicekr(); /* Color picker */
|
15 |
});
|
|
|
16 |
this.titleNotEmpty(); /* Check title is Empty */
|
17 |
this.showThemePicture(); /* Show themes pictures */
|
18 |
this.showEffects(); /* Show effect type */
|
19 |
this.pageAcordion(); /* For page acordion divs */
|
20 |
this.fixedPostionSelection(); /* Fuctionality for selected postion */
|
21 |
this.showInfo(); /* Show description options */
|
22 |
this.opasictyRange(); /* Opcity range */
|
23 |
this.subOptionContents();
|
24 |
this.addCountris();
|
25 |
this.showCloseTextFieldForTheme();
|
26 |
this.popupReview();
|
27 |
this.popupTimer();
|
28 |
this.colorPicekr(); /* Color picker */
|
29 |
});
|
|
|
1 |
this.titleNotEmpty(); /* Check title is Empty */
|
2 |
this.showThemePicture(); /* Show themes pictures */
|
3 |
this.showEffects(); /* Show effect type */
|
4 |
this.pageAcordion(); /* For page acordion divs */
|
5 |
this.fixedPostionSelection(); /* Fuctionality for selected postion */
|
6 |
this.showInfo(); /* Show description options */
|
7 |
this.opasictyRange(); /* Opcity range */
|
8 |
this.subOptionContents();
|
9 |
this.addCountris();
|
10 |
this.showCloseTextFieldForTheme();
|
11 |
this.popupReview();
|
12 |
this.popupTimer();
|
13 |
this.colorPicekr(); /* Color picker */
|
14 |
});
|
15 |
+
jQuery(document).ready(function($){
|
16 |
this.titleNotEmpty(); /* Check title is Empty */
|
17 |
this.showThemePicture(); /* Show themes pictures */
|
18 |
this.showEffects(); /* Show effect type */
|
19 |
this.pageAcordion(); /* For page acordion divs */
|
20 |
this.fixedPostionSelection(); /* Fuctionality for selected postion */
|
21 |
this.showInfo(); /* Show description options */
|
22 |
this.opasictyRange(); /* Opcity range */
|
23 |
this.subOptionContents();
|
24 |
this.addCountris();
|
25 |
this.showCloseTextFieldForTheme();
|
26 |
this.popupReview();
|
27 |
this.popupTimer();
|
28 |
this.colorPicekr(); /* Color picker */
|
29 |
});
|
javascript/sg_popup_frontend.js
CHANGED
@@ -16,6 +16,25 @@ function SGPopup() {
|
|
16 |
this.sgTrapFocus = true;
|
17 |
}
|
18 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
19 |
SGPopup.prototype.init = function() {
|
20 |
var that = this;
|
21 |
|
@@ -234,6 +253,10 @@ SGPopup.prototype.sgShowColorboxWithOptions = function() {
|
|
234 |
if (sgIsHeightInPercent != -1) {
|
235 |
sgPopupHeightPx = that.percentToPx(popupHeight, sgScreenHeight);
|
236 |
}
|
|
|
|
|
|
|
|
|
237 |
popupPositionTop = that.getPositionPercent("50%", sgScreenHeight, sgPopupHeightPx);
|
238 |
popupPositionLeft = that.getPositionPercent("50%", sgScreenWidth, sgPopupWidthPx);
|
239 |
|
16 |
this.sgTrapFocus = true;
|
17 |
}
|
18 |
|
19 |
+
SGPopup.prototype.popupOpenById = function(popupId) {
|
20 |
+
sgOnScrolling = (SG_POPUP_DATA [popupId]['onScrolling']) ? SG_POPUP_DATA [popupId]['onScrolling']: '';
|
21 |
+
sgInActivity = (SG_POPUP_DATA [popupId]['inActivityStatus']) ? SG_POPUP_DATA [popupId]['inActivityStatus']: ''; ;
|
22 |
+
beforeScrolingPrsent = (SG_POPUP_DATA [popupId]['onScrolling']) ? SG_POPUP_DATA [popupId]['beforeScrolingPrsent']: '';
|
23 |
+
autoClosePopup = (SG_POPUP_DATA [popupId]['autoClosePopup']) ? SG_POPUP_DATA [popupId]['autoClosePopup']: '';
|
24 |
+
popupClosingTimer = (SG_POPUP_DATA [popupId]['popupClosingTimer']) ? SG_POPUP_DATA [popupId]['popupClosingTimer']: '';
|
25 |
+
sgPoupFrontendObj = new SGPopup();
|
26 |
+
|
27 |
+
if(sgOnScrolling) {
|
28 |
+
sgPoupFrontendObj.onScrolling(popupId);
|
29 |
+
}
|
30 |
+
else if(sgInActivity) {
|
31 |
+
sgPoupFrontendObj.showPopupAfterInactivity(popupId);
|
32 |
+
}
|
33 |
+
else {
|
34 |
+
sgPoupFrontendObj.showPopup(popupId,true);
|
35 |
+
}
|
36 |
+
}
|
37 |
+
|
38 |
SGPopup.prototype.init = function() {
|
39 |
var that = this;
|
40 |
|
253 |
if (sgIsHeightInPercent != -1) {
|
254 |
sgPopupHeightPx = that.percentToPx(popupHeight, sgScreenHeight);
|
255 |
}
|
256 |
+
/*for when width or height in px*/
|
257 |
+
sgPopupWidthPx = parseInt(sgPopupWidthPx);
|
258 |
+
sgPopupHeightPx = parseInt(sgPopupHeightPx);
|
259 |
+
|
260 |
popupPositionTop = that.getPositionPercent("50%", sgScreenHeight, sgPopupHeightPx);
|
261 |
popupPositionLeft = that.getPositionPercent("50%", sgScreenWidth, sgPopupWidthPx);
|
262 |
|
popup-builder.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Plugin Name: Popup Builder
|
4 |
* Plugin URI: http://sygnoos.com
|
5 |
* Description: The most complete popup plugin. Html, image, iframe, shortcode, video and many other popup types. Manage popup dimensions, effects, themes and more.
|
6 |
-
* Version: 2.3.
|
7 |
* Author: Sygnoos
|
8 |
* Author URI: http://www.sygnoos.com
|
9 |
* License: GPLv2
|
@@ -201,18 +201,8 @@ function sgRenderPopupOpen($popupId)
|
|
201 |
echo "<script type=\"text/javascript\">
|
202 |
|
203 |
sgAddEvent(window, 'load',function() {
|
204 |
-
|
205 |
-
|
206 |
-
autoClosePopup = (SG_POPUP_DATA [$popupId]['autoClosePopup']) ? SG_POPUP_DATA [$popupId]['autoClosePopup']: '';
|
207 |
-
popupClosingTimer = (SG_POPUP_DATA [$popupId]['popupClosingTimer']) ? SG_POPUP_DATA [$popupId]['popupClosingTimer']: '';
|
208 |
-
sgPoupFrontendObj = new SGPopup();
|
209 |
-
if(sgOnScrolling) {
|
210 |
-
sgPoupFrontendObj.onScrolling($popupId);
|
211 |
-
}
|
212 |
-
else {
|
213 |
-
|
214 |
-
sgPoupFrontendObj.showPopup($popupId,true);
|
215 |
-
}
|
216 |
});
|
217 |
</script>";
|
218 |
}
|
@@ -228,6 +218,12 @@ function showPopupInPage($popupId) {
|
|
228 |
return false;
|
229 |
}
|
230 |
|
|
|
|
|
|
|
|
|
|
|
|
|
231 |
$showUser = SgPopupPro::showUserResolution($popupId);
|
232 |
if(!$showUser) return false;
|
233 |
|
@@ -236,7 +232,6 @@ function showPopupInPage($popupId) {
|
|
236 |
}
|
237 |
}
|
238 |
|
239 |
-
|
240 |
redenderScriptMode($popupId);
|
241 |
}
|
242 |
|
@@ -298,7 +293,11 @@ function sgOnloadPopup()
|
|
298 |
delete_option("SG_MULTIPLE_POPUP");
|
299 |
|
300 |
/* Retrun all popups id width selected On All Pages */
|
301 |
-
$popupsId = SgPopupPro::allowPopupInAllPages($page);
|
|
|
|
|
|
|
|
|
302 |
$sgpbAllPosts = get_option("SG_ALL_POSTS");
|
303 |
$sgpbAllPages = get_option("SG_ALL_PAGES");
|
304 |
|
3 |
* Plugin Name: Popup Builder
|
4 |
* Plugin URI: http://sygnoos.com
|
5 |
* Description: The most complete popup plugin. Html, image, iframe, shortcode, video and many other popup types. Manage popup dimensions, effects, themes and more.
|
6 |
+
* Version: 2.3.6
|
7 |
* Author: Sygnoos
|
8 |
* Author URI: http://www.sygnoos.com
|
9 |
* License: GPLv2
|
201 |
echo "<script type=\"text/javascript\">
|
202 |
|
203 |
sgAddEvent(window, 'load',function() {
|
204 |
+
var sgPoupFrontendObj = new SGPopup();
|
205 |
+
sgPoupFrontendObj.popupOpenById($popupId)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
206 |
});
|
207 |
</script>";
|
208 |
}
|
218 |
return false;
|
219 |
}
|
220 |
|
221 |
+
$isInSchedule = SgPopupPro::popupInSchedule($popupId);
|
222 |
+
|
223 |
+
if(!$isInSchedule) {
|
224 |
+
return;
|
225 |
+
}
|
226 |
+
|
227 |
$showUser = SgPopupPro::showUserResolution($popupId);
|
228 |
if(!$showUser) return false;
|
229 |
|
232 |
}
|
233 |
}
|
234 |
|
|
|
235 |
redenderScriptMode($popupId);
|
236 |
}
|
237 |
|
293 |
delete_option("SG_MULTIPLE_POPUP");
|
294 |
|
295 |
/* Retrun all popups id width selected On All Pages */
|
296 |
+
$popupsId = SgPopupPro::allowPopupInAllPages($page,'page');
|
297 |
+
$categories = SgPopupPro::allowPopupInAllCategories($page);
|
298 |
+
|
299 |
+
$popupsId = array_merge($popupsId,$categories);
|
300 |
+
|
301 |
$sgpbAllPosts = get_option("SG_ALL_POSTS");
|
302 |
$sgpbAllPages = get_option("SG_ALL_PAGES");
|
303 |
|
readme.txt
CHANGED
@@ -5,7 +5,7 @@ Author: Sygnoos
|
|
5 |
Donate link: http://popup-builder.com
|
6 |
Tags: popup, pop up, modal popup, responsive popup, lightbox, youtube, video popup, iframe popup, vimeo, contact form, html popup, social popup, age restriction popup, countdown popup, facebook popup, subscription popup, exit intent popup
|
7 |
Requires at least: 3.8
|
8 |
-
Tested up to: 4.
|
9 |
Stable tag: trunk
|
10 |
License: GPLv2 or later
|
11 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
@@ -39,6 +39,7 @@ With popup builder plugin you can insert any type of content, right into your Po
|
|
39 |
* Add custom class for popup overlay
|
40 |
* Add custom class for popup content
|
41 |
* Redirect user to another page when he/she clicks on popup content
|
|
|
42 |
* Responsive popup
|
43 |
* Network/Multisite popup
|
44 |
* On click popup
|
@@ -151,6 +152,13 @@ Go to the Popup Builder settings and set your desired options.
|
|
151 |
|
152 |
== Changelog ==
|
153 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
154 |
= Version 2.3.5 =
|
155 |
* Added new menu item `Settings` where user can choose weather to delete tables or not. This is helpfull when user upgrades to PRO version and don't want to lost previous data.
|
156 |
* Third party shortcodes improvments.
|
@@ -363,16 +371,18 @@ Adding the following class `sg-popup-id-1`
|
|
363 |
Example: `<span class='sg-popup-id-1'>Popup #1</span>`
|
364 |
|
365 |
**Can I change the wrapping element of onclick popup?**
|
366 |
-
|
367 |
|
368 |
-
|
|
|
|
|
369 |
|
370 |
**Can I put a popup to show after hovering an element?**
|
371 |
|
372 |
Sure, you can! Just insert your text into the following code: `[sg_popup id="1" event="hover" wrap="span"]Your text, which will be wrapped inside span element[/sg_popup]`
|
373 |
|
374 |
**Can I change the wrapping element of hovering popup?**
|
375 |
-
|
|
|
376 |
|
377 |
Example: `[sg_popup id="1" event="hover" wrap="span"]Your text, which will be wraped inside span element[/sg_popup]`
|
378 |
|
@@ -380,9 +390,20 @@ Example: `[sg_popup id="1" event="hover" wrap="span"]Your text, which will be wr
|
|
380 |
|
381 |
It's a very easy thing to do, just follow the steps!
|
382 |
|
383 |
-
* Find "Popup Builder" plugin on the left bar
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
384 |
* Find the popup you created in "All popups" on the left bar
|
385 |
-
|
|
|
|
|
386 |
**How to make the Popup responsive?**
|
387 |
|
388 |
To make your popup responsive you should do the following:
|
@@ -407,8 +428,13 @@ You should enter the URL of the site you want to share.
|
|
407 |
**How to redirect user to specific page when he/she clicks on popup?**
|
408 |
|
409 |
You should create any type of popup.
|
410 |
-
|
411 |
-
|
|
|
|
|
|
|
|
|
|
|
412 |
|
413 |
**Can I make the video play automatically in the Video popup? (PRO)**
|
414 |
|
@@ -426,9 +452,13 @@ You can select "Use active URL" and the current page URL will be shared.
|
|
426 |
|
427 |
The Free version of Popup Builder gives you anything you need for creating unlimited fully functional popups and insert them wherever you want. Our PRO package gives you the ability to create more specific popups, like iframe, video or shortcode popups. Also, advanced options will be available for you to disable popup closing, disable popup for mobile devices, show the popup only once, and many other features. So if you need these advanced popups and functionalities, get Popup Builder PRO <a href="http://popup-builder.com">here</a>.
|
428 |
|
429 |
-
**How to upgrade to PRO version without losing popup's data?**
|
430 |
-
|
431 |
-
|
|
|
|
|
|
|
|
|
432 |
|
433 |
**Can I create a popup and make it invisible for some countries? (PRO)**
|
434 |
|
@@ -449,7 +479,7 @@ Leave us a good review :)
|
|
449 |
|
450 |
== Upgrade Notice ==
|
451 |
|
452 |
-
Current Version of Popup Builder is 2.3.
|
453 |
|
454 |
== Other Notes ==
|
455 |
|
5 |
Donate link: http://popup-builder.com
|
6 |
Tags: popup, pop up, modal popup, responsive popup, lightbox, youtube, video popup, iframe popup, vimeo, contact form, html popup, social popup, age restriction popup, countdown popup, facebook popup, subscription popup, exit intent popup
|
7 |
Requires at least: 3.8
|
8 |
+
Tested up to: 4.6
|
9 |
Stable tag: trunk
|
10 |
License: GPLv2 or later
|
11 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
39 |
* Add custom class for popup overlay
|
40 |
* Add custom class for popup content
|
41 |
* Redirect user to another page when he/she clicks on popup content
|
42 |
+
* Show/Hide Popup for selected User Roles (Admin panel)
|
43 |
* Responsive popup
|
44 |
* Network/Multisite popup
|
45 |
* On click popup
|
152 |
|
153 |
== Changelog ==
|
154 |
|
155 |
+
= Version 2.3.6 =
|
156 |
+
* Show/Hide Popup for selected User Roles (Admin panel) (Free)
|
157 |
+
* Bug fixed connected to 3rd party shortcodes
|
158 |
+
* New option: Show popup after inactivity (PRO)
|
159 |
+
* New option: Popup Scheduling (Example: every Monday from 9:00am - 6:00pm) (PRO)
|
160 |
+
* New option: Show popup on categories
|
161 |
+
|
162 |
= Version 2.3.5 =
|
163 |
* Added new menu item `Settings` where user can choose weather to delete tables or not. This is helpfull when user upgrades to PRO version and don't want to lost previous data.
|
164 |
* Third party shortcodes improvments.
|
371 |
Example: `<span class='sg-popup-id-1'>Popup #1</span>`
|
372 |
|
373 |
**Can I change the wrapping element of onclick popup?**
|
|
|
374 |
|
375 |
+
Yes, you can change it. You can write any HTML element you need to wrap your content in the wrapper attribute of your onclick popup.
|
376 |
+
|
377 |
+
Example: `[sg_popup id="1" event="click" wrap="span"]Your text, which will be wraped inside span element[/sg_popup]`
|
378 |
|
379 |
**Can I put a popup to show after hovering an element?**
|
380 |
|
381 |
Sure, you can! Just insert your text into the following code: `[sg_popup id="1" event="hover" wrap="span"]Your text, which will be wrapped inside span element[/sg_popup]`
|
382 |
|
383 |
**Can I change the wrapping element of hovering popup?**
|
384 |
+
|
385 |
+
Yes, you can change it. You can write any HTML element you need to wrap your content in the wrapper attribute of your hovering popup.
|
386 |
|
387 |
Example: `[sg_popup id="1" event="hover" wrap="span"]Your text, which will be wraped inside span element[/sg_popup]`
|
388 |
|
390 |
|
391 |
It's a very easy thing to do, just follow the steps!
|
392 |
|
393 |
+
* Find "Popup Builder" plugin on the left bar
|
394 |
+
* Press "Add new Popup" button
|
395 |
+
* Press "Shortcode" button
|
396 |
+
* Enter a title for the Popup
|
397 |
+
* Setup general options of the popup
|
398 |
+
* Enter a Shortcode
|
399 |
+
* Setup effects of the popup
|
400 |
+
* Setup the dimensions of the popup
|
401 |
+
* Setup advanced options of the popup
|
402 |
+
* After creating press "Save changes" right above the page
|
403 |
* Find the popup you created in "All popups" on the left bar
|
404 |
+
|
405 |
+
One perfect news for the popup builder users! Our popup builder plugin is now compatible with any other plugins' shortcodes!
|
406 |
+
|
407 |
**How to make the Popup responsive?**
|
408 |
|
409 |
To make your popup responsive you should do the following:
|
428 |
**How to redirect user to specific page when he/she clicks on popup?**
|
429 |
|
430 |
You should create any type of popup.
|
431 |
+
|
432 |
+
* From the Popup's options, find "Dismiss on content click" option.
|
433 |
+
* Check it.
|
434 |
+
* Select "Redirect" button.
|
435 |
+
* In the "URL" field enter the URL of the page you need your users to be redirected to.
|
436 |
+
|
437 |
+
Don't forget to Save changes!)
|
438 |
|
439 |
**Can I make the video play automatically in the Video popup? (PRO)**
|
440 |
|
452 |
|
453 |
The Free version of Popup Builder gives you anything you need for creating unlimited fully functional popups and insert them wherever you want. Our PRO package gives you the ability to create more specific popups, like iframe, video or shortcode popups. Also, advanced options will be available for you to disable popup closing, disable popup for mobile devices, show the popup only once, and many other features. So if you need these advanced popups and functionalities, get Popup Builder PRO <a href="http://popup-builder.com">here</a>.
|
454 |
|
455 |
+
**How to upgrade to PRO version without losing popup's data?**
|
456 |
+
We made it very easy for you! All you need to do is:
|
457 |
+
|
458 |
+
* In your Menu sidebar, go to Popup -> "Settings" section.
|
459 |
+
* Disable the "Delete popup data" option.
|
460 |
+
|
461 |
+
That's all! And you don't need to delete your Free version manually before upgrading to Pro!
|
462 |
|
463 |
**Can I create a popup and make it invisible for some countries? (PRO)**
|
464 |
|
479 |
|
480 |
== Upgrade Notice ==
|
481 |
|
482 |
+
Current Version of Popup Builder is 2.3.6
|
483 |
|
484 |
== Other Notes ==
|
485 |
|
style/sg_popup_style.css
CHANGED
@@ -7,6 +7,10 @@
|
|
7 |
display: none;
|
8 |
}
|
9 |
|
|
|
|
|
|
|
|
|
10 |
.sg-full-width {
|
11 |
width: 100%;
|
12 |
}
|
@@ -21,6 +25,11 @@
|
|
21 |
font-style: italic;
|
22 |
}
|
23 |
|
|
|
|
|
|
|
|
|
|
|
24 |
#sg-general .postbox-container,
|
25 |
#effect .postbox-container,
|
26 |
#dimentions .postbox-container,
|
@@ -454,12 +463,13 @@ span.phpErrorStyle {
|
|
454 |
}
|
455 |
|
456 |
.pro-options {
|
457 |
-
|
458 |
-
|
459 |
-
|
460 |
-
|
461 |
-
|
462 |
-
|
|
|
463 |
}
|
464 |
|
465 |
.generalMenu {
|
@@ -1145,24 +1155,18 @@ input[name="theme"] {
|
|
1145 |
}
|
1146 |
|
1147 |
/*Settings tabe style*/
|
1148 |
-
.
|
1149 |
-
|
1150 |
-
width: 200px;
|
1151 |
-
font-size: 14px;
|
1152 |
-
color: #23282d;
|
1153 |
-
line-height: 1.3;
|
1154 |
-
font-weight: 600;
|
1155 |
}
|
1156 |
|
1157 |
-
.
|
1158 |
-
|
1159 |
}
|
1160 |
|
1161 |
-
|
1162 |
-
|
1163 |
-
display: inline-block;
|
1164 |
}
|
1165 |
-
|
1166 |
@media only screen and (min-width:800px) {
|
1167 |
.sgmb-container {
|
1168 |
min-width:800px;
|
7 |
display: none;
|
8 |
}
|
9 |
|
10 |
+
.sg-margin0 {
|
11 |
+
margin: 0;
|
12 |
+
}
|
13 |
+
|
14 |
.sg-full-width {
|
15 |
width: 100%;
|
16 |
}
|
25 |
font-style: italic;
|
26 |
}
|
27 |
|
28 |
+
.sg-aligin-with-multiselect {
|
29 |
+
display: block;
|
30 |
+
float: left;
|
31 |
+
}
|
32 |
+
|
33 |
#sg-general .postbox-container,
|
34 |
#effect .postbox-container,
|
35 |
#dimentions .postbox-container,
|
463 |
}
|
464 |
|
465 |
.pro-options {
|
466 |
+
clear: both;
|
467 |
+
width: 100%;
|
468 |
+
height: 568px;
|
469 |
+
background-image: url("../img/proOptions.png");
|
470 |
+
background-repeat: no-repeat;
|
471 |
+
background-size: contain;
|
472 |
+
cursor: pointer;
|
473 |
}
|
474 |
|
475 |
.generalMenu {
|
1155 |
}
|
1156 |
|
1157 |
/*Settings tabe style*/
|
1158 |
+
.sg-settings-wrapper {
|
1159 |
+
width: 50%;
|
|
|
|
|
|
|
|
|
|
|
1160 |
}
|
1161 |
|
1162 |
+
.sg-selectbox {
|
1163 |
+
width: 30%;
|
1164 |
}
|
1165 |
|
1166 |
+
.setting-submit-wrraper {
|
1167 |
+
margin-top: 15px;
|
|
|
1168 |
}
|
1169 |
+
|
1170 |
@media only screen and (min-width:800px) {
|
1171 |
.sgmb-container {
|
1172 |
min-width:800px;
|
style/sg_popup_style.php
CHANGED
@@ -24,6 +24,8 @@ function sg_popup_admin_style($hook) {
|
|
24 |
wp_enqueue_style('sg_flipclock_css');
|
25 |
wp_register_style('sg_jqueryUi_css', SG_APP_POPUP_URL . "/style/jquery-ui.min.css");
|
26 |
wp_enqueue_style('sg_jqueryUi_css');
|
|
|
|
|
27 |
wp_register_style('sg_datetimepicker_css', SG_APP_POPUP_URL . "/style/jquery.datetimepicker.min.css");
|
28 |
wp_enqueue_style('sg_datetimepicker_css');
|
29 |
}
|
24 |
wp_enqueue_style('sg_flipclock_css');
|
25 |
wp_register_style('sg_jqueryUi_css', SG_APP_POPUP_URL . "/style/jquery-ui.min.css");
|
26 |
wp_enqueue_style('sg_jqueryUi_css');
|
27 |
+
}
|
28 |
+
if(POPUP_BUILDER_PKG != POPUP_BUILDER_PKG_FREE) {
|
29 |
wp_register_style('sg_datetimepicker_css', SG_APP_POPUP_URL . "/style/jquery.datetimepicker.min.css");
|
30 |
wp_enqueue_style('sg_datetimepicker_css');
|
31 |
}
|