Popup Builder – Responsive WordPress Pop up - Version 2.4.2

Version Description

Current Version of Popup Builder is 2.4.2

Download this release

Release Info

Developer Sygnoos
Plugin Icon 128x128 Popup Builder – Responsive WordPress Pop up
Version 2.4.2
Comparing to
See all releases

Code changes from version 2.4.1 to 2.4.2

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.41);
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.42);
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/options_section/pro.php ADDED
@@ -0,0 +1,165 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if (POPUP_BUILDER_PKG !== POPUP_BUILDER_PKG_FREE) {
3
+ require_once(SG_APP_POPUP_FILES ."/sg_popup_pro.php");
4
+ }
5
+
6
+ $sgAllSelectedPages = @implode(',', $sgAllSelectedPages);
7
+ $sgAllSelectedPosts = @implode(',', $sgAllSelectedPosts);
8
+ $sgAllSelectedCustomPosts = @implode(',', $sgAllSelectedCustomPosts);
9
+ ?>
10
+ <div id="pro-options">
11
+ <div id="post-body" class="metabox-holder columns-2">
12
+ <div id="postbox-container-2" class="postbox-container">
13
+ <div id="normal-sortables" class="meta-box-sortables ui-sortable">
14
+ <div class="postbox js-advanced-postbox">
15
+ <div class="handlediv js-advanced-title" title="Click to toggle"><br></div>
16
+ <h3 class="hndle ui-sortable-handle js-advanced-title">
17
+ <span>Advanced options</span>
18
+ </h3>
19
+ <div class="advanced-options-content">
20
+ <span class="liquid-width">Show on selected pages:</span><input class="input-width-static js-on-all-pages" type="checkbox" name="allPagesStatus" <?php echo @$sgAllPagesStatus;?>>
21
+ <span class="dashicons dashicons-info same-image-style"></span><span class="infoForMobile samefontStyle">Select page where popup should be shown.</span><br>
22
+ <div class="js-all-pages-content acordion-main-div-content">
23
+ <?php echo createRadiobuttons($pagesRadio, SG_POST_TYPE_PAGE, true, esc_html($sgAllPages), "liquid-width"); ?>
24
+ <div class="js-pages-selectbox-content acordion-main-div-content">
25
+ <span class="liquid-width sg-pages-title">Pages</span>
26
+ <select class="js-all-pages js-multiselect" multiple data-slectbox="all-selected-page" data-sorce="<?php echo SG_POST_TYPE_PAGE; ?>" size="10" class="popup-builder-multiselect">
27
+
28
+ </select>
29
+ <img src="<?php echo plugins_url('img/wpAjax.gif', dirname(__FILE__).'../../../../'); ?>" alt="gif" class="spiner-allPages js-sg-spinner sg-hide-element js-sg-import-gif">
30
+ <input type="hidden" class="js-sg-selected-pages" name="all-selected-page" value="<?php echo $sgAllSelectedPages;?>">
31
+ </div>
32
+ </div>
33
+ <span class="liquid-width">Show on selected posts:</span><input class="input-width-static js-on-all-posts" type="checkbox" name="allPostsStatus" <?php echo @$sgAllPostsStatus;?>>
34
+ <span class="dashicons dashicons-info same-image-style"></span><span class="infoForMobile samefontStyle">Select post where popup should be shown.</span><br>
35
+ <div class="js-all-posts-content acordion-main-div-content">
36
+ <?php echo createRadiobuttons($postsRadio, SG_POST_TYPE_POST, true, esc_html($sgAllPosts), "liquid-width"); ?>
37
+ <div class="js-posts-selectbox-content acordion-main-div-content">
38
+ <span class="liquid-width sg-pages-title">Posts</span>
39
+ <select class="js-all-posts js-multiselect" multiple data-slectbox="all-selected-posts" data-sorce="<?php echo SG_POST_TYPE_POST; ?>" size="10" class="popup-builder-multiselect">
40
+
41
+ </select>
42
+ <img src="<?php echo plugins_url('img/wpAjax.gif', dirname(__FILE__).'../../../../'); ?>" alt="gif" class="spiner-allPosts js-sg-spinner sg-hide-element js-sg-import-gif">
43
+ <input type="hidden" class="js-sg-selected-posts" name="all-selected-posts" value="<?php echo $sgAllSelectedPosts; ?>">
44
+ </div>
45
+ <div class="js-all-categories-content acordion-main-div-content">
46
+ <span class="liquid-width sg-pages-title">All categories</span>
47
+ <?php
48
+ $categories = SgPopupGetData::getPostsAllCategories();
49
+ echo SGFunctions::createSelectBox($categories, @$sgPostsAllCategories, array("name"=>"posts-all-categories[]","multiple"=>"multiple","size"=>10,"class"=>"popup-builder-multiselect")); ?>
50
+ </div>
51
+ </div>
52
+
53
+ <span class="liquid-width">Show on selected custom posts:</span><input class="input-width-static js-on-all-custom-posts" type="checkbox" name="allCustomPostsStatus" <?php echo @$sgAllCustomPostsStatus;?>>
54
+ <span class="dashicons dashicons-info same-image-style"></span><span class="infoForMobile samefontStyle">Select post where popup should be shown.</span><br>
55
+ <div class="js-all-custom-posts-content acordion-main-div-content">
56
+ <span class="liquid-width sg-pages-title">Custom Posts</span>
57
+ <?php
58
+ $allCustomPosts = SgPopupGetData::getAllCustomPosts();
59
+ echo SGFunctions::createSelectBox($allCustomPosts, @$sgAllCustomPostsType, array("name"=>"all-custom-posts[]","multiple"=>"multiple","size"=>10,"class"=>"popup-builder-multiselect"))."<br>";
60
+ echo createRadiobuttons($customPostsRadio, 'allCustomPosts', true, esc_html(@$sgAllCustomPosts), "liquid-width");
61
+
62
+ ?>
63
+ <div class="js-all-custompost-content acordion-main-div-content">
64
+ <span class="liquid-width sg-pages-title"></span><select class="js-all-custom-posts js-multiselect" multiple data-slectbox="all-selected-custom-posts" data-sorce="<?php echo SG_POST_TYPE_POST; ?>" size="10" ></select>
65
+ <img src="<?php echo plugins_url('img/wpAjax.gif', dirname(__FILE__).'../../../../'); ?>" alt="gif" class="spiner-allCustomPosts js-sg-spinner sg-hide-element js-sg-import-gif">
66
+ <input type="hidden" class="js-sg-selected-custom-posts" name="all-selected-custom-posts" value="<?php echo $sgAllSelectedCustomPosts; ?>">
67
+ </div>
68
+ </div>
69
+
70
+ <?php if (!sgRemoveOption('onScrolling')): ?>
71
+ <span class="liquid-width">Show while scrolling:</span><input id="js-scrolling-event-inp" class="input-width-static js-checkbox-acordion" type="checkbox" name="onScrolling" <?php echo @$sgOnScrolling;?> >
72
+ <span id="scrollingEvent" class="dashicons dashicons-info same-image-style"></span><span class="infoScrollingEvent samefontStyle">Show the popup whenever the user scrolls the page.</span><br>
73
+ <div class="js-scrolling-content acordion-main-div-content">
74
+ <span class="liquid-width">Show popup after scrolling</span><input class="before-scroling-percent improveOptionsstyle" type="text" name="beforeScrolingPrsent" value="<?php echo esc_attr(@$beforeScrolingPrsent); ?>">
75
+ <span class="span-percent">%</span>
76
+ </div>
77
+ <span class="liquid-width">Show after inactivity</span><input id="js-inactivity-event-inp" class="input-width-static js-checkbox-acordion" type="checkbox" name="inActivityStatus" <?php echo $sgInActivityStatus;?> >
78
+ <span id="scrollingEvent" class="dashicons dashicons-info same-image-style"></span><span class="infoScrollingEvent samefontStyle">Show the popup whenever the user scrolls the page.</span><br>
79
+ <div class="js-inactivity-content acordion-main-div-content">
80
+ <span class="liquid-width">Show popup after</span><input class="improveOptionsstyle before-scroling-percent" type="number" name="inactivity-timout" value="<?php echo esc_attr(@$sgInactivityTimout); ?>">
81
+ <span class="span-percent">Sec</span>
82
+ </div>
83
+
84
+ <?php endif; ?>
85
+ <span class="liquid-width">Hide on mobile devices:</span><input class="input-width-static" type="checkbox" name="forMobile" <?php echo @$sgForMobile;?>>
86
+ <span class="dashicons dashicons-info same-image-style"></span><span class="infoForMobile samefontStyle">Don't show the popup for mobile.</span><br>
87
+
88
+ <span class="liquid-width">Show only on mobile devices:</span><input class="input-width-static" type="checkbox" name="openMobile" <?php echo @$sgOpenOnMobile;?> />
89
+ <span class="dashicons dashicons-info same-image-style"></span><span class="infoForMobile samefontStyle">If this option is active popup will not appear on mobile devices</span><br>
90
+
91
+ <span class="liquid-width">Show popup in date range:</span><input class="input-width-static js-checkbox-acordion" type="checkbox" name="popup-timer-status" <?php echo $sgPopupTimerStatus;?>>
92
+ <span class="dashicons dashicons-info repeatPopup same-image-style"></span><span class="infoSelectRepeat samefontStyle">Show popup for selected date range. If current date is in selected date range then popup will appear.</span><br>
93
+ <div class="acordion-main-div-content">
94
+ <span class="liquid-width">Start date</span><input class="popup-start-timer" type="text" name="popup-start-timer" value="<?php echo esc_attr(@$sgPopupStartTimer)?>"><br>
95
+ <span class="liquid-width">End date</span><input class="popup-finish-timer" type="text" name="popup-finish-timer" value="<?php echo esc_attr(@$sgPopupFinishTimer)?>"><br>
96
+ </div>
97
+ <span class="liquid-width">Schedule:</span><input class="input-width-static js-checkbox-acordion" type="checkbox" name="popup-schedule-status" <?php echo $sgPopupScheduleStatus;?>>
98
+ <span class="dashicons dashicons-info repeatPopup same-image-style"></span><span class="infoSelectRepeat samefontStyle">Show popup for selected date range. If current date is in selected date range then popup will appear.</span><br>
99
+ <div class="acordion-main-div-content schedule-main-div-content">
100
+ <div class="liquid-width sg-label-div">
101
+ </div><div class="sg-options-content-div">
102
+ <h3 class="sg-h3">Every</h3>
103
+ <?php echo SGFunctions::createSelectBox($sgWeekDaysArray, @$sgPopupScheduleStartWeeks, array('name'=>'schedule-start-weeks[]', 'class' => 'schedule-start-selectbox sg-margin0', 'multiple'=> 'multiple', 'size'=>7));?>
104
+ <h3 class="sg-h3">From</h3>
105
+ <input type="text" class="sg-time-picker sg-time-picker-style" name="schedule-start-time" value="<?php echo esc_attr(@$sgPopupScheduleStartTime)?>">
106
+ <h3 class="sg-h3">To</h3>
107
+ <input type="text" class="sg-time-picker sg-time-picker-style" name="schedule-end-time" value="<?php echo esc_attr(@$sgPopupScheduleEndTime)?>">
108
+ </div>
109
+
110
+ </div>
111
+ <?php if(!sgRemoveOption('showOnlyOnce')): ?>
112
+ <span class="liquid-width">Show popup this often:</span><input class="input-width-static js-checkbox-acordion" id="js-popup-only-once" type="checkbox" name="repeatPopup" <?php echo $sgRepeatPopup;?>>
113
+ <span class="dashicons dashicons-info repeatPopup same-image-style"></span><span class="infoSelectRepeat samefontStyle">Show the popup to a user only once.</span><br>
114
+ <div class="acordion-main-div-content js-popup-only-once-content">
115
+ <span class="liquid-width">Show popup less than </span><input class="before-scroling-percent" type="number" min="1" name="popup-appear-number-limit" value="<?php echo esc_attr(@$sgPopupAppearNumberLimit); ?>">
116
+ <span class="span-percent">for same user</span><br>
117
+ <span class="liquid-width">Expire time</span><input class="before-scroling-percent improveOptionsstyle" type="number" min="1" name="onceExpiresTime" value="<?php echo esc_attr(@$sgOnceExpiresTime); ?>">
118
+ <span class="span-percent">Days</span><br>
119
+ <span class="liquid-width">Page level cookie saving</span>
120
+ <input type="checkbox" name="save-cookie-page-level" <?php echo $sgPopupCookiePageLevel; ?>>
121
+ <span class="dashicons dashicons-info repeatPopup same-image-style"></span><span class="infoSelectRepeat samefontStyle">If this option is checked popup's cookie will be saved for a current page.By default cookie set for all site.</span>
122
+ </div>
123
+ <?php endif;?>
124
+
125
+ <span class="liquid-width">Show popup by user status:</span><input class="js-checkbox-acordion js-user-seperator" type="checkbox" name="sg-user-status" <?php echo $sgUserSeperate; ?>>
126
+ <span class="dashicons dashicons-info repeatPopup same-image-style"></span><span class="infoSelectRepeat samefontStyle">Show Popup if the user is logged in to your site or vice versa.</span><br>
127
+ <div class="acordion-main-div-content js-user-seperator-content">
128
+ <span class="liquid-width">User is</span><?php echo SGFunctions::sgCreateRadioElements($usersGroup, @$sgLogedUser);?>
129
+ </div>
130
+
131
+ <span class="liquid-width">Disable popup closing:</span><input class="input-width-static" type="checkbox" name="disablePopup" <?php echo $sgDisablePopup;?>>
132
+ <span class="dashicons dashicons-info same-image-style"></span><span class="infoDisablePopup samefontStyle">Disable popup closing in any possible way.</span><br>
133
+
134
+ <span class="liquid-width">Disable popup overlay:</span><input class="input-width-static" type="checkbox" name="disablePopupOverlay" <?php echo $sgDisablePopupOverlay;?>>
135
+ <span class="dashicons dashicons-info same-image-style"></span><span class="infoDisablePopup samefontStyle">Disable popup overlay.</span><br>
136
+
137
+ <span class="liquid-width">Auto close popup:</span><input id="js-auto-close" class="input-width-static js-checkbox-acordion" type="checkbox" name="autoClosePopup" <?php echo $sgAutoClosePopup;?>>
138
+ <span class="dashicons dashicons-info same-image-style"></span><span class="infoAutoClose samefontStyle">Close popup automatically.</span><br>
139
+ <div class="js-auto-close-content acordion-main-div-content">
140
+ <span class="liquid-width" >After</span><input class="popupTimer improveOptionsstyle" type="text" name="popupClosingTimer" value="<?php echo esc_attr(@$sgPopupClosingTimer);?>"><span class="scroll-percent">seconds</span>
141
+ </div>
142
+ <?php if(POPUP_BUILDER_PKG == POPUP_BUILDER_PKG_PLATINUM): ?>
143
+ <span class="liquid-width">Filter popup for selected countries:</span><input id="js-countris" class="input-width-static js-checkbox-acordion" type="checkbox" name="countryStatus" <?php echo @$sgCountryStatus;?>>
144
+ <span class="dashicons dashicons-info same-image-style"></span><span class="infoAutoClose samefontStyle">Select country where popup should be shown/hidden.</span><br>
145
+ <div class="js-countri-content">
146
+ <span class="liquid-width" ></span><?php echo SGFunctions::sgCreateRadioElements($countriesRadio, @$sgAllowCountries);?>
147
+ <span class="liquid-width" ></span><?php echo SGFunctions::countrisSelect(); ?>
148
+ <input type="button" value="Add" class="addCountry">
149
+ <span class="liquid-width"></span><input type="text" name="countryName" id="countryName" data-role="tagsinput" id="countryName" value="<?php echo esc_attr(@$sgCountryName);?>">
150
+ <span class="liquid-width"></span><input type="hidden" name="countryIso" id="countryIso" value="<?php echo esc_attr(@$sgCountryIso);?>">
151
+ </div>
152
+ <?php endif;?>
153
+ </div>
154
+ <?php if (POPUP_BUILDER_PKG == POPUP_BUILDER_PKG_FREE) : ?>
155
+ <a href="<?php echo SG_POPUP_PRO_URL; ?>" target="_blank">
156
+ <div class="sgpb-pro pro-options-div">
157
+ <p class="pro-options-title">PRO Features</p>
158
+ </div>
159
+ </a>
160
+ <?php endif; ?>
161
+ </div>
162
+ </div>
163
+ </div>
164
+ </div>
165
+ </div>
files/sg_functions.php CHANGED
@@ -86,6 +86,9 @@ class SGFunctions
86
  else if($selectedValue == $value) {
87
  $selected = 'selected';
88
  }
 
 
 
