Popup Builder – Responsive WordPress Pop up - Version 2.5.1

Version Description

Current Version of Popup Builder is 2.5.1

Download this release

Release Info

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

Code changes from version 2.5.0 to 2.5.1

classes/PopupInstaller.php CHANGED
@@ -1,12 +1,11 @@
1
  <?php
2
- class PopupInstaller
3
- {
4
  public static $mainTableName = "sg_popup";
5
 
6
- public static function createTables($blogId = '')
7
- {
8
- global $wpdb;
9
 
 
10
  update_option('SG_POPUP_VERSION', SG_POPUP_VERSION);
11
  $sgPopupBase = "CREATE TABLE IF NOT EXISTS ". $wpdb->prefix.$blogId."sg_popup (
12
  `id` int(11) NOT NULL AUTO_INCREMENT,
@@ -70,7 +69,7 @@ class PopupInstaller
70
  $wpdb->query($sgPopupShortcodeBase);
71
  $wpdb->query($sgPopupAddon);
72
  $wpdb->query($addonsConnectionTable);
73
-
74
  $columnInfo = $wpdb->query("SHOW COLUMNS FROM ".$wpdb->prefix.$blogId.SGPBExtension::SGPB_ADDON_TABLE_NAME." LIKE 'isEvent'");
75
  if(!$columnInfo) {
76
  $alterQuery = "ALTER TABLE ".$wpdb->prefix.$blogId.SGPBExtension::SGPB_ADDON_TABLE_NAME." ADD isEvent TINYINT UNSIGNED NOT NULL";
@@ -79,10 +78,9 @@ class PopupInstaller
79
 
80
  }
81
 
82
- public static function install()
83
- {
84
- $obj = new self();
85
- $obj->createTables();
86
 
87
  /*get_current_blog_id() == 1 When plugin activated inside the child of multisite instance*/
88
  if(is_multisite() && get_current_blog_id() == 1) {
@@ -104,14 +102,14 @@ class PopupInstaller
104
  $blogId = $site['blog_id']."_";
105
  }
106
  if($blogId != 1) {
107
- $obj->createTables($blogId);
108
  }
109
  }
110
  }
111
  }
112
 
113
- public static function uninstallTables($blogId = '')
114
- {
115
  global $wpdb;
116
  $delete = "DELETE FROM ".$wpdb->prefix.$blogId."postmeta WHERE meta_key = 'sg_promotional_popup' ";
117
  $wpdb->query($delete);
@@ -150,8 +148,8 @@ class PopupInstaller
150
  $wpdb->query($deleteAddonsConnectionTable);
151
  }
152
 
153
- public static function deleteSgPopupOptions($blogId = '')
154
- {
155
  global $wpdb;
156
  $deleteSG = "DELETE FROM ".$wpdb->prefix.$blogId."options WHERE option_name LIKE '%SG_POPUP%'";
157
  $wpdb->query($deleteSG);
@@ -160,7 +158,7 @@ class PopupInstaller
160
  public static function uninstall() {
161
 
162
  $obj = new self();
163
- $obj->uninstallTables();
164
  $obj->deleteSgPopupOptions();
165
 
166
  if(is_multisite()) {
@@ -181,7 +179,7 @@ class PopupInstaller
181
  $blogId = $site['blog_id']."_";
182
  }
183
 
184
- $obj->uninstallTables($blogId);
185
  $obj->deleteSgPopupOptions($blogId);
186
  }
187
  }
1
  <?php
2
+ class PopupInstaller {
3
+
4
  public static $mainTableName = "sg_popup";
5
 
6
+ public static function createTables($blogId = '') {
 
 
7
 
8
+ global $wpdb;
9
  update_option('SG_POPUP_VERSION', SG_POPUP_VERSION);
10
  $sgPopupBase = "CREATE TABLE IF NOT EXISTS ". $wpdb->prefix.$blogId."sg_popup (
11
  `id` int(11) NOT NULL AUTO_INCREMENT,
69
  $wpdb->query($sgPopupShortcodeBase);
70
  $wpdb->query($sgPopupAddon);
71
  $wpdb->query($addonsConnectionTable);
72
+
73
  $columnInfo = $wpdb->query("SHOW COLUMNS FROM ".$wpdb->prefix.$blogId.SGPBExtension::SGPB_ADDON_TABLE_NAME." LIKE 'isEvent'");
74
  if(!$columnInfo) {
75
  $alterQuery = "ALTER TABLE ".$wpdb->prefix.$blogId.SGPBExtension::SGPB_ADDON_TABLE_NAME." ADD isEvent TINYINT UNSIGNED NOT NULL";
78
 
79
  }
80
 
81
+ public static function install() {
82
+
83
+ self::createTables();
 
84
 
85
  /*get_current_blog_id() == 1 When plugin activated inside the child of multisite instance*/
86
  if(is_multisite() && get_current_blog_id() == 1) {
102
  $blogId = $site['blog_id']."_";
103
  }
104
  if($blogId != 1) {
105
+ self::createTables($blogId);
106
  }
107
  }
108
  }
109
  }
110
 
111
+ public static function uninstallTables($blogId = '') {
112
+
113
  global $wpdb;
114
  $delete = "DELETE FROM ".$wpdb->prefix.$blogId."postmeta WHERE meta_key = 'sg_promotional_popup' ";
115
  $wpdb->query($delete);
148
  $wpdb->query($deleteAddonsConnectionTable);
149
  }
150
 
151
+ public static function deleteSgPopupOptions($blogId = '') {
152
+
153
  global $wpdb;
154
  $deleteSG = "DELETE FROM ".$wpdb->prefix.$blogId."options WHERE option_name LIKE '%SG_POPUP%'";
155
  $wpdb->query($deleteSG);
158
  public static function uninstall() {
159
 
160
  $obj = new self();
161
+ self::uninstallTables();
162
  $obj->deleteSgPopupOptions();
163
 
164
  if(is_multisite()) {
179
  $blogId = $site['blog_id']."_";
180
  }
181
 
182
+ self::uninstallTables($blogId);
183
  $obj->deleteSgPopupOptions($blogId);
184
  }
185
  }
classes/SGPBExtension.php CHANGED
@@ -148,7 +148,7 @@ abstract class SGPBExtension {
148
  'extensionKey'=> $extensionKey,
149
  'content'=> $popupContent,
150
  'extensionType'=> $extensionType,
151
- 'options'=> $extensionOptions,
152
  );
153
  $formats = array('%d', '%s', '%s', '%s', '%s');
154
  $wpdb->insert($wpdb->prefix.$extensionConnectionTable, $data, $formats);
