Version Description
Download this release
Release Info
Developer | Sygnoos |
Plugin | Popup Builder – Responsive WordPress Pop up |
Version | 2.0.3 |
Comparing to | |
See all releases |
Code changes from version 2.0.1 to 2.0.3
- classes/PopupInstaller.php +2 -2
- classes/SGHtmlPopup.php +1 -1
- classes/SGPopup.php +6 -5
- files/sg_popup_create.php +24 -0
- files/sg_popup_create_new.php +74 -11
- files/sg_popup_media_buuton.php +4 -4
- files/sg_popup_page_selection.php +1 -1
- files/sg_popup_savePopupFrom.php +57 -7
- img/AgeRestriction.png +0 -0
- img/Countdown.png +0 -0
- img/ShortcodePopupPro.png +0 -0
- img/VideoPopupPro.png +0 -0
- img/iframePopupPro.png +0 -0
- img/socialPopup.png +0 -0
- javascript/sg_popup_backend.js +1 -1
- javascript/sg_popup_frontend.js +29 -12
- popup-builder.php +7 -6
- readme.txt +24 -14
- style/sg_popup_style.css +32 -2
classes/PopupInstaller.php
CHANGED
@@ -141,7 +141,7 @@ class PopupInstaller {
|
|
141 |
$res = $wpdb->query($sql);
|
142 |
break;
|
143 |
case "shortCode":
|
144 |
-
$sql = $wpdb->prepare( "INSERT INTO ". $wpdb->prefix ."
|
145 |
$res = $wpdb->query($sql);
|
146 |
break;
|
147 |
}
|
@@ -178,7 +178,7 @@ class PopupInstaller {
|
|
178 |
$res = $wpdb->query($sqlnet);
|
179 |
break;
|
180 |
case "shortCode":
|
181 |
-
$sqlnet = $wpdb->prepare( "INSERT INTO ". $wpdb->prefix.$bolgs_id."
|
182 |
$res = $wpdb->query($sqlnet);
|
183 |
break;
|
184 |
}
|
141 |
$res = $wpdb->query($sql);
|
142 |
break;
|
143 |
case "shortCode":
|
144 |
+
$sql = $wpdb->prepare( "INSERT INTO ". $wpdb->prefix ."sg_shortCode_popup (id, url) VALUES (%d,%s)",$id,$sgShortCodePopup);
|
145 |
$res = $wpdb->query($sql);
|
146 |
break;
|
147 |
}
|
178 |
$res = $wpdb->query($sqlnet);
|
179 |
break;
|
180 |
case "shortCode":
|
181 |
+
$sqlnet = $wpdb->prepare( "INSERT INTO ". $wpdb->prefix.$bolgs_id."_sg_shortCode_popup (id, url) VALUES (%d,%s)",$id,$sgShortCodePopup);
|
182 |
$res = $wpdb->query($sqlnet);
|
183 |
break;
|
184 |
}
|
classes/SGHtmlPopup.php
CHANGED
@@ -22,7 +22,7 @@ class SGHtmlPopup extends SGPopup {
|
|
22 |
$editMode = $this->getId()?true:false;
|
23 |
|
24 |
$res = parent::save($data);
|
25 |
-
if (
|
26 |
|
27 |
$sgHtmlPopup = $this->getContent();
|
28 |
|
22 |
$editMode = $this->getId()?true:false;
|
23 |
|
24 |
$res = parent::save($data);
|
25 |
+
if ($res===false) return false;
|
26 |
|
27 |
$sgHtmlPopup = $this->getContent();
|
28 |
|
classes/SGPopup.php
CHANGED
@@ -138,7 +138,6 @@ abstract class SGPopup {
|
|
138 |
global $wpdb;
|
139 |
|
140 |
if($id == '') {
|
141 |
-
|
142 |
$sql = $wpdb->prepare( "INSERT INTO ". $wpdb->prefix ."sg_popup(type,title,options) VALUES (%s,%s,%s)",$type,$title,$options);
|
143 |
$res = $wpdb->query($sql);
|
144 |
|
@@ -147,13 +146,12 @@ abstract class SGPopup {
|
|
147 |
$id = $wpdb->insert_id;
|
148 |
$this->setId($id);
|
149 |
}
|
150 |
-
|
151 |
return $res;
|
152 |
|
153 |
}
|
154 |
else {
|
155 |
$sql = $wpdb->prepare("UPDATE ". $wpdb->prefix ."sg_popup SET type=%s,title=%s,options=%s WHERE id=%d",$type,$title,$options,$id);
|
156 |
-
$wpdb->query($sql);
|
157 |
if(!$wpdb->show_errors()) {
|
158 |
$res = 1;
|
159 |
}
|
@@ -222,7 +220,7 @@ abstract class SGPopup {
|
|
222 |
$getexrArray = $this->getExtraRenderOptions();
|
223 |
$options = json_decode($this->getOptions(),true);
|
224 |
if(empty($options)) $options = array();
|
225 |
-
$sgPopupVars = 'SG_POPUP_DATA['.$this->getId().'] ='.json_encode(array_merge($parentOption, $
|
226 |
|
227 |
return $sgPopupVars;
|
228 |
}
|
@@ -235,7 +233,10 @@ abstract class SGPopup {
|
|
235 |
global $wpdb;
|
236 |
$sql = $wpdb->prepare("SELECT meta_value FROM ". $wpdb->prefix ."postmeta WHERE post_id = %d AND meta_key = %s",$page,$popup);
|
237 |
$row = $wpdb->get_row($sql);
|
238 |
-
$id =
|
|
|
|
|
|
|
239 |
return $id;
|
240 |
}
|
241 |
|
138 |
global $wpdb;
|
139 |
|
140 |
if($id == '') {
|
|
|
141 |
$sql = $wpdb->prepare( "INSERT INTO ". $wpdb->prefix ."sg_popup(type,title,options) VALUES (%s,%s,%s)",$type,$title,$options);
|
142 |
$res = $wpdb->query($sql);
|
143 |
|
146 |
$id = $wpdb->insert_id;
|
147 |
$this->setId($id);
|
148 |
}
|
|
|
149 |
return $res;
|
150 |
|
151 |
}
|
152 |
else {
|
153 |
$sql = $wpdb->prepare("UPDATE ". $wpdb->prefix ."sg_popup SET type=%s,title=%s,options=%s WHERE id=%d",$type,$title,$options,$id);
|
154 |
+
$res = $wpdb->query($sql);
|
155 |
if(!$wpdb->show_errors()) {
|
156 |
$res = 1;
|
157 |
}
|
220 |
$getexrArray = $this->getExtraRenderOptions();
|
221 |
$options = json_decode($this->getOptions(),true);
|
222 |
if(empty($options)) $options = array();
|
223 |
+
$sgPopupVars = 'SG_POPUP_DATA['.$this->getId().'] ='.json_encode(array_merge($parentOption, $options, $getexrArray)).';';
|
224 |
|
225 |
return $sgPopupVars;
|
226 |
}
|
233 |
global $wpdb;
|
234 |
$sql = $wpdb->prepare("SELECT meta_value FROM ". $wpdb->prefix ."postmeta WHERE post_id = %d AND meta_key = %s",$page,$popup);
|
235 |
$row = $wpdb->get_row($sql);
|
236 |
+
$id = 0;
|
237 |
+
if($row) {
|
238 |
+
$id = (int)@$row->meta_value;
|
239 |
+
}
|
240 |
return $id;
|
241 |
}
|
242 |
|
files/sg_popup_create.php
CHANGED
@@ -26,5 +26,29 @@
|
|
26 |
<div class="popupsDiv ageRestriction">
|
27 |
</div>
|
28 |
</a>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
29 |
<?php } ?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
30 |
</div>
|
26 |
<div class="popupsDiv ageRestriction">
|
27 |
</div>
|
28 |
</a>
|
29 |
+
<a class="createPopupLink" href="<?php echo SG_APP_POPUP_ADMIN_URL?>admin.php?page=edit-popup&type=countdown">
|
30 |
+
<div class="popupsDiv countdown">
|
31 |
+
</div>
|
32 |
+
</a>
|
33 |
+
<a class="createPopupLink" href="<?php echo SG_APP_POPUP_ADMIN_URL?>admin.php?page=edit-popup&type=social">
|
34 |
+
<div class="popupsDiv sgSocial">
|
35 |
+
</div>
|
36 |
+
</a>
|
37 |
<?php } ?>
|
38 |
+
<?php
|
39 |
+
if(SG_POPUP_PRO == 0) { ?>
|
40 |
+
<a class="createPopupLink" href="<?php echo SG_POPUP_PRO_URL;?>" target=\"_blank\"">
|
41 |
+
<div class="popupsDiv iframePopupPro">
|
42 |
+
</div>
|
43 |
+
</a>
|
44 |
+
<a class="createPopupLink" href="<?php echo SG_POPUP_PRO_URL;?>" target=\"_blank\"">
|
45 |
+
<div class="popupsDiv shortcodePopupPro">
|
46 |
+
</div>
|
47 |
+
</a>
|
48 |
+
<a class="createPopupLink" href="<?php echo SG_POPUP_PRO_URL;?>" target=\"_blank\">
|
49 |
+
<div class="popupsDiv videoPopupPro">
|
50 |
+
</div>
|
51 |
+
</a>
|
52 |
+
<?php }
|
53 |
+
?>
|
54 |
</div>
|
files/sg_popup_create_new.php
CHANGED
@@ -9,8 +9,8 @@
|
|
9 |
$popupName = "SG".ucfirst(strtolower($popupType));
|
10 |
$popupClassName = $popupName."Popup";
|
11 |
require_once(SG_APP_POPUP_PATH ."/classes/".$popupClassName.".php");
|
12 |
-
|
13 |
-
|
14 |
switch ($popupType) {
|
15 |
case 'iframe':
|
16 |
$sgPopupDataIframe = $result->getUrl();
|
@@ -27,6 +27,22 @@
|
|
27 |
case 'shortcode':
|
28 |
$sgPopupDataShortcode = $result->getShortcode();
|
29 |
break;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
30 |
}
|
31 |
$title = $result->getTitle();
|
32 |
$jsonData = json_decode($result->getOptions());
|
@@ -61,9 +77,29 @@
|
|
61 |
$sgPopupClosingTimer = $jsonData->popupClosingTimer;
|
62 |
$sgAutoClosePopup = $jsonData->autoClosePopup;
|
63 |
$sgTheme = $jsonData->theme;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
64 |
}
|
65 |
-
|
66 |
-
$colorbox_deafult_values = array('escKey'=> true,'closeButton' => true,'scale'=> true, 'scrolling'=> true,'opacity'=>0.8,'reposition' => true,'width' => false,'height' => false,'initialWidth'=>'300','initialHeight'=>'100','maxWidth'=>false,'maxHeight'=>false,'overlayClose'=>true,'contentClick'=>true,'fixed'=>false,'top'=>false,'right'=>false,'bottom'=>false,'left'=>false,"duration"=>1,"delay"=>0);
|
67 |
$escKey = ($colorbox_deafult_values['escKey'] == true ? 'checked' : '');
|
68 |
$closeButton = ($colorbox_deafult_values['closeButton'] == true ? 'checked' : '');
|
69 |
$scale = ($colorbox_deafult_values['scale'] == true ? 'checked' : '');
|
@@ -86,7 +122,7 @@
|
|
86 |
$defaultDuration = $colorbox_deafult_values['duration'];
|
87 |
$defaultDelay = $colorbox_deafult_values['delay'];
|
88 |
|
89 |
-
|
90 |
if(isset($sgEscKey)) {$sgEscKey = ($sgEscKey == '') ? '': 'checked'; } else {$sgEscKey = $escKey;}
|
91 |
if(isset($sgCloseButton)) {$sgCloseButton = ($sgCloseButton == '') ? '': 'checked'; } else {$sgCloseButton = $closeButton;}
|
92 |
if(isset($sgScrolling)) {$sgScrolling = ($sgScrolling == '') ? '': 'checked'; } else {$sgScrolling = $scrolling;}
|
@@ -100,6 +136,13 @@
|
|
100 |
if(isset($sgCountryStataus)) {$sgCountryStataus = ($sgCountryStataus== '') ? '': 'checked'; }else{$sgCountryStataus = '';}
|
101 |
if(isset($sgDisablePopup)) {$sgDisablePopup = ($sgDisablePopup== '') ? '': 'checked'; }else{$sgDisablePopup = '';}
|
102 |
if(isset($sgAutoClosePopup)) {$sgAutoClosePopup = ($sgAutoClosePopup== '') ? '': 'checked'; }else{$sgAutoClosePopup = '';}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
103 |
if(!isset($sgOpacity )) {$sgOpacity = $opacityValue;}
|
104 |
if(!isset($sgWidth )) {$sgWidth = $width;}
|
105 |
if(!isset($sgHeight )) {$sgHeight = $height;}
|
@@ -112,17 +155,37 @@
|
|
112 |
if(!isset($sgPopupDataIframe)) {$sgPopupDataIframe = 'http://';}
|
113 |
if(!isset($sgPopupDataHtml)) {$sgPopupDataHtml = '';}
|
114 |
if(!isset($sgPopupDataImage)) {$sgPopupDataImage = '';}
|
115 |
-
|
116 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
117 |
//select basa value or deafult value
|
118 |
$sg_popup_effects = array("No effect"=>"No Effect","flip"=>"flip","shake"=>"shake","wobble"=>"wobble","swing"=>"swing","flash"=>"flash","bounce"=>"bounce","pulse"=>"pulse","rubberBand"=>"rubberBand","tada"=>"tada","fadeIn"=>"fadeIn");
|
119 |
$sg_popup_theme = array("colorbox1.css","colorbox2.css","colorbox3.css","colorbox4.css","colorbox5.css");
|
|
|
|
|
|
|
120 |
function creaeSelect($options,$name,$selecteOption)
|
121 |
{
|
122 |
$selected ='';
|
123 |
$str = "";
|
124 |
$checked = "";
|
125 |
-
if($name == 'theme') {
|
126 |
|
127 |
$popup_style_name = 'popup_theme_name';
|
128 |
$firstOption = array_shift($options);
|
@@ -191,7 +254,7 @@
|
|
191 |
if(!SG_POPUP_PRO) { ?>
|
192 |
<input class="crudToPro" type="button" value="Upgrade to PRO version" onclick="window.open('<?php echo SG_POPUP_PRO_URL;?>')"><div class="clear"></div>
|
193 |
<?php } ?>
|
194 |
-
<input type="submit" id="promotionalSaveButton" class="button-primary" value="<?php
|
195 |
<img id="createAjaxLoader" src="<?php echo plugins_url('img/wpspin_light.gif', dirname(__FILE__).'../');?>" style="display: none">
|
196 |
</p>
|
197 |
</div>
|
@@ -300,10 +363,10 @@
|
|
300 |
<span class="createDescribe">Enable responsiveness:</span><input class='sameWidthinputs' type="checkbox" name="reposition" <?php echo $sgReposition;?> />
|
301 |
<span class="dashicons dashicons-info repositionImg sameImageStyle"></span><span class="infoReposition samefontStyle">The popup will be resized/repositioned automatically when window is being resized.</span><br>
|
302 |
|
303 |
-
<span class="createDescribe">
|
304 |
<span class="dashicons dashicons-info overlayImg sameImageStyle"></span><span class="infoOverlayClose samefontStyle">The popup will be dismissed when user clicks beyond of the popup area.</span><br>
|
305 |
|
306 |
-
<span class="createDescribe">
|
307 |
<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>
|
308 |
|
309 |
<span class="createDescribe">Change overlay color:</span><div id="colorPiccer"><input class="sgOverlayColor" id="sgOverlayColor" type="text" name="sgOverlayColor" value="<?php echo esc_attr(@$sgOverlayColor); ?>" /></div><br>
|
9 |
$popupName = "SG".ucfirst(strtolower($popupType));
|
10 |
$popupClassName = $popupName."Popup";
|
11 |
require_once(SG_APP_POPUP_PATH ."/classes/".$popupClassName.".php");
|
12 |
+
$result = call_user_func(array($popupClassName, 'findById'), $id);
|
13 |
+
|
14 |
switch ($popupType) {
|
15 |
case 'iframe':
|
16 |
$sgPopupDataIframe = $result->getUrl();
|
27 |
case 'shortcode':
|
28 |
$sgPopupDataShortcode = $result->getShortcode();
|
29 |
break;
|
30 |
+
case 'ageRestriction':
|
31 |
+
$sgPopupAgeRestriction = ($result->getContent());
|
32 |
+
$sgYesButton = checkVarebls($result->getYesButton());
|
33 |
+
$sgNoButton = checkVarebls($result->getNoButton());
|
34 |
+
$sgRestrictionUrl = checkVarebls($result->getRestrictionUrl());
|
35 |
+
break;
|
36 |
+
case 'countdown':
|
37 |
+
$sgCoundownContent = ($result->getCountdownContent());
|
38 |
+
$sgCloseType = checkVarebls($result->getCloseType());
|
39 |
+
$sgClosingTime = checkVarebls($result->getClosingTime());
|
40 |
+
break;
|
41 |
+
case 'social':
|
42 |
+
$sgSocialContent = ($result->getSocialContent());
|
43 |
+
$sgSocialButtons = checkVarebls($result->getButtons());
|
44 |
+
$sgSocialOptions = checkVarebls($result->getSocialOptions());
|
45 |
+
break;
|
46 |
}
|
47 |
$title = $result->getTitle();
|
48 |
$jsonData = json_decode($result->getOptions());
|
77 |
$sgPopupClosingTimer = $jsonData->popupClosingTimer;
|
78 |
$sgAutoClosePopup = $jsonData->autoClosePopup;
|
79 |
$sgTheme = $jsonData->theme;
|
80 |
+
$sgRestrictionAction = $jsonData->restrictionAction;
|
81 |
+
$yesButtonBackgroundColor = checkVarebls($jsonData->yesButtonBackgroundColor);
|
82 |
+
$noButtonBackgroundColor = checkVarebls($jsonData->noButtonBackgroundColor);
|
83 |
+
$yesButtonTextColor = checkVarebls($jsonData->yesButtonTextColor);
|
84 |
+
$noButtonTextColor = checkVarebls($jsonData->noButtonTextColor);
|
85 |
+
$yesButtonRadius = checkVarebls($jsonData->yesButtonRadius);
|
86 |
+
$noButtonRadius = checkVarebls($jsonData->noButtonRadius);
|
87 |
+
$sgSocialOptions = json_decode(@$sgSocialOptions,true);
|
88 |
+
$fbShareUrl = checkVarebls($sgSocialOptions['fbShareUrl']);
|
89 |
+
$sgTwitte = checkVarebls($sgSocialOptions['sgTwitte']);
|
90 |
+
$sgMailSubject = checkVarebls($sgSocialOptions['sgMailSubject']);
|
91 |
+
$sgMailUlr = checkVarebls($sgSocialOptions['sgMailUlr']);
|
92 |
+
$sgSocialButtons = json_decode(@$sgSocialButtons,true);
|
93 |
+
$sgTwitterStatus = checkVarebls($sgSocialButtons['sgTwitterStatus']);
|
94 |
+
$sgFbStatus = checkVarebls($sgSocialButtons['sgFbStatus']);
|
95 |
+
$sgEmailStatus = checkVarebls($sgSocialButtons['sgEmailStatus']);
|
96 |
+
$sgLinkedinStatus = checkVarebls($sgSocialButtons['sgLinkedinStatus']);
|
97 |
+
$sgGoogleStatus = checkVarebls($sgSocialButtons['sgGoogleStatus']);
|
98 |
+
$sgPinterestStatus = checkVarebls($sgSocialButtons['sgPinterestStatus']);
|
99 |
+
$sgSocialTheme = checkVarebls($sgSocialOptions['sgSocialTheme']);
|
100 |
+
$sgSocialButtonsSize = checkVarebls($sgSocialOptions['sgSocialButtonsSize']);
|
101 |
}
|
102 |
+
$colorbox_deafult_values = array('escKey'=> true,'closeButton' => true,'scale'=> true, 'scrolling'=> true,'opacity'=>0.8,'reposition' => true,'width' => false,'height' => false,'initialWidth'=>'300','initialHeight'=>'100','maxWidth'=>false,'maxHeight'=>false,'overlayClose'=>true,'contentClick'=>false,'fixed'=>false,'top'=>false,'right'=>false,'bottom'=>false,'left'=>false,"duration"=>1,"delay"=>0);
|
|
|
103 |
$escKey = ($colorbox_deafult_values['escKey'] == true ? 'checked' : '');
|
104 |
$closeButton = ($colorbox_deafult_values['closeButton'] == true ? 'checked' : '');
|
105 |
$scale = ($colorbox_deafult_values['scale'] == true ? 'checked' : '');
|
122 |
$defaultDuration = $colorbox_deafult_values['duration'];
|
123 |
$defaultDelay = $colorbox_deafult_values['delay'];
|
124 |
|
125 |
+
if(isset($sgCloseType)) { $sgCloseType = ($sgCloseType == '') ? '': 'checked'; } else {$sgCloseType = '';}
|
126 |
if(isset($sgEscKey)) {$sgEscKey = ($sgEscKey == '') ? '': 'checked'; } else {$sgEscKey = $escKey;}
|
127 |
if(isset($sgCloseButton)) {$sgCloseButton = ($sgCloseButton == '') ? '': 'checked'; } else {$sgCloseButton = $closeButton;}
|
128 |
if(isset($sgScrolling)) {$sgScrolling = ($sgScrolling == '') ? '': 'checked'; } else {$sgScrolling = $scrolling;}
|
136 |
if(isset($sgCountryStataus)) {$sgCountryStataus = ($sgCountryStataus== '') ? '': 'checked'; }else{$sgCountryStataus = '';}
|
137 |
if(isset($sgDisablePopup)) {$sgDisablePopup = ($sgDisablePopup== '') ? '': 'checked'; }else{$sgDisablePopup = '';}
|
138 |
if(isset($sgAutoClosePopup)) {$sgAutoClosePopup = ($sgAutoClosePopup== '') ? '': 'checked'; }else{$sgAutoClosePopup = '';}
|
139 |
+
if(isset($sgFbStatus)) {$sgFbStatus = ($sgFbStatus== '') ? '': 'checked'; }else{$sgFbStatus = '';}
|
140 |
+
if(isset($sgTwitterStatus)) {$sgTwitterStatus = ($sgTwitterStatus== '') ? '': 'checked'; }else{$sgTwitterStatus = '';}
|
141 |
+
if(isset($sgEmailStatus)) {$sgEmailStatus = ($sgEmailStatus== '') ? '': 'checked'; }else{$sgEmailStatus = '';}
|
142 |
+
if(isset($sgLinkedinStatus)) {$sgLinkedinStatus = ($sgLinkedinStatus== '') ? '': 'checked'; }else{$sgLinkedinStatus = '';}
|
143 |
+
if(isset($sgGoogleStatus)) {$sgGoogleStatus = ($sgGoogleStatus== '') ? '': 'checked'; }else{$sgGoogleStatus = '';}
|
144 |
+
if(isset($sgPinterestStatus)) {$sgPinterestStatus = ($sgPinterestStatus== '') ? '': 'checked'; }else{$sgPinterestStatus = '';}
|
145 |
+
if(isset($sgRestrictionAction)) { if($sgRestrictionAction == 'byUrl') $restrictionAction2 = 'checked'; else $restrictionAction1 = 'checked';} else { $restrictionAction1 = 'checked';}
|
146 |
if(!isset($sgOpacity )) {$sgOpacity = $opacityValue;}
|
147 |
if(!isset($sgWidth )) {$sgWidth = $width;}
|
148 |
if(!isset($sgHeight )) {$sgHeight = $height;}
|
155 |
if(!isset($sgPopupDataIframe)) {$sgPopupDataIframe = 'http://';}
|
156 |
if(!isset($sgPopupDataHtml)) {$sgPopupDataHtml = '';}
|
157 |
if(!isset($sgPopupDataImage)) {$sgPopupDataImage = '';}
|
158 |
+
$restrictionAction2 = '';
|
159 |
+
$restrictionAction1 = 'checked';
|
160 |
+
if(@$sgRestrictionAction == 'closeTab') {
|
161 |
+
$restrictionAction2 = 'checked';
|
162 |
+
$restrictionAction1 = '';
|
163 |
+
}
|
164 |
+
else {
|
165 |
+
$restrictionAction2 = '';
|
166 |
+
$restrictionAction1 = 'checked';
|
167 |
+
}
|
168 |
+
|
169 |
+
function checkVarebls($varieble) {
|
170 |
+
if(isset($varieble)) {
|
171 |
+
return $varieble;
|
172 |
+
}
|
173 |
+
else {
|
174 |
+
return '';
|
175 |
+
}
|
176 |
+
}
|
177 |
//select basa value or deafult value
|
178 |
$sg_popup_effects = array("No effect"=>"No Effect","flip"=>"flip","shake"=>"shake","wobble"=>"wobble","swing"=>"swing","flash"=>"flash","bounce"=>"bounce","pulse"=>"pulse","rubberBand"=>"rubberBand","tada"=>"tada","fadeIn"=>"fadeIn");
|
179 |
$sg_popup_theme = array("colorbox1.css","colorbox2.css","colorbox3.css","colorbox4.css","colorbox5.css");
|
180 |
+
$sg_theme = array("flat"=>"flat","classic"=>"classic","minima"=>"minima","plain"=>"plain");
|
181 |
+
$sg_theme_size = array("8"=>"8","10"=>"10","12"=>"12","14"=>"14","16"=>"16","18"=>"18","20"=>"20","24"=>"24");
|
182 |
+
|
183 |
function creaeSelect($options,$name,$selecteOption)
|
184 |
{
|
185 |
$selected ='';
|
186 |
$str = "";
|
187 |
$checked = "";
|
188 |
+
if($name == 'theme' || $name == 'restrictionAction') {
|
189 |
|
190 |
$popup_style_name = 'popup_theme_name';
|
191 |
$firstOption = array_shift($options);
|
254 |
if(!SG_POPUP_PRO) { ?>
|
255 |
<input class="crudToPro" type="button" value="Upgrade to PRO version" onclick="window.open('<?php echo SG_POPUP_PRO_URL;?>')"><div class="clear"></div>
|
256 |
<?php } ?>
|
257 |
+
<input type="submit" id="promotionalSaveButton" class="button-primary" value="<?php echo 'Save Changes'; ?>" />
|
258 |
<img id="createAjaxLoader" src="<?php echo plugins_url('img/wpspin_light.gif', dirname(__FILE__).'../');?>" style="display: none">
|
259 |
</p>
|
260 |
</div>
|
363 |
<span class="createDescribe">Enable responsiveness:</span><input class='sameWidthinputs' type="checkbox" name="reposition" <?php echo $sgReposition;?> />
|
364 |
<span class="dashicons dashicons-info repositionImg sameImageStyle"></span><span class="infoReposition samefontStyle">The popup will be resized/repositioned automatically when window is being resized.</span><br>
|
365 |
|
366 |
+
<span class="createDescribe">Dismiss on overlay click:</span><input class='sameWidthinputs' type="checkbox" name="overlayClose" <?php echo $sgOverlayClose;?> />
|
367 |
<span class="dashicons dashicons-info overlayImg sameImageStyle"></span><span class="infoOverlayClose samefontStyle">The popup will be dismissed when user clicks beyond of the popup area.</span><br>
|
368 |
|
369 |
+
<span class="createDescribe">Dismiss on content click:</span><input class='sameWidthinputs' type="checkbox" name="contentClick" <?php echo $sgContentClick;?> />
|
370 |
<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>
|
371 |
|
372 |
<span class="createDescribe">Change overlay color:</span><div id="colorPiccer"><input class="sgOverlayColor" id="sgOverlayColor" type="text" name="sgOverlayColor" value="<?php echo esc_attr(@$sgOverlayColor); ?>" /></div><br>
|
files/sg_popup_media_buuton.php
CHANGED
@@ -50,10 +50,10 @@ function dh_popup_media_button_thickboxs() {
|
|
50 |
|
51 |
<div id="sg-popup-thickbox" style="display: none;" class="popupShortDiv">
|
52 |
<div class="wrap" style="font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;">
|
53 |
-
<p><?php
|
54 |
<div>
|
55 |
<select id="sg_popup_id">
|
56 |
-
<option value=""><?php
|
57 |
<?php
|
58 |
global $wpdb;
|
59 |
$proposedTypes = array();
|
@@ -65,8 +65,8 @@ function dh_popup_media_button_thickboxs() {
|
|
65 |
</select>
|
66 |
</div>
|
67 |
<p class="submit">
|
68 |
-
<input type="button" id="dh-ptp-popup-insert" class="button-primary dashicons-welcome-widgets-menus" value="<?php
|
69 |
-
<a id="sg_popup_cancel" class="button-secondary" onclick="tb_remove();" title="<?php
|
70 |
</p>
|
71 |
</div>
|
72 |
</div>
|
50 |
|
51 |
<div id="sg-popup-thickbox" style="display: none;" class="popupShortDiv">
|
52 |
<div class="wrap" style="font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;">
|
53 |
+
<p><?php echo 'Insert the shortcode for showing a Popup.'; ?></p>
|
54 |
<div>
|
55 |
<select id="sg_popup_id">
|
56 |
+
<option value=""><?php echo 'Please select...'; ?></option>
|
57 |
<?php
|
58 |
global $wpdb;
|
59 |
$proposedTypes = array();
|
65 |
</select>
|
66 |
</div>
|
67 |
<p class="submit">
|
68 |
+
<input type="button" id="dh-ptp-popup-insert" class="button-primary dashicons-welcome-widgets-menus" value="<?php echo 'Insert'; ?>"/>
|
69 |
+
<a id="sg_popup_cancel" class="button-secondary" onclick="tb_remove();" title="<?php echo 'Cancel'; ?>"><?php echo 'Cancel'; ?></a>
|
70 |
</p>
|
71 |
</div>
|
72 |
</div>
|
files/sg_popup_page_selection.php
CHANGED
@@ -62,7 +62,7 @@ function sg_popup_callback($post) {
|
|
62 |
}
|
63 |
|
64 |
function selectPopupSaved($post_id) {
|
65 |
-
if($_POST['sg_promotional_popup']
|
66 |
delete_post_meta($post_id, 'sg_promotional_popup');
|
67 |
return false;
|
68 |
}
|
62 |
}
|
63 |
|
64 |
function selectPopupSaved($post_id) {
|
65 |
+
if(empty($_POST['sg_promotional_popup'])) {
|
66 |
delete_post_meta($post_id, 'sg_promotional_popup');
|
67 |
return false;
|
68 |
}
|
files/sg_popup_savePopupFrom.php
CHANGED
@@ -5,7 +5,7 @@ add_action('admin_post_save_popup', 'savePopupFrom');
|
|
5 |
|
6 |
if(isset($_POST[$optionsKey]))
|
7 |
{
|
8 |
-
if($optionsKey == "sg_popup_html")
|
9 |
{
|
10 |
return wp_kses_post($_POST[$optionsKey]);
|
11 |
}
|
@@ -22,6 +22,8 @@ function savePopupFrom() {
|
|
22 |
|
23 |
global $wpdb;
|
24 |
$array = array();
|
|
|
|
|
25 |
|
26 |
$array['width'] = setOptionvalue('width');
|
27 |
$array['height'] = setOptionvalue('height');
|
@@ -58,10 +60,31 @@ function savePopupFrom() {
|
|
58 |
$array['popupClosingTimer'] = setOptionvalue('popupClosingTimer');
|
59 |
$array['yesButtonLabel'] = setOptionvalue('yesButtonLabel');
|
60 |
$array['noButtonLabel'] = setOptionvalue('noButtonLabel');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
61 |
|
62 |
$html = stripslashes(setOptionvalue("sg_popup_html"));
|
63 |
-
$ageRestriction = setOptionvalue('sg_ageRestriction');
|
|
|
64 |
$image = setOptionvalue('ad_image');
|
|
|
65 |
$iframe = setOptionvalue('iframe');
|
66 |
$video = setOptionvalue('video');
|
67 |
$shortCode = stripslashes(setOptionvalue('shortCode'));
|
@@ -69,7 +92,20 @@ function savePopupFrom() {
|
|
69 |
$title = setOptionvalue('title');
|
70 |
$id = setOptionvalue('hidden_popup_number');
|
71 |
$jsonDataArray = json_encode($array);
|
72 |
-
$data = array(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
73 |
$popupName = "SG".ucfirst(strtolower($_POST['type']));
|
74 |
$popupClassName = $popupName."Popup";
|
75 |
|
@@ -77,19 +113,18 @@ function savePopupFrom() {
|
|
77 |
|
78 |
if($id == "") {
|
79 |
global $wpdb;
|
80 |
-
$popupClassName
|
81 |
$lastId = $wpdb->get_var("SELECT LAST_INSERT_ID() FROM ". $wpdb->prefix."sg_popup");
|
82 |
wp_redirect(SG_APP_POPUP_ADMIN_URL."admin.php?page=edit-popup&id=".$lastId."&type=$type&saved=1");
|
83 |
exit();
|
84 |
}
|
85 |
else {
|
86 |
-
|
87 |
-
|
88 |
$popup = SGPopup::findById($id);
|
89 |
$popup->setTitle($title);
|
90 |
$popup->setId($id);
|
91 |
$popup->setType($type);
|
92 |
$popup->setOptions($jsonDataArray);
|
|
|
93 |
switch ($popupName) {
|
94 |
case 'SGImage':
|
95 |
$popup->setUrl($image);
|
@@ -107,7 +142,22 @@ function savePopupFrom() {
|
|
107 |
case 'SGShortcode':
|
108 |
$popup->setShortcode($shortCode);
|
109 |
break;
|
110 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
111 |
}
|
112 |
$popup->save();
|
113 |
wp_redirect(SG_APP_POPUP_ADMIN_URL."admin.php?page=edit-popup&id=$id&type=$type&saved=1");
|
5 |
|
6 |
if(isset($_POST[$optionsKey]))
|
7 |
{
|
8 |
+
if($optionsKey == "sg_popup_html" || $optionsKey == 'sg_ageRestriction' || $optionsKey =='sg_countdown')
|
9 |
{
|
10 |
return wp_kses_post($_POST[$optionsKey]);
|
11 |
}
|
22 |
|
23 |
global $wpdb;
|
24 |
$array = array();
|
25 |
+
$socialButtons = array();
|
26 |
+
$socialOptions = array();
|
27 |
|
28 |
$array['width'] = setOptionvalue('width');
|
29 |
$array['height'] = setOptionvalue('height');
|
60 |
$array['popupClosingTimer'] = setOptionvalue('popupClosingTimer');
|
61 |
$array['yesButtonLabel'] = setOptionvalue('yesButtonLabel');
|
62 |
$array['noButtonLabel'] = setOptionvalue('noButtonLabel');
|
63 |
+
$array['restrictionUrl'] = setOptionvalue('restrictionUrl');
|
64 |
+
$array['yesButtonBackgroundColor'] = setOptionvalue('yesButtonBackgroundColor');
|
65 |
+
$array['noButtonBackgroundColor'] = setOptionvalue('noButtonBackgroundColor');
|
66 |
+
$array['yesButtonTextColor'] = setOptionvalue('yesButtonTextColor');
|
67 |
+
$array['noButtonTextColor'] = setOptionvalue('noButtonTextColor');
|
68 |
+
$array['yesButtonRadius'] = setOptionvalue('yesButtonRadius');
|
69 |
+
$array['noButtonRadius'] = setOptionvalue('noButtonRadius');
|
70 |
+
$array['restrictionAction'] = setOptionvalue('restrictionAction');
|
71 |
+
$array['closingTime'] = setOptionvalue('closingTime');
|
72 |
+
$array['closeType'] = setOptionvalue('closeType');
|
73 |
+
$socialOptions['fbShareUrl']= setOptionvalue('fbShareUrl');
|
74 |
+
$socialButtons['sgTwitterStatus'] = setOptionvalue('sgTwitterStatus');
|
75 |
+
$socialButtons['sgFbStatus'] = setOptionvalue('sgFbStatus');
|
76 |
+
$socialButtons['sgEmailStatus'] = setOptionvalue('sgEmailStatus');
|
77 |
+
$socialButtons['sgLinkedinStatus'] = setOptionvalue('sgLinkedinStatus');
|
78 |
+
$socialButtons['sgGoogleStatus'] = setOptionvalue('sgGoogleStatus');
|
79 |
+
$socialButtons['sgPinterestStatus'] = setOptionvalue('sgPinterestStatus');
|
80 |
+
$array['socialButtons'] = json_encode($socialButtons);
|
81 |
+
$array['socialOptions'] = json_encode($socialOptions);
|
82 |
|
83 |
$html = stripslashes(setOptionvalue("sg_popup_html"));
|
84 |
+
$ageRestriction = stripslashes(setOptionvalue('sg_ageRestriction'));
|
85 |
+
$social = stripslashes(setOptionvalue('sg_social'));
|
86 |
$image = setOptionvalue('ad_image');
|
87 |
+
$countdown = setOptionvalue('sg_countdown');
|
88 |
$iframe = setOptionvalue('iframe');
|
89 |
$video = setOptionvalue('video');
|
90 |
$shortCode = stripslashes(setOptionvalue('shortCode'));
|
92 |
$title = setOptionvalue('title');
|
93 |
$id = setOptionvalue('hidden_popup_number');
|
94 |
$jsonDataArray = json_encode($array);
|
95 |
+
$data = array(
|
96 |
+
'id'=>$id,
|
97 |
+
'title'=>$title,
|
98 |
+
'type'=>$type,
|
99 |
+
'image'=>$image,
|
100 |
+
'html'=>$html,
|
101 |
+
'iframe'=>$iframe,
|
102 |
+
'video'=>$video,
|
103 |
+
'shortcode'=>$shortCode,
|
104 |
+
'ageRestriction'=>$ageRestriction,
|
105 |
+
'countdown'=>$countdown,
|
106 |
+
'social'=> $social,
|
107 |
+
'options'=>$jsonDataArray
|
108 |
+
);
|
109 |
$popupName = "SG".ucfirst(strtolower($_POST['type']));
|
110 |
$popupClassName = $popupName."Popup";
|
111 |
|
113 |
|
114 |
if($id == "") {
|
115 |
global $wpdb;
|
116 |
+
call_user_func(array($popupClassName, 'create'), $data);
|
117 |
$lastId = $wpdb->get_var("SELECT LAST_INSERT_ID() FROM ". $wpdb->prefix."sg_popup");
|
118 |
wp_redirect(SG_APP_POPUP_ADMIN_URL."admin.php?page=edit-popup&id=".$lastId."&type=$type&saved=1");
|
119 |
exit();
|
120 |
}
|
121 |
else {
|
|
|
|
|
122 |
$popup = SGPopup::findById($id);
|
123 |
$popup->setTitle($title);
|
124 |
$popup->setId($id);
|
125 |
$popup->setType($type);
|
126 |
$popup->setOptions($jsonDataArray);
|
127 |
+
|
128 |
switch ($popupName) {
|
129 |
case 'SGImage':
|
130 |
$popup->setUrl($image);
|
142 |
case 'SGShortcode':
|
143 |
$popup->setShortcode($shortCode);
|
144 |
break;
|
145 |
+
case 'SGAgerestriction':
|
146 |
+
$popup->setContent($ageRestriction);
|
147 |
+
$popup->setYesButton($array['yesButtonLabel']);
|
148 |
+
$popup->setNoButton($array['noButtonLabel']);
|
149 |
+
$popup->setRestrictionUrl($array['restrictionUrl']);
|
150 |
+
break;
|
151 |
+
case 'SGCountdown':
|
152 |
+
$popup->setCountdownContent($social);
|
153 |
+
$popup->setClosingTime($array['closingTime']);
|
154 |
+
$popup->setCloseType($array['closeType']);
|
155 |
+
break;
|
156 |
+
case 'SGSocial':
|
157 |
+
$popup->setSocialContent($social);
|
158 |
+
$popup->setButtons(json_encode($socialButtons));
|
159 |
+
$popup->setSocialOptions(json_encode($socialOptions));
|
160 |
+
break;
|
161 |
}
|
162 |
$popup->save();
|
163 |
wp_redirect(SG_APP_POPUP_ADMIN_URL."admin.php?page=edit-popup&id=$id&type=$type&saved=1");
|
img/AgeRestriction.png
ADDED
Binary file
|
img/Countdown.png
ADDED
Binary file
|
img/ShortcodePopupPro.png
ADDED
Binary file
|
img/VideoPopupPro.png
ADDED
Binary file
|
img/iframePopupPro.png
ADDED
Binary file
|
img/socialPopup.png
ADDED
Binary file
|
javascript/sg_popup_backend.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
jQuery(document).ready(function($){
|
2 |
var custom_uploader;
|
3 |
$('#upload_image_button').click(function(e)
|
4 |
e.preventDefault();
|
5 |
//If the uploader object has already been created, reopen the dialog
|
6 |
if (custom_uploader)
|
7 |
custom_uploader.open();
|
8 |
return;
|
9 |
}
|
10 |
//Extend the wp.media object
|
11 |
custom_uploader = wp.media.frames.file_frame = wp.media({
|
12 |
titleFF: 'Choose Image',
|
13 |
button: {
|
14 |
text: 'Choose Image'
|
15 |
},
|
16 |
multiple: false
|
17 |
});
|
18 |
//When a file is selected, grab the URL and set it as the text field's value
|
19 |
custom_uploader.on('select', function() {
|
20 |
attachment = custom_uploader.state().get('selection').first().toJSON();
|
21 |
$('#upload_image').val(attachment.url);
|
22 |
});
|
23 |
//Open the uploader dialog
|
24 |
custom_uploader.open();
|
25 |
});
|
26 |
var currentAttrValue = jQuery(this).attr('href');
|
27 |
// Show/Hide Tabs
|
28 |
jQuery('.tabs ' + currentAttrValue).show().siblings().hide();
|
29 |
// Change/remove current tab to active
|
30 |
jQuery(this).parent('li').removeClass('active').siblings().addClass('active');
|
31 |
e.preventDefault();
|
32 |
});
|
|
|
33 |
var custom_uploader;
|
34 |
$('#upload_image_button').click(function(e)
|
35 |
e.preventDefault();
|
36 |
//If the uploader object has already been created, reopen the dialog
|
37 |
if (custom_uploader)
|
38 |
custom_uploader.open();
|
39 |
return;
|
40 |
}
|
41 |
//Extend the wp.media object
|
42 |
custom_uploader = wp.media.frames.file_frame = wp.media({
|
43 |
titleFF: 'Choose Image',
|
44 |
button: {
|
45 |
text: 'Choose Image'
|
46 |
},
|
47 |
multiple: false
|
48 |
});
|
49 |
//When a file is selected, grab the URL and set it as the text field's value
|
50 |
custom_uploader.on('select', function() {
|
51 |
attachment = custom_uploader.state().get('selection').first().toJSON();
|
52 |
$('#upload_image').val(attachment.url);
|
53 |
});
|
54 |
//Open the uploader dialog
|
55 |
custom_uploader.open();
|
56 |
});
|
57 |
var currentAttrValue = jQuery(this).attr('href');
|
58 |
// Show/Hide Tabs
|
59 |
jQuery('.tabs ' + currentAttrValue).show().siblings().hide();
|
60 |
// Change/remove current tab to active
|
61 |
jQuery(this).parent('li').removeClass('active').siblings().addClass('active');
|
62 |
e.preventDefault();
|
63 |
});
|
|
|
1 |
var custom_uploader;
|
2 |
$('#upload_image_button').click(function(e)
|
3 |
e.preventDefault();
|
4 |
//If the uploader object has already been created, reopen the dialog
|
5 |
if (custom_uploader)
|
6 |
custom_uploader.open();
|
7 |
return;
|
8 |
}
|
9 |
//Extend the wp.media object
|
10 |
custom_uploader = wp.media.frames.file_frame = wp.media({
|
11 |
titleFF: 'Choose Image',
|
12 |
button: {
|
13 |
text: 'Choose Image'
|
14 |
},
|
15 |
multiple: false
|
16 |
});
|
17 |
//When a file is selected, grab the URL and set it as the text field's value
|
18 |
custom_uploader.on('select', function() {
|
19 |
attachment = custom_uploader.state().get('selection').first().toJSON();
|
20 |
$('#upload_image').val(attachment.url);
|
21 |
});
|
22 |
//Open the uploader dialog
|
23 |
custom_uploader.open();
|
24 |
});
|
25 |
var currentAttrValue = jQuery(this).attr('href');
|
26 |
// Show/Hide Tabs
|
27 |
jQuery('.tabs ' + currentAttrValue).show().siblings().hide();
|
28 |
// Change/remove current tab to active
|
29 |
jQuery(this).parent('li').removeClass('active').siblings().addClass('active');
|
30 |
e.preventDefault();
|
31 |
});
|
32 |
+
jQuery(document).ready(function($){
|
33 |
var custom_uploader;
|
34 |
$('#upload_image_button').click(function(e)
|
35 |
e.preventDefault();
|
36 |
//If the uploader object has already been created, reopen the dialog
|
37 |
if (custom_uploader)
|
38 |
custom_uploader.open();
|
39 |
return;
|
40 |
}
|
41 |
//Extend the wp.media object
|
42 |
custom_uploader = wp.media.frames.file_frame = wp.media({
|
43 |
titleFF: 'Choose Image',
|
44 |
button: {
|
45 |
text: 'Choose Image'
|
46 |
},
|
47 |
multiple: false
|
48 |
});
|
49 |
//When a file is selected, grab the URL and set it as the text field's value
|
50 |
custom_uploader.on('select', function() {
|
51 |
attachment = custom_uploader.state().get('selection').first().toJSON();
|
52 |
$('#upload_image').val(attachment.url);
|
53 |
});
|
54 |
//Open the uploader dialog
|
55 |
custom_uploader.open();
|
56 |
});
|
57 |
var currentAttrValue = jQuery(this).attr('href');
|
58 |
// Show/Hide Tabs
|
59 |
jQuery('.tabs ' + currentAttrValue).show().siblings().hide();
|
60 |
// Change/remove current tab to active
|
61 |
jQuery(this).parent('li').removeClass('active').siblings().addClass('active');
|
62 |
e.preventDefault();
|
63 |
});
|
javascript/sg_popup_frontend.js
CHANGED
@@ -5,7 +5,7 @@ jQuery( document ).ready(function( $ ) {
|
|
5 |
jQuery('[id=sg_colorbox_theme5-css]').remove();
|
6 |
});
|
7 |
jQuery(".sg-show-popup").bind('click',function() {
|
8 |
-
var sgPopupID = jQuery(this).attr("sgpopupid");
|
9 |
showPopup(sgPopupID,false);
|
10 |
});
|
11 |
|
@@ -13,7 +13,6 @@ function optionConvertBool(optionName) {
|
|
13 |
returnValue = (optionName) ? true : false;
|
14 |
return returnValue;
|
15 |
}
|
16 |
-
|
17 |
function canOpenPopup(id, openOnce, onLoad) {
|
18 |
if (!onLoad) return true;
|
19 |
|
@@ -25,7 +24,15 @@ function canOpenPopup(id, openOnce, onLoad) {
|
|
25 |
|
26 |
return true;
|
27 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
28 |
|
|
|
29 |
function showPopup(id, onLoad) {
|
30 |
var data = SG_POPUP_DATA[id];
|
31 |
|
@@ -62,6 +69,7 @@ function showPopup(id, onLoad) {
|
|
62 |
sg_popup_cantClose = optionConvertBool(data['disablePopup']);
|
63 |
sg_popup_autoClosePopup = optionConvertBool(data['autoClosePopup']);
|
64 |
popupClosingTimer = data['popupClosingTimer'];
|
|
|
65 |
|
66 |
if(sg_popup_cantClose) {
|
67 |
sgPopup.cantPopupClose();
|
@@ -70,11 +78,22 @@ function showPopup(id, onLoad) {
|
|
70 |
sg_popup_html = (data['html'] == '') ? ' ' : data['html'];
|
71 |
sg_popup_image = data['image'];
|
72 |
sg_popup_iframe_url = data['iframe'];
|
73 |
-
sg_popup_shortCode = data['
|
74 |
sg_popup_video = data['video'];
|
75 |
sg_popup_overlayColor = data['sgOverlayColor'];
|
76 |
sg_popup_width = data['width'];
|
77 |
sg_popup_height = data['height'];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
78 |
|
79 |
sg_popup_html = (sg_popup_html) ? sg_popup_html: false;
|
80 |
sg_popup_iframe = (sg_popup_iframe_url) ? true: false;
|
@@ -151,10 +170,10 @@ function showPopup(id, onLoad) {
|
|
151 |
sgfixedPsotonleft = 50;
|
152 |
}
|
153 |
if(sg_popup_forMobile) {
|
154 |
-
var
|
155 |
}
|
156 |
else {
|
157 |
-
|
158 |
}
|
159 |
if(sg_popup_autoClosePopup) {
|
160 |
sgPopup.cantPopupClose();
|
@@ -165,9 +184,9 @@ function showPopup(id, onLoad) {
|
|
165 |
|
166 |
}
|
167 |
}
|
168 |
-
if(
|
169 |
|
170 |
-
|
171 |
width: sg_popup_width,
|
172 |
height: sg_popup_height,
|
173 |
onOpen:function() {
|
@@ -187,10 +206,6 @@ function showPopup(id, onLoad) {
|
|
187 |
|
188 |
},
|
189 |
onLoad: function(){
|
190 |
-
|
191 |
-
},
|
192 |
-
onComplete: function(){
|
193 |
-
|
194 |
},
|
195 |
html: sg_popup_html,
|
196 |
photo: sg_popup_photo,
|
@@ -211,7 +226,9 @@ function showPopup(id, onLoad) {
|
|
211 |
maxHeight: data['maxHeight'],
|
212 |
initialWidth: data['initialWidth'],
|
213 |
initialHeight: data['initialHeight']
|
214 |
-
}
|
|
|
|
|
215 |
|
216 |
if(data['id'] && onLoad==true && openOnce != '') {
|
217 |
jQuery.cookie("sgPopupNumbers",data['id'], { expires: 7});
|
5 |
jQuery('[id=sg_colorbox_theme5-css]').remove();
|
6 |
});
|
7 |
jQuery(".sg-show-popup").bind('click',function() {
|
8 |
+
var sgPopupID = jQuery(this).attr("data-sgpopupid");
|
9 |
showPopup(sgPopupID,false);
|
10 |
});
|
11 |
|
13 |
returnValue = (optionName) ? true : false;
|
14 |
return returnValue;
|
15 |
}
|
|
|
16 |
function canOpenPopup(id, openOnce, onLoad) {
|
17 |
if (!onLoad) return true;
|
18 |
|
24 |
|
25 |
return true;
|
26 |
}
|
27 |
+
function checkVariebls(varieble) {
|
28 |
+
if(varieble) {
|
29 |
+
return varieble;
|
30 |
+
}
|
31 |
+
else {
|
32 |
+
return '';
|
33 |
+
}
|
34 |
|
35 |
+
}
|
36 |
function showPopup(id, onLoad) {
|
37 |
var data = SG_POPUP_DATA[id];
|
38 |
|
69 |
sg_popup_cantClose = optionConvertBool(data['disablePopup']);
|
70 |
sg_popup_autoClosePopup = optionConvertBool(data['autoClosePopup']);
|
71 |
popupClosingTimer = data['popupClosingTimer'];
|
72 |
+
|
73 |
|
74 |
if(sg_popup_cantClose) {
|
75 |
sgPopup.cantPopupClose();
|
78 |
sg_popup_html = (data['html'] == '') ? ' ' : data['html'];
|
79 |
sg_popup_image = data['image'];
|
80 |
sg_popup_iframe_url = data['iframe'];
|
81 |
+
sg_popup_shortCode = data['shortcode'];
|
82 |
sg_popup_video = data['video'];
|
83 |
sg_popup_overlayColor = data['sgOverlayColor'];
|
84 |
sg_popup_width = data['width'];
|
85 |
sg_popup_height = data['height'];
|
86 |
+
sg_popup_ageRestriction = data['ageRestriction'];
|
87 |
+
sg_popup_ageRestrictionUrl = data['restrictionUrl'];
|
88 |
+
sg_pupup_yesButtonLabel = checkVariebls(data['yesButtonLabel']);
|
89 |
+
sg_pupup_noButtonLabel = checkVariebls(data['noButtonLabel']);
|
90 |
+
yesButtonBackgroundColor = checkVariebls(data['yesButtonBackgroundColor']);
|
91 |
+
noButtonBackgroundColor = checkVariebls(data['noButtonBackgroundColor']);
|
92 |
+
yesButtonTextColor = checkVariebls(data['yesButtonTextColor']);
|
93 |
+
noButtonTextColor = checkVariebls(data['noButtonTextColor']);
|
94 |
+
yesButtonRadius = checkVariebls(data['yesButtonRadius']);
|
95 |
+
noButtonRadius = checkVariebls(data['noButtonRadius']);
|
96 |
+
|
97 |
|
98 |
sg_popup_html = (sg_popup_html) ? sg_popup_html: false;
|
99 |
sg_popup_iframe = (sg_popup_iframe_url) ? true: false;
|
170 |
sgfixedPsotonleft = 50;
|
171 |
}
|
172 |
if(sg_popup_forMobile) {
|
173 |
+
var userDevice = sgPopup.forMobile();
|
174 |
}
|
175 |
else {
|
176 |
+
userDevice = false;
|
177 |
}
|
178 |
if(sg_popup_autoClosePopup) {
|
179 |
sgPopup.cantPopupClose();
|
184 |
|
185 |
}
|
186 |
}
|
187 |
+
if(userDevice) return;
|
188 |
|
189 |
+
SG_POPUP_SETTINGS = {
|
190 |
width: sg_popup_width,
|
191 |
height: sg_popup_height,
|
192 |
onOpen:function() {
|
206 |
|
207 |
},
|
208 |
onLoad: function(){
|
|
|
|
|
|
|
|
|
209 |
},
|
210 |
html: sg_popup_html,
|
211 |
photo: sg_popup_photo,
|
226 |
maxHeight: data['maxHeight'],
|
227 |
initialWidth: data['initialWidth'],
|
228 |
initialHeight: data['initialHeight']
|
229 |
+
};
|
230 |
+
|
231 |
+
jQuery.sgcolorbox(SG_POPUP_SETTINGS);
|
232 |
|
233 |
if(data['id'] && onLoad==true && openOnce != '') {
|
234 |
jQuery.cookie("sgPopupNumbers",data['id'], { expires: 7});
|
popup-builder.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Plugin Name: Popup Builder
|
4 |
* Plugin URI: http://sygnoos.com
|
5 |
* Description: Create and manage powerful promotion popups for your WordPress blog or website. It's completely free and all features are available.
|
6 |
-
* Version: 2.0.
|
7 |
* Author: Sygnoos
|
8 |
* Author URI: http://www.sygnoos.com
|
9 |
* License: GPLv2
|
@@ -18,7 +18,7 @@ define('SG_APP_POPUP_FILES', SG_APP_POPUP_PATH . '/files');
|
|
18 |
define('SG_APP_POPUP_CLASSES', SG_APP_POPUP_PATH . '/classes');
|
19 |
define('SG_APP_POPUP_JS', SG_APP_POPUP_PATH . '/javascript');
|
20 |
define('SG_APP_POPUP_TABLE_LIMIT', 20 );
|
21 |
-
define('SG_POPUP_VERSION', 2.
|
22 |
define('SG_POPUP_PRO', 0);
|
23 |
define('SG_POPUP_PRO_URL', 'http://sygnoos.com/wordpress-popup/');
|
24 |
|
@@ -28,7 +28,8 @@ $POPUP_TITLES = array(
|
|
28 |
'iframe' => 'Iframe',
|
29 |
'video' => 'Video',
|
30 |
'shortcode' => 'Shortcode',
|
31 |
-
'ageRestriction' => 'Age Restriction'
|
|
|
32 |
);
|
33 |
|
34 |
require_once( SG_APP_POPUP_CLASSES .'/SGPopup.php');
|
@@ -128,7 +129,7 @@ function sgShowShortCode($args, $content) {
|
|
128 |
wp_enqueue_style('sg_colorbox_theme');
|
129 |
if(!$obj) return $content;
|
130 |
sgRenderPopupScript($args['id']);
|
131 |
-
return "<a href='javascript:void(0)' class='sg-show-popup' sgpopupid=".$args['id'].">".$content."</a>";
|
132 |
}
|
133 |
add_shortCode('sg_popup', 'sgShowShortCode');
|
134 |
|
@@ -161,8 +162,8 @@ require_once( SG_APP_POPUP_FILES . '/sg_popup_ajax.php');
|
|
161 |
function sg_popup_plugin_loaded() {
|
162 |
$versionPopup = get_option('SG_POPUP_VERSION');
|
163 |
if(!$versionPopup || $versionPopup < SG_POPUP_VERSION ) {
|
164 |
-
update_option('SG_POPUP_VERSION', SG_POPUP_VERSION);
|
165 |
-
PopupInstaller::install();
|
166 |
PopupInstaller::convert();
|
167 |
}
|
168 |
}
|
3 |
* Plugin Name: Popup Builder
|
4 |
* Plugin URI: http://sygnoos.com
|
5 |
* Description: Create and manage powerful promotion popups for your WordPress blog or website. It's completely free and all features are available.
|
6 |
+
* Version: 2.0.3
|
7 |
* Author: Sygnoos
|
8 |
* Author URI: http://www.sygnoos.com
|
9 |
* License: GPLv2
|
18 |
define('SG_APP_POPUP_CLASSES', SG_APP_POPUP_PATH . '/classes');
|
19 |
define('SG_APP_POPUP_JS', SG_APP_POPUP_PATH . '/javascript');
|
20 |
define('SG_APP_POPUP_TABLE_LIMIT', 20 );
|
21 |
+
define('SG_POPUP_VERSION', 2.03);
|
22 |
define('SG_POPUP_PRO', 0);
|
23 |
define('SG_POPUP_PRO_URL', 'http://sygnoos.com/wordpress-popup/');
|
24 |
|
28 |
'iframe' => 'Iframe',
|
29 |
'video' => 'Video',
|
30 |
'shortcode' => 'Shortcode',
|
31 |
+
'ageRestriction' => 'Age Restriction',
|
32 |
+
'countdown' => 'Countdown'
|
33 |
);
|
34 |
|
35 |
require_once( SG_APP_POPUP_CLASSES .'/SGPopup.php');
|
129 |
wp_enqueue_style('sg_colorbox_theme');
|
130 |
if(!$obj) return $content;
|
131 |
sgRenderPopupScript($args['id']);
|
132 |
+
return "<a href='javascript:void(0)' class='sg-show-popup' data-sgpopupid=".$args['id'].">".$content."</a>";
|
133 |
}
|
134 |
add_shortCode('sg_popup', 'sgShowShortCode');
|
135 |
|
162 |
function sg_popup_plugin_loaded() {
|
163 |
$versionPopup = get_option('SG_POPUP_VERSION');
|
164 |
if(!$versionPopup || $versionPopup < SG_POPUP_VERSION ) {
|
165 |
+
update_option('SG_POPUP_VERSION', SG_POPUP_VERSION);
|
166 |
+
PopupInstaller::install();
|
167 |
PopupInstaller::convert();
|
168 |
}
|
169 |
}
|
readme.txt
CHANGED
@@ -2,10 +2,10 @@
|
|
2 |
Plugin Name: Popup Builder
|
3 |
Contributors: Sygnoos
|
4 |
Donate link: http://sygnoos.com/wordpress-popup/
|
5 |
-
Tags: popup,popup promote,promotional popup,popup ads, popup advertising, popup box, popup form, popup message, popup window, popups, wordpress popup, simple popup, modal window, responsive popup, fancybox, fancy popup, lightbox, automatic popup, custom popup,popup message, youtube popup, video popup, iframe popup, vimeo popup, popup contact form, dialog box, fancy box popup, wordpress popup plugin, lightbox popup, popup builder, wordpress popup builder
|
6 |
Requires at least: 3.8
|
7 |
-
Tested up to: 4.
|
8 |
-
Stable tag: 2.0.
|
9 |
License: GPLv2 or later
|
10 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
11 |
|
@@ -21,19 +21,19 @@ https://www.youtube.com/watch?v=3ZwRKPhHMzY
|
|
21 |
|
22 |
Popups are a good marketing tool, they're impressively high converting. A web page with a popup typically sees more conversions than the same page without a popup. More important, a page with a well designed and thoughtfully implemented popup converts better than one with an ugly popup. With Popup Builder plugin you can customize the popup according to your needs.
|
23 |
|
24 |
-
**Features:**
|
25 |
|
26 |
-
* Create and manage as many popups as you want
|
27 |
-
* Customize the look and feel of the popup
|
28 |
-
* Set custom animation effects
|
29 |
-
* Customize popup animation effect
|
30 |
-
* Choose between several popup themes
|
31 |
-
* Set popup location on the screen
|
32 |
-
* Customize popup overlay color and opacity
|
33 |
-
* Responsive popup
|
34 |
-
* Network/Multisite popup
|
35 |
|
36 |
-
**PRO features:**
|
37 |
|
38 |
* Create iframe popup - you can set the URL you want to load within an iframe and the popup will load that iframe
|
39 |
* Create popup from shortcodes of other plugins - very useful when you want to load another plugin inside your popup
|
@@ -84,6 +84,16 @@ Go to the Popup Builder settings and set your desired options.
|
|
84 |
|
85 |
== Changelog ==
|
86 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
87 |
* Version 2.0.1
|
88 |
|
89 |
Bug fixed.
|
2 |
Plugin Name: Popup Builder
|
3 |
Contributors: Sygnoos
|
4 |
Donate link: http://sygnoos.com/wordpress-popup/
|
5 |
+
Tags: popup,popup promote,promotional popup,popup ads, popup advertising, popup box, popup form, popup message, popup window, popups, wordpress popup, simple popup, modal window, responsive popup, fancybox, fancy popup, lightbox, automatic popup, custom popup,popup message, youtube popup, video popup, iframe popup, vimeo popup, popup contact form, dialog box, fancy box popup, wordpress popup plugin, lightbox popup, popup builder, wordpress popup builder, html popup
|
6 |
Requires at least: 3.8
|
7 |
+
Tested up to: 4.3
|
8 |
+
Stable tag: 2.0.3
|
9 |
License: GPLv2 or later
|
10 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
11 |
|
21 |
|
22 |
Popups are a good marketing tool, they're impressively high converting. A web page with a popup typically sees more conversions than the same page without a popup. More important, a page with a well designed and thoughtfully implemented popup converts better than one with an ugly popup. With Popup Builder plugin you can customize the popup according to your needs.
|
23 |
|
24 |
+
**Popup Builder - Features:**
|
25 |
|
26 |
+
* Create and manage as many popups as you want - Popup Builder
|
27 |
+
* Customize the look and feel of the popup - Popup Builder
|
28 |
+
* Set custom animation effects - Popup Builder
|
29 |
+
* Customize popup animation effect - Popup Builder
|
30 |
+
* Choose between several popup themes - Popup Builder
|
31 |
+
* Set popup location on the screen - Popup Builder
|
32 |
+
* Customize popup overlay color and opacity - Popup Builder
|
33 |
+
* Responsive popup - Popup Builder
|
34 |
+
* Network/Multisite popup - Popup Builder
|
35 |
|
36 |
+
**Popup Builder - PRO features:**
|
37 |
|
38 |
* Create iframe popup - you can set the URL you want to load within an iframe and the popup will load that iframe
|
39 |
* Create popup from shortcodes of other plugins - very useful when you want to load another plugin inside your popup
|
84 |
|
85 |
== Changelog ==
|
86 |
|
87 |
+
* Version 2.0.3
|
88 |
+
|
89 |
+
Bug fixed.
|
90 |
+
|
91 |
+
* Version 2.0.2
|
92 |
+
|
93 |
+
Popup UI changed.
|
94 |
+
|
95 |
+
Popup Builder PHP version fixes.
|
96 |
+
|
97 |
* Version 2.0.1
|
98 |
|
99 |
Bug fixed.
|
style/sg_popup_style.css
CHANGED
@@ -250,6 +250,27 @@ span.phpErrorStyle{
|
|
250 |
.videoPopup {
|
251 |
background-image: url(../img/VideoPopup.png);
|
252 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
253 |
/****** end create page *****/
|
254 |
/******* general ******/
|
255 |
#createAjaxLoader {
|
@@ -496,7 +517,7 @@ input[name="theme"]{
|
|
496 |
.options{
|
497 |
margin-top: 13px;
|
498 |
}
|
499 |
-
.optionsContent .createDescribe, .advancedOptionsContent .createDescribe {
|
500 |
width: 241px;
|
501 |
}
|
502 |
.optionsContent .sameWidthinputs {
|
@@ -605,6 +626,9 @@ input[name="theme"]{
|
|
605 |
#colorPiccer > .wp-picker-container .wp-color-result {
|
606 |
top:12px;
|
607 |
}
|
|
|
|
|
|
|
608 |
.wp-picker-open+.wp-picker-input-wrap {
|
609 |
float: right;
|
610 |
margin-top: 12px;
|
@@ -700,7 +724,13 @@ input[name="theme"]{
|
|
700 |
border-right: 1px solid #ccc;
|
701 |
border-left: 1px solid #ccc;
|
702 |
}
|
703 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
704 |
|
705 |
/******* options end ******/
|
706 |
|
250 |
.videoPopup {
|
251 |
background-image: url(../img/VideoPopup.png);
|
252 |
}
|
253 |
+
.countdown {
|
254 |
+
background-image: url(../img/Countdown.png);
|
255 |
+
}
|
256 |
+
.sgSocial {
|
257 |
+
background-image: url(../img/SocialPopup.png);
|
258 |
+
}
|
259 |
+
.ageRestriction {
|
260 |
+
background-image: url(../img/AgeRestriction.png);
|
261 |
+
}
|
262 |
+
.iframePopupPro {
|
263 |
+
background-image: url(../img/iframePopupPro.png);
|
264 |
+
}
|
265 |
+
.shortcodePopupPro {
|
266 |
+
background-image: url(../img/ShortcodePopupPro.png);
|
267 |
+
}
|
268 |
+
.videoPopupPro {
|
269 |
+
background-image: url(../img/VideoPopupPro.png);
|
270 |
+
}
|
271 |
+
.ageRestrictionPro {
|
272 |
+
background-color: blue;
|
273 |
+
}
|
274 |
/****** end create page *****/
|
275 |
/******* general ******/
|
276 |
#createAjaxLoader {
|
517 |
.options{
|
518 |
margin-top: 13px;
|
519 |
}
|
520 |
+
.optionsContent .createDescribe, .advancedOptionsContent .createDescribe,.specialOptionsContent .createDescribe,.effectsContent .createDescribe{
|
521 |
width: 241px;
|
522 |
}
|
523 |
.optionsContent .sameWidthinputs {
|
626 |
#colorPiccer > .wp-picker-container .wp-color-result {
|
627 |
top:12px;
|
628 |
}
|
629 |
+
.specialOptionsContent .wp-color-result:after{
|
630 |
+
line-height: 24px;
|
631 |
+
}
|
632 |
.wp-picker-open+.wp-picker-input-wrap {
|
633 |
float: right;
|
634 |
margin-top: 12px;
|
724 |
border-right: 1px solid #ccc;
|
725 |
border-left: 1px solid #ccc;
|
726 |
}
|
727 |
+
.specialSubDiv {
|
728 |
+
margin-left: 40px;
|
729 |
+
}
|
730 |
+
.restrictionUrlDiv {
|
731 |
+
display: none;
|
732 |
+
width: 100%;
|
733 |
+
}
|
734 |
|
735 |
/******* options end ******/
|
736 |
|