89
 
90
  $selectBox .= '<option value="'.$value.'" '.$selected.'>'.$label.'</option>';
91
  $selected = '';
86
  else if($selectedValue == $value) {
87
  $selected = 'selected';
88
  }
89
+ else if(is_array($value) && is_array($selectedValue, $value)) {
90
+ $selected = 'selected';
91
+ }
92
 
93
  $selectBox .= '<option value="'.$value.'" '.$selected.'>'.$label.'</option>';
94
  $selected = '';
files/sg_more_plugins.php CHANGED
@@ -1,21 +1,9 @@
1
 
2
  <div class="plugin-group" id="sg-plugins-wrapper">
3
- <div class="plugin-card" onclick="window.open('https://wordpress.org/plugins/pricing-table-builder/')">
4
- <div class="plugin-card-top">
5
- <a href="https://wordpress.org/plugins/pricing-table-builder/" target="_blank" class="plugin-icon"><style type="text/css">#plugin-icon-pricing-table-builder { width:128px; height:128px; background-image: url(//ps.w.org/pricing-table-builder/assets/icon-128x128.png?rev=1414780); background-size:128px 128px; }</style><div class="plugin-icon" id="plugin-icon-pricing-table-builder" style="float:left; margin: 3px 6px 6px 0px;"></div></a>
6
- <div class="name column-name">
7
- <h4><a href="https://wordpress.org/plugins/pricing-table-builder/" target="_blank">Pricing Table Builder</a></h4>
8
- </div>
9
- <div class="desc column-description">
10
- <p>Pricing Table Builder will allow you to create awesome pricing tables for your site/blog. Responsive Pricing Table By Sygnoos.</p>
11
- <div class="column-compatibility"><span class="compatibility-compatible"><strong>Compatible</strong> with your version of WordPress</span></div>
12
- </div>
13
- </div>
14
- </div>
15
 
16
  <div class="plugin-card" onclick="window.open('https://wordpress.org/plugins/backup/')">
17
  <div class="plugin-card-top">
18
- <a href="https://wordpress.org/plugins/backup/" target="_blank" class="plugin-icon"><style type="text/css">#plugin-icon-backup { width:128px; height:128px; background-image: url(//ps.w.org/backup/assets/icon-128x128.png?rev=1293306); background-size:128px 128px; }</style><div class="plugin-icon" id="plugin-icon-backup" style="float:left; margin: 3px 6px 6px 0px;"></div></a>
19
  <div class="name column-name">
20
  <h4><a href="https://wordpress.org/plugins/backup/" target="_blank">Backup Guard</a></h4>
21
  </div>
@@ -28,7 +16,7 @@
28
 
29
  <div class="plugin-card">
30
  <div class="plugin-card-top" onclick="window.open('https://wordpress.org/plugins/social-media-builder/')">
31
- <a href="https://wordpress.org/plugins/social-media-builder/" class="plugin-icon" target="_blank"><style type="text/css">#plugin-icon-social-media-builder { width:128px; height:128px; background-image: url(//ps.w.org/social-media-builder/assets/icon-128x128.png?rev=1315835); background-size:128px 128px; }</style><div class="plugin-icon" id="plugin-icon-social-media-builder" style="float:left; margin: 3px 6px 6px 0px;"></div></a>
32
  <div class="name column-name">
33
  <h4><a href="https://wordpress.org/plugins/social-media-builder/" target="_blank">Social</a></h4>
34
  </div>
@@ -41,7 +29,7 @@
41
 
42
  <div class="plugin-card" onclick="window.open('https://wordpress.org/plugins/review-builder/')">
43
  <div class="plugin-card-top">
44
- <a href="https://wordpress.org/plugins/review-builder/" target="_blank" class="plugin-icon"><style type="text/css">#plugin-icon-review-builder { width:128px; height:128px; background-image: url(//ps.w.org/review-builder/assets/icon-128x128.jpg?rev=1430387); background-size:128px 128px; }</style><div class="plugin-icon" id="plugin-icon-review-builder" style="float:left; margin: 3px 6px 6px 0px;"></div></a>
45
  <div class="name column-name">
46
  <h4><a href="https://wordpress.org/plugins/review-builder/" target="_blank">Review</a></h4>
47
  </div>
@@ -53,7 +41,7 @@
53
  </div>
54
  <div class="plugin-card" onclick="window.open('http://wpkicker.com/')">
55
  <div class="plugin-card-top">
56
- <a href="#" class="plugin-icon"><style type="text/css">#plugin-icon-kicker { width:128px; height:128px; background-size:128px 128px; }</style><div class="plugin-icon" style="float:left; margin: 3px 6px 6px 0px;"><img id="plugin-icon-kicker" src="<?php echo SG_APP_POPUP_URL.'/img/blog-wp-kicker.png';?>"></div></a>
57
  <div class="name column-name">
58
  <h4><a href="#">WP Kicker</a></h4>
59
  </div>
1
 
2
  <div class="plugin-group" id="sg-plugins-wrapper">
 
 
 
 
 
 
 
 
 
 
 
 
3
 
4
  <div class="plugin-card" onclick="window.open('https://wordpress.org/plugins/backup/')">
5
  <div class="plugin-card-top">
6
+ <a href="https://wordpress.org/plugins/backup/" target="_blank" class="plugin-icon"><div class="plugin-icon" id="plugin-icon-backup"></div></a>
7
  <div class="name column-name">
8
  <h4><a href="https://wordpress.org/plugins/backup/" target="_blank">Backup Guard</a></h4>
9
  </div>
16
 
17
  <div class="plugin-card">
18
  <div class="plugin-card-top" onclick="window.open('https://wordpress.org/plugins/social-media-builder/')">
19
+ <a href="https://wordpress.org/plugins/social-media-builder/" class="plugin-icon" target="_blank"><div class="plugin-icon" id="plugin-icon-social-media-builder"></div></a>
20
  <div class="name column-name">
21
  <h4><a href="https://wordpress.org/plugins/social-media-builder/" target="_blank">Social</a></h4>
22
  </div>
29
 
30
  <div class="plugin-card" onclick="window.open('https://wordpress.org/plugins/review-builder/')">
31
  <div class="plugin-card-top">