@@ -157,13 +157,13 @@ abstract class SGPBExtension {
157
  else {
158
  $data = array(
159
  'content'=> $popupContent,
160
- 'options'=> $extensionOptions,
161
  );
162
  $formats = array('%s', '%s');
163
  $whereFormat = array('%d', '%s');
164
  $where = array(
165
  'popupId'=> $popupId,
166
- 'extensionKey'=> $extensionKey,
167
  );
168
 
169
  $wpdb->update($wpdb->prefix.$extensionConnectionTable, $data, $where, $formats, $whereFormat);
148
  'extensionKey'=> $extensionKey,
149
  'content'=> $popupContent,
150
  'extensionType'=> $extensionType,
151
+ 'options'=> $extensionOptions
152
  );
153
  $formats = array('%d', '%s', '%s', '%s', '%s');
154
  $wpdb->insert($wpdb->prefix.$extensionConnectionTable, $data, $formats);
157
  else {
158
  $data = array(
159
  'content'=> $popupContent,
160
+ 'options'=> $extensionOptions
161
  );
162
  $formats = array('%s', '%s');
163
  $whereFormat = array('%d', '%s');
164
  $where = array(
165
  'popupId'=> $popupId,
166
+ 'extensionKey'=> $extensionKey
167
  );
168
 
169
  $wpdb->update($wpdb->prefix.$extensionConnectionTable, $data, $where, $formats, $whereFormat);
classes/SGPopup.php CHANGED
@@ -106,6 +106,9 @@ abstract class SGPopup {
106
  $paths = IntegrateExternalSettings::getCurrentPopupAppPaths($type);
107
 
108
  $popupAppPath = $paths['app-path'];
 
 
 
109
  require_once($popupAppPath.'/classes/'.$className.'.php');
110
  $obj = new $className();
111
  }
@@ -251,6 +254,32 @@ abstract class SGPopup {
251
 
252
  }
253
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
254
  public function render() {
255
  /* When have popup with same id in the same page */
256
  $registryInstance = SgRegistry::getInstance();
@@ -258,6 +287,7 @@ abstract class SGPopup {
258
 
259
  if(!in_array($this->getId(), $currentPopups)) {
260
  $popupId = $this->getId();
 
261
  $hasPopupEvent = SGPBExtension::hasPopupEvent($popupId);
262
  $eventOptions = array('customEvent' => $hasPopupEvent);
263
  $parentOption = array('id'=>$this->getId(),'title'=>$this->getTitle(),'type'=>$this->getType(),'effect'=>$this->getEffect(),'width',$this->getWidth(),'height'=>$this->getHeight(),'delay'=>$this->getDelay(),'duration'=>$this->getEffectDuration(),'initialWidth',$this->getInitialWidth(),'initialHeight'=>$this->getInitialHeight());
@@ -327,21 +357,17 @@ abstract class SGPopup {
327
  }
328
 
329
  public static function addPopupForAllPages($id = '', $selectedData = '', $type) {
 
330
  global $wpdb;
331
 
332
- $values = array();
333
  $insertPreapre = array();
334
-
335
- //Remove page if it is in use for another popup
336
- //self::deleteAllPagesPopup($selectedData);
337
-
338
  $insertQuery = "INSERT INTO ". $wpdb->prefix ."sg_popup_in_pages(popupId, pageId, type) VALUES ";
339
 
340
  foreach ($selectedData as $value) {
341
  $insertPreapre[] .= $wpdb->prepare( "(%d,%d,%s)", $id, $value, $type);
342
  }
343
  $insertQuery .= implode( ",\n", $insertPreapre );
344
- $res = $wpdb->query($insertQuery);
345
  }
346
 
347
  public static function removePopupFromPages($popupId, $type)
106
  $paths = IntegrateExternalSettings::getCurrentPopupAppPaths($type);
107
 
108
  $popupAppPath = $paths['app-path'];
109
+ if(!file_exists($popupAppPath.'/classes/'.$className.'.php')) {
110
+ return false;
111
+ }
112
  require_once($popupAppPath.'/classes/'.$className.'.php');
113
  $obj = new $className();
114
  }
254
 
255
  }
256
 
257
+ private function addPopupStyles() {
258
+ $popupId = $this->getId();
259
+ $options = $this->getOptions();
260
+ $options = json_decode($options, true);
261
+
262
+ if(empty($options)) {
263
+ return '';
264
+ }
265
+
266
+ /*When popup z index does not exist we give to z - index max value*/
267
+ if(empty($options['popup-z-index'])) {
268
+ $popupZIndex = '2147483647';
269
+ }
270
+ else {
271
+ $popupZIndex = $options['popup-z-index'];
272
+ }
273
+
274
+ echo '<style type="text/css">
275
+
276
+ .sg-popup-overlay-'.$popupId.',
277
+ .sg-popup-content-'.$popupId.' {
278
+ z-index: '.$popupZIndex.' !important;
279
+ }
280
+ </style>';
281
+ }
282
+
283
  public function render() {
284
  /* When have popup with same id in the same page */
285
  $registryInstance = SgRegistry::getInstance();
287
 
288
  if(!in_array($this->getId(), $currentPopups)) {
289
  $popupId = $this->getId();
290
+ $this->addPopupStyles();
291
  $hasPopupEvent = SGPBExtension::hasPopupEvent($popupId);
292
  $eventOptions = array('customEvent' => $hasPopupEvent);
293
  $parentOption = array('id'=>$this->getId(),'title'=>$this->getTitle(),'type'=>$this->getType(),'effect'=>$this->getEffect(),'width',$this->getWidth(),'height'=>$this->getHeight(),'delay'=>$this->getDelay(),'duration'=>$this->getEffectDuration(),'initialWidth',$this->getInitialWidth(),'initialHeight'=>$this->getInitialHeight());
357
  }
358
 
359
  public static function addPopupForAllPages($id = '', $selectedData = '', $type) {
360
+
361
  global $wpdb;
362
 
 
363
  $insertPreapre = array();
 
 
 
 
364
  $insertQuery = "INSERT INTO ". $wpdb->prefix ."sg_popup_in_pages(popupId, pageId, type) VALUES ";
365
 
366
  foreach ($selectedData as $value) {
367
  $insertPreapre[] .= $wpdb->prepare( "(%d,%d,%s)", $id, $value, $type);
368
  }
369
  $insertQuery .= implode( ",\n", $insertPreapre );
370
+ $wpdb->query($insertQuery);
371
  }
372
 
373
  public static function removePopupFromPages($popupId, $type)
classes/SGPopupBuilderMain.php CHANGED
@@ -72,7 +72,7 @@ class SGPopupBuilderMain {
72
  public function popupPluginActionLinks($links) {
73
 
74
  $popupActionLinks = array(
75
- '<a href="' . SG_POPUP_EXTENSION_URL . '" target="_blank">Extensions</a>',
76
  );
77
 
78
  if(POPUP_BUILDER_PKG == POPUP_BUILDER_PKG_FREE) {
72
  public function popupPluginActionLinks($links) {
73
 
74
  $popupActionLinks = array(
75
+ '<a href="' . SG_POPUP_EXTENSION_URL . '" target="_blank">Extensions</a>'
76
  );
77
 
78
  if(POPUP_BUILDER_PKG == POPUP_BUILDER_PKG_FREE) {
classes/sgDataTable/SGPopupTable.php CHANGED
@@ -59,4 +59,25 @@ class SGPB_PopupsView extends SGPB_Table
59
  }
60
  $query .= $searchQuery;
61
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
62
  }
59
  }
60
  $query .= $searchQuery;
61
  }
62
+
63
+ public function customizeRowsData(&$popupsData)
64
+ {
65
+ $columnsNames = $this->getColumns();
66
+ $typeKey = array_search('type', $columnsNames);
67
+
68
+ foreach ($popupsData as $key => $popupData) {
69
+ $type = $popupData[$typeKey];
70
+ $className = "SG".ucfirst(strtolower($type)).'Popup';
71
+ /* get current popup app path */
72
+ $paths = IntegrateExternalSettings::getCurrentPopupAppPaths($type);
73
+
74
+ $popupAppPath = $paths['app-path'];
75
+ if(!file_exists($popupAppPath.'/classes/'.$className.'.php')) {
76
+ unset($popupsData[$key]);
77
+ }
78
+
79
+ }
80
+ }
81
+
82
+
83
  }
classes/sgDataTable/Table.php CHANGED
@@ -37,6 +37,11 @@ class SGPB_Table extends SGPB_ListTable
37
  $this->columns = $columns;
38
  }
39
 
 
 
 
 
 
40
  public function setDisplayColumns($displayColumns)
41
  {
42
  $this->displayColumns = $displayColumns;
@@ -118,7 +123,15 @@ class SGPB_Table extends SGPB_ListTable
118
  $hidden = array();
119
  $sortable = $this->get_sortable_columns();
120
  $this->_column_headers = array($columns, $hidden, $sortable);
121
- $this->items = $wpdb->get_results($query, ARRAY_N);
 
 
 
 
 
 
 
 
122
  }
123
 
124
  public function get_sortable_columns() {
@@ -129,7 +142,7 @@ class SGPB_Table extends SGPB_ListTable
129
  {
130
  //get the records registered in the prepare_items method
131
  $records = $this->items;
132
-
133
  //get the columns registered in the get_columns and get_sortable_columns methods
134
  list($columns, $hidden) = $this->get_column_info();
135
 
37
  $this->columns = $columns;
38
  }
39
 
40
+ public function getColumns()
41
+ {
42
+ return $this->columns;
43
+ }
44
+
45
  public function setDisplayColumns($displayColumns)
46
  {
47
  $this->displayColumns = $displayColumns;
123
  $hidden = array();
124
  $sortable = $this->get_sortable_columns();
125
  $this->_column_headers = array($columns, $hidden, $sortable);
126
+ $items = $wpdb->get_results($query, ARRAY_N);
127
+ /*Remove popup data when its class does not exist.*/
128
+ $this->customizeRowsData($items);
129
+
130
+ $this->items = $items;
131
+ }
132
+
133
+ public function customizeRowsData(&$items) {
134
+
135
  }
136
 
137
  public function get_sortable_columns() {
142
  {
143
  //get the records registered in the prepare_items method
144
  $records = $this->items;
145
+
146
  //get the columns registered in the get_columns and get_sortable_columns methods
147
  list($columns, $hidden) = $this->get_column_info();
148
 
config.php CHANGED
@@ -20,8 +20,8 @@ class SgPopupBuilderConfig {
20
  define('SG_APP_POPUP_JS', SG_APP_POPUP_PATH . '/javascript');
21
  define('SG_APP_POPUP_HELPERS', SG_APP_POPUP_PATH . '/helpers/');
22
  define('SG_APP_POPUP_TABLE_LIMIT', 15);
23
- define('SG_POPUP_VERSION', 2.50);
24
- define('SG_POPUP_PRO_VERSION', 3.20);
25
  define('SG_POPUP_PRO_URL', 'http://popup-builder.com/');
26
  define('SG_POPUP_EXTENSION_URL', 'http://popup-builder.com/extensions');
27
  define('SG_MAILCHIMP_EXTENSION_URL', 'http://popup-builder.com/downloads/mailchimp/');
@@ -58,7 +58,7 @@ class SgPopupBuilderConfig {
58
  'social' => 'Social',
59
  'exitIntent' => 'Exit Intent',
60
  'subscription' => 'Subscription',
61
- 'contactForm' => 'Contact Form',
62
  );
63
 
64
  $POPUP_ADDONS = array(
20
  define('SG_APP_POPUP_JS', SG_APP_POPUP_PATH . '/javascript');
21
  define('SG_APP_POPUP_HELPERS', SG_APP_POPUP_PATH . '/helpers/');
22
  define('SG_APP_POPUP_TABLE_LIMIT', 15);
23
+ define('SG_POPUP_VERSION', 2.51);
24
+ define('SG_POPUP_PRO_VERSION', 3.21);
25
  define('SG_POPUP_PRO_URL', 'http://popup-builder.com/');
26
  define('SG_POPUP_EXTENSION_URL', 'http://popup-builder.com/extensions');
27
  define('SG_MAILCHIMP_EXTENSION_URL', 'http://popup-builder.com/downloads/mailchimp/');
58
  'social' => 'Social',
59
  'exitIntent' => 'Exit Intent',
60
  'subscription' => 'Subscription',
61
+ 'contactForm' => 'Contact Form'
62
  );
63
 
64
  $POPUP_ADDONS = array(
files/main_section/fblike.php CHANGED
@@ -9,7 +9,7 @@
9
  $settings = array(
10
  'wpautop' => false,
11
  'tinymce' => array(
12
- 'width' => '100%',
13
  ),
14
  'textarea_rows' => '6',
15
  'media_buttons' => true
9
  $settings = array(
10
  'wpautop' => false,
11
  'tinymce' => array(
12
+ 'width' => '100%'
13
  ),
14
  'textarea_rows' => '6',
15
  'media_buttons' => true
files/main_section/html.php CHANGED
@@ -9,7 +9,7 @@
9
  $settings = array(
10
  'wpautop' => false,
11
  'tinymce' => array(
12
- 'width' => '100%',
13
  ),
14
  'textarea_rows' => '6',
15
  'media_buttons' => true
9
  $settings = array(
10
  'wpautop' => false,
11
  'tinymce' => array(
12
+ 'width' => '100%'
13
  ),
14
  'textarea_rows' => '6',
15
  'media_buttons' => true
files/sg_admin_post.php CHANGED
@@ -5,7 +5,7 @@ function sgGetCsvFile() {
5
  $rows = array('id', 'firstName', 'lastName', 'email', 'subscriptionType');
6
  foreach ($rows as $value) {
7
 
8
- $content .= $value.",";
9
  }
10
  $content .= "\n";
11
 
5
  $rows = array('id', 'firstName', 'lastName', 'email', 'subscriptionType');
6
  foreach ($rows as $value) {
7
 
8
+ $content .= $value.',';
9
  }
10
  $content .= "\n";
11
 
files/sg_functions.php CHANGED
@@ -91,6 +91,11 @@ class SGFunctions
91
 
92
  $st = $wpdb->prepare("SELECT * FROM ". $wpdb->prefix ."sg_popup_settings WHERE id = %d",1);
93
  $arr = $wpdb->get_row($st,ARRAY_A);
 
 
 
 
 
94
  $options = json_decode($arr['options'], true);
95
  $deleteStatus = ($options['tables-delete-status'] == 'on' ? true: false);
96
 
91
 
92
  $st = $wpdb->prepare("SELECT * FROM ". $wpdb->prefix ."sg_popup_settings WHERE id = %d",1);
93
  $arr = $wpdb->get_row($st,ARRAY_A);
94
+
95
+ if(empty($arr)) {
96
+ return true;
97
+ }
98
+
99
  $options = json_decode($arr['options'], true);
100
  $deleteStatus = ($options['tables-delete-status'] == 'on' ? true: false);
101
 
files/sg_more_plugins.php CHANGED
@@ -15,7 +15,7 @@
15
  </div>
16
  <div class="plugin-card">
17
  <div class="plugin-card-top" onclick="window.open('https://wordpress.org/plugins/breadcrumbs-builder/')">
18
- <a href="#" class="plugin-icon"><style type="text/css">#plugin-icon-breadcrumbs-builder { width:128px; height:128px; background-image: url("//ps.w.org/breadcrumbs-builder/assets/icon-128x128.jpg?rev=1581944"); background-size:128px 128px; }</style><div class="plugin-icon" id="plugin-icon-breadcrumbs-builder" style="float:left; margin: 3px 6px 6px 0px;"></div></a>
19
  <div class="name column-name">
20
  <h4><a href="#">Breadcrumbs</a></h4>
21
  </div>
@@ -56,7 +56,7 @@
56
  </div>
57
  <div class="plugin-card" onclick="window.open('http://wpkicker.com/')">
58
  <div class="plugin-card-top">
59
- <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>
60
  <div class="name column-name">
61
  <h4><a href="#">WP Kicker</a></h4>
62
  </div>
15
  </div>
16
  <div class="plugin-card">
17
  <div class="plugin-card-top" onclick="window.open('https://wordpress.org/plugins/breadcrumbs-builder/')">
18
+ <a href="https://wordpress.org/plugins/breadcrumbs-builder/" class="plugin-icon"><style type="text/css">#plugin-icon-breadcrumbs-builder { width:128px; height:128px; background-image: url("//ps.w.org/breadcrumbs-builder/assets/icon-128x128.jpg?rev=1581944"); background-size:128px 128px; }</style><div class="plugin-icon" id="plugin-icon-breadcrumbs-builder" style="float:left; margin: 3px 6px 6px 0px;"></div></a>
19
  <div class="name column-name">
20
  <h4><a href="#">Breadcrumbs</a></h4>
21
  </div>
56
  </div>
57
  <div class="plugin-card" onclick="window.open('http://wpkicker.com/')">
58
  <div class="plugin-card-top">
59
+ <a href="http://wpkicker.com/" 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>
60
  <div class="name column-name">
61
  <h4><a href="#">WP Kicker</a></h4>
62
  </div>
files/sg_popup_actions.php CHANGED
@@ -78,6 +78,10 @@ function sgnewslatter_repeat_function($args) {
78
  $allData = $wpdb->get_results($getAllDataSql, ARRAY_A);
79
  }
80
 
 
 
 
 
81
  foreach ($allData as $data) {
82
 
83
  $patternFirstName = '/\[First name]/';
@@ -95,10 +99,6 @@ function sgnewslatter_repeat_function($args) {
95
  $emailMessageCustom = preg_replace($patternUserName, $replacementUserName, $emailMessageCustom);
96
  $emailMessageCustom = stripslashes($emailMessageCustom);
97
 
98
- /*Mail Headers*/
99
- $headers = 'MIME-Version: 1.0'."\r\n";
100
- $headers .= 'Content-type: text/html; charset=UTF-8'."\r\n";
101
-
102
  $mailStatus = wp_mail($data['email'], $mailSubject, $emailMessageCustom, $headers);
103
  if(!$mailStatus) {
104
  $errorLogSql = $wpdb->prepare('INSERT INTO '. $wpdb->prefix .'sg_subscription_error_log(`popupType`, `email`, `date`) VALUES (%s, %s, %s)', $subscriptionType, $data['email'], date('Y-m-d H:i'));
78
  $allData = $wpdb->get_results($getAllDataSql, ARRAY_A);
79
  }
80
 
81
+ /*Mail Headers*/
82
+ $headers = 'MIME-Version: 1.0'."\r\n";
83
+ $headers .= 'Content-type: text/html; charset=UTF-8'."\r\n";
84
+
85
  foreach ($allData as $data) {
86
 
87
  $patternFirstName = '/\[First name]/';
99
  $emailMessageCustom = preg_replace($patternUserName, $replacementUserName, $emailMessageCustom);
100
  $emailMessageCustom = stripslashes($emailMessageCustom);
101
 
 
 
 
 
102
  $mailStatus = wp_mail($data['email'], $mailSubject, $emailMessageCustom, $headers);
103
  if(!$mailStatus) {
104
  $errorLogSql = $wpdb->prepare('INSERT INTO '. $wpdb->prefix .'sg_subscription_error_log(`popupType`, `email`, `date`) VALUES (%s, %s, %s)', $subscriptionType, $data['email'], date('Y-m-d H:i'));
files/sg_popup_ajax.php CHANGED
@@ -114,7 +114,7 @@ function sgImportPopups()
114
  $popupOptions = $popupData['options'];
115
 
116
  //Insert popup
117
- $sql = $wpdb->prepare("INSERT INTO ".$wpdb->prefix.PopupInstaller::$maintablename."(id, type, title, options) VALUES (%d, %s, %s, %s)", $popupId, $popupType, $popupTitle, $popupOptions);
118
  $res = $wpdb->query($sql);
119
  //Get last insert popup id
120
  $lastInsertId = $wpdb->insert_id;
@@ -162,13 +162,11 @@ function sgLazyLoading() {
162
  $postType = $_POST['postType'];
163
  $loadingNumber = (int)$_POST['loadingNumber'];
164
  $customParams = $_POST['customParams'];
 
165
 
166
- /* Whem load first time need add Home page in Wp pages */
167
  if($loadingNumber == 0) {
168
- $defArray = array(-1=>"Home page");
169
- }
170
- else {
171
- $defArray = array();
172
  }
173
 
174
  if($postType == SG_POST_TYPE_PAGE) {
@@ -185,7 +183,7 @@ function sgLazyLoading() {
185
  }
186
  }
187
 
188
- if($loadingNumber > 0 && sizeof($pageData) == 0) {
189
  die();
190
  }
191
 
@@ -232,10 +230,14 @@ function addToSubscribers() {
232
  $lastName = $_POST['lastName'];
233
  $email = $_POST['email'];
234
  $subsType = $_POST['subsType'];
235
-
236
  foreach ($subsType as $subType) {
237
- $sql = $wpdb->prepare("INSERT INTO ".$wpdb->prefix."sg_subscribers (firstName, lastName, email, subscriptionType) VALUES (%s, %s, %s, %s)", $firstName, $lastName, $email, $subType);
238
- $res = $wpdb->query($sql);
 
 
 
 
239
  }
240
 
241
  die();
114
  $popupOptions = $popupData['options'];
115
 
116
  //Insert popup
117
+ $sql = $wpdb->prepare("INSERT INTO ".$wpdb->prefix.PopupInstaller::$mainTableName."(id, type, title, options) VALUES (%d, %s, %s, %s)", $popupId, $popupType, $popupTitle, $popupOptions);
118
  $res = $wpdb->query($sql);
119
  //Get last insert popup id
120
  $lastInsertId = $wpdb->insert_id;
162
  $postType = $_POST['postType'];
163
  $loadingNumber = (int)$_POST['loadingNumber'];
164
  $customParams = $_POST['customParams'];
165
+ $defArray = array();
166
 
167
+ /* When load first time need add Home page in Wp pages */
168
  if($loadingNumber == 0) {
169
+ $defArray = array(-1 => 'Home page');
 
 
 
170
  }
171
 
172
  if($postType == SG_POST_TYPE_PAGE) {
183
  }
184
  }
185
 
186
+ if($loadingNumber > 0 && count($pageData) == 0) {
187
  die();
188
  }
189
 
230
  $lastName = $_POST['lastName'];
231
  $email = $_POST['email'];
232
  $subsType = $_POST['subsType'];
233
+
234
  foreach ($subsType as $subType) {
235
+ $selectSql = $wpdb->prepare("SELECT id FROM ".$wpdb->prefix."sg_subscribers WHERE email=%s AND subscriptionType=%s", $email, $subType);
236
+ $res = $wpdb->get_row($selectSql, ARRAY_A);
237
+ if(empty($res)) {
238
+ $sql = $wpdb->prepare("INSERT INTO ".$wpdb->prefix."sg_subscribers (firstName, lastName, email, subscriptionType) VALUES (%s, %s, %s, %s) ", $firstName, $lastName, $email, $subType);
239
+ $wpdb->query($sql);
240
+ }
241
  }
242
 
243
  die();
files/sg_popup_create_new.php CHANGED
@@ -161,6 +161,7 @@ if (isset($_GET['id'])) {
161
  $sgColorboxTheme = @$jsonData['theme'];
162
  $sgOverlayCustomClasss = @$jsonData['sgOverlayCustomClasss'];
163
  $sgContentCustomClasss = @$jsonData['sgContentCustomClasss'];
 
164
  $sgOnceExpiresTime = @$jsonData['onceExpiresTime'];
165
  $sgRestrictionAction = @$jsonData['restrictionAction'];
166
  $yesButtonBackgroundColor = @sgSafeStr($jsonData['yesButtonBackgroundColor']);
@@ -299,7 +300,8 @@ $sgPopup = array(
299
  'delay' => 0,
300
  'theme-close-text' => 'Close',
301
  'content-click-behavior' => 'close',
302
- 'sgTheme3BorderRadius' => 0
 
303
  );
304
 
305
  $popupProDefaultValues = array(
@@ -409,6 +411,7 @@ $reopenAfterSubmission = sgBoolToChecked($sgPopup['reopenAfterSubmission']);
409
  $contentClick = sgBoolToChecked($sgPopup['contentClick']);
410
  $contentClickBehavior = $sgPopup['content-click-behavior'];
411
  $theme3BorderRadius = $sgPopup['sgTheme3BorderRadius'];
 
412
 
413
  $closeType = sgBoolToChecked($popupProDefaultValues['closeType']);
414
  $onScrolling = sgBoolToChecked($popupProDefaultValues['onScrolling']);
@@ -606,6 +609,7 @@ $sgOpacity = @sgGetValue($sgOpacity, $opacityValue);
606
  $sgPopupBackgroundOpacity = @sgGetValue($sgPopupBackgroundOpacity, $popupBackgroundOpacity);
607
  $sgWidth = @sgGetValue($sgWidth, $width);
608
  $sgHeight = @sgGetValue($sgHeight, $height);
 
609
  $sgPopupDimensionMode = @sgGetValue($sgPopupDimensionMode, $popupDimensionMode);
610
  $sgPopupResponsiveDimensionMeasure = @sgGetValue($sgPopupResponsiveDimensionMeasure, $popupResponsiveDimensionMeasure);
611
  $sgInitialWidth = @sgGetValue($sgInitialWidth, $initialWidth);
@@ -1089,13 +1093,14 @@ function sgCreateSelect($options,$name,$selecteOption)
1089
  else {
1090
  @$popup_style_name = ($popup_style_name) ? $popup_style_name : '';
1091
  $str .= "<select name=$name class=$popup_style_name input-width-static >";
1092
- foreach ($options as $key=>$option) {
 
 
 
1093
  if ($key == $selecteOption) {
1094
- $selected = "selected";
1095
- }
1096
- else {
1097
- $selected ='';
1098
  }
 
1099
  $str .= "<option value='".$key."' ".$selected." >$option</potion>";
1100
  }
1101
 
@@ -1229,18 +1234,18 @@ if (isset($_GET["titleError"])): ?>
1229
  </div>
1230
  <div class="js-accordion-customMode js-radio-accordion sg-accordion-content">
1231
  <span class="liquid-width">Width:</span>
1232
- <input class="input-width-static" type="text" name="width" value="<?php echo esc_attr($sgWidth); ?>" pattern = "\d+(([px]+|\%)|)" title="It must be number + px or %" /><img class='errorInfo' src="<?php echo plugins_url('img/info-error.png', dirname(__FILE__).'../') ?>"><span class="validateError">It must be a number + px or %</span><br>
1233
  <span class="liquid-width">Height:</span>
1234
- <input class="input-width-static" type="text" name="height" value="<?php echo esc_attr($sgHeight);?>" pattern = "\d+(([px]+|\%)|)" title="It must be number + px or %" /><img class='errorInfo' src="<?php echo plugins_url('img/info-error.png', dirname(__FILE__).'../') ?>"><span class="validateError">It must be a number + px or %</span><br>
1235
  <span class="liquid-width">Initial width:</span>
1236
- <input class="input-width-static" type="text" name="initialWidth" value="<?php echo esc_attr($sgInitialWidth);?>" pattern = "\d+(([px]+|\%)|)" title="It must be number + px or %" /><img class='errorInfo' src="<?php echo plugins_url('img/info-error.png', dirname(__FILE__).'../') ?>"><span class="validateError">It must be a number + px or %</span><br>
1237
  <span class="liquid-width">Initial height:</span>
1238
- <input class="input-width-static" type="text" name="initialHeight" value="<?php echo esc_attr($sgInitialHeight);?>" pattern = "\d+(([px]+|\%)|)" title="It must be number + px or %" /><img class='errorInfo' src="<?php echo plugins_url('img/info-error.png', dirname(__FILE__).'../') ?>"><span class="validateError">It must be a number + px or %</span><br>
1239
  </div>
1240
  <span class="liquid-width">Max width:</span>
1241
- <input class="input-width-static" type="text" name="maxWidth" value="<?php echo esc_attr($sgMaxWidth);?>" pattern = "\d+(([px]+|\%)|)" title="It must be number + px or %" /><img class='errorInfo' src="<?php echo plugins_url('img/info-error.png', dirname(__FILE__).'../') ?>"><span class="validateError">It must be a number + px or %</span><br>
1242
  <span class="liquid-width">Max height:</span>
1243
- <input class="input-width-static" type="text" name="maxHeight" value="<?php echo esc_attr(@$sgMaxHeight);?>" pattern = "\d+(([px]+|\%)|)" title="It must be number + px or %" /><img class='errorInfo' src="<?php echo plugins_url('img/info-error.png', dirname(__FILE__).'../') ?>"><span class="validateError">It must be a number + px or %</span><br>
1244
  </div>
1245
  </div>
1246
 
@@ -1280,21 +1285,14 @@ if (isset($_GET["titleError"])): ?>
1280
  <div class="sg-hide sg-full-width js-content-click-wrraper">
1281
  <?php echo createRadiobuttons($contentClickOptions, "content-click-behavior", true, esc_html($sgContentClickBehavior), "liquid-width"); ?>
1282
  <div class="sg-hide js-readio-buttons-acordion-content sg-full-width">
1283
- <span class="liquid-width">Url:</span><input class="input-width-static" type="text" name='click-redirect-to-url' value="<?php echo esc_attr(@$sgClickRedirectToUrl); ?>">
1284
- <span class="liquid-width">Redirect to new tab:</span><input type="checkbox" name="redirect-to-new-tab" <?php echo $sgRedirectToNewTab; ?> >
1285
  </div>
1286
  </div>
1287
 
1288
  <span class="liquid-width">Reopen after form submission:</span><input class="input-width-static" type="checkbox" name="reopenAfterSubmission" <?php echo $sgReopenAfterSubmission;?> />
1289
  <span class="dashicons dashicons-info overlayImg sameImageStyle"></span><span class="infoReopenSubmiting samefontStyle">If checked, the popup will reopen after form submission.</span><br>
1290
 
1291
- <div class="sg-hide sg-full-width js-content-click-wrraper">
1292
- <?php echo createRadiobuttons($contentClickOptions, "content-click-behavior", true, esc_html($sgContentClickBehavior), "liquid-width"); ?>
1293
- <div class="sg-hide js-readio-buttons-acordion-content sg-full-width">
1294
- <span class="liquid-width">URL:</span><input class="input-width-static" type="text" name='click-redirect-to-url' value="<?php echo esc_attr(@$sgClickRedirectToUrl); ?>">
1295
- <span class="liquid-width">redirect to new tab:</span><input type="checkbox" name="redirect-to-new-tab" <?php echo $sgRedirectToNewTab; ?> >
1296
- </div>
1297
- </div>
1298
 
1299
  <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>
1300
 
@@ -1318,6 +1316,9 @@ if (isset($_GET["titleError"])): ?>
1318
  <span class="liquid-width">Content custom class:</span><input class="input-width-static" type="text" name="sgContentCustomClasss" value="<?php echo esc_attr(@$sgContentCustomClasss);?>">
1319
  <br>
1320
 
 
 
 
1321
  <span class="liquid-width" id="createDescribeFixed">Popup location:</span><input class="input-width-static js-checkbox-acordion" type="checkbox" name="popupFixed" <?php echo $sgPopupFixed;?> />
1322
  <div class="js-popop-fixeds">
1323
  <span class="fix-wrapper-style" >&nbsp;</span>
161
  $sgColorboxTheme = @$jsonData['theme'];
162
  $sgOverlayCustomClasss = @$jsonData['sgOverlayCustomClasss'];
163
  $sgContentCustomClasss = @$jsonData['sgContentCustomClasss'];
164
+ $sgPopupZIndex = @$jsonData['popup-z-index'];
165
  $sgOnceExpiresTime = @$jsonData['onceExpiresTime'];
166
  $sgRestrictionAction = @$jsonData['restrictionAction'];
167
  $yesButtonBackgroundColor = @sgSafeStr($jsonData['yesButtonBackgroundColor']);
300
  'delay' => 0,
301
  'theme-close-text' => 'Close',
302
  'content-click-behavior' => 'close',
303
+ 'sgTheme3BorderRadius' => 0,
304
+ 'popup-z-index' => 9999
305
  );
306
 
307
  $popupProDefaultValues = array(
411
  $contentClick = sgBoolToChecked($sgPopup['contentClick']);
412
  $contentClickBehavior = $sgPopup['content-click-behavior'];
413
  $theme3BorderRadius = $sgPopup['sgTheme3BorderRadius'];
414
+ $popupZIndex = $sgPopup['popup-z-index'];
415
 
416
  $closeType = sgBoolToChecked($popupProDefaultValues['closeType']);
417
  $onScrolling = sgBoolToChecked($popupProDefaultValues['onScrolling']);
609
  $sgPopupBackgroundOpacity = @sgGetValue($sgPopupBackgroundOpacity, $popupBackgroundOpacity);
610
  $sgWidth = @sgGetValue($sgWidth, $width);
611
  $sgHeight = @sgGetValue($sgHeight, $height);
612
+ $sgPopupZIndex = @sgGetValue($sgPopupZIndex, $popupZIndex);
613
  $sgPopupDimensionMode = @sgGetValue($sgPopupDimensionMode, $popupDimensionMode);
614
  $sgPopupResponsiveDimensionMeasure = @sgGetValue($sgPopupResponsiveDimensionMeasure, $popupResponsiveDimensionMeasure);
615
  $sgInitialWidth = @sgGetValue($sgInitialWidth, $initialWidth);
1093
  else {
1094
  @$popup_style_name = ($popup_style_name) ? $popup_style_name : '';
1095
  $str .= "<select name=$name class=$popup_style_name input-width-static >";
1096
+ foreach ($options as $key => $option) {
1097
+
1098
+ $selected ='';
1099
+
1100
  if ($key == $selecteOption) {
1101
+ $selected = 'selected';
 
 
 
1102
  }
1103
+
1104
  $str .= "<option value='".$key."' ".$selected." >$option</potion>";
1105
  }
1106
 
1234
  </div>
1235
  <div class="js-accordion-customMode js-radio-accordion sg-accordion-content">
1236
  <span class="liquid-width">Width:</span>
1237
+ <input class="input-width-static" type="text" name="width" value="<?php echo esc_attr($sgWidth); ?>" pattern = "\d+(([px]+|%)|)" title="It must be number + px or %" /><img class='errorInfo' src="<?php echo plugins_url('img/info-error.png', dirname(__FILE__).'../') ?>"><span class="validateError">It must be a number + px or %</span><br>
1238
  <span class="liquid-width">Height:</span>
1239
+ <input class="input-width-static" type="text" name="height" value="<?php echo esc_attr($sgHeight);?>" pattern = "\d+(([px]+|%)|)" title="It must be number + px or %" /><img class='errorInfo' src="<?php echo plugins_url('img/info-error.png', dirname(__FILE__).'../') ?>"><span class="validateError">It must be a number + px or %</span><br>
1240
  <span class="liquid-width">Initial width:</span>
1241
+ <input class="input-width-static" type="text" name="initialWidth" value="<?php echo esc_attr($sgInitialWidth);?>" pattern = "\d+(([px]+|%)|)" title="It must be number + px or %" /><img class='errorInfo' src="<?php echo plugins_url('img/info-error.png', dirname(__FILE__).'../') ?>"><span class="validateError">It must be a number + px or %</span><br>
1242
  <span class="liquid-width">Initial height:</span>
1243
+ <input class="input-width-static" type="text" name="initialHeight" value="<?php echo esc_attr($sgInitialHeight);?>" pattern = "\d+(([px]+|%)|)" title="It must be number + px or %" /><img class='errorInfo' src="<?php echo plugins_url('img/info-error.png', dirname(__FILE__).'../') ?>"><span class="validateError">It must be a number + px or %</span><br>
1244
  </div>
1245
  <span class="liquid-width">Max width:</span>
1246
+ <input class="input-width-static" type="text" name="maxWidth" value="<?php echo esc_attr($sgMaxWidth);?>" pattern = "\d+(([px]+|%)|)" title="It must be number + px or %" /><img class='errorInfo' src="<?php echo plugins_url('img/info-error.png', dirname(__FILE__).'../') ?>"><span class="validateError">It must be a number + px or %</span><br>
1247
  <span class="liquid-width">Max height:</span>
1248
+ <input class="input-width-static" type="text" name="maxHeight" value="<?php echo esc_attr(@$sgMaxHeight);?>" pattern = "\d+(([px]+|%)|)" title="It must be number + px or %" /><img class='errorInfo' src="<?php echo plugins_url('img/info-error.png', dirname(__FILE__).'../') ?>"><span class="validateError">It must be a number + px or %</span><br>
1249
  </div>
1250
  </div>
1251
 
1285
  <div class="sg-hide sg-full-width js-content-click-wrraper">
1286
  <?php echo createRadiobuttons($contentClickOptions, "content-click-behavior", true, esc_html($sgContentClickBehavior), "liquid-width"); ?>
1287
  <div class="sg-hide js-readio-buttons-acordion-content sg-full-width">
1288
+ <span class="liquid-width">URL:</span><input class="input-width-static" type="text" name='click-redirect-to-url' value="<?php echo esc_attr(@$sgClickRedirectToUrl); ?>">
1289
+ <span class="liquid-width">redirect to new tab:</span><input type="checkbox" name="redirect-to-new-tab" <?php echo $sgRedirectToNewTab; ?> >
1290
  </div>
1291
  </div>
1292
 
1293
  <span class="liquid-width">Reopen after form submission:</span><input class="input-width-static" type="checkbox" name="reopenAfterSubmission" <?php echo $sgReopenAfterSubmission;?> />
1294
  <span class="dashicons dashicons-info overlayImg sameImageStyle"></span><span class="infoReopenSubmiting samefontStyle">If checked, the popup will reopen after form submission.</span><br>
1295
 
 
 
 
 
 
 
 
1296
 
1297
  <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>
1298
 
1316
  <span class="liquid-width">Content custom class:</span><input class="input-width-static" type="text" name="sgContentCustomClasss" value="<?php echo esc_attr(@$sgContentCustomClasss);?>">
1317
  <br>
1318
 
1319
+ <span class="liquid-width">Popup z-index:</span><input class="input-width-static" type="number" name="popup-z-index" value="<?php echo esc_attr($sgPopupZIndex);?>">
1320
+ <br>
1321
+
1322
  <span class="liquid-width" id="createDescribeFixed">Popup location:</span><input class="input-width-static js-checkbox-acordion" type="checkbox" name="popupFixed" <?php echo $sgPopupFixed;?> />
1323
  <div class="js-popop-fixeds">
1324
  <span class="fix-wrapper-style" >&nbsp;</span>
files/sg_popup_media_button.php CHANGED
@@ -78,7 +78,7 @@ function sgPopupMediaButtonThickboxs()
78
  }
79
  var appearEvent = jQuery("#openEvent").val();
80
 
81
- selectionText = '';
82
  if (typeof(tinyMCE.editors.content) != "undefined") {
83
  selectionText = (tinyMCE.activeEditor.selection.getContent()) ? tinyMCE.activeEditor.selection.getContent() : '';
84
  }
78
  }
79
  var appearEvent = jQuery("#openEvent").val();
80
 
81
+ var selectionText = '';
82
  if (typeof(tinyMCE.editors.content) != "undefined") {
83
  selectionText = (tinyMCE.activeEditor.selection.getContent()) ? tinyMCE.activeEditor.selection.getContent() : '';
84
  }
files/sg_popup_page_selection.php CHANGED
@@ -23,12 +23,14 @@ function sgPopupCallback($post)
23
  $orderBy = 'id DESC';
24
  $proposedTypes = SGPopup::findAll($orderBy);
25
  function sgCreateSelect($options,$name,$selecteOption) {
26
- $selected ='';
27
  $str = "";
28
  $str .= "<select class=\"choose-popup-type\" name=\"$name\">";
29
  $str .= "<option value=''>Not selected</option>";
30
- foreach($options as $option)
31
- {
 
 
32
  if ($option) {
33
  $title = $option->getTitle();
34
  $type = $option->getType();
@@ -36,9 +38,7 @@ function sgPopupCallback($post)
36
  if ($selecteOption == $id) {
37
  $selected = "selected";
38
  }
39
- else {
40
- $selected ='';
41
- }
42
  $str .= "<option value='".$id."' disable='".$id."' ".$selected." >$title - $type</option>";
43
  }
44
  }
23
  $orderBy = 'id DESC';
24
  $proposedTypes = SGPopup::findAll($orderBy);
25
  function sgCreateSelect($options,$name,$selecteOption) {
26
+
27
  $str = "";
28
  $str .= "<select class=\"choose-popup-type\" name=\"$name\">";
29
  $str .= "<option value=''>Not selected</option>";
30
+ foreach($options as $option) {
31
+
32
+ $selected ='';
33
+
34
  if ($option) {
35
  $title = $option->getTitle();
36
  $type = $option->getType();
38
  if ($selecteOption == $id) {
39
  $selected = "selected";
40
  }
41
+
 
 
42
  $str .= "<option value='".$id."' disable='".$id."' ".$selected." >$title - $type</option>";
43
  }
44
  }
helpers/Integrate_external_settings.php CHANGED
@@ -30,19 +30,18 @@ Class IntegrateExternalSettings {
30
 
31
  public static function doesntHaveAnyActiveExtensions() {
32
 
 
 
33
  $addons = self::getAllAddons();
34
 
35
  if(empty($addons)) {
36
  return true;
37
  }
38
- global $POPUP_ADDONS;
39
- $activeExtensionsCount = sizeof($addons);
40
- $allSizeOf = sizeof($POPUP_ADDONS);
41
 
42
- if($allSizeOf > $activeExtensionsCount) {
43
- return true;
44
- }
45
- return false;
46
  }
47
 
48
  public static function isExtensionExists($extensionName) {
@@ -176,6 +175,7 @@ Class IntegrateExternalSettings {
176
  'onceExpiresTime' => sgSanitize('onceExpiresTime'),
177
  'sgOverlayCustomClasss' => sgSanitize('sgOverlayCustomClasss'),
178
  'sgContentCustomClasss' => sgSanitize('sgContentCustomClasss'),
 
179
  'theme-close-text' => sgSanitize('theme-close-text'),
180
  'socialButtons' => json_encode($params['socialButtons']),
181
  'socialOptions' => json_encode($params['socialOptions']),
30
 
31
  public static function doesntHaveAnyActiveExtensions() {
32
 
33
+ global $POPUP_ADDONS;
34
+
35
  $addons = self::getAllAddons();
36
 
37
  if(empty($addons)) {
38
  return true;
39
  }
 
 
 
40
 
41
+ $activeExtensionsCount = count($addons);
42
+ $allSizeOf = count($POPUP_ADDONS);
43
+
44
+ return $allSizeOf > $activeExtensionsCount;
45
  }
46
 
47
  public static function isExtensionExists($extensionName) {
175
  'onceExpiresTime' => sgSanitize('onceExpiresTime'),
176
  'sgOverlayCustomClasss' => sgSanitize('sgOverlayCustomClasss'),
177
  'sgContentCustomClasss' => sgSanitize('sgContentCustomClasss'),
178
+ 'popup-z-index' => sgSanitize('popup-z-index'),
179
  'theme-close-text' => sgSanitize('theme-close-text'),
180
  'socialButtons' => json_encode($params['socialButtons']),
181
  'socialOptions' => json_encode($params['socialOptions']),
javascript/jquery.sgcolorbox-min.js CHANGED
@@ -461,6 +461,13 @@
461
  }
462
  /* Start to set custom class and add to html */
463
  if(typeof options === 'object') {
 
 
 
 
 
 
 
464
  var customClass = defaults['customClass'];
465
  if(typeof options['className'] !== 'undefined' && options['className']){
466
  customClass = options['className'];
@@ -478,8 +485,8 @@
478
  contentCustomClassName = defaults['contentCustomClassName'];
479
  }
480
 
481
- $box.addClass(customClass).addClass(contentCustomClassName);
482
- $overlay.addClass(customClass).addClass(overlayCutsomClassName);
483
  }
484
  /* End action */
485
  }
461
  }
462
  /* Start to set custom class and add to html */
463
  if(typeof options === 'object') {
464
+ var popupId = options['popupId'];
465
+
466
+ /*when popup id does not exist*/
467
+ if(typeof popupId == 'undefined') {
468
+ popupId = 0;
469
+ }
470
+
471
  var customClass = defaults['customClass'];
472
  if(typeof options['className'] !== 'undefined' && options['className']){
473
  customClass = options['className'];
485
  contentCustomClassName = defaults['contentCustomClassName'];
486
  }
487
 
488
+ $box.addClass(customClass).addClass(contentCustomClassName+' sg-popup-content-'+popupId);
489
+ $overlay.addClass(customClass).addClass(overlayCutsomClassName+' sg-popup-overlay-'+popupId);
490
  }
491
  /* End action */
492
  }
javascript/sg_popup_backend.js CHANGED
@@ -1 +1 @@
1
- function beckend() {
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.opacityRange();
9
  this.subOptionContents();
10
  this.addCountries();
11
  this.showCloseTextFieldForTheme();
12
  this.popupReview();
13
  this.colorPicekr(); /* Color picker */
14
  this.switchPopupActive();
15
  this.initAccordions();
16
  });
17
  jQuery('.sg-info-close').on('click', function() {
18
  jQuery( ".sg-info-panel-wrapper" ).hide(300);
19
  });
20
  this.radioButtonAcordion(jQuery("[name='subs-success-behavior']"),jQuery("[name='subs-success-behavior']:checked"),"showMessage", jQuery('.js-subs-success-message-content'));
21
  this.radioButtonAcordion(jQuery("[name='subs-success-behavior']"),jQuery("[name='subs-success-behavior']:checked"),"redirectToUrl", jQuery('.js-subs-success-redirect-content'));
22
  this.radioButtonAcordion(jQuery("[name='subs-success-behavior']"),jQuery("[name='subs-success-behavior']:checked"),"openPopup", jQuery('.js-subs-success-popups-list-content'));
23
  checkedElement.after(toggleContnet.css({'display':'inline-block'}));
 
24
  this.titleNotEmpty(); /* Check title is Empty */
25
  this.showThemePicture(); /* Show themes pictures */
26
  this.showEffects(); /* Show effect type */
27
  this.pageAcordion(); /* For page accordion divs */
28
  this.fixedPostionSelection(); /* Functionality for selected position */
29
  this.showInfo(); /* Show description options */
30
  this.opacityRange();
31
  this.subOptionContents();
32
  this.addCountries();
33
  this.showCloseTextFieldForTheme();
34
  this.popupReview();
35
  this.colorPicekr(); /* Color picker */
36
  this.switchPopupActive();
37
  this.initAccordions();
38
  });
39
  jQuery('.sg-info-close').on('click', function() {
40
  jQuery( ".sg-info-panel-wrapper" ).hide(300);
41
  });
42
  this.radioButtonAcordion(jQuery("[name='subs-success-behavior']"),jQuery("[name='subs-success-behavior']:checked"),"showMessage", jQuery('.js-subs-success-message-content'));
43
  this.radioButtonAcordion(jQuery("[name='subs-success-behavior']"),jQuery("[name='subs-success-behavior']:checked"),"redirectToUrl", jQuery('.js-subs-success-redirect-content'));
44
  this.radioButtonAcordion(jQuery("[name='subs-success-behavior']"),jQuery("[name='subs-success-behavior']:checked"),"openPopup", jQuery('.js-subs-success-popups-list-content'));
45
  checkedElement.after(toggleContnet.css({'display':'inline-block'}));
 
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.opacityRange();
8
  this.subOptionContents();
9
  this.addCountries();
10
  this.showCloseTextFieldForTheme();
11
  this.popupReview();
12
  this.colorPicekr(); /* Color picker */
13
  this.switchPopupActive();
14
  this.initAccordions();
15
  });
16
  jQuery('.sg-info-close').on('click', function() {
17
  jQuery( ".sg-info-panel-wrapper" ).hide(300);
18
  });
19
  this.radioButtonAcordion(jQuery("[name='subs-success-behavior']"),jQuery("[name='subs-success-behavior']:checked"),"showMessage", jQuery('.js-subs-success-message-content'));
20
  this.radioButtonAcordion(jQuery("[name='subs-success-behavior']"),jQuery("[name='subs-success-behavior']:checked"),"redirectToUrl", jQuery('.js-subs-success-redirect-content'));
21
  this.radioButtonAcordion(jQuery("[name='subs-success-behavior']"),jQuery("[name='subs-success-behavior']:checked"),"openPopup", jQuery('.js-subs-success-popups-list-content'));
22
  checkedElement.after(toggleContnet.css({'display':'inline-block'}));
23
+ function beckend() {
24
  this.titleNotEmpty(); /* Check title is Empty */
25
  this.showThemePicture(); /* Show themes pictures */
26
  this.showEffects(); /* Show effect type */
27
  this.pageAcordion(); /* For page accordion divs */
28
  this.fixedPostionSelection(); /* Functionality for selected position */
29
  this.showInfo(); /* Show description options */
30
  this.opacityRange();
31
  this.subOptionContents();
32
  this.addCountries();
33
  this.showCloseTextFieldForTheme();
34
  this.popupReview();
35
  this.colorPicekr(); /* Color picker */
36
  this.switchPopupActive();
37
  this.initAccordions();
38
  });
39
  jQuery('.sg-info-close').on('click', function() {
40
  jQuery( ".sg-info-panel-wrapper" ).hide(300);
41
  });
42
  this.radioButtonAcordion(jQuery("[name='subs-success-behavior']"),jQuery("[name='subs-success-behavior']:checked"),"showMessage", jQuery('.js-subs-success-message-content'));
43
  this.radioButtonAcordion(jQuery("[name='subs-success-behavior']"),jQuery("[name='subs-success-behavior']:checked"),"redirectToUrl", jQuery('.js-subs-success-redirect-content'));
44
  this.radioButtonAcordion(jQuery("[name='subs-success-behavior']"),jQuery("[name='subs-success-behavior']:checked"),"openPopup", jQuery('.js-subs-success-popups-list-content'));
45
  checkedElement.after(toggleContnet.css({'display':'inline-block'}));
javascript/sg_popup_frontend.js CHANGED
@@ -1,4 +1,5 @@
1
  function SGPopup() {
 
2
  this.positionLeft = '';
3
  this.positionTop = '';
4
  this.positionBottom = '';
@@ -17,18 +18,20 @@ function SGPopup() {
17
  this.popupType = '';
18
  this.popupClassEvents = ['hover'];
19
  this.eventExecuteCountByClass = 0;
 
20
  }
21
 
22
  /*Popup thems default paddings where key is theme number value padding*/
23
  SGPopup.sgColorBoxDeafults = {1 : 70, 2: 34, 3: 30, 4 : 70, 5 : 62, 6: 70};
24
 
25
  SGPopup.prototype.popupOpenById = function (popupId) {
26
- sgOnScrolling = (SG_POPUP_DATA [popupId]['onScrolling']) ? SG_POPUP_DATA [popupId]['onScrolling'] : '';
27
- sgInActivity = (SG_POPUP_DATA [popupId]['inActivityStatus']) ? SG_POPUP_DATA [popupId]['inActivityStatus'] : '';
28
- beforeScrolingPrsent = (SG_POPUP_DATA [popupId]['onScrolling']) ? SG_POPUP_DATA [popupId]['beforeScrolingPrsent'] : '';
29
- autoClosePopup = (SG_POPUP_DATA [popupId]['autoClosePopup']) ? SG_POPUP_DATA [popupId]['autoClosePopup'] : '';
30
- popupClosingTimer = (SG_POPUP_DATA [popupId]['popupClosingTimer']) ? SG_POPUP_DATA [popupId]['popupClosingTimer'] : '';
31
- sgPoupFrontendObj = new SGPopup();
 
32
 
33
  if (sgOnScrolling) {
34
  sgPoupFrontendObj.onScrolling(popupId);
@@ -42,6 +45,7 @@ SGPopup.prototype.popupOpenById = function (popupId) {
42
  };
43
 
44
  SGPopup.getCookie = function (cName) {
 
45
  var name = cName + "=";
46
  var ca = document.cookie.split(';');
47
  for (var i = 0; i < ca.length; i++) {
@@ -57,6 +61,7 @@ SGPopup.getCookie = function (cName) {
57
  };
58
 
59
  SGPopup.deleteCookie = function (name) {
 
60
  document.cookie = name + '=; expires=Thu, 01 Jan 1970 00:00:01 GMT;';
61
  };
62
 
@@ -110,10 +115,10 @@ SGPopup.prototype.attacheShortCodeEvent = function () {
110
  popupEvent = 'click';
111
  }
112
  /* For counting execute and did it one time for popup open */
113
- sgEventExecuteCount = 0;
114
  jQuery(this).bind(popupEvent, function () {
115
- ++sgEventExecuteCount;
116
- if (sgEventExecuteCount > 1) {
117
  return;
118
  }
119
  var sgPopupID = jQuery(this).attr("data-sgpopupid");
@@ -252,22 +257,45 @@ SGPopup.prototype.findPopupIdFromClassNames = function (className, classKey) {
252
  return popupId;
253
  };
254
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
255
  SGPopup.prototype.sgCustomizeThemes = function (popupId) {
256
 
257
  var popupData = SG_POPUP_DATA[popupId];
258
  var borderRadiues = popupData['sg3ThemeBorderRadiues'];
259
  var popupContentOpacity = popupData['popup-background-opacity'];
260
- var changedColor = jQuery('#sgcboxContent').css('background-color').replace(')', ', '+popupContentOpacity+')').replace('rgb', 'rgba');
 
 
 
 
 
 
 
261
 
262
  if (popupData['theme'] == "colorbox3.css") {
263
  var borderColor = popupData['sgTheme3BorderColor'];
264
  var borderRadiues = popupData['sgTheme3BorderRadius'];
265
- jQuery("#sgcboxLoadedContent").css({'border-color': borderColor})
266
- jQuery("#sgcboxLoadedContent").css({'border-radius': borderRadiues + "%"})
267
  jQuery("#sgcboxContent").css({'border-radius': borderRadiues + "%"})
268
  }
269
 
270
- jQuery('#sgcboxContent').css({'background-color': changedColor})
271
  jQuery('#sgcboxLoadedContent').css({'background-color': changedColor})
272
 
273
  };
@@ -299,6 +327,7 @@ SGPopup.prototype.isolatedScroll = function () {
299
  };
300
 
301
  SGPopup.prototype.sgPopupScalingDimensions = function () {
 
302
  var popupWrapper = jQuery("#sgcboxWrapper").outerWidth();
303
  var screenWidth = jQuery(window).width();
304
  /*popupWrapper != 9999 for resizing case when colorbox is calculated popup dimensions*/
@@ -319,6 +348,7 @@ SGPopup.prototype.sgPopupScalingDimensions = function () {
319
  };
320
 
321
  SGPopup.prototype.sgPopupScaling = function () {
 
322
  var that = this;
323
  jQuery("#sgcolorbox").bind("sgColorboxOnCompleate", function () {
324
  that.sgPopupScalingDimensions();
@@ -331,7 +361,8 @@ SGPopup.prototype.sgPopupScaling = function () {
331
  };
332
 
333
  SGPopup.prototype.varToBool = function (optionName) {
334
- returnValue = (optionName) ? true : false;
 
335
  return returnValue;
336
  };
337
 
@@ -367,6 +398,7 @@ SGPopup.prototype.canOpenPopup = function (id, openOnce, isOnLoad) {
367
  };
368
 
369
  SGPopup.prototype.setFixedPosition = function (sgPositionLeft, sgPositionTop, sgPositionBottom, sgPositionRight, sgFixedPositionTop, sgFixedPositionLeft) {
 
370
  this.positionLeft = sgPositionLeft;
371
  this.positionTop = sgPositionTop;
372
  this.positionBottom = sgPositionBottom;
@@ -376,16 +408,19 @@ SGPopup.prototype.setFixedPosition = function (sgPositionLeft, sgPositionTop, sg
376
  };
377
 
378
  SGPopup.prototype.percentToPx = function (percentDimention, screenDimension) {
 
379
  var dimension = parseInt(percentDimention) * screenDimension / 100;
380
  return dimension;
381
  };
382
 
383
  SGPopup.prototype.getPositionPercent = function (needPercent, screenDimension, dimension) {
 
384
  var sgPosition = (((this.percentToPx(needPercent, screenDimension) - dimension / 2) / screenDimension) * 100) + "%";
385
  return sgPosition;
386
  };
387
 
388
  SGPopup.prototype.showPopup = function (id, isOnLoad) {
 
389
  var that = this;
390
 
391
  /*When id does not exist*/
@@ -409,9 +444,8 @@ SGPopup.prototype.showPopup = function (id, isOnLoad) {
409
  if (!this.canOpenPopup(this.popupData['id'], this.openOnce, isOnLoad)) {
410
  return;
411
  }
412
-
413
- popupColorboxUrl = SG_APP_POPUP_URL + '/style/sgcolorbox/' + this.popupData['theme'];
414
- jQuery('[id=sg_colorbox_theme-css]').remove();
415
  head = document.getElementsByTagName('head')[0];
416
  link = document.createElement('link');
417
  link.type = "text/css";
@@ -429,7 +463,9 @@ SGPopup.prototype.showPopup = function (id, isOnLoad) {
429
  };
430
 
431
  SGPopup.setToPopupsCookiesList = function (cookieName) {
 
432
  var currentCookies = SGPopup.getCookie('sgPopupCookieList');
 
433
  if (!currentCookies) {
434
  currentCookies = [];
435
  }
@@ -484,7 +520,7 @@ SGPopup.prototype.resizeDimension = function () {
484
  contentWidth = '94%';
485
  }
486
  else {
487
- contentWidth = responsiveMeasure+'%s';
488
  }
489
  jQuery.sgcolorbox.settings.width = contentWidth;
490
 
@@ -521,10 +557,12 @@ SGPopup.prototype.calculateContentDimensions = function () {
521
  };
522
 
523
  SGPopup.prototype.sgShowColorboxWithOptions = function () {
 
524
  var that = this;
525
  setTimeout(function () {
526
-
527
- sgPopupFixed = that.varToBool(that.popupData['popupFixed']);
 
528
  that.popupOverlayClose = that.varToBool(that.popupData['overlayClose']);
529
  that.popupContentClick = that.varToBool(that.popupData['contentClick']);
530
  var popupReposition = that.varToBool(that.popupData['reposition']);
@@ -539,7 +577,7 @@ SGPopup.prototype.sgShowColorboxWithOptions = function () {
539
  var disablePopupOverlay = that.varToBool(that.popupData['disablePopupOverlay']);
540
  var popupAutoClosePopup = that.varToBool(that.popupData['autoClosePopup']);
541
  var saveCookiePageLevel = that.varToBool(that.popupData['save-cookie-page-level']);
542
- popupClosingTimer = that.popupData['popupClosingTimer'];
543
 
544
  if (popupScaling) {
545
  that.sgPopupScaling();
@@ -631,8 +669,8 @@ SGPopup.prototype.sgShowColorboxWithOptions = function () {
631
  sgPopupWidthPx = parseInt(sgPopupWidthPx);
632
  sgPopupHeightPx = parseInt(sgPopupHeightPx);
633
 
634
- popupPositionTop = that.getPositionPercent("50%", sgScreenHeight, sgPopupHeightPx);
635
- popupPositionLeft = that.getPositionPercent("50%", sgScreenWidth, sgPopupWidthPx);
636
 
637
  if (popupPosition == 1) { // Left Top
638
  that.setFixedPosition('0%', '3%', false, false, 0, 0);
@@ -681,7 +719,7 @@ SGPopup.prototype.sgShowColorboxWithOptions = function () {
681
  }
682
 
683
  if (onlyMobile) {
684
- openOnlyMobile = false;
685
  openOnlyMobile = that.forMobile();
686
  if (openOnlyMobile == false) {
687
  return;
@@ -693,6 +731,7 @@ SGPopup.prototype.sgShowColorboxWithOptions = function () {
693
  }
694
 
695
  SG_POPUP_SETTINGS = {
 
696
  width: popupWidth,
697
  height: popupHeight,
698
  className: customClassName,
@@ -715,16 +754,15 @@ SGPopup.prototype.sgShowColorboxWithOptions = function () {
715
  }
716
 
717
  jQuery('#sgcolorbox').trigger("sgColorboxOnOpen", []);
718
- that.sgCustomizeThemes(that.popupData['id']);
719
 
720
  },
721
  onLoad: function () {
722
  },
723
  onComplete: function () {
724
  if (contentBackgroundColor) {
725
- jQuery("#sgcboxLoadedContent").css({'background-color': contentBackgroundColor})
726
  }
727
- jQuery("#sgcboxLoadedContent").addClass("sg-current-popup-" + that.popupData['id'])
728
  jQuery('#sgcolorbox').trigger("sgColorboxOnCompleate", [pushToBottom]);
729
  if (popupWidth == '' && popupHeight == '') {
730
  jQuery.sgcolorbox.resize();
@@ -744,7 +782,7 @@ SGPopup.prototype.sgShowColorboxWithOptions = function () {
744
  jQuery('#sgcolorbox').trigger("sgPopupCleanup", []);
745
  },
746
  onClosed: function () {
747
- jQuery("#sgcboxLoadedContent").removeClass("sg-current-popup-" + that.popupData['id'])
748
  jQuery('#sgcolorbox').trigger("sgPopupClose", []);
749
  },
750
  trapFocus: that.sgTrapFocus,
@@ -781,7 +819,7 @@ SGPopup.prototype.sgShowColorboxWithOptions = function () {
781
  }
782
  /* Cookie can't be set here as it's set in Age Restriction popup when the user clicks "yes" */
783
  if (that.popupData['id'] && that.isOnLoad == true && that.openOnce != '' && that.popupData['type'] != "ageRestriction") {
784
- sgCookieData = '';
785
  if (!saveCookiePageLevel) {
786
  jQuery.cookie.defaults = {path: '/'};
787
  }
@@ -789,11 +827,11 @@ SGPopup.prototype.sgShowColorboxWithOptions = function () {
789
  var currentCookie = jQuery.cookie('sgPopupDetails' + that.popupData['id']);
790
 
791
  if (typeof currentCookie == 'undefined') {
792
- openCounter = 1;
793
  }
794
  else {
795
  var currentCookie = JSON.parse(jQuery.cookie('sgPopupDetails' + that.popupData['id']));
796
- openCounter = currentCookie.openCounter += 1;
797
  }
798
  sgCookieData = {
799
  'popupId': that.popupData['id'],
@@ -831,7 +869,7 @@ SGPopup.prototype.sgShowColorboxWithOptions = function () {
831
 
832
  jQuery('#sgcolorbox').bind('sgPopupClose', function (e) {
833
  /* reset event execute count for popup open */
834
- sgEventExecuteCount = 0;
835
  that.eventExecuteCountByClass = 0;
836
  jQuery('#sgcolorbox').removeClass(customClassName);
837
  /* Remove custom class for another popup */
@@ -844,6 +882,7 @@ SGPopup.prototype.sgShowColorboxWithOptions = function () {
844
  };
845
 
846
  jQuery(document).ready(function ($) {
 
847
  var popupObj = new SGPopup();
848
  popupObj.init();
849
  });
1
  function SGPopup() {
2
+
3
  this.positionLeft = '';
4
  this.positionTop = '';
5
  this.positionBottom = '';
18
  this.popupType = '';
19
  this.popupClassEvents = ['hover'];
20
  this.eventExecuteCountByClass = 0;
21
+ this.sgEventExecuteCount = 0;
22
  }
23
 
24
  /*Popup thems default paddings where key is theme number value padding*/
25
  SGPopup.sgColorBoxDeafults = {1 : 70, 2: 34, 3: 30, 4 : 70, 5 : 62, 6: 70};
26
 
27
  SGPopup.prototype.popupOpenById = function (popupId) {
28
+
29
+ var sgOnScrolling = (SG_POPUP_DATA [popupId]['onScrolling']) ? SG_POPUP_DATA [popupId]['onScrolling'] : '';
30
+ var sgInActivity = (SG_POPUP_DATA [popupId]['inActivityStatus']) ? SG_POPUP_DATA [popupId]['inActivityStatus'] : '';
31
+ var beforeScrolingPrsent = (SG_POPUP_DATA [popupId]['onScrolling']) ? SG_POPUP_DATA [popupId]['beforeScrolingPrsent'] : '';
32
+ var autoClosePopup = (SG_POPUP_DATA [popupId]['autoClosePopup']) ? SG_POPUP_DATA [popupId]['autoClosePopup'] : '';
33
+ var popupClosingTimer = (SG_POPUP_DATA [popupId]['popupClosingTimer']) ? SG_POPUP_DATA [popupId]['popupClosingTimer'] : '';
34
+ var sgPoupFrontendObj = new SGPopup();
35
 
36
  if (sgOnScrolling) {
37
  sgPoupFrontendObj.onScrolling(popupId);
45
  };
46
 
47
  SGPopup.getCookie = function (cName) {
48
+
49
  var name = cName + "=";
50
  var ca = document.cookie.split(';');
51
  for (var i = 0; i < ca.length; i++) {
61
  };
62
 
63
  SGPopup.deleteCookie = function (name) {
64
+
65
  document.cookie = name + '=; expires=Thu, 01 Jan 1970 00:00:01 GMT;';
66
  };
67
 
115
  popupEvent = 'click';
116
  }
117
  /* For counting execute and did it one time for popup open */
118
+ that.sgEventExecuteCount = 0;
119
  jQuery(this).bind(popupEvent, function () {
120
+ that.sgEventExecuteCount += 1;
121
+ if (that.sgEventExecuteCount > 1) {
122
  return;
123
  }
124
  var sgPopupID = jQuery(this).attr("data-sgpopupid");
257
  return popupId;
258
  };
259
 
260
+ SGPopup.prototype.hexToRgba = function (hex, opacity){
261
+
262
+ var c;
263
+ if(/^#([A-Fa-f0-9]{3}){1,2}$/.test(hex)){
264
+ c = hex.substring(1).split('');
265
+
266
+ if(c.length == 3){
267
+ c= [c[0], c[0], c[1], c[1], c[2], c[2]];
268
+ }
269
+ c = '0x'+c.join('');
270
+ return 'rgba('+[(c>>16)&255, (c>>8)&255, c&255].join(',')+','+opacity+')';
271
+ }
272
+ throw new Error('Bad Hex');
273
+ };
274
+
275
+
276
  SGPopup.prototype.sgCustomizeThemes = function (popupId) {
277
 
278
  var popupData = SG_POPUP_DATA[popupId];
279
  var borderRadiues = popupData['sg3ThemeBorderRadiues'];
280
  var popupContentOpacity = popupData['popup-background-opacity'];
281
+ var popupContentColor = jQuery('#sgcboxContent').css('background-color');
282
+ var contentBackgroundColor = popupData['sg-content-background-color'];
283
+ var changedColor = popupContentColor.replace(')', ', '+popupContentOpacity+')').replace('rgb', 'rgba');
284
+
285
+ if(contentBackgroundColor != '') {
286
+ changedColor = this.hexToRgba(contentBackgroundColor, popupContentOpacity);
287
+ }
288
+
289
 
290
  if (popupData['theme'] == "colorbox3.css") {
291
  var borderColor = popupData['sgTheme3BorderColor'];
292
  var borderRadiues = popupData['sgTheme3BorderRadius'];
293
+ jQuery("#sgcboxLoadedContent").css({'border-color': borderColor});
294
+ jQuery("#sgcboxLoadedContent").css({'border-radius': borderRadiues + "%"});
295
  jQuery("#sgcboxContent").css({'border-radius': borderRadiues + "%"})
296
  }
297
 
298
+ jQuery('#sgcboxContent').css({'background-color': changedColor});
299
  jQuery('#sgcboxLoadedContent').css({'background-color': changedColor})
300
 
301
  };
327
  };
328
 
329
  SGPopup.prototype.sgPopupScalingDimensions = function () {
330
+
331
  var popupWrapper = jQuery("#sgcboxWrapper").outerWidth();
332
  var screenWidth = jQuery(window).width();
333
  /*popupWrapper != 9999 for resizing case when colorbox is calculated popup dimensions*/
348
  };
349
 
350
  SGPopup.prototype.sgPopupScaling = function () {
351
+
352
  var that = this;
353
  jQuery("#sgcolorbox").bind("sgColorboxOnCompleate", function () {
354
  that.sgPopupScalingDimensions();
361
  };
362
 
363
  SGPopup.prototype.varToBool = function (optionName) {
364
+
365
+ var returnValue = (optionName) ? true : false;
366
  return returnValue;
367
  };
368
 
398
  };
399
 
400
  SGPopup.prototype.setFixedPosition = function (sgPositionLeft, sgPositionTop, sgPositionBottom, sgPositionRight, sgFixedPositionTop, sgFixedPositionLeft) {
401
+
402
  this.positionLeft = sgPositionLeft;
403
  this.positionTop = sgPositionTop;
404
  this.positionBottom = sgPositionBottom;
408
  };
409
 
410
  SGPopup.prototype.percentToPx = function (percentDimention, screenDimension) {
411
+
412
  var dimension = parseInt(percentDimention) * screenDimension / 100;
413
  return dimension;
414
  };
415
 
416
  SGPopup.prototype.getPositionPercent = function (needPercent, screenDimension, dimension) {
417
+
418
  var sgPosition = (((this.percentToPx(needPercent, screenDimension) - dimension / 2) / screenDimension) * 100) + "%";
419
  return sgPosition;
420
  };
421
 
422
  SGPopup.prototype.showPopup = function (id, isOnLoad) {
423
+
424
  var that = this;
425
 
426
  /*When id does not exist*/
444
  if (!this.canOpenPopup(this.popupData['id'], this.openOnce, isOnLoad)) {
445
  return;
446
  }
447
+
448
+ popupColorboxUrl = SG_APP_POPUP_URL + '/style/sgcolorbox/sgthemes.css';
 
449
  head = document.getElementsByTagName('head')[0];
450
  link = document.createElement('link');
451
  link.type = "text/css";
463
  };
464
 
465
  SGPopup.setToPopupsCookiesList = function (cookieName) {
466
+
467
  var currentCookies = SGPopup.getCookie('sgPopupCookieList');
468
+
469
  if (!currentCookies) {
470
  currentCookies = [];
471
  }
520
  contentWidth = '94%';
521
  }
522
  else {
523
+ contentWidth = responsiveMeasure+'%';
524
  }
525
  jQuery.sgcolorbox.settings.width = contentWidth;
526
 
557
  };
558
 
559
  SGPopup.prototype.sgShowColorboxWithOptions = function () {
560
+
561
  var that = this;
562
  setTimeout(function () {
563
+
564
+ var sgPopupFixed = that.varToBool(that.popupData['popupFixed']);
565
+ var popupId = that.popupData['id'];
566
  that.popupOverlayClose = that.varToBool(that.popupData['overlayClose']);
567
  that.popupContentClick = that.varToBool(that.popupData['contentClick']);
568
  var popupReposition = that.varToBool(that.popupData['reposition']);
577
  var disablePopupOverlay = that.varToBool(that.popupData['disablePopupOverlay']);
578
  var popupAutoClosePopup = that.varToBool(that.popupData['autoClosePopup']);
579
  var saveCookiePageLevel = that.varToBool(that.popupData['save-cookie-page-level']);
580
+ var popupClosingTimer = that.popupData['popupClosingTimer'];
581
 
582
  if (popupScaling) {
583
  that.sgPopupScaling();
669
  sgPopupWidthPx = parseInt(sgPopupWidthPx);
670
  sgPopupHeightPx = parseInt(sgPopupHeightPx);
671
 
672
+ var popupPositionTop = that.getPositionPercent("50%", sgScreenHeight, sgPopupHeightPx);
673
+ var popupPositionLeft = that.getPositionPercent("50%", sgScreenWidth, sgPopupWidthPx);
674
 
675
  if (popupPosition == 1) { // Left Top
676
  that.setFixedPosition('0%', '3%', false, false, 0, 0);
719
  }
720
 
721
  if (onlyMobile) {
722
+ var openOnlyMobile = false;
723
  openOnlyMobile = that.forMobile();
724
  if (openOnlyMobile == false) {
725
  return;
731
  }
732
 
733
  SG_POPUP_SETTINGS = {
734
+ popupId: popupId,
735
  width: popupWidth,
736
  height: popupHeight,
737
  className: customClassName,
754
  }
755
 
756
  jQuery('#sgcolorbox').trigger("sgColorboxOnOpen", []);
 
757
 
758
  },
759
  onLoad: function () {
760
  },
761
  onComplete: function () {
762
  if (contentBackgroundColor) {
763
+ jQuery("#sgcboxLoadedContent").css({'background-color': contentBackgroundColor});
764
  }
765
+ jQuery("#sgcboxLoadedContent").addClass("sg-current-popup-" + that.popupData['id']);
766
  jQuery('#sgcolorbox').trigger("sgColorboxOnCompleate", [pushToBottom]);
767
  if (popupWidth == '' && popupHeight == '') {
768
  jQuery.sgcolorbox.resize();
782
  jQuery('#sgcolorbox').trigger("sgPopupCleanup", []);
783
  },
784
  onClosed: function () {
785
+ jQuery("#sgcboxLoadedContent").removeClass("sg-current-popup-" + that.popupData['id']);
786
  jQuery('#sgcolorbox').trigger("sgPopupClose", []);
787
  },
788
  trapFocus: that.sgTrapFocus,
819
  }
820
  /* Cookie can't be set here as it's set in Age Restriction popup when the user clicks "yes" */
821
  if (that.popupData['id'] && that.isOnLoad == true && that.openOnce != '' && that.popupData['type'] != "ageRestriction") {
822
+ var sgCookieData = '';
823
  if (!saveCookiePageLevel) {
824
  jQuery.cookie.defaults = {path: '/'};
825
  }
827
  var currentCookie = jQuery.cookie('sgPopupDetails' + that.popupData['id']);
828
 
829
  if (typeof currentCookie == 'undefined') {
830
+ var openCounter = 1;
831
  }
832
  else {
833
  var currentCookie = JSON.parse(jQuery.cookie('sgPopupDetails' + that.popupData['id']));
834
+ var openCounter = currentCookie.openCounter += 1;
835
  }
836
  sgCookieData = {
837
  'popupId': that.popupData['id'],
869
 
870
  jQuery('#sgcolorbox').bind('sgPopupClose', function (e) {
871
  /* reset event execute count for popup open */
872
+ that.sgEventExecuteCount = 0;
873
  that.eventExecuteCountByClass = 0;
874
  jQuery('#sgcolorbox').removeClass(customClassName);
875
  /* Remove custom class for another popup */
882
  };
883
 
884
  jQuery(document).ready(function ($) {
885
+
886
  var popupObj = new SGPopup();
887
  popupObj.init();
888
  });
javascript/sg_popup_init.js CHANGED
@@ -1,10 +1,12 @@
1
  function SgPopupInit(popupData) {
 
2
  this.popupData = popupData;
3
  this.cloneToHtmlPopup();
4
  this.reopenPopupAfterSubmission();
5
  }
6
 
7
  SgPopupInit.prototype.cloneToHtmlPopup = function() {
 
8
  var currentPopupId = this.popupData['id'];
9
 
10
  /*When content does not have shortcode*/
@@ -24,10 +26,11 @@ SgPopupInit.prototype.cloneToHtmlPopup = function() {
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() {
@@ -71,7 +74,7 @@ SgPopupInit.prototype.shortcodeInPopupContent = function() {
71
  if(sgPopupID == '') {
72
  return;
73
  }
74
- sgPoupFrontendObj = new SGPopup();
75
  sgPoupFrontendObj.showPopup(sgPopupID,false);
76
  sgPopupID = '';
77
  });
@@ -79,6 +82,7 @@ SgPopupInit.prototype.shortcodeInPopupContent = function() {
79
  };
80
 
81
  SgPopupInit.prototype.overallInit = function() {
 
82
  jQuery('.sg-popup-close').bind('click', function() {
83
  jQuery.sgcolorbox.close();
84
  });
@@ -90,6 +94,7 @@ SgPopupInit.prototype.overallInit = function() {
90
  };
91
 
92
  SgPopupInit.prototype.initByPopupType = function() {
 
93
  var data = this.popupData;
94
  var popupObj = {};
95
  var popupType = data['type'];
1
  function SgPopupInit(popupData) {
2
+
3
  this.popupData = popupData;
4
  this.cloneToHtmlPopup();
5
  this.reopenPopupAfterSubmission();
6
  }
7
 
8
  SgPopupInit.prototype.cloneToHtmlPopup = function() {
9
+
10
  var currentPopupId = this.popupData['id'];
11
 
12
  /*When content does not have shortcode*/
26
 
27
  SgPopupInit.prototype.reopenPopupAfterSubmission = function() {
28
 
29
+ var that = this;
30
+
31
  var reopenSubmission = this.popupData['reopenAfterSubmission'];
32
  var currentPopupId = this.popupData['id'];
33
  SGPopup.setCookie('sgSubmitReloadingForm', currentPopupId, -10);
 
34
 
35
  if(reopenSubmission) {
36
  jQuery("#sgcboxLoadedContent form").submit(function() {
74
  if(sgPopupID == '') {
75
  return;
76
  }
77
+ var sgPoupFrontendObj = new SGPopup();
78
  sgPoupFrontendObj.showPopup(sgPopupID,false);
79
  sgPopupID = '';
80
  });
82
  };
83
 
84
  SgPopupInit.prototype.overallInit = function() {
85
+
86
  jQuery('.sg-popup-close').bind('click', function() {
87
  jQuery.sgcolorbox.close();
88
  });
94
  };
95
 
96
  SgPopupInit.prototype.initByPopupType = function() {
97
+
98
  var data = this.popupData;
99
  var popupObj = {};
100
  var popupType = data['type'];
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.5.0
7
  * Author: Sygnoos
8
  * Author URI: http://www.sygnoos.com
9
  * License: GPLv2
@@ -37,7 +37,6 @@ require_once(SG_APP_POPUP_JS .'/sg_popup_javascript.php' ); //include our js fil
37
  require_once(SG_APP_POPUP_FILES .'/sg_popup_page_selection.php' ); // include here in page button for select popup every page
38
 
39
  register_activation_hook(__FILE__, 'sgPopupActivate');
40
- register_uninstall_hook(__FILE__, 'sgPopupDeactivate');
41
 
42
  add_action('wpmu_new_blog', 'sgNewBlogPopup', 10, 6);
43
 
@@ -59,19 +58,6 @@ function sgPopupActivate()
59
  }
60
  }
61
 
62
- function sgPopupDeactivate()
63
- {
64
- $deleteStatus = SGFunctions::popupTablesDeleteSatus();
65
-
66
- if($deleteStatus) {
67
- PopupInstaller::uninstall();
68
- if (POPUP_BUILDER_PKG > POPUP_BUILDER_PKG_FREE) {
69
- PopupProInstaller::uninstall();
70
- }
71
- }
72
- }
73
-
74
-
75
  function sgRegisterScripts()
76
  {
77
  SGPopup::$registeredScripts = true;
@@ -112,18 +98,8 @@ function sgRenderPopupScript($id)
112
  }
113
  $extensionManagerObj = new SGPBExtensionManager();
114
  $extensionManagerObj->includeExtensionScripts($id);
115
- wp_register_style('sg_colorbox_theme', SG_APP_POPUP_URL . "/style/sgcolorbox/colorbox1.css", array(), SG_POPUP_VERSION);
116
- wp_register_style('sg_colorbox_theme2', SG_APP_POPUP_URL . "/style/sgcolorbox/colorbox2.css", array(), SG_POPUP_VERSION);
117
- wp_register_style('sg_colorbox_theme3', SG_APP_POPUP_URL . "/style/sgcolorbox/colorbox3.css", array(), SG_POPUP_VERSION);
118
- wp_register_style('sg_colorbox_theme4', SG_APP_POPUP_URL . "/style/sgcolorbox/colorbox4.css", array(), SG_POPUP_VERSION);
119
- wp_register_style('sg_colorbox_theme5', SG_APP_POPUP_URL . "/style/sgcolorbox/colorbox5.css", array(), SG_POPUP_VERSION);
120
- wp_register_style('sg_colorbox_theme6', SG_APP_POPUP_URL . "/style/sgcolorbox/colorbox6.css", array(), SG_POPUP_VERSION);
121
  wp_enqueue_style('sg_colorbox_theme');
122
- wp_enqueue_style('sg_colorbox_theme2');
123
- wp_enqueue_style('sg_colorbox_theme3');
124
- wp_enqueue_style('sg_colorbox_theme4');
125
- wp_enqueue_style('sg_colorbox_theme5');
126
- wp_enqueue_style('sg_colorbox_theme6');
127
  sgFindPopupData($id);
128
  }
129
 
@@ -311,7 +287,7 @@ function getPopupIdInPageByClass($pageId) {
311
  /*this will return template for the current page*/
312
  $templatePath = get_page_template();
313
 
314
- if(isset($templatePath)) {
315
  $content .= file_get_contents($templatePath);
316
  }
317
 
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.5.1
7
  * Author: Sygnoos
8
  * Author URI: http://www.sygnoos.com
9
  * License: GPLv2
37
  require_once(SG_APP_POPUP_FILES .'/sg_popup_page_selection.php' ); // include here in page button for select popup every page
38
 
39
  register_activation_hook(__FILE__, 'sgPopupActivate');
 
40
 
41
  add_action('wpmu_new_blog', 'sgNewBlogPopup', 10, 6);
42
 
58
  }
59
  }
60
 
 
 
 
 
 
 
 
 
 
 
 
 
 
61
  function sgRegisterScripts()
62
  {
63
  SGPopup::$registeredScripts = true;
98
  }
99
  $extensionManagerObj = new SGPBExtensionManager();
100
  $extensionManagerObj->includeExtensionScripts($id);
101
+ wp_register_style('sg_colorbox_theme', SG_APP_POPUP_URL . "/style/sgcolorbox/sgthemes.css", array(), SG_POPUP_VERSION);
 
 
 
 
 
102
  wp_enqueue_style('sg_colorbox_theme');
 
 
 
 
 
103
  sgFindPopupData($id);
104
  }
105
 
287
  /*this will return template for the current page*/
288
  $templatePath = get_page_template();
289
 
290
+ if(!empty($templatePath)) {
291
  $content .= file_get_contents($templatePath);
292
  }
293
 
readme.txt CHANGED
@@ -81,9 +81,11 @@ With popup builder plugin you can insert any type of content, right into your Po
81
 
82
  * Create contact form popup - contact popup will allow your clients to write you a message right from the popup.
83
 
84
- * MailChimp popup - create eye-catching, beautiful MailChimp popups to make your users sign up to the mail list right from the popup. You can set up all the design customization according to your needs and preferences!
85
 
86
- * Adblock popup - Detect Adblock extensions that block the advertisements of your site and show a message to your visitors via popup!
 
 
87
 
88
  * Show popup only when user is scrolling - sometimes you don't want to show the popup right away, it's a good idea to set this option so the popup will be shown to the visitor only when he scrolls.
89
 
@@ -97,7 +99,7 @@ With popup builder plugin you can insert any type of content, right into your Po
97
 
98
  * Auto close popup after X seconds - useful when activated together with the previous option, you can disable manual popup closing but close it after a certain time.
99
 
100
- * Targeting popup - this popup allows you to show popup depending user location. This kind of popup is useful if your product or service is created for a specific region.
101
 
102
  * Show popup for logged in users or vice versa - you can make the popup appear only for the users who are logged in. Or you can make the popup visible only for the users who aren't logged in.
103
 
@@ -157,6 +159,13 @@ Go to the Popup Builder settings and set your desired options.
157
 
158
  == Changelog ==
159
 
 
 
 
 
 
 
 
160
  = Version 2.5.0 =
161
  * Added new option for responsiveness.
162
  * Added option to control the opacity of the popup background.
@@ -448,7 +457,7 @@ This will open a popup before a user goes to the page from the link.
448
 
449
  **How to redirect users after clicking on the popup image?**
450
 
451
- Go to the “Options” section of your popup and find "Dismiss on content click" option.
452
  Then Select "Redirect" option and in the URL field type the URL of the page you need your users to be redirected to.
453
 
454
  **Can I show a popup after a specific amount of time?**
@@ -587,7 +596,7 @@ Leave us a good review :)
587
 
588
  == Upgrade Notice ==
589
 
590
- Current Version of Popup Builder is 2.4.8
591
 
592
  == Other Notes ==
593
 
81
 
82
  * Create contact form popup - contact popup will allow your clients to write you a message right from the popup.
83
 
84
+ * MailChimp popup (separate extension) - create eye-catching, beautiful MailChimp popups to make your users sign up to the mail list right from the popup. You can set up all the design customization according to your needs and preferences!
85
 
86
+ * Adblock popup (separate extension) - detect Adblock extensions that block the advertisements of your site and show a message to your visitors via popup!
87
+
88
+ * AWeber popup (separate extension) - let your visitors to subscribe to your AWeber subscription form right from the popup.
89
 
90
  * Show popup only when user is scrolling - sometimes you don't want to show the popup right away, it's a good idea to set this option so the popup will be shown to the visitor only when he scrolls.
91
 
99
 
100
  * Auto close popup after X seconds - useful when activated together with the previous option, you can disable manual popup closing but close it after a certain time.
101
 
102
+ * Targeting popup - this popup allows you to show a popup depending on user's location. This kind of popup is useful if your product or service is created for a specific region.
103
 
104
  * Show popup for logged in users or vice versa - you can make the popup appear only for the users who are logged in. Or you can make the popup visible only for the users who aren't logged in.
105
 
159
 
160
  == Changelog ==
161
 
162
+ = Version 2.5.1 =
163
+ * Bug fixed connected to Filename notice.
164
+ * Added new feature to control popup Z-Index.
165
+ * Popup themes optimization.
166
+ * Code optimization and typo fixes.
167
+ * Fixed some output notices.
168
+
169
  = Version 2.5.0 =
170
  * Added new option for responsiveness.
171
  * Added option to control the opacity of the popup background.
457
 
458
  **How to redirect users after clicking on the popup image?**
459
 
460
+ Go to the “Options” section of your popup and find "Dismiss on content click" option.
461
  Then Select "Redirect" option and in the URL field type the URL of the page you need your users to be redirected to.
462
 
463
  **Can I show a popup after a specific amount of time?**
596
 
597
  == Upgrade Notice ==
598
 
599
+ Current Version of Popup Builder is 2.5.1
600
 
601
  == Other Notes ==
602
 
style/sgcolorbox/colorbox1.css DELETED
@@ -1 +0,0 @@
1
- /*
2
  The following fixes a problem where IE7 and IE8 replace a PNG's alpha transparency with a black fill
3
  when an alpha filter (opacity change) is set on the element or ancestor element. This style is not applied to or needed in IE9.
4
  See: http://jacklmoore.com/notes/ie-transparency-problems/
 
0
  The following fixes a problem where IE7 and IE8 replace a PNG's alpha transparency with a black fill
1
  when an alpha filter (opacity change) is set on the element or ancestor element. This style is not applied to or needed in IE9.
2
  See: http://jacklmoore.com/notes/ie-transparency-problems/
style/sgcolorbox/colorbox2.css DELETED
@@ -1 +0,0 @@
1
- /*
 
style/sgcolorbox/colorbox3.css DELETED
@@ -1 +0,0 @@
1
- /*
 
style/sgcolorbox/colorbox4.css DELETED
@@ -1 +0,0 @@
1
- /*
2
  The following fixes a problem where IE7 and IE8 replace a PNG's alpha transparency with a black fill
3
  when an alpha filter (opacity change) is set on the element or ancestor element. This style is not applied to or needed in IE9.
4
  See: http://jacklmoore.com/notes/ie-transparency-problems/
 
0
  The following fixes a problem where IE7 and IE8 replace a PNG's alpha transparency with a black fill
1
  when an alpha filter (opacity change) is set on the element or ancestor element. This style is not applied to or needed in IE9.
2
  See: http://jacklmoore.com/notes/ie-transparency-problems/
style/sgcolorbox/colorbox5.css DELETED
@@ -1 +0,0 @@
1
- /*
2
  Colorbox Core Style:
 
0
  Colorbox Core Style:
style/sgcolorbox/colorbox6.css DELETED
@@ -1,128 +0,0 @@
1
- /*
2
- Colorbox Core Style:
3
- The following CSS is consistent between example themes and should not be altered.
4
- */
5
- #sgcolorbox.colorbox6, #sgcboxOverlay.colorbox6,.colorbox6 #sgcboxWrapper{position:absolute; top:0; left:0; z-index:2147483647; overflow:visible;}
6
-
7
- .colorbox6 #sgcboxWrapper {max-width:none;}
8
-
9
- #sgcboxOverlay.colorbox6{position:fixed; width:100%; height:100%;}
10
-
11
- .colorbox6 #sgcboxMiddleLeft,.colorbox6 #sgcboxBottomLeft{clear:left;}
12
-
13
- .colorbox6 #sgcboxContent{position:relative;}
14
-
15
- .colorbox6 #sgcboxLoadedContent{overflow:auto; -webkit-overflow-scrolling: touch;}
16
-
17
- .colorbox6 #sgcboxTitle{margin:0;}
18
-
19
- #sgcboxLoadingOverlay.colorbox6,.colorbox6 #sgcboxLoadingGraphic{position:absolute; top:0; left:0; width:100%; height:100%;}
20
-
21
- .colorbox6 #sgcboxPrevious,.colorbox6 #sgcboxNext,.colorbox6 #sgcboxClose,.colorbox6 #sgcboxSlideshow{cursor:pointer;}
22
-
23
- .colorbox6 .sgcboxPhoto{float:left; margin:auto; border:0; display:block; max-width:none; -ms-interpolation-mode:bicubic;}
24
-
25
- .colorbox6 .sgcboxIframe{width:100%; height:100%; display:block; border:0; padding:0; margin:0;}
26
-
27
- #sgcolorbox.colorbox6,.colorbox6 #sgcboxContent,.colorbox6 #sgcboxLoadedContent{box-sizing:content-box; -moz-box-sizing:content-box; -webkit-box-sizing:content-box;}
28
-
29
- /*
30
- User Style:
31
- Change the following styles to modify the appearance of Colorbox. They are
32
- ordered & tabbed in a way that represents the nesting of the generated HTML.
33
- */
34
-
35
- #sgcboxOverlay.colorbox6{opacity: 1; filter: alpha(opacity = 99);}
36
-
37
- #sgcboxOverlay.colorbox6 {background:url(../../img/colorbox6/colorbox_overlay.png) repeat 0 0;}
38
-
39
- #sgcolorbox.colorbox6{outline:0;}
40
-
41
- .colorbox6 #sgcboxTopLeft{width:25px; height:25px; background:url(../../img/colorbox6/border1.png) no-repeat 0 0;}
42
-
43
- .colorbox6 #sgcboxTopCenter{height:25px; background:url(../../img/colorbox6/border1.png) repeat-x 0 -50px;}
44
-
45
- .colorbox6 #sgcboxTopRight{width:25px; height:25px; background:url(../../img/colorbox6/border1.png) no-repeat -25px 0;}
46
-
47
- .colorbox6 #sgcboxBottomLeft{width:25px; height:25px; background:url(../../img/colorbox6/border1.png) no-repeat 0 -25px;}
48
-
49
- .colorbox6 #sgcboxBottomCenter{height:25px; background:url(../../img/colorbox6/border1.png) repeat-x 0 -75px;}
50
-
51
- .colorbox6 #sgcboxBottomRight{width:25px; height:25px; background:url(../../img/colorbox6/border1.png) no-repeat -25px -25px;}
52
-
53
- .colorbox6 #sgcboxMiddleLeft{width:25px; background:url(../../img/colorbox6/border2.png) repeat-y 0 0;}
54
-
55
- .colorbox6 #sgcboxMiddleRight{width:25px; background:url(../../img/colorbox6/border2.png) repeat-y -25px 0;}
56
-
57
- .colorbox6 #sgcboxContent{background:#fff; overflow:visible;}
58
-
59
- .colorbox6 .sgcboxIframe{background:#fff;}
60
-
61
- .colorbox6 #sgcboxError{padding:50px; border:1px solid #ccc;}
62
-
63
- /*.colorbox6 #sgcboxLoadedContent{margin-bottom:20px;}*/
64
-
65
- .colorbox6 #sgcboxTitle{position:absolute; bottom:0px; left:0; text-align:center; width:100%; color:#999;}
66
-
67
- .colorbox6 #sgcboxCurrent{position:absolute; bottom:0px; left:100px; color:#999;}
68
-
69
- #sgcboxLoadingOverlay.colorbox6{background:#fff url(../../img/colorbox6/loading.gif) no-repeat 5px 5px;}
70
-
71
- /* these elements are buttons, and may need to have additional styles reset to avoid unwanted base styles */
72
- .colorbox6 #sgcboxPrevious,.colorbox6 #sgcboxNext,.colorbox6 #sgcboxSlideshow,.colorbox6 #sgcboxClose {border:0; padding:0; margin:0; overflow:visible; width:auto; background:none; }
73
-
74
-
75
- /* avoid outlines on :active (mouseclick), but preserve outlines on :focus (tabbed navigating) */
76
-
77
- .colorbox6 #sgcboxPrevious:active,.colorbox6 #sgcboxNext:active,.colorbox6 #sgcboxSlideshow:active,.colorbox6 #sgcboxClose:active {outline:0;}
78
-
79
- .colorbox6 #sgcboxSlideshow{position:absolute; bottom:0px; right:42px; color:#444;}
80
-
81
- .colorbox6 #sgcboxPrevious{position:absolute; bottom:0px; left:0; color:#444;}
82
-
83
- .colorbox6 #sgcboxNext{position:absolute; bottom:0px; left:63px; color:#444;}
84
-
85
- .colorbox6 #sgcboxClose{
86
- position:absolute;
87
- top:-28px;
88
- right:-26px;
89
- display:block;
90
- background:url(../../img/colorbox6/colorbox_sprite.png) no-repeat 2px 0;
91
- text-indent: -9999px;
92
- width:37px;
93
- height:37px;
94
- }
95
-
96
- .colorbox6 #sgcboxClose:hover {
97
- background-position: 2px 0px !important;
98
- }
99
- /*
100
- The following fixes a problem where IE7 and IE8 replace a PNG's alpha transparency with a black fill
101
- when an alpha filter (opacity change) is set on the element or ancestor element. This style is not applied to or needed in IE9.
102
- See: http://jacklmoore.com/notes/ie-transparency-problems/
103
- */
104
-
105
-
106
- .colorbox6 .sgcboxIE #sgcboxTopLeft,
107
-
108
- .colorbox6 .sgcboxIE #sgcboxTopCenter,
109
-
110
- .colorbox6 .sgcboxIE #sgcboxTopRight,
111
-
112
- .colorbox6 .sgcboxIE #sgcboxBottomLeft,
113
-
114
- .colorbox6 .sgcboxIE #sgcboxBottomCenter,
115
-
116
- .colorbox6 .sgcboxIE #sgcboxBottomRight,
117
-
118
- .colorbox6 .sgcboxIE #sgcboxMiddleLeft,
119
-
120
- .colorbox6 .sgcboxIE #sgcboxMiddleRight {
121
- filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#00FFFFFF,endColorstr=#00FFFFFF);
122
-
123
- }
124
-
125
- #sgcboxLoadedContent img{
126
- max-width: 100%;
127
- height: auto;
128
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
style/sgcolorbox/sgthemes.css ADDED
@@ -0,0 +1 @@
 
0
  The following fixes a problem where IE7 and IE8 replace a PNG's alpha transparency with a black fill
1
  when an alpha filter (opacity change) is set on the element or ancestor element. This style is not applied to or needed in IE9.
2
  See: http://jacklmoore.com/notes/ie-transparency-problems/
3
  The following fixes a problem where IE7 and IE8 replace a PNG's alpha transparency with a black fill
4
  when an alpha filter (opacity change) is set on the element or ancestor element. This style is not applied to or needed in IE9.
5
  See: http://jacklmoore.com/notes/ie-transparency-problems/
6
  Colorbox Core Style:
7
  The following fixes a problem where IE7 and IE8 replace a PNG's alpha transparency with a black fill
8
  when an alpha filter (opacity change) is set on the element or ancestor element. This style is not applied to or needed in IE9.
9
  See: http://jacklmoore.com/notes/ie-transparency-problems/
1
+ /*
2
  The following fixes a problem where IE7 and IE8 replace a PNG's alpha transparency with a black fill
3
  when an alpha filter (opacity change) is set on the element or ancestor element. This style is not applied to or needed in IE9.
4
  See: http://jacklmoore.com/notes/ie-transparency-problems/
5
  The following fixes a problem where IE7 and IE8 replace a PNG's alpha transparency with a black fill
6
  when an alpha filter (opacity change) is set on the element or ancestor element. This style is not applied to or needed in IE9.
7
  See: http://jacklmoore.com/notes/ie-transparency-problems/
8
  Colorbox Core Style:
9
  The following fixes a problem where IE7 and IE8 replace a PNG's alpha transparency with a black fill
10
  when an alpha filter (opacity change) is set on the element or ancestor element. This style is not applied to or needed in IE9.
11
  See: http://jacklmoore.com/notes/ie-transparency-problems/
uninstall.php ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ if( ! defined( 'WP_UNINSTALL_PLUGIN' ) )
4
+ exit();
5
+
6
+ require_once(dirname(__FILE__)."/config.php");
7
+ require_once(SG_APP_POPUP_CLASSES .'/PopupInstaller.php'); //cretae tables
8
+ require_once(SG_APP_POPUP_FILES .'/sg_functions.php');
9
+
10
+
11
+ if (POPUP_BUILDER_PKG > POPUP_BUILDER_PKG_FREE) {
12
+ require_once( SG_APP_POPUP_CLASSES .'/PopupProInstaller.php'); //uninstall tables
13
+ }
14
+
15
+ $deleteStatus = SGFunctions::popupTablesDeleteSatus();
16
+
17
+ if($deleteStatus) {
18
+ PopupInstaller::uninstall();
19
+ if (POPUP_BUILDER_PKG > POPUP_BUILDER_PKG_FREE) {
20
+ PopupProInstaller::uninstall();
21
+ }
22
+ }