32
+ <a href="https://wordpress.org/plugins/review-builder/" target="_blank" class="plugin-icon"><style type="text/css"></style><div class="plugin-icon" id="plugin-icon-review-builder"></div></a>
33
  <div class="name column-name">
34
  <h4><a href="https://wordpress.org/plugins/review-builder/" target="_blank">Review</a></h4>
35
  </div>
41
  </div>
42
  <div class="plugin-card" onclick="window.open('http://wpkicker.com/')">
43
  <div class="plugin-card-top">
44
+ <a href="#" class="plugin-icon"><div class="plugin-icon"><img id="plugin-icon-kicker" src="<?php echo SG_APP_POPUP_URL.'/img/blog-wp-kicker.png';?>"></div></a>
45
  <div class="name column-name">
46
  <h4><a href="#">WP Kicker</a></h4>
47
  </div>
files/sg_popup_ajax.php CHANGED
@@ -9,6 +9,9 @@ function sgPopupDelete()
9
  require_once(SG_APP_POPUP_CLASSES.'/SGPopup.php');
10
  SGPopup::delete($id);
11
  SGPopup::removePopupFromPages($id);
 
 
 
12
  }
13
 
14
  add_action('wp_ajax_delete_popup', 'sgPopupDelete');
@@ -156,6 +159,7 @@ function sgLazyLoading() {
156
  $params = "";
157
  $postType = $_POST['postType'];
158
  $loadingNumber = (int)$_POST['loadingNumber'];
 
159
 
160
  /* Whem load first time need add Home page in Wp pages */
161
  if($loadingNumber == 0) {
@@ -171,7 +175,14 @@ function sgLazyLoading() {
171
  if($postType == SG_POST_TYPE_POST) {
172
  $pageData = SgPopupPro::getAllData($defArray, 'post', $loadingNumber);
173
  }
174
-
 
 
 
 
 
 
 
175
  if($loadingNumber > 0 && sizeof($pageData) == 0) {
176
  die();
177
  }
@@ -188,10 +199,13 @@ function sgLazyLoading() {
188
  else if($postType == SG_POST_TYPE_POST) {
189
  $allSelectedPages = $options['allSelectedPosts'];
190
  }
 
 
 
191
  }
192
 
193
  foreach ($pageData as $key => $value) {
194
- /* When have seleced pages data */
195
  if($popupId != -1) {
196
  $selected = "";
197
  if(isset($allSelectedPages) && @in_array($key, $allSelectedPages)) {
9
  require_once(SG_APP_POPUP_CLASSES.'/SGPopup.php');
10
  SGPopup::delete($id);
11
  SGPopup::removePopupFromPages($id);
12
+
13
+ $args = array('popupId'=> $id);
14
+ do_action('sgPopupDelete', $args);
15
  }
16
 
17
  add_action('wp_ajax_delete_popup', 'sgPopupDelete');
159
  $params = "";
160
  $postType = $_POST['postType'];
161
  $loadingNumber = (int)$_POST['loadingNumber'];
162
+ $customParams = $_POST['customParams'];
163
 
164
  /* Whem load first time need add Home page in Wp pages */
165
  if($loadingNumber == 0) {
175
  if($postType == SG_POST_TYPE_POST) {
176
  $pageData = SgPopupPro::getAllData($defArray, 'post', $loadingNumber);
177
  }
178
+ if($postType == 'allCustomPosts') {
179
+ $pageData = array();
180
+ foreach ($customParams['customPosts'] as $value) {
181
+ $currentData = SgPopupPro::getAllData(array(), $value, $loadingNumber);
182
+ $pageData += $currentData;
183
+ }
184
+ }
185
+
186
  if($loadingNumber > 0 && sizeof($pageData) == 0) {
187
  die();
188
  }
199
  else if($postType == SG_POST_TYPE_POST) {
200
  $allSelectedPages = $options['allSelectedPosts'];
201
  }
202
+ else if($postType == 'allCustomPosts') {
203
+ $allSelectedPages = $options['allSelectedCustomPosts'];
204
+ }
205
  }
206
 
207
  foreach ($pageData as $key => $value) {
208
+ /* Add Home page in Wp pages array */
209
  if($popupId != -1) {
210
  $selected = "";
211
  if(isset($allSelectedPages) && @in_array($key, $allSelectedPages)) {
files/sg_popup_create_new.php CHANGED
@@ -7,7 +7,7 @@
7
  $paths = IntegrateExternalSettings::getCurrentPopupAppPaths($popupType);
8
  //Get current form action, for addons it different
9
  $currentActionName = IntegrateExternalSettings::getCurrentPopupAdminPostActionName($popupType);
10
-
11
  $popupAppPath = $paths['app-path'];
12
  $popupFilesPath = $paths['files-path'];
13
 
@@ -92,6 +92,7 @@
92
  $sgCloseButton = @$jsonData['closeButton'];
93
  $sgReposition = @$jsonData['reposition'];
94
  $sgOverlayClose = @$jsonData['overlayClose'];
 
95
  $sgOverlayColor = @$jsonData['sgOverlayColor'];
96
  $sgContentBackgroundColor = @$jsonData['sg-content-background-color'];
97
  $sgContentClick = @$jsonData['contentClick'];
@@ -121,6 +122,7 @@
121
  $sgOpenOnMobile = @$jsonData['openMobile'];
122
  $sgAllPagesStatus = @$jsonData['allPagesStatus'];
123
  $sgAllPostsStatus = @$jsonData['allPostsStatus'];
 
124
  $sgPostsAllCategories = @$jsonData['posts-all-categories'];
125
  $sgRepeatPopup = @$jsonData['repeatPopup'];
126
  $sgPopupAppearNumberLimit = @$jsonData['popup-appear-number-limit'];
@@ -130,12 +132,15 @@
130
  $sgPopupClosingTimer = @$jsonData['popupClosingTimer'];
131
  $sgAutoClosePopup = @$jsonData['autoClosePopup'];
132
  $sgCountryStatus = @$jsonData['countryStatus'];
133
- $allSelectedPages = @$jsonData['allSelectedPages'];
 
134
  $sgAllPostStatus = @$jsonData['showAllPosts'];
135
- $allSelectedPosts = @$jsonData['allSelectedPosts'];
136
  $sgAllowCountries = @$jsonData['allowCountries'];
137
  $sgAllPages = @$jsonData['showAllPages'];
138
  $sgAllPosts = @$jsonData['showAllPosts'];
 
 
139
  $sgLogedUser = @$jsonData['loggedin-user'];
140
  $sgUserSeperate = @$jsonData['sg-user-status'];
141
  $sgCountryName = @$jsonData['countryName'];
@@ -265,6 +270,7 @@
265
  'maxWidth' => false,
266
  'maxHeight' => false,
267
  'overlayClose' => true,
 
268
  'contentClick'=>false,
269
  'fixed' => false,
270
  'top' => false,
@@ -302,8 +308,10 @@
302
  'pushToBottom' => true,
303
  'allPages' => "all",
304
  'allPosts' => "all",
 
305
  'allPagesStatus' => false,
306
  'allPostsStatus' => false,
 
307
  'onceExpiresTime' => 7,
308
  'popup-appear-number-limit' => 1,
309
  'save-cookie-page-level' => false,
@@ -369,6 +377,7 @@
369
  $scaling = sgBoolToChecked($sgPopup['scaling']);
370
  $reposition = sgBoolToChecked($sgPopup['reposition']);
371
  $overlayClose = sgBoolToChecked($sgPopup['overlayClose']);
 
372
  $contentClick = sgBoolToChecked($sgPopup['contentClick']);
373
  $contentClickBehavior = $sgPopup['content-click-behavior'];
374
 
@@ -397,8 +406,10 @@
397
  $pushToBottom = sgBoolToChecked($popupProDefaultValues['pushToBottom']);
398
  $allPages = $popupProDefaultValues['allPages'];
399
  $allPosts = $popupProDefaultValues['allPosts'];
 
400
  $allPagesStatus = sgBoolToChecked($popupProDefaultValues['allPagesStatus']);
401
  $allPostsStatus = sgBoolToChecked($popupProDefaultValues['allPostsStatus']);
 
402
  $contactNameStatus = sgBoolToChecked($popupProDefaultValues['contact-name-status']);
403
  $showFormToTop = sgBoolToChecked($popupProDefaultValues['show-form-to-top']);
404
  $contactNameRequired = sgBoolToChecked($popupProDefaultValues['contact-name-required']);
@@ -486,6 +497,7 @@
486
  $sgEscKey = @sgSetChecked($sgEscKey, $escKey);
487
  $sgContentClick = @sgSetChecked($sgContentClick, $contentClick);
488
  $sgOverlayClose = @sgSetChecked($sgOverlayClose, $overlayClose);
 
489
  $sgReposition = @sgSetChecked($sgReposition, $reposition);
490
  $sgScrolling = @sgSetChecked($sgScrolling, $scrolling);
491
  $sgScaling = @sgSetChecked($sgScaling, $scaling);
@@ -514,9 +526,10 @@
514
  $sgSocialLabel = @sgSetChecked($sgSocialLabel, $socialLabel);
515
  $sgPopupFixed = @sgSetChecked($sgPopupFixed, $deafultFixed);
516
  $sgPushToBottom = @sgSetChecked($sgPushToBottom, $pushToBottom);
517
-
518
  $sgAllPagesStatus = @sgSetChecked($sgAllPagesStatus, $allPagesStatus);
519
  $sgAllPostsStatus = @sgSetChecked($sgAllPostsStatus, $allPostsStatus);
 
520
  $sgCountdownPosition = @sgSetChecked($sgCountdownPosition, $countdownPosition);
521
  $sgVideoAutoplay = @sgSetChecked($sgVideoAutoplay, $videoAutoplay);
522
  $sgSubsLastNameStatus = @sgSetChecked($sgSubsLastNameStatus, $subsLastNameStatus);
@@ -570,6 +583,7 @@
570
  $sgAllowCountries = @sgGetValue($sgAllowCountries, $allowCountries);
571
  $sgAllPages = @sgGetValue($sgAllPages, $allPages);
572
  $sgAllPosts = @sgGetValue($sgAllPosts, $allPosts);
 
573
  $sgLogedUser = @sgGetValue($sgLogedUser, $logedUser);
574
  $sgCountdownNumbersTextColor = @sgGetValue($sgCountdownNumbersTextColor, $countdownNumbersTextColor);
575
  $sgCountdownNumbersBgColor = @sgGetValue($sgCountdownNumbersBgColor, $countdownNumbersBgColor);
@@ -622,7 +636,10 @@
622
  $sgContactFailMessage = @sgGetValue($sgContactFailMessage, $contactFailMessage);
623
  $sgOverlayCustomClasss = @sgGetValue($sgOverlayCustomClasss, $overlayCustomClasss);
624
  $sgContentCustomClasss = @sgGetValue($sgContentCustomClasss, $contentCustomClasss);
625
-
 
 
 
626
  function sgGetValue($getedVal,$defValue)
627
  {
628
  if (!isset($getedVal)) {
@@ -744,7 +761,7 @@
744
  "data-loading-number" => 0,
745
  "data-selectbox-role" => "js-all-posts"
746
  )
747
-
748
  ),
749
  array(
750
  "title" => "Show on selected categories",
@@ -756,6 +773,26 @@
756
  )
757
  );
758
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
759
  $radiobuttons = array(
760
  array(
761
  "title" => "Soft mode:",
@@ -797,7 +834,7 @@
797
  function createRadiobuttons($elements, $name, $newLine, $selectedInput, $class)
798
  {
799
  $str = "";
800
-
801
  foreach ($elements as $key => $element) {
802
  $breakLine = "";
803
  $infoIcon = "";
@@ -1146,16 +1183,20 @@
1146
 
1147
  <span class="liquid-width">Dismiss on content click:</span><input class="input-width-static js-checkbox-contnet-click" type="checkbox" name="contentClick" <?php echo $sgContentClick;?> />
1148
  <span class="dashicons dashicons-info contentClick sameImageStyle"></span><span class="infoContentClick samefontStyle">The popup will be dismissed when user clicks inside popup area.</span><br>
 
 
 
 
1149
  <div class="sg-hide sg-full-width js-content-click-wrraper">
1150
  <?php echo createRadiobuttons($contentClickOptions, "content-click-behavior", true, esc_html($sgContentClickBehavior), "liquid-width"); ?>
1151
  <div class="sg-hide js-readio-buttons-acordion-content sg-full-width">
1152
- <span class="liquid-width">Url:</span><input class="input-width-static" type="text" name='click-redirect-to-url' value="<?php echo esc_attr(@$sgClickRedirectToUrl); ?>">
1153
  <span class="liquid-width">Redirect to new tab:</span><input type="checkbox" name="redirect-to-new-tab" <?php echo $sgRedirectToNewTab; ?> >
1154
  </div>
1155
  </div>
1156
 
1157
  <span class="liquid-width">Change overlay color:</span><div id="color-picker"><input class="sgOverlayColor" id="sgOverlayColor" type="text" name="sgOverlayColor" value="<?php echo esc_attr(@$sgOverlayColor); ?>" /></div><br>
1158
-
1159
  <span class="liquid-width">Change background color:</span><div id="color-picker"><input class="sgOverlayColor" id="sgOverlayColor" type="text" name="sg-content-background-color" value="<?php echo esc_attr(@$sgContentBackgroundColor); ?>" /></div><br>
1160
 
1161
  <span class="liquid-width" id="createDescribeOpacitcy">Background overlay opacity:</span><div class="slider-wrapper">
@@ -1192,14 +1233,11 @@
1192
  </div>
1193
  </div>
1194
  </div>
1195
- <?php if (POPUP_BUILDER_PKG != POPUP_BUILDER_PKG_FREE) : require_once("options_section/pro.php"); ?>
1196
- <?php else: ?>
1197
- <div class="pro-options" onclick="window.open('<?php echo SG_POPUP_PRO_URL;?>')"></div>
1198
- <?php endif; ?>
1199
  </div>
1200
  </div>
1201
  <div class="clear"></div>
1202
- <?php
1203
  $isActivePopup = SgPopupGetData::isActivePopup(@$id);
1204
  if(!@$id) $isActivePopup = 'checked';
1205
  ?>
@@ -1209,4 +1247,4 @@
1209
  </div>
1210
  </form>
1211
  <?php
1212
- SGFunctions::showInfo();
7
  $paths = IntegrateExternalSettings::getCurrentPopupAppPaths($popupType);
8
  //Get current form action, for addons it different
9
  $currentActionName = IntegrateExternalSettings::getCurrentPopupAdminPostActionName($popupType);
10
+
11
  $popupAppPath = $paths['app-path'];
12
  $popupFilesPath = $paths['files-path'];
13
 
92
  $sgCloseButton = @$jsonData['closeButton'];
93
  $sgReposition = @$jsonData['reposition'];
94
  $sgOverlayClose = @$jsonData['overlayClose'];
95
+ $sgReopenAfterSubmission = @$jsonData['reopenAfterSubmission'];
96
  $sgOverlayColor = @$jsonData['sgOverlayColor'];
97
  $sgContentBackgroundColor = @$jsonData['sg-content-background-color'];
98
  $sgContentClick = @$jsonData['contentClick'];
122
  $sgOpenOnMobile = @$jsonData['openMobile'];
123
  $sgAllPagesStatus = @$jsonData['allPagesStatus'];
124
  $sgAllPostsStatus = @$jsonData['allPostsStatus'];
125
+ $sgAllCustomPostsStatus = @$jsonData['allCustomPostsStatus'];
126
  $sgPostsAllCategories = @$jsonData['posts-all-categories'];
127
  $sgRepeatPopup = @$jsonData['repeatPopup'];
128
  $sgPopupAppearNumberLimit = @$jsonData['popup-appear-number-limit'];
132
  $sgPopupClosingTimer = @$jsonData['popupClosingTimer'];
133
  $sgAutoClosePopup = @$jsonData['autoClosePopup'];
134
  $sgCountryStatus = @$jsonData['countryStatus'];
135
+ $sgAllSelectedPages = @$jsonData['allSelectedPages'];
136
+ $sgAllSelectedCustomPosts = @$jsonData['allSelectedCustomPosts'];
137
  $sgAllPostStatus = @$jsonData['showAllPosts'];
138
+ $sgAllSelectedPosts = @$jsonData['allSelectedPosts'];
139
  $sgAllowCountries = @$jsonData['allowCountries'];
140
  $sgAllPages = @$jsonData['showAllPages'];
141
  $sgAllPosts = @$jsonData['showAllPosts'];
142
+ $sgAllCustomPosts = @$jsonData['showAllCustomPosts'];
143
+ $sgAllCustomPostsType = @$jsonData['all-custom-posts'];
144
  $sgLogedUser = @$jsonData['loggedin-user'];
145
  $sgUserSeperate = @$jsonData['sg-user-status'];
146
  $sgCountryName = @$jsonData['countryName'];
270
  'maxWidth' => false,
271
  'maxHeight' => false,
272
  'overlayClose' => true,
273
+ 'reopenAfterSubmission' => false,
274
  'contentClick'=>false,
275
  'fixed' => false,
276
  'top' => false,
308
  'pushToBottom' => true,
309
  'allPages' => "all",
310
  'allPosts' => "all",
311
+ 'allCustomPosts' => "all",
312
  'allPagesStatus' => false,
313
  'allPostsStatus' => false,
314
+ 'allCustomPostsStatus' => false,
315
  'onceExpiresTime' => 7,
316
  'popup-appear-number-limit' => 1,
317
  'save-cookie-page-level' => false,
377
  $scaling = sgBoolToChecked($sgPopup['scaling']);
378
  $reposition = sgBoolToChecked($sgPopup['reposition']);
379
  $overlayClose = sgBoolToChecked($sgPopup['overlayClose']);
380
+ $reopenAfterSubmission = sgBoolToChecked($sgPopup['reopenAfterSubmission']);
381
  $contentClick = sgBoolToChecked($sgPopup['contentClick']);
382
  $contentClickBehavior = $sgPopup['content-click-behavior'];
383
 
406
  $pushToBottom = sgBoolToChecked($popupProDefaultValues['pushToBottom']);
407
  $allPages = $popupProDefaultValues['allPages'];
408
  $allPosts = $popupProDefaultValues['allPosts'];
409
+ $allCustomPosts = $popupProDefaultValues['allCustomPosts'];
410
  $allPagesStatus = sgBoolToChecked($popupProDefaultValues['allPagesStatus']);
411
  $allPostsStatus = sgBoolToChecked($popupProDefaultValues['allPostsStatus']);
412
+ $allCustomPostsStatus = sgBoolToChecked($popupProDefaultValues['allCustomPostsStatus']);
413
  $contactNameStatus = sgBoolToChecked($popupProDefaultValues['contact-name-status']);
414
  $showFormToTop = sgBoolToChecked($popupProDefaultValues['show-form-to-top']);
415
  $contactNameRequired = sgBoolToChecked($popupProDefaultValues['contact-name-required']);
497
  $sgEscKey = @sgSetChecked($sgEscKey, $escKey);
498
  $sgContentClick = @sgSetChecked($sgContentClick, $contentClick);
499
  $sgOverlayClose = @sgSetChecked($sgOverlayClose, $overlayClose);
500
+ $sgReopenAfterSubmission = @sgSetChecked($sgReopenAfterSubmission, $reopenAfterSubmission);
501
  $sgReposition = @sgSetChecked($sgReposition, $reposition);
502
  $sgScrolling = @sgSetChecked($sgScrolling, $scrolling);
503
  $sgScaling = @sgSetChecked($sgScaling, $scaling);
526
  $sgSocialLabel = @sgSetChecked($sgSocialLabel, $socialLabel);
527
  $sgPopupFixed = @sgSetChecked($sgPopupFixed, $deafultFixed);
528
  $sgPushToBottom = @sgSetChecked($sgPushToBottom, $pushToBottom);
529
+
530
  $sgAllPagesStatus = @sgSetChecked($sgAllPagesStatus, $allPagesStatus);
531
  $sgAllPostsStatus = @sgSetChecked($sgAllPostsStatus, $allPostsStatus);
532
+ $sgAllCustomPostsStatus = @sgSetChecked($sgAllCustomPostsStatus, $allCustomPostsStatus);
533
  $sgCountdownPosition = @sgSetChecked($sgCountdownPosition, $countdownPosition);
534
  $sgVideoAutoplay = @sgSetChecked($sgVideoAutoplay, $videoAutoplay);
535
  $sgSubsLastNameStatus = @sgSetChecked($sgSubsLastNameStatus, $subsLastNameStatus);
583
  $sgAllowCountries = @sgGetValue($sgAllowCountries, $allowCountries);
584
  $sgAllPages = @sgGetValue($sgAllPages, $allPages);
585
  $sgAllPosts = @sgGetValue($sgAllPosts, $allPosts);
586
+ $sgAllCustomPosts = @sgGetValue($sgAllCustomPosts, $allCustomPosts);
587
  $sgLogedUser = @sgGetValue($sgLogedUser, $logedUser);
588
  $sgCountdownNumbersTextColor = @sgGetValue($sgCountdownNumbersTextColor, $countdownNumbersTextColor);
589
  $sgCountdownNumbersBgColor = @sgGetValue($sgCountdownNumbersBgColor, $countdownNumbersBgColor);
636
  $sgContactFailMessage = @sgGetValue($sgContactFailMessage, $contactFailMessage);
637
  $sgOverlayCustomClasss = @sgGetValue($sgOverlayCustomClasss, $overlayCustomClasss);
638
  $sgContentCustomClasss = @sgGetValue($sgContentCustomClasss, $contentCustomClasss);
639
+ $sgAllSelectedPages = @sgGetValue($sgAllSelectedPages, array());
640
+ $sgAllSelectedPosts = @sgGetValue($sgAllSelectedPosts, array());
641
+ $sgAllSelectedCustomPosts = @sgGetValue($sgAllSelectedCustomPosts, array());
642
+
643
  function sgGetValue($getedVal,$defValue)
644
  {
645
  if (!isset($getedVal)) {
761
  "data-loading-number" => 0,
762
  "data-selectbox-role" => "js-all-posts"
763
  )
764
+
765
  ),
766
  array(
767
  "title" => "Show on selected categories",
773
  )
774
  );
775
 
776
+ $customPostsRadio = array(
777
+ array(
778
+ "title" => "Show on all custom posts:",
779
+ "value" => "all",
780
+ "info" => ""
781
+ ),
782
+ array(
783
+ "title" => "Show on selected custom post:",
784
+ "value" => "selected",
785
+ "info" => "",
786
+ "data-attributes" => array(
787
+ "data-name" => 'allCustomPosts',
788
+ "data-popupid" => $dataPopupId,
789
+ "data-loading-number" => 0,
790
+ "data-selectbox-role" => "js-all-custom-posts"
791
+ )
792
+
793
+ )
794
+ );
795
+
796
  $radiobuttons = array(
797
  array(
798
  "title" => "Soft mode:",
834
  function createRadiobuttons($elements, $name, $newLine, $selectedInput, $class)
835
  {
836
  $str = "";
837
+
838
  foreach ($elements as $key => $element) {
839
  $breakLine = "";
840
  $infoIcon = "";
1183
 
1184
  <span class="liquid-width">Dismiss on content click:</span><input class="input-width-static js-checkbox-contnet-click" type="checkbox" name="contentClick" <?php echo $sgContentClick;?> />
1185
  <span class="dashicons dashicons-info contentClick sameImageStyle"></span><span class="infoContentClick samefontStyle">The popup will be dismissed when user clicks inside popup area.</span><br>
1186
+
1187
+ <span class="liquid-width">Reopen after form submission:</span><input class="input-width-static" type="checkbox" name="reopenAfterSubmission" <?php echo $sgReopenAfterSubmission;?> />
1188
+ <span class="dashicons dashicons-info overlayImg sameImageStyle"></span><span class="infoReopenSubmiting samefontStyle">If checked, the popup will reopen after form submission.</span><br>
1189
+
1190
  <div class="sg-hide sg-full-width js-content-click-wrraper">
1191
  <?php echo createRadiobuttons($contentClickOptions, "content-click-behavior", true, esc_html($sgContentClickBehavior), "liquid-width"); ?>
1192
  <div class="sg-hide js-readio-buttons-acordion-content sg-full-width">
1193
+ <span class="liquid-width">Url:</span><input class="input-width-static" type="text" name='click-redirect-to-url' value="<?php echo esc_attr(@$sgClickRedirectToUrl); ?>">
1194
  <span class="liquid-width">Redirect to new tab:</span><input type="checkbox" name="redirect-to-new-tab" <?php echo $sgRedirectToNewTab; ?> >
1195
  </div>
1196
  </div>
1197
 
1198
  <span class="liquid-width">Change overlay color:</span><div id="color-picker"><input class="sgOverlayColor" id="sgOverlayColor" type="text" name="sgOverlayColor" value="<?php echo esc_attr(@$sgOverlayColor); ?>" /></div><br>
1199
+
1200
  <span class="liquid-width">Change background color:</span><div id="color-picker"><input class="sgOverlayColor" id="sgOverlayColor" type="text" name="sg-content-background-color" value="<?php echo esc_attr(@$sgContentBackgroundColor); ?>" /></div><br>
1201
 
1202
  <span class="liquid-width" id="createDescribeOpacitcy">Background overlay opacity:</span><div class="slider-wrapper">
1233
  </div>
1234
  </div>
1235
  </div>
1236
+ <?php require_once("options_section/pro.php"); ?>
 
 
 
1237
  </div>
1238
  </div>
1239
  <div class="clear"></div>
1240
+ <?php
1241
  $isActivePopup = SgPopupGetData::isActivePopup(@$id);
1242
  if(!@$id) $isActivePopup = 'checked';
1243
  ?>
1247
  </div>
1248
  </form>
1249
  <?php
1250
+ SGFunctions::showInfo();
files/sg_popup_save.php CHANGED
@@ -43,8 +43,10 @@ function sgPopupSave()
43
  $contactFormOptions = array();
44
  $showAllPages = sgSanitize('allPages');
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 */
@@ -55,7 +57,9 @@ function sgPopupSave()
55
  if($showAllPosts !== "all") {
56
  $allSelectedPosts = explode(",", sgSanitize('all-selected-posts'));
57
  }
58
-
 
 
59
 
60
  $socialOptions = array(
61
  'sgSocialTheme' => sgSanitize('sgSocialTheme'),
@@ -171,15 +175,17 @@ function sgPopupSave()
171
  $addToGeneralOptions = array(
172
  'showAllPages' => $showAllPages,
173
  'showAllPosts' => $showAllPosts,
 
174
  'allSelectedPages' => $allSelectedPages,
175
  'allSelectedPosts' => $allSelectedPosts,
176
- 'allSelectedCategories'=>$allSelectedCategories,
177
- 'fblikeOptions'=>$fblikeOptions,
 
178
  'videoOptions'=>$videoOptions,
179
- 'exitIntentOptions'=>$exitIntentOptions,
180
- 'countdownOptions'=>$countdownOptions,
181
- 'socialOptions'=>$socialOptions,
182
- 'socialButtons'=>$socialButtons
183
  );
184
 
185
  $options = IntegrateExternalSettings::getPopupGeneralOptions($addToGeneralOptions);
@@ -252,7 +258,7 @@ function sgPopupSave()
252
  }
253
  else {
254
 
255
- addPopupToAllPages($lastId);
256
  }
257
  }
258
 
@@ -262,12 +268,21 @@ function sgPopupSave()
262
  setPopupForAllPages($lastId, $allSelectedPosts, 'page');
263
  }
264
  else if($showAllPosts == "all") {
265
- addPopupToAllPosts($lastId);
266
  }
267
  if($showAllPosts == "allCategories") {
268
  setPopupForAllPages($lastId, $allSelectedCategories, 'categories');
269
  }
270
  }
 
 
 
 
 
 
 
 
 
271
 
272
  }
273
 
@@ -337,31 +352,44 @@ function sgPopupSave()
337
  SGPopup::removePopupFromPages($id, 'categories');
338
  if(!empty($options['allPagesStatus'])) {
339
  if($showAllPages && $showAllPages != 'all') {
340
- removePopupFromAllPages($id);
341
  setPopupForAllPages($id, $allSelectedPages, 'page');
342
  }
343
  else {
344
- addPopupToAllPages($id);
345
  }
346
  }
347
  else {
348
- removePopupFromAllPages($id);
349
  }
350
 
351
  if(!empty($options['allPostsStatus'])) {
352
  if(!empty($showAllPosts) && $showAllPosts == "selected") {
353
- removePopupFromAllPosts($id);
354
  setPopupForAllPages($id, $allSelectedPosts, 'page');
355
  }
356
  else if($showAllPosts == "all"){
357
- addPopupToAllPosts($id);
358
  }
359
  if($showAllPosts == "allCategories") {
360
  setPopupForAllPages($id, $allSelectedCategories, 'categories');
361
  }
362
  }
363
  else {
364
- removePopupFromAllPosts($id);
 
 
 
 
 
 
 
 
 
 
 
 
 
365
  }
366
  }
367
 
@@ -373,56 +401,75 @@ function sgPopupSave()
373
 
374
  }
375
 
376
-
377
- function removePopupFromAllPosts($id) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
378
  $allPosts = get_option("SG_ALL_POSTS");
 
379
 
380
- if(is_array($allPosts)) {
381
- $key = array_search($id, $allPosts);
382
-
383
- if ($key !== false) {
384
- unset($allPosts[$key]);
385
- }
386
- update_option("SG_ALL_POSTS", $allPosts);
387
  }
388
- }
389
 
390
- function removePopupFromAllPages($id) {
391
- $allPages = get_option("SG_ALL_PAGES");
 
 
392
 
393
- if(is_array($allPages)) {
394
- $key = array_search($id, $allPages);
395
-
396
- if ($key !== false) {
397
- unset($allPages[$key]);
 
 
 
 
 
 
 
 
398
  }
399
- update_option("SG_ALL_PAGES", $allPages);
400
- }
401
- }
402
 
403
- function addPopupToAllPosts($id) {
404
- $allPosts = get_option("SG_ALL_POSTS");
 
 
 
 
405
 
406
- if(!is_array($allPosts)) {
407
- $allPosts = array();
408
  }
409
- $key = array_search($id, $allPosts);
410
-
411
- if($key == false) {
412
- array_push($allPosts, $id);
413
  }
 
414
  update_option("SG_ALL_POSTS", $allPosts);
415
  }
416
 
417
- function addPopupToAllPages($id) {
418
- $allPages = get_option("SG_ALL_PAGES");
419
- if(!is_array($allPages)) {
420
- $allPages = array();
421
- }
422
- $key = array_search($id, $allPages);
423
 
424
- if($key == false) {
425
- array_push($allPages, $id);
 
 
 
 
426
  }
427
- update_option("SG_ALL_PAGES", $allPages);
428
- }
 
 
43
  $contactFormOptions = array();
44
  $showAllPages = sgSanitize('allPages');
45
  $showAllPosts = sgSanitize('allPosts');
46
+ $showAllCustomPosts = sgSanitize('allCustomPosts');
47
  $allSelectedPages = "";
48
  $allSelectedPosts = "";
49
+ $allSelectedCustomPosts = "";
50
  $allSelectedCategories = sgSanitize("posts-all-categories", true);
51
 
52
  /* if popup check for all pages it is not needed for save all pages all posts */
57
  if($showAllPosts !== "all") {
58
  $allSelectedPosts = explode(",", sgSanitize('all-selected-posts'));
59
  }
60
+ if($showAllCustomPosts !== "all") {
61
+ $allSelectedCustomPosts = explode(",", sgSanitize('all-selected-custom-posts'));
62
+ }
63
 
64
  $socialOptions = array(
65
  'sgSocialTheme' => sgSanitize('sgSocialTheme'),
175
  $addToGeneralOptions = array(
176
  'showAllPages' => $showAllPages,
177
  'showAllPosts' => $showAllPosts,
178
+ 'showAllCustomPosts' => $showAllCustomPosts,
179
  'allSelectedPages' => $allSelectedPages,
180
  'allSelectedPosts' => $allSelectedPosts,
181
+ 'allSelectedCustomPosts' => $allSelectedCustomPosts,
182
+ 'allSelectedCategories'=> $allSelectedCategories,
183
+ 'fblikeOptions'=> $fblikeOptions,
184
  'videoOptions'=>$videoOptions,
185
+ 'exitIntentOptions'=> $exitIntentOptions,
186
+ 'countdownOptions'=> $countdownOptions,
187
+ 'socialOptions'=> $socialOptions,
188
+ 'socialButtons'=> $socialButtons
189
  );
190
 
191
  $options = IntegrateExternalSettings::getPopupGeneralOptions($addToGeneralOptions);
258
  }
259
  else {
260
 
261
+ updatePopupOptions($lastId, array('page'), true);
262
  }
263
  }
264
 
268
  setPopupForAllPages($lastId, $allSelectedPosts, 'page');
269
  }
270
  else if($showAllPosts == "all") {
271
+ updatePopupOptions($lastId, array('post'), true);
272
  }
273
  if($showAllPosts == "allCategories") {
274
  setPopupForAllPages($lastId, $allSelectedCategories, 'categories');
275
  }
276
  }
277
+
278
+ if($options['allCustomPostsStatus']) {
279
+ if(!empty($showAllCustomPosts) && $showAllCustomPosts == "selected") {
280
+ setPopupForAllPages($lastId, $allSelectedCustomPosts, 'page');
281
+ }
282
+ else if($showAllCustomPosts == "all") {
283
+ updatePopupOptions($lastId, $options['all-custom-posts'], true);
284
+ }
285
+ }
286
 
287
  }
288
 
352
  SGPopup::removePopupFromPages($id, 'categories');
353
  if(!empty($options['allPagesStatus'])) {
354
  if($showAllPages && $showAllPages != 'all') {
355
+ updatePopupOptions($id, array('page'), false);
356
  setPopupForAllPages($id, $allSelectedPages, 'page');
357
  }
358
  else {
359
+ updatePopupOptions($id, array('page'), true);
360
  }
361
  }
362
  else {
363
+ updatePopupOptions($id, array('page'), false);
364
  }
365
 
366
  if(!empty($options['allPostsStatus'])) {
367
  if(!empty($showAllPosts) && $showAllPosts == "selected") {
368
+ updatePopupOptions($id, array('post'), false);
369
  setPopupForAllPages($id, $allSelectedPosts, 'page');
370
  }
371
  else if($showAllPosts == "all"){
372
+ updatePopupOptions($id, array('post'), true);
373
  }
374
  if($showAllPosts == "allCategories") {
375
  setPopupForAllPages($id, $allSelectedCategories, 'categories');
376
  }
377
  }
378
  else {
379
+ updatePopupOptions($id, array('post'), false);
380
+ }
381
+
382
+ if(!empty($options['allCustomPostsStatus'])) {
383
+ if(!empty($showAllCustomPosts) && $showAllCustomPosts == "selected") {
384
+ updatePopupOptions($id, $options['all-custom-posts'], false);
385
+ setPopupForAllPages($id, $allSelectedCustomPosts, 'page');
386
+ }
387
+ else if($showAllCustomPosts == "all") {
388
+ updatePopupOptions($id, $options['all-custom-posts'], true);
389
+ }
390
+ }
391
+ else {
392
+ updatePopupOptions($id, $options['all-custom-posts'], false);
393
  }
394
  }
395
 
401
 
402
  }
403
 
404
+ /**
405
+ * Saveing data to wp options
406
+ *
407
+ * @since 3.1.5
408
+ *
409
+ * @param int $id popup id number
410
+ * @param array $postTypes page post types
411
+ * @param bool $isInsert true for insert false for remove
412
+ *
413
+ * @return void
414
+ *
415
+ */
416
+
417
+ function updatePopupOptions($id, $postTypes, $isInsert) {
418
+
419
+ /*getting wp option data*/
420
  $allPosts = get_option("SG_ALL_POSTS");
421
+ $key = false;
422
 
423
+ if(!$allPosts) {
424
+ $allPosts = array();
 
 
 
 
 
425
  }
 
426
 
427
+ if($allPosts && !empty($allPosts)) {
428
+ /*Assoc array key value*/
429
+ $key = getCurrentPopupIdFromOptions($id);
430
+ }
431
 
432
+ /*When isset like id data in wp options*/
433
+ if($key !== false) {
434
+ $popupPostTypes = $allPosts[$key]['popstTypes'];
435
+
436
+ if($isInsert) {
437
+ $popupPostTypes = array_merge($popupPostTypes, $postTypes);
438
+ $popupPostTypes = array_unique($popupPostTypes);
439
+ }
440
+ else {
441
+ if(!empty($postTypes)) {
442
+ $popupPostTypes = array_diff($popupPostTypes, $postTypes);
443
+ }
444
+
445
  }
 
 
 
446
 
447
+ if(empty($popupPostTypes)) {
448
+ unset($allPosts[$key]);
449
+ }
450
+ else {
451
+ $allPosts[$key]['popstTypes'] = $popupPostTypes;
452
+ }
453
 
 
 
454
  }
455
+ else if($isInsert) {
456
+ $data = array('id'=>$id, 'popstTypes'=>$postTypes);
457
+ array_push($allPosts, $data);
 
458
  }
459
+
460
  update_option("SG_ALL_POSTS", $allPosts);
461
  }
462
 
463
+ function getCurrentPopupIdFromOptions($id) {
 
 
 
 
 
464
 
465
+ $allPosts = get_option("SG_ALL_POSTS");
466
+
467
+ foreach ($allPosts as $key => $post) {
468
+ if($post['id'] == $id) {
469
+ return $key;
470
+ }
471
  }
472
+
473
+ return false;
474
+ }
475
+
helpers/Integrate_external_settings.php CHANGED
@@ -73,6 +73,7 @@ Class IntegrateExternalSettings {
73
  'scaling' => sgSanitize('scaling'),
74
  'reposition' => sgSanitize('reposition'),
75
  'overlayClose' => sgSanitize('overlayClose'),
 
76
  'contentClick' => sgSanitize('contentClick'),
77
  'content-click-behavior' => sgSanitize('content-click-behavior'),
78
  'click-redirect-to-url' => sgSanitize('click-redirect-to-url'),
@@ -102,12 +103,16 @@ Class IntegrateExternalSettings {
102
  'autoClosePopup' => sgSanitize('autoClosePopup'),
103
  'countryStatus' => sgSanitize('countryStatus'),
104
  'showAllPages' => $params['showAllPages'],
105
- "allPagesStatus" => sgSanitize("allPagesStatus"),
106
- "allPostsStatus" => sgSanitize("allPostsStatus"),
 
107
  'allSelectedPages' => $params['allSelectedPages'],
108
  'showAllPosts' => $params['showAllPosts'],
 
109
  'allSelectedPosts' => $params['allSelectedPosts'],
 
110
  'posts-all-categories'=> $params['allSelectedCategories'],
 
111
  'sg-user-status' => sgSanitize('sg-user-status'),
112
  'loggedin-user' => sgSanitize('loggedin-user'),
113
  'popup-timer-status' => sgSanitize('popup-timer-status'),
73
  'scaling' => sgSanitize('scaling'),
74
  'reposition' => sgSanitize('reposition'),
75
  'overlayClose' => sgSanitize('overlayClose'),
76
+ 'reopenAfterSubmission' => sgSanitize('reopenAfterSubmission'),
77
  'contentClick' => sgSanitize('contentClick'),
78
  'content-click-behavior' => sgSanitize('content-click-behavior'),
79
  'click-redirect-to-url' => sgSanitize('click-redirect-to-url'),
103
  'autoClosePopup' => sgSanitize('autoClosePopup'),
104
  'countryStatus' => sgSanitize('countryStatus'),
105
  'showAllPages' => $params['showAllPages'],
106
+ 'allPagesStatus' => sgSanitize('allPagesStatus'),
107
+ 'allPostsStatus' => sgSanitize('allPostsStatus'),
108
+ 'allCustomPostsStatus' => sgSanitize('allCustomPostsStatus'),
109
  'allSelectedPages' => $params['allSelectedPages'],
110
  'showAllPosts' => $params['showAllPosts'],
111
+ 'showAllCustomPosts' => $params['showAllCustomPosts'],
112
  'allSelectedPosts' => $params['allSelectedPosts'],
113
+ 'allSelectedCustomPosts' => $params['allSelectedCustomPosts'],
114
  'posts-all-categories'=> $params['allSelectedCategories'],
115
+ 'all-custom-posts' => sgSanitize('all-custom-posts', true),
116
  'sg-user-status' => sgSanitize('sg-user-status'),
117
  'loggedin-user' => sgSanitize('loggedin-user'),
118
  'popup-timer-status' => sgSanitize('popup-timer-status'),
helpers/SgPopupGetData.php CHANGED
@@ -143,4 +143,16 @@ class SgPopupGetData {
143
  }
144
  return "";
145
  }
 
 
 
 
 
 
 
 
 
 
 
 
146
  }
143
  }
144
  return "";
145
  }
146
+
147
+ public static function getAllCustomPosts() {
148
+
149
+ $args = array(
150
+ 'public' => true,
151
+ '_builtin' => false
152
+ );
153
+
154
+ $allCustomPosts = get_post_types($args);
155
+
156
+ return $allCustomPosts;
157
+ }
158
  }
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.addCountries();
11
  this.showCloseTextFieldForTheme();
12
  this.popupReview();
13
  this.popupTimer();
14
  this.colorPicekr(); /* Color picker */
15
  this.switchPopupActive();
16
  });
 
17
  this.titleNotEmpty(); /* Check title is Empty */
18
  this.showThemePicture(); /* Show themes pictures */
19
  this.showEffects(); /* Show effect type */
20
  this.pageAcordion(); /* For page acordion divs */
21
  this.fixedPostionSelection(); /* Fuctionality for selected postion */
22
  this.showInfo(); /* Show description options */
23
  this.opasictyRange(); /* Opcity range */
24
  this.subOptionContents();
25
  this.addCountries();
26
  this.showCloseTextFieldForTheme();
27
  this.popupReview();
28
  this.popupTimer();
29
  this.colorPicekr(); /* Color picker */
30
  this.switchPopupActive();
31
  });
 
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.addCountries();
10
  this.showCloseTextFieldForTheme();
11
  this.popupReview();
12
  this.popupTimer();
13
  this.colorPicekr(); /* Color picker */
14
  this.switchPopupActive();
15
  });
16
+ jQuery(document).ready(function($){
17
  this.titleNotEmpty(); /* Check title is Empty */
18
  this.showThemePicture(); /* Show themes pictures */
19
  this.showEffects(); /* Show effect type */
20
  this.pageAcordion(); /* For page acordion divs */
21
  this.fixedPostionSelection(); /* Fuctionality for selected postion */
22
  this.showInfo(); /* Show description options */
23
  this.opasictyRange(); /* Opcity range */
24
  this.subOptionContents();
25
  this.addCountries();
26
  this.showCloseTextFieldForTheme();
27
  this.popupReview();
28
  this.popupTimer();
29
  this.colorPicekr(); /* Color picker */
30
  this.switchPopupActive();
31
  });
javascript/sg_popup_frontend.js CHANGED
@@ -35,10 +35,39 @@ SGPopup.prototype.popupOpenById = function(popupId) {
35
  }
36
  }
37
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
38
  SGPopup.prototype.init = function() {
39
  var that = this;
40
 
41
  this.onCompleate();
 
 
42
  jQuery(".sg-show-popup").each(function() {
43
  var popupEvent = jQuery(this).attr("data-popup-event");
44
  if(typeof popupEvent == 'undefined') {
@@ -110,6 +139,16 @@ SGPopup.prototype.init = function() {
110
  });
111
  }
112
 
 
 
 
 
 
 
 
 
 
 
113
  SGPopup.prototype.findPopupIdFromClassNames = function(className, classKey) {
114
 
115
  var classSplitArray = className.split(classKey);
35
  }
36
  }
37
 
38
+ SGPopup.getCookie = function(cname) {
39
+ var name = cname + "=";
40
+ var ca = document.cookie.split(';');
41
+ for(var i = 0; i <ca.length; i++) {
42
+ var c = ca[i];
43
+ while (c.charAt(0)==' ') {
44
+ c = c.substring(1);
45
+ }
46
+ if (c.indexOf(name) == 0) {
47
+ return c.substring(name.length,c.length);
48
+ }
49
+ }
50
+ return "";
51
+ }
52
+
53
+ SGPopup.setCookie = function(cname, cvalue, exdays) {
54
+
55
+ var exdate = new Date();
56
+ if(!exdays || isNaN(exdays)) {
57
+ exdays = 365*50;
58
+ }
59
+ exdate.setDate(exdate.getDate() + exdays);
60
+
61
+ var value = cvalue + ((exdays == null) ? ";" : "; expires=" + exdate.toUTCString());
62
+ document.cookie = cname + "=" + value;
63
+ }
64
+
65
  SGPopup.prototype.init = function() {
66
  var that = this;
67
 
68
  this.onCompleate();
69
+ this.popupOpenByCookie();
70
+
71
  jQuery(".sg-show-popup").each(function() {
72
  var popupEvent = jQuery(this).attr("data-popup-event");
73
  if(typeof popupEvent == 'undefined') {
139
  });
140
  }
141
 
142
+ SGPopup.prototype.popupOpenByCookie = function() {
143
+
144
+ var popupId = SGPopup.getCookie("sgSubmitReloadingForm");
145
+ popupId = parseInt(popupId);
146
+
147
+ if(typeof popupId == 'number') {
148
+ this.showPopup(popupId,false);
149
+ }
150
+ }
151
+
152
  SGPopup.prototype.findPopupIdFromClassNames = function(className, classKey) {
153
 
154
  var classSplitArray = className.split(classKey);
javascript/sg_popup_init.js CHANGED
@@ -1,7 +1,7 @@
1
  function SgPopupInit(popupData) {
2
  this.popupData = popupData;
3
- this.shortcodeInPopupContent();
4
  this.cloneToHtmlPopup();
 
5
  }
6
 
7
  SgPopupInit.prototype.cloneToHtmlPopup = function() {
@@ -18,8 +18,25 @@ SgPopupInit.prototype.cloneToHtmlPopup = function() {
18
  jQuery('#sgcolorbox').bind('sgPopupCleanup', function() {
19
  jQuery('#sgpb-all-content-'+currentPopupId).appendTo(jQuery("#sg-popup-content-"+currentPopupId));
20
  });
 
 
21
  }
22
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
23
  SgPopupInit.prototype.decodeBase64 = function(s) {
24
  if(typeof window.atob == 'function') {
25
  return decodeURIComponent(escape(window.atob(s)));
@@ -85,6 +102,7 @@ SgPopupInit.prototype.initByPopupType = function() {
85
  var data = this.popupData;
86
  var popupObj = {};
87
  var popupType = data['type'];
 
88
 
89
  switch(popupType) {
90
  case 'countdown':
@@ -105,6 +123,7 @@ SgPopupInit.prototype.initByPopupType = function() {
105
  break;
106
  case 'ageRestriction':
107
  popupObj = new SGAgeRestriction();
 
108
  popupObj.init();
109
  break;
110
  }
1
  function SgPopupInit(popupData) {
2
  this.popupData = popupData;
 
3
  this.cloneToHtmlPopup();
4
+ this.reopenPopupAfterSubmission();
5
  }
6
 
7
  SgPopupInit.prototype.cloneToHtmlPopup = function() {
18
  jQuery('#sgcolorbox').bind('sgPopupCleanup', function() {
19
  jQuery('#sgpb-all-content-'+currentPopupId).appendTo(jQuery("#sg-popup-content-"+currentPopupId));
20
  });
21
+
22
+ this.shortcodeInPopupContent();
23
  }
24
 
25
+ SgPopupInit.prototype.reopenPopupAfterSubmission = function() {
26
+
27
+ var reopenSubmission = this.popupData['reopenAfterSubmission'];
28
+ var currentPopupId = this.popupData['id'];
29
+ SGPopup.setCookie('sgSubmitReloadingForm', currentPopupId, -10);
30
+ var that = this;
31
+
32
+ if(reopenSubmission) {
33
+ jQuery("#sgcboxLoadedContent form").submit(function() {
34
+ SGPopup.setCookie('sgSubmitReloadingForm', currentPopupId);
35
+ });
36
+ }
37
+ }
38
+
39
+
40
  SgPopupInit.prototype.decodeBase64 = function(s) {
41
  if(typeof window.atob == 'function') {
42
  return decodeURIComponent(escape(window.atob(s)));
102
  var data = this.popupData;
103
  var popupObj = {};
104
  var popupType = data['type'];
105
+ var popupId = data['id'];
106
 
107
  switch(popupType) {
108
  case 'countdown':
123
  break;
124
  case 'ageRestriction':
125
  popupObj = new SGAgeRestriction();
126
+ popupObj.setPopupId(popupId);
127
  popupObj.init();
128
  break;
129
  }
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.4.1
7
  * Author: Sygnoos
8
  * Author URI: http://www.sygnoos.com
9
  * License: GPLv2
@@ -70,10 +70,10 @@ function sgRegisterScripts()
70
  SGPopup::$registeredScripts = true;
71
  wp_register_style('sg_animate', SG_APP_POPUP_URL . '/style/animate.css');
72
  wp_enqueue_style('sg_animate');
73
- wp_register_script('sg_popup_init', SG_APP_POPUP_URL . '/javascript/sg_popup_init.js', array('jquery'), SG_POPUP_VERSION);
74
- wp_enqueue_script('sg_popup_init');
75
  wp_register_script('sg_popup_frontend', SG_APP_POPUP_URL . '/javascript/sg_popup_frontend.js', array('jquery'), SG_POPUP_VERSION);
76
  wp_enqueue_script('sg_popup_frontend');
 
 
77
  wp_enqueue_script('jquery');
78
  wp_register_script('sg_colorbox', SG_APP_POPUP_URL . '/javascript/jquery.sgcolorbox-min.js', array('jquery'), SG_POPUP_VERSION);
79
  wp_enqueue_script('sg_colorbox');
@@ -150,7 +150,7 @@ function sgShowShortCode($args, $content)
150
  sgRenderPopupScript($args['id']);
151
  $attr = '';
152
  $eventName = @$args['event'];
153
-
154
  if(isset($args['insidepopup'])) {
155
  $attr .= 'insidePopup="on"';
156
  }
@@ -171,7 +171,7 @@ function sgShowShortCode($args, $content)
171
  if(POPUP_BUILDER_PKG > POPUP_BUILDER_PKG_FREE) {
172
  $page = get_queried_object_id();
173
  $popupsId = SgPopupPro::allowPopupInAllPages($page,'page');
174
-
175
  /* When have many popups in current page */
176
  if(count($popupsId) > 0) {
177
  /* Add shordcode popup id in the QUEUE for php side */
@@ -188,7 +188,7 @@ function sgShowShortCode($args, $content)
188
  else {
189
  echo showPopupInPage($args['id']);
190
  }
191
-
192
  }
193
  $shortcodeContent = ob_get_contents();
194
  ob_end_clean();
@@ -199,7 +199,7 @@ add_shortCode('sg_popup', 'sgShowShortCode');
199
  function sgRenderPopupOpen($popupId)
200
  {
201
  sgRenderPopupScript($popupId);
202
-
203
  echo "<script type=\"text/javascript\">
204
 
205
  sgAddEvent(window, 'load',function() {
@@ -220,7 +220,7 @@ function showPopupInPage($popupId) {
220
  if(POPUP_BUILDER_PKG > POPUP_BUILDER_PKG_FREE) {
221
 
222
  $popupInTimeRange = SgPopupPro::popupInTimeRange($popupId);
223
-
224
  if(!$popupInTimeRange) {
225
  return false;
226
  }
@@ -233,7 +233,7 @@ function showPopupInPage($popupId) {
233
 
234
  $showUser = SgPopupPro::showUserResolution($popupId);
235
  if(!$showUser) return false;
236
-
237
  if(!SGPopup::showPopupForCounrty($popupId)) { /* Sended popupId and function return true or false */
238
  return;
239
  }
@@ -250,7 +250,7 @@ function redenderScriptMode($popupId)
250
  }
251
  $multiplePopup = get_option('SG_MULTIPLE_POPUP');
252
  $exitIntentPopupId = get_option('SG_POPUP_EXITINTENT_'.$popupId);
253
-
254
  if(isset($exitIntentPopupId) && $exitIntentPopupId == $popupId) {
255
  sgRenderPopupScript($popupId);
256
  require_once(SG_APP_POPUP_CLASSES.'/SGExitintentPopup.php');
@@ -260,9 +260,9 @@ function redenderScriptMode($popupId)
260
  }
261
  if($multiplePopup && @in_array($popupId, $multiplePopup)) {
262
  sgRenderPopupScript($popupId);
263
- return;
264
  }
265
-
266
 
267
  sgRenderPopupOpen($popupId);
268
  }
@@ -289,23 +289,65 @@ function getPopupIdFromContentByClass($content) {
289
  }
290
  }
291
  }
292
-
293
  return $popupsID;
294
  }
295
 
296
  function getPopupIdInPageByClass($pageId) {
297
- $content = get_post($pageId)->post_content;
298
- return getPopupIdFromContentByClass($content);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
299
  }
300
 
301
  function sgOnloadPopup()
302
  {
303
  $page = get_queried_object_id();
 
304
  $popup = "sg_promotional_popup";
305
  /* If popup is set on page load */
306
  $popupId = SGPopup::getPagePopupId($page, $popup);
307
  /* get all popups id which set in current page by class */
308
  $popupsIdByClass = getPopupIdInPageByClass($page);
 
 
309
 
310
  if(POPUP_BUILDER_PKG > POPUP_BUILDER_PKG_FREE){
311
  delete_option("SG_MULTIPLE_POPUP");
@@ -313,20 +355,13 @@ function sgOnloadPopup()
313
  /* Retrun all popups id width selected On All Pages */
314
  $popupsId = SgPopupPro::allowPopupInAllPages($page,'page');
315
  $categories = SgPopupPro::allowPopupInAllCategories($page);
316
-
317
  $popupsId = array_merge($popupsId,$categories);
318
-
319
  $sgpbAllPosts = get_option("SG_ALL_POSTS");
320
- $sgpbAllPages = get_option("SG_ALL_PAGES");
321
-
322
- if(!empty($sgpbAllPosts) && is_array($sgpbAllPosts) && !(is_page() || is_home() || is_front_page())) {
323
- /* Add to popups Queue */
324
- $popupsId = array_merge(get_option("SG_ALL_POSTS"), $popupsId);
325
- }
326
- if(!empty($sgpbAllPages) && is_array($sgpbAllPages) && (is_page() || is_home() || is_front_page())) {
327
- /* Add to popups Queue */
328
- $popupsId = array_merge(get_option("SG_ALL_PAGES"), $popupsId);
329
- }
330
 
331
  /* $popupsId[0] its last selected popup id */
332
  if(isset($popupsId[0])) {
@@ -338,7 +373,7 @@ function sgOnloadPopup()
338
 
339
  showPopupInPage($queuePupupId);
340
  }
341
-
342
  $popupsId = json_encode($popupsId);
343
  }
344
  else {
@@ -358,6 +393,9 @@ function sgOnloadPopup()
358
  sgRenderPopupScript($popupId);
359
  }
360
  }
 
 
 
361
  return false;
362
  }
363
 
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.4.2
7
  * Author: Sygnoos
8
  * Author URI: http://www.sygnoos.com
9
  * License: GPLv2
70
  SGPopup::$registeredScripts = true;
71
  wp_register_style('sg_animate', SG_APP_POPUP_URL . '/style/animate.css');
72
  wp_enqueue_style('sg_animate');
 
 
73
  wp_register_script('sg_popup_frontend', SG_APP_POPUP_URL . '/javascript/sg_popup_frontend.js', array('jquery'), SG_POPUP_VERSION);
74
  wp_enqueue_script('sg_popup_frontend');
75
+ wp_register_script('sg_popup_init', SG_APP_POPUP_URL . '/javascript/sg_popup_init.js', array('jquery'), SG_POPUP_VERSION);
76
+ wp_enqueue_script('sg_popup_init');
77
  wp_enqueue_script('jquery');
78
  wp_register_script('sg_colorbox', SG_APP_POPUP_URL . '/javascript/jquery.sgcolorbox-min.js', array('jquery'), SG_POPUP_VERSION);
79
  wp_enqueue_script('sg_colorbox');
150
  sgRenderPopupScript($args['id']);
151
  $attr = '';
152
  $eventName = @$args['event'];
153
+
154
  if(isset($args['insidepopup'])) {
155
  $attr .= 'insidePopup="on"';
156
  }
171
  if(POPUP_BUILDER_PKG > POPUP_BUILDER_PKG_FREE) {
172
  $page = get_queried_object_id();
173
  $popupsId = SgPopupPro::allowPopupInAllPages($page,'page');
174
+
175
  /* When have many popups in current page */
176
  if(count($popupsId) > 0) {
177
  /* Add shordcode popup id in the QUEUE for php side */
188
  else {
189
  echo showPopupInPage($args['id']);
190
  }
191
+
192
  }
193
  $shortcodeContent = ob_get_contents();
194
  ob_end_clean();
199
  function sgRenderPopupOpen($popupId)
200
  {
201
  sgRenderPopupScript($popupId);
202
+
203
  echo "<script type=\"text/javascript\">
204
 
205
  sgAddEvent(window, 'load',function() {
220
  if(POPUP_BUILDER_PKG > POPUP_BUILDER_PKG_FREE) {
221
 
222
  $popupInTimeRange = SgPopupPro::popupInTimeRange($popupId);
223
+
224
  if(!$popupInTimeRange) {
225
  return false;
226
  }
233
 
234
  $showUser = SgPopupPro::showUserResolution($popupId);
235
  if(!$showUser) return false;
236
+
237
  if(!SGPopup::showPopupForCounrty($popupId)) { /* Sended popupId and function return true or false */
238
  return;
239
  }
250
  }
251
  $multiplePopup = get_option('SG_MULTIPLE_POPUP');
252
  $exitIntentPopupId = get_option('SG_POPUP_EXITINTENT_'.$popupId);
253
+
254
  if(isset($exitIntentPopupId) && $exitIntentPopupId == $popupId) {
255
  sgRenderPopupScript($popupId);
256
  require_once(SG_APP_POPUP_CLASSES.'/SGExitintentPopup.php');
260
  }
261
  if($multiplePopup && @in_array($popupId, $multiplePopup)) {
262
  sgRenderPopupScript($popupId);
263
+ return;
264
  }
265
+
266
 
267
  sgRenderPopupOpen($popupId);
268
  }
289
  }
290
  }
291
  }
292
+
293
  return $popupsID;
294
  }
295
 
296
  function getPopupIdInPageByClass($pageId) {
297
+
298
+ $postContentObj = get_post($pageId);
299
+
300
+ if(isset($postContentObj)) {
301
+ $content = $postContentObj->post_content;
302
+ return getPopupIdFromContentByClass($content);
303
+ }
304
+
305
+ return 0;
306
+ }
307
+
308
+ /**
309
+ * Get popup id from url
310
+ *
311
+ * @since 3.1.5
312
+ *
313
+ * @return int if popup not found->0 otherwise->popupId
314
+ *
315
+ */
316
+
317
+ function getPopupIdFromUrl() {
318
+
319
+ $popupId = 0;
320
+ if(!isset($_SERVER['REQUEST_URI'])) {
321
+ return $popupId;
322
+ }
323
+
324
+ $pageUrl = @$_SERVER['REQUEST_URI'];
325
+
326
+ preg_match("/sg_popup_id=+[0-9]+/i", $pageUrl, $match);
327
+
328
+ if(!empty($match)) {
329
+ $matchingNumber = explode("=", $match[0]);
330
+ if(!empty($matchingNumber[1])) {
331
+ $popupId = (int)$matchingNumber[1];
332
+ return $popupId;
333
+ }
334
+ return 0;
335
+ }
336
+
337
+ return 0;
338
  }
339
 
340
  function sgOnloadPopup()
341
  {
342
  $page = get_queried_object_id();
343
+ $postType = get_post_type();
344
  $popup = "sg_promotional_popup";
345
  /* If popup is set on page load */
346
  $popupId = SGPopup::getPagePopupId($page, $popup);
347
  /* get all popups id which set in current page by class */
348
  $popupsIdByClass = getPopupIdInPageByClass($page);
349
+ /* get popup id in page url */
350
+ $popupIdInPageUrl = getPopupIdFromUrl();
351
 
352
  if(POPUP_BUILDER_PKG > POPUP_BUILDER_PKG_FREE){
353
  delete_option("SG_MULTIPLE_POPUP");
355
  /* Retrun all popups id width selected On All Pages */
356
  $popupsId = SgPopupPro::allowPopupInAllPages($page,'page');
357
  $categories = SgPopupPro::allowPopupInAllCategories($page);
358
+
359
  $popupsId = array_merge($popupsId,$categories);
360
+
361
  $sgpbAllPosts = get_option("SG_ALL_POSTS");
362
+
363
+ $popupsInAllPosts = SgPopupPro::popupsIdInAllCategories($postType);
364
+ $popupsId = array_merge($popupsInAllPosts, $popupsId);
 
 
 
 
 
 
 
365
 
366
  /* $popupsId[0] its last selected popup id */
367
  if(isset($popupsId[0])) {
373
 
374
  showPopupInPage($queuePupupId);
375
  }
376
+
377
  $popupsId = json_encode($popupsId);
378
  }
379
  else {
393
  sgRenderPopupScript($popupId);
394
  }
395
  }
396
+ if($popupIdInPageUrl) {
397
+ showPopupInPage($popupIdInPageUrl);
398
+ }
399
  return false;
400
  }
401
 
readme.txt CHANGED
@@ -44,6 +44,8 @@ With popup builder plugin you can insert any type of content, right into your Po
44
  * Scale popup for desktop sizes
45
  * Network/Multisite popup
46
  * On click popup
 
 
47
  * Html popup
48
  * Image popup
49
  * Facebook popup
@@ -75,7 +77,7 @@ With popup builder plugin you can insert any type of content, right into your Po
75
 
76
  * Exit Intent popup - catch your users attention when they decide to leave your site without doing any of the things you want them to do. Exit-Intent popup can briefly interrupt them with a popup message, steering them towards a singular call to action.
77
 
78
- * Subscription popup - this kind of popup provides the easiest way to create an efficient connection between users and your website through subscription popup. With this simple popup solution you can quickly collect subscribers in a very pleasant and elegant way. With our newsletter module you can easly send mass mailings.
79
 
80
  * Create contact form popup - contact popup will allow your clients to write you a message right from the popup.
81
 
@@ -104,7 +106,7 @@ With popup builder plugin you can insert any type of content, right into your Po
104
 
105
  <a href="http://popup-builder.com" target="_blank">Get Popup Builder PRO package</a>
106
  <div>
107
- Customizing the look and feel of the popup is as important as the content itself. That's why Popup Builder gives you the ability tu customize the timings, effects, position and size of the popup to your needs.
108
  </div>
109
 
110
 
@@ -153,6 +155,12 @@ Go to the Popup Builder settings and set your desired options.
153
 
154
  == Changelog ==
155
 
 
 
 
 
 
 
156
  = Version 2.4.1 =
157
  * New opening animation added.
158
 
@@ -522,7 +530,7 @@ Leave us a good review :)
522
 
523
  == Upgrade Notice ==
524
 
525
- Current Version of Popup Builder is 2.3.9
526
 
527
  == Other Notes ==
528
 
44
  * Scale popup for desktop sizes
45
  * Network/Multisite popup
46
  * On click popup
47
+ * Open popup from URL. Example http://popup-builder.com/index.php?sg_popup_id=1
48
+ * Reopen popup after form submission
49
  * Html popup
50
  * Image popup
51
  * Facebook popup
77
 
78
  * Exit Intent popup - catch your users attention when they decide to leave your site without doing any of the things you want them to do. Exit-Intent popup can briefly interrupt them with a popup message, steering them towards a singular call to action.
79
 
80
+ * Subscription popup - this kind of popup provides the easiest way to create an efficient connection between users and your website through subscription popup. With this simple popup solution you can quickly collect subscribers in a very pleasant and elegant way. With our newsletter module you can easily send mass mailings.
81
 
82
  * Create contact form popup - contact popup will allow your clients to write you a message right from the popup.
83
 
106
 
107
  <a href="http://popup-builder.com" target="_blank">Get Popup Builder PRO package</a>
108
  <div>
109
+ Customizing the look and feel of the popup is as important as the content itself. That's why Popup Builder gives you the ability to customize the timings, effects, position and size of the popup to your needs.
110
  </div>
111
 
112
 
155
 
156
  == Changelog ==
157
 
158
+ = Version 2.4.2 =
159
+ * Added option to open from URL. Example http://popup-builder.com/index.php?sg_popup_id=1
160
+ * Added option to reopen popup after any form submission.
161
+ * Added option to show popup on custom posts (PRO)
162
+ * Bug fixes and code optimization.
163
+
164
  = Version 2.4.1 =
165
  * New opening animation added.
166
 
530
 
531
  == Upgrade Notice ==
532
 
533
+ Current Version of Popup Builder is 2.4.2
534
 
535
  == Other Notes ==
536
 
style/sg_popup_style.css CHANGED
@@ -25,6 +25,10 @@
25
  font-style: italic;
26
  }
27
 
 
 
 
 
28
  .sg-aligin-with-multiselect {
29
  display: block;
30
  float: left;
@@ -1408,6 +1412,60 @@ input:checked + .sg-slider:before {
1408
  border-radius: 50%;
1409
  }
1410
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1411
  @media only screen and (min-width:800px) {
1412
  .sgmb-container {
1413
  min-width:800px;
25
  font-style: italic;
26
  }
27
 
28
+ .popup-builder-multiselect {
29
+ min-width: 120px !important;
30
+ }
31
+
32
  .sg-aligin-with-multiselect {
33
  display: block;
34
  float: left;
1412
  border-radius: 50%;
1413
  }
1414
 
1415
+ /*more plugins section*/
1416
+ .plugin-icon {
1417
+ float:left;
1418
+ margin: 3px 6px 6px 0px;
1419
+ }
1420
+
1421
+ #plugin-icon-backup {
1422
+ width:128px;
1423
+ height:128px;
1424
+ background-image: url(//ps.w.org/backup/assets/icon-128x128.png?rev=1293306);
1425
+ background-size:128px 128px;
1426
+ }
1427
+
1428
+ #plugin-icon-social-media-builder {
1429
+ width:128px;
1430
+ height:128px;
1431
+ background-image: url(//ps.w.org/social-media-builder/assets/icon-128x128.png?rev=1315835);
1432
+ background-size:128px 128px;
1433
+ }
1434
+
1435
+ #plugin-icon-review-builder {
1436
+ width:128px;
1437
+ height:128px;
1438
+ background-image: url(//ps.w.org/review-builder/assets/icon-128x128.png?rev=1489430);
1439
+ background-size:128px 128px;
1440
+ }
1441
+
1442
+ #plugin-icon-kicker {
1443
+ width:128px;
1444
+ height:128px;
1445
+ background-size:128px 128px;
1446
+ }
1447
+
1448
+ .pro-options-div {
1449
+ position: absolute;
1450
+ width: 100%;
1451
+ height: 100%;
1452
+ background-color: rgba(238,238,238,0.4);
1453
+ top: 0;
1454
+ cursor: pointer;
1455
+ }
1456
+
1457
+ .pro-options-title {
1458
+ position: relative;
1459
+ top: 50%;
1460
+ left: 54%;
1461
+ font-size: 30px;
1462
+ color: red;
1463
+ opacity: 1;
1464
+ overflow-wrap: break-word;
1465
+ width: auto;
1466
+ margin-top: -15px;
1467
+ }
1468
+
1469
  @media only screen and (min-width:800px) {
1470
  .sgmb-container {
1471
  min-width:800px;