Version Description
- Fixed bug with popup on mobiles devices
- Css fixed for better alignment of social networks
- Added filters and actions for a future premium version of the plugin
Download this release
Release Info
Developer | timersys |
Plugin | Popups – WordPress Popup |
Version | 1.0.3 |
Comparing to | |
See all releases |
Code changes from version 1.0.2 to 1.0.3
- README.txt +7 -1
- admin/assets/css/admin.css +5 -0
- admin/class-social-popup-admin.php +3 -2
- admin/views/metabox-links.php +6 -1
- admin/views/metabox-options.php +10 -8
- popups.php +1 -1
- public/assets/css/public.css +4 -0
- public/assets/js/min/public-ck.js +1 -1
- public/assets/js/public.js +2 -3
- public/class-social-popup.php +4 -45
- public/views/popup.php +54 -0
- public/views/public.php +0 -16
README.txt
CHANGED
@@ -4,7 +4,7 @@ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_i
|
|
4 |
Tags: twitter,google+, facebook,Popups, twitter follow, facebook like, google plus,social boost, social splash, popup, facebook popup, scroll popups, popups, wordpress popup, wp popups
|
5 |
Requires at least: 3.6
|
6 |
Tested up to: 3.9.1
|
7 |
-
Stable tag: 1.0.
|
8 |
Text Domain: spucpt
|
9 |
License: GPLv2 or later
|
10 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
@@ -77,6 +77,12 @@ Enhance your site by letting your users send Social Invitations ([http://wp.time
|
|
77 |
|
78 |
== Changelog ==
|
79 |
|
|
|
|
|
|
|
|
|
|
|
|
|
80 |
= 1.0.2 =
|
81 |
|
82 |
* Added checks for shortcode values to avoid problems
|
4 |
Tags: twitter,google+, facebook,Popups, twitter follow, facebook like, google plus,social boost, social splash, popup, facebook popup, scroll popups, popups, wordpress popup, wp popups
|
5 |
Requires at least: 3.6
|
6 |
Tested up to: 3.9.1
|
7 |
+
Stable tag: 1.0.3
|
8 |
Text Domain: spucpt
|
9 |
License: GPLv2 or later
|
10 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
77 |
|
78 |
== Changelog ==
|
79 |
|
80 |
+
= 1.0.3 =
|
81 |
+
|
82 |
+
* Fixed bug with popup on mobiles devices
|
83 |
+
* Css fixed for better alignment of social networks
|
84 |
+
* Added filters and actions for a future premium version of the plugin
|
85 |
+
|
86 |
= 1.0.2 =
|
87 |
|
88 |
* Added checks for shortcode values to avoid problems
|
admin/assets/css/admin.css
CHANGED
@@ -111,6 +111,11 @@ table.spu_table select:focus {
|
|
111 |
input#spu-width {
|
112 |
width: 90px;
|
113 |
}
|
|
|
|
|
|
|
|
|
|
|
114 |
/*---------------------------------------------------------------------------------------------
|
115 |
*
|
116 |
* Rules
|
111 |
input#spu-width {
|
112 |
width: 90px;
|
113 |
}
|
114 |
+
|
115 |
+
h3.spu-title {
|
116 |
+
border-bottom: 1px solid #ccc;
|
117 |
+
font-size: 18px !important;
|
118 |
+
}
|
119 |
/*---------------------------------------------------------------------------------------------
|
120 |
*
|
121 |
* Rules
|
admin/class-social-popup-admin.php
CHANGED
@@ -304,6 +304,7 @@ class SocialPopup_Admin {
|
|
304 |
unset( $_POST['spu'] );
|
305 |
|
306 |
// sanitize settings
|
|
|
307 |
$opts['css']['bgopacity'] = sanitize_text_field( $opts['css']['bgopacity'] );
|
308 |
$opts['css']['border_width'] = absint( sanitize_text_field( $opts['css']['border_width'] ) );
|
309 |
$opts['cookie'] = absint( sanitize_text_field( $opts['cookie'] ) );
|
@@ -311,7 +312,7 @@ class SocialPopup_Admin {
|
|
311 |
|
312 |
|
313 |
// save box settings
|
314 |
-
update_post_meta( $post_id, 'spu_options', $opts );
|
315 |
|
316 |
// Start with rules
|
317 |
if( isset($_POST['spu_rules']) && is_array($_POST['spu_rules']) )
|
@@ -330,7 +331,7 @@ class SocialPopup_Admin {
|
|
330 |
}
|
331 |
}
|
332 |
|
333 |
-
update_post_meta( $post_id, 'spu_rules', $groups_a );
|
334 |
unset( $_POST['spu_rules'] );
|
335 |
}
|
336 |
|
304 |
unset( $_POST['spu'] );
|
305 |
|
306 |
// sanitize settings
|
307 |
+
$opts['css']['width'] = sanitize_text_field( $opts['css']['width'] );
|
308 |
$opts['css']['bgopacity'] = sanitize_text_field( $opts['css']['bgopacity'] );
|
309 |
$opts['css']['border_width'] = absint( sanitize_text_field( $opts['css']['border_width'] ) );
|
310 |
$opts['cookie'] = absint( sanitize_text_field( $opts['cookie'] ) );
|
312 |
|
313 |
|
314 |
// save box settings
|
315 |
+
update_post_meta( $post_id, 'spu_options', apply_filters( 'spu/metaboxes/sanitized_options', $opts ) );
|
316 |
|
317 |
// Start with rules
|
318 |
if( isset($_POST['spu_rules']) && is_array($_POST['spu_rules']) )
|
331 |
}
|
332 |
}
|
333 |
|
334 |
+
update_post_meta( $post_id, 'spu_rules', apply_filters( 'spu/metaboxes/sanitized_rules', $groups_a ) );
|
335 |
unset( $_POST['spu_rules'] );
|
336 |
}
|
337 |
|
admin/views/metabox-links.php
CHANGED
@@ -5,4 +5,9 @@ if ( !defined( 'ABSPATH' ) ) exit;
|
|
5 |
|
6 |
<p><?php _e( 'My name is', $this->plugin_slug );?> <a href="http://twitter.com/chifliiiii">Damian Logghe</a>. <?php _e( 'I develop WordPress plugins and themes.', $this->plugin_slug );?></p>
|
7 |
<p><?php printf(__( 'Take a look at my <a href="%s">site</a> to see my other plugins or hire me. Subscribe to get updates!', $this->plugin_slug ), 'http://wp.timersys.com/');?></p>
|
8 |
-
<
|
|
|
|
|
|
|
|
|
|
5 |
|
6 |
<p><?php _e( 'My name is', $this->plugin_slug );?> <a href="http://twitter.com/chifliiiii">Damian Logghe</a>. <?php _e( 'I develop WordPress plugins and themes.', $this->plugin_slug );?></p>
|
7 |
<p><?php printf(__( 'Take a look at my <a href="%s">site</a> to see my other plugins or hire me. Subscribe to get updates!', $this->plugin_slug ), 'http://wp.timersys.com/');?></p>
|
8 |
+
<h4><?php _e( 'Other plugins I built:', $this->plugin_slug );?></h4>
|
9 |
+
<ul>
|
10 |
+
<li> <a href="http://wordpress.org/plugins/wpfavs/" target="_blank">Wp Favs</a> - <?php _e( 'Install multiple plugins and create collections', $this->plugin_slug );?></li>
|
11 |
+
<li> <a href="http://wordpress.org/plugins/twitter-like-box-reloaded/" target="_blank">Twitter like Box</a> - <?php _e( 'Like Facebook like box but for Twitter', $this->plugin_slug );?></li>
|
12 |
+
<li> <a href="http://wordpress.org/plugins/wp-social-invitations" target="_blank">Wordpress Social Invitations</a> - <?php _e( 'Invite your network friends and import contacts', $this->plugin_slug );?></li>
|
13 |
+
</ul>
|
admin/views/metabox-options.php
CHANGED
@@ -4,7 +4,7 @@ if ( !defined( 'ABSPATH' ) ) exit;?>
|
|
4 |
|
5 |
<table class="form-table">
|
6 |
|
7 |
-
<?php do_action( 'spu/metaboxes/before_display_options' );?>
|
8 |
<tr valign="top">
|
9 |
<th><label for="spu_position"><?php _e( 'Box Position', $this->plugin_slug ); ?></label></th>
|
10 |
<td>
|
@@ -14,6 +14,7 @@ if ( !defined( 'ABSPATH' ) ) exit;?>
|
|
14 |
<option value="top-right" <?php selected($opts['css']['position'], 'top-right'); ?>><?php _e( 'Top Right', $this->plugin_slug ); ?></option>
|
15 |
<option value="bottom-left" <?php selected($opts['css']['position'], 'bottom-left'); ?>><?php _e( 'Bottom Left', $this->plugin_slug ); ?></option>
|
16 |
<option value="bottom-right" <?php selected($opts['css']['position'], 'bottom-right'); ?>><?php _e( 'Bottom Right', $this->plugin_slug ); ?></option>
|
|
|
17 |
</select>
|
18 |
</td>
|
19 |
<td colspan="2"></td>
|
@@ -25,19 +26,20 @@ if ( !defined( 'ABSPATH' ) ) exit;?>
|
|
25 |
|
26 |
<option value="seconds" <?php selected($opts['trigger'], 'seconds'); ?>><?php _e( 'seconds after page load', $this->plugin_slug ); ?></option>
|
27 |
<option value="percentage" <?php selected($opts['trigger'], 'percentage'); ?>>% <?php _e( 'of page height', $this->plugin_slug ); ?></option>
|
28 |
-
<?php do_action( 'spu/metaboxes/trigger_options' );?>
|
29 |
</select>
|
30 |
</td>
|
31 |
<td>
|
32 |
-
<input type="number" class="spu-trigger-number" name="spu[trigger_number]" min="0"
|
|
|
33 |
</td>
|
34 |
</tr>
|
35 |
<tr valign="top">
|
36 |
<th><label><?php _e( 'Animation', $this->plugin_slug ); ?></label></th>
|
37 |
<td colspan="3">
|
38 |
<label><input type="radio" name="spu[animation]" value="fade" <?php checked($opts['animation'], 'fade'); ?> /> <?php _e( 'Fade In', $this->plugin_slug ); ?></label>
|
39 |
-
<label><input type="radio" name="spu[animation]" value="slide" <?php checked($opts['animation'], 'slide'); ?> /> <?php _e( 'Slide In', $this->plugin_slug ); ?></label>
|
40 |
-
<?php do_action( 'spu/metaboxes/animations', $
|
41 |
<p class="help"><?php _e( 'Slide will only apply when popup is on the corners', $this->plugin_slug ); ?></p>
|
42 |
</td>
|
43 |
</tr>
|
@@ -67,12 +69,12 @@ if ( !defined( 'ABSPATH' ) ) exit;?>
|
|
67 |
<p class="help"><?php _e( 'If test mode is enabled, the box will show up regardless of whether a cookie has been set. (To admins only)', $this->plugin_slug ); ?></p>
|
68 |
</td>
|
69 |
</tr>
|
70 |
-
<?php do_action( 'spu/metaboxes/after_display_options' );?>
|
71 |
</table>
|
72 |
|
73 |
<h3 class="spu-title"><?php _e( 'Appearance', $this->plugin_slug ); ?></h3>
|
74 |
<table class="form-table">
|
75 |
-
<?php do_action( 'spu/metaboxes/before_appearance_options' );?>
|
76 |
<tr valign="top">
|
77 |
<th><label for="spu_bgopacity"><?php _e( 'Background opacity', $this->plugin_slug ); ?></label></th>
|
78 |
<td colspan="3">
|
@@ -106,7 +108,7 @@ if ( !defined( 'ABSPATH' ) ) exit;?>
|
|
106 |
</td>
|
107 |
<td></td>
|
108 |
</tr>
|
109 |
-
<?php do_action( 'spu/metaboxes/after_appearance_options' );?>
|
110 |
</table>
|
111 |
|
112 |
<?php wp_nonce_field( 'spu_options', 'spu_options_nonce' ); ?>
|
4 |
|
5 |
<table class="form-table">
|
6 |
|
7 |
+
<?php do_action( 'spu/metaboxes/before_display_options', $opts );?>
|
8 |
<tr valign="top">
|
9 |
<th><label for="spu_position"><?php _e( 'Box Position', $this->plugin_slug ); ?></label></th>
|
10 |
<td>
|
14 |
<option value="top-right" <?php selected($opts['css']['position'], 'top-right'); ?>><?php _e( 'Top Right', $this->plugin_slug ); ?></option>
|
15 |
<option value="bottom-left" <?php selected($opts['css']['position'], 'bottom-left'); ?>><?php _e( 'Bottom Left', $this->plugin_slug ); ?></option>
|
16 |
<option value="bottom-right" <?php selected($opts['css']['position'], 'bottom-right'); ?>><?php _e( 'Bottom Right', $this->plugin_slug ); ?></option>
|
17 |
+
<?php do_action( 'spu/metaboxes/positions', $opts );?>
|
18 |
</select>
|
19 |
</td>
|
20 |
<td colspan="2"></td>
|
26 |
|
27 |
<option value="seconds" <?php selected($opts['trigger'], 'seconds'); ?>><?php _e( 'seconds after page load', $this->plugin_slug ); ?></option>
|
28 |
<option value="percentage" <?php selected($opts['trigger'], 'percentage'); ?>>% <?php _e( 'of page height', $this->plugin_slug ); ?></option>
|
29 |
+
<?php do_action( 'spu/metaboxes/trigger_options', $opts );?>
|
30 |
</select>
|
31 |
</td>
|
32 |
<td>
|
33 |
+
<input type="number" class="spu-trigger-number" name="spu[trigger_number]" min="0" value="<?php echo esc_attr($opts['trigger_number']); ?>" />
|
34 |
+
<?php do_action( 'spu/metaboxes/trigger_values', $opts );?>
|
35 |
</td>
|
36 |
</tr>
|
37 |
<tr valign="top">
|
38 |
<th><label><?php _e( 'Animation', $this->plugin_slug ); ?></label></th>
|
39 |
<td colspan="3">
|
40 |
<label><input type="radio" name="spu[animation]" value="fade" <?php checked($opts['animation'], 'fade'); ?> /> <?php _e( 'Fade In', $this->plugin_slug ); ?></label>
|
41 |
+
<label><input type="radio" name="spu[animation]" value="slide" <?php checked($opts['animation'], 'slide'); ?> /> <?php _e( 'Slide In', $this->plugin_slug ); ?></label>
|
42 |
+
<?php do_action( 'spu/metaboxes/animations', $opts );?>
|
43 |
<p class="help"><?php _e( 'Slide will only apply when popup is on the corners', $this->plugin_slug ); ?></p>
|
44 |
</td>
|
45 |
</tr>
|
69 |
<p class="help"><?php _e( 'If test mode is enabled, the box will show up regardless of whether a cookie has been set. (To admins only)', $this->plugin_slug ); ?></p>
|
70 |
</td>
|
71 |
</tr>
|
72 |
+
<?php do_action( 'spu/metaboxes/after_display_options', $opts );?>
|
73 |
</table>
|
74 |
|
75 |
<h3 class="spu-title"><?php _e( 'Appearance', $this->plugin_slug ); ?></h3>
|
76 |
<table class="form-table">
|
77 |
+
<?php do_action( 'spu/metaboxes/before_appearance_options', $opts );?>
|
78 |
<tr valign="top">
|
79 |
<th><label for="spu_bgopacity"><?php _e( 'Background opacity', $this->plugin_slug ); ?></label></th>
|
80 |
<td colspan="3">
|
108 |
</td>
|
109 |
<td></td>
|
110 |
</tr>
|
111 |
+
<?php do_action( 'spu/metaboxes/after_appearance_options', $opts );?>
|
112 |
</table>
|
113 |
|
114 |
<?php wp_nonce_field( 'spu_options', 'spu_options_nonce' ); ?>
|
popups.php
CHANGED
@@ -11,7 +11,7 @@
|
|
11 |
* @socialpopup
|
12 |
* Plugin Name: Popups
|
13 |
* Plugin URI: http://www.timersys.com/free-plugins/social-popup/
|
14 |
-
* Version: 1.0.
|
15 |
* Description: This plugin will display a popup or splash screen when a new user visit your site showing a Google+, twitter and facebook follow links. This will increase you followers ratio in a 40%. Popup will be close depending on your settings. Check readme.txt for full details.
|
16 |
* Author: Damian Logghe
|
17 |
* Author URI: http://wp.timersys.com
|
11 |
* @socialpopup
|
12 |
* Plugin Name: Popups
|
13 |
* Plugin URI: http://www.timersys.com/free-plugins/social-popup/
|
14 |
+
* Version: 1.0.3
|
15 |
* Description: This plugin will display a popup or splash screen when a new user visit your site showing a Google+, twitter and facebook follow links. This will increase you followers ratio in a 40%. Popup will be close depending on your settings. Check readme.txt for full details.
|
16 |
* Author: Damian Logghe
|
17 |
* Author URI: http://wp.timersys.com
|
public/assets/css/public.css
CHANGED
@@ -97,7 +97,11 @@ body {
|
|
97 |
}
|
98 |
.spu-shortcode {
|
99 |
float: left;
|
|
|
100 |
}
|
|
|
|
|
|
|
101 |
.spu-total-4 .spu-shortcode{
|
102 |
width:24%;
|
103 |
margin-left:.5%;
|
97 |
}
|
98 |
.spu-shortcode {
|
99 |
float: left;
|
100 |
+
line-height: normal !important;
|
101 |
}
|
102 |
+
.spu-shortcode iframe{
|
103 |
+
max-width: 1200px;
|
104 |
+
}
|
105 |
.spu-total-4 .spu-shortcode{
|
106 |
width:24%;
|
107 |
margin-left:.5%;
|
public/assets/js/min/public-ck.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
function createCookie(t,n,e){if(e){var i=new Date;i.setTime(i.getTime()+24*e*60*60*1e3);var o="; expires="+i.toGMTString()}else var o="";document.cookie=t+"="+n+o+"; path=/"}function readCookie(t){for(var n=t+"=",e=document.cookie.split(";"),i=0;i<e.length;i++){for(var o=e[i];" "==o.charAt(0);)o=o.substring(1,o.length);if(0==o.indexOf(n))return o.substring(n.length,o.length)}return null}jQuery(window).load(function(){window.SPU=function(
|
1 |
+
function createCookie(t,n,e){if(e){var i=new Date;i.setTime(i.getTime()+24*e*60*60*1e3);var o="; expires="+i.toGMTString()}else var o="";document.cookie=t+"="+n+o+"; path=/"}function readCookie(t){for(var n=t+"=",e=document.cookie.split(";"),i=0;i<e.length;i++){for(var o=e[i];" "==o.charAt(0);)o=o.substring(1,o.length);if(0==o.indexOf(n))return o.substring(n.length,o.length)}return null}jQuery(window).load(function(){window.SPU=function($){function t(t){var n=o[t],e=$(window).width(),i=$(window).height(),a=n.height(),r=n.width();n.css({position:"fixed",top:i/2-a/2,left:e/2-r/2})}function n(t,n){var e=o[t],i=$("#spu-bg-"+t),a=e.data("bgopa");if(e.is(":animated"))return!1;if(n===!0&&e.is(":visible")||n===!1&&e.is(":hidden"))return!1;var r=e.data("animation");return"fade"===r?e.fadeToggle("slow"):e.slideToggle("slow"),n===!0&&a>0?i.fadeIn():i.fadeOut(),n}var e=$(window).height(),i=spuvar.is_admin,o=[];return $(".spu-content").children().first().css({"margin-top":0,"padding-top":0}).end().last().css({"margin-bottom":0,"padding-bottom":0}),$(".spu-box").each(function(){var a=$(this),r=a.data("trigger"),s=0,d=1===parseInt(a.data("test-mode")),c=a.data("box-id"),u=1===parseInt(a.data("auto-hide")),l=1===parseInt(a.data("advanced-close")),f=parseInt(a.data("seconds-close"));if(l){$(document).keyup(function(t){27==t.keyCode&&n(c,!1)});var h=navigator.userAgent,g=h.match(/iPad/i)||h.match(/iPhone/i)?"touchstart":"click";$("body").on(g,function(t){console.log(g.target),n(c,!1)}),$(".spu-box").on(g,function(t){t.stopPropagation()})}if(a.hide().css("left",""),o[c]=a,"seconds"==r)var w=parseInt(a.data("trigger-number"),10);else var p="percentage"==r?parseInt(a.data("trigger-number"),10)/100:.8,m=p*$(document).height();var v=function(){s&&clearTimeout(s),s=window.setTimeout(function(){var i=$(window).scrollTop(),o=i+e>=m;o?(u||$(window).unbind("scroll",v),a.hasClass("spu-centered")&&t(c),n(c,!0)):n(c,!1)},100)},b=function(){s&&clearTimeout(s),s=window.setTimeout(function(){a.hasClass("spu-centered")&&t(c),n(c,!0)},1e3*w)},k=readCookie("spu_box_"+c);if((void 0==k||i&&d)&&("seconds"==r?b():($(window).bind("scroll",v),v()),window.location.hash&&window.location.hash.length>0)){var T=window.location.hash,x;T.substring(1)===a.attr("id")&&setTimeout(function(){n(c,!0)},100)}a.find(".spu-close").click(function(){n(c,!1),"percentage"==r&&$(window).unbind("scroll",v);var t=parseInt(a.data("cookie"));t>0&&createCookie("spu_box_"+c,!0,t)}),$('a[href="#'+a.attr("id")+'"]').click(function(){return n(c,!0),!1})}),{show:function(t){return n(t,!0)},hide:function(t){return n(t,!1)}}}(window.jQuery)});
|
public/assets/js/public.js
CHANGED
@@ -22,7 +22,6 @@ jQuery(window).load(function() {
|
|
22 |
// vars
|
23 |
var $box = $(this);
|
24 |
var triggerMethod = $box.data('trigger');
|
25 |
-
var animation = $box.data('animation');
|
26 |
var timer = 0;
|
27 |
var testMode = (parseInt($box.data('test-mode')) === 1);
|
28 |
var id = $box.data('box-id');
|
@@ -42,11 +41,11 @@ jQuery(window).load(function() {
|
|
42 |
event = (ua.match(/iPad/i) || ua.match(/iPhone/i)) ? "touchstart" : "click";
|
43 |
|
44 |
$('body').on(event, function (ev) {
|
45 |
-
|
46 |
toggleBox( id, false );
|
47 |
});
|
48 |
//not on the box
|
49 |
-
$('.spu-box' ).
|
50 |
event.stopPropagation();
|
51 |
});
|
52 |
}
|
22 |
// vars
|
23 |
var $box = $(this);
|
24 |
var triggerMethod = $box.data('trigger');
|
|
|
25 |
var timer = 0;
|
26 |
var testMode = (parseInt($box.data('test-mode')) === 1);
|
27 |
var id = $box.data('box-id');
|
41 |
event = (ua.match(/iPad/i) || ua.match(/iPhone/i)) ? "touchstart" : "click";
|
42 |
|
43 |
$('body').on(event, function (ev) {
|
44 |
+
console.log(event.target);
|
45 |
toggleBox( id, false );
|
46 |
});
|
47 |
//not on the box
|
48 |
+
$('.spu-box' ).on(event, function(event) {
|
49 |
event.stopPropagation();
|
50 |
});
|
51 |
}
|
public/class-social-popup.php
CHANGED
@@ -23,7 +23,7 @@ class SocialPopup {
|
|
23 |
*
|
24 |
* @var string
|
25 |
*/
|
26 |
-
const VERSION = '1.0.
|
27 |
|
28 |
/**
|
29 |
* Popups to use acrros files
|
@@ -91,10 +91,10 @@ class SocialPopup {
|
|
91 |
add_action( 'wpmu_new_blog', array( $this, 'activate_new_site' ) );
|
92 |
|
93 |
// Register public-facing style sheet and JavaScript.
|
94 |
-
add_action( 'wp_enqueue_scripts', array( $this, 'register_scripts' ) );
|
95 |
|
96 |
//check for matches
|
97 |
-
add_action( 'wp_enqueue_scripts', array( $this, 'check_for_matches' ) );
|
98 |
|
99 |
//print boxes
|
100 |
add_action( 'wp_footer', array( $this, 'print_boxes' ) );
|
@@ -529,48 +529,7 @@ class SocialPopup {
|
|
529 |
|
530 |
foreach ($spu_matches as $spu_id ) {
|
531 |
|
532 |
-
|
533 |
-
$box = get_post( $spu_id );
|
534 |
-
|
535 |
-
// has box with this id been found?
|
536 |
-
if ( ! $box instanceof WP_Post || $box->post_status !== 'publish' ) {
|
537 |
-
return;
|
538 |
-
}
|
539 |
-
|
540 |
-
$opts = Spu_Helper::get_box_options( $box->ID );
|
541 |
-
$css = $opts['css'];
|
542 |
-
$content = $box->post_content;
|
543 |
-
|
544 |
-
// run filters on content
|
545 |
-
$content = apply_filters( 'spu/popup/content', $content, $box );
|
546 |
-
|
547 |
-
|
548 |
-
?>
|
549 |
-
<style type="text/css">
|
550 |
-
#spu-<?php echo $box->ID; ?> {
|
551 |
-
background: <?php echo ( !empty( $css['background_color'] ) ) ? esc_attr($css['background_color']) : 'white'; ?>;
|
552 |
-
<?php if ( !empty( $css['color'] ) ) { ?>color: <?php echo esc_attr($css['color']); ?>;<?php } ?>
|
553 |
-
<?php if ( !empty( $css['border_color'] ) && !empty( $css['border_width'] ) ) { ?>border: <?php echo esc_attr($css['border_width']) . 'px' ?> solid <?php echo esc_attr($css['border_color']); ?>;<?php } ?>
|
554 |
-
max-width: <?php echo ( !empty( $css['width'] ) ) ? esc_attr( $css['width'] ) : 'auto'; ?>;
|
555 |
-
}
|
556 |
-
#spu-bg-<?php echo $box->ID; ?> {
|
557 |
-
opacity: <?php echo ( !empty( $css['bgopacity'] ) ) ? esc_attr($css['bgopacity']) : 0; ?>;
|
558 |
-
}
|
559 |
-
</style>
|
560 |
-
<div class="spu-bg" id="spu-bg-<?php echo $box->ID; ?>"></div>
|
561 |
-
<div class="spu-box spu-<?php echo esc_attr( $opts['css']['position'] ); ?> spu-total-<?php echo $total_shortcodes[$box->ID];?>" id="spu-<?php echo $box->ID; ?>"
|
562 |
-
data-box-id="<?php echo $box->ID ; ?>" data-trigger="<?php echo esc_attr( $opts['trigger'] ); ?>"
|
563 |
-
data-trigger-number="<?php echo esc_attr( absint( $opts['trigger_number'] ) ); ?>"
|
564 |
-
data-animation="<?php echo esc_attr($opts['animation']); ?>" data-cookie="<?php echo esc_attr( absint ( $opts['cookie'] ) ); ?>" data-test-mode="<?php echo esc_attr($opts['test_mode']); ?>"
|
565 |
-
data-auto-hide="<?php echo esc_attr($opts['auto_hide']); ?>" data-bgopa="<?php echo esc_attr($css['bgopacity']);?>" data-advanced-close="1"
|
566 |
-
style="left:-99999px">
|
567 |
-
<div class="spu-content"><?php echo $content; ?></div>
|
568 |
-
<span class="spu-close">×</span>
|
569 |
-
</div>
|
570 |
-
<?php
|
571 |
-
|
572 |
-
?> <!-- / Popups Box -->
|
573 |
-
<?php
|
574 |
|
575 |
} //endforeach
|
576 |
echo '<div id="fb-root" class=" fb_reset"></div>';
|
23 |
*
|
24 |
* @var string
|
25 |
*/
|
26 |
+
const VERSION = '1.0.3';
|
27 |
|
28 |
/**
|
29 |
* Popups to use acrros files
|
91 |
add_action( 'wpmu_new_blog', array( $this, 'activate_new_site' ) );
|
92 |
|
93 |
// Register public-facing style sheet and JavaScript.
|
94 |
+
add_action( 'wp_enqueue_scripts', array( $this, 'register_scripts' ), 1 );
|
95 |
|
96 |
//check for matches
|
97 |
+
add_action( 'wp_enqueue_scripts', array( $this, 'check_for_matches' ), 3 );
|
98 |
|
99 |
//print boxes
|
100 |
add_action( 'wp_footer', array( $this, 'print_boxes' ) );
|
529 |
|
530 |
foreach ($spu_matches as $spu_id ) {
|
531 |
|
532 |
+
include( 'views/popup.php');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
533 |
|
534 |
} //endforeach
|
535 |
echo '<div id="fb-root" class=" fb_reset"></div>';
|
public/views/popup.php
ADDED
@@ -0,0 +1,54 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Popup view
|
4 |
+
*
|
5 |
+
* @package Popups
|
6 |
+
* @author Damian Logghe <info@timersys.com
|
7 |
+
* @license GPL-2.0+
|
8 |
+
* @link http://wp.timersys.com
|
9 |
+
* @copyright 2014 Timersys
|
10 |
+
*/
|
11 |
+
|
12 |
+
?><!-- Popups v<?php echo self::VERSION; ?> - http://wordpress.org/plugins/social-popup/--><?php
|
13 |
+
$box = get_post( $spu_id );
|
14 |
+
|
15 |
+
// has box with this id been found?
|
16 |
+
if ( ! $box instanceof WP_Post || $box->post_status !== 'publish' ) {
|
17 |
+
return;
|
18 |
+
}
|
19 |
+
|
20 |
+
$opts = Spu_Helper::get_box_options( $box->ID );
|
21 |
+
$css = $opts['css'];
|
22 |
+
$content = $box->post_content;
|
23 |
+
|
24 |
+
// run filters on content
|
25 |
+
$content = apply_filters( 'spu/popup/content', $content, $box );
|
26 |
+
|
27 |
+
do_action( 'spu/popup/before_popup', $box, $opts, $css);
|
28 |
+
|
29 |
+
?>
|
30 |
+
<style type="text/css">
|
31 |
+
#spu-<?php echo $box->ID; ?> {
|
32 |
+
background: <?php echo ( !empty( $css['background_color'] ) ) ? esc_attr($css['background_color']) : 'white'; ?>;
|
33 |
+
<?php if ( !empty( $css['color'] ) ) { ?>color: <?php echo esc_attr($css['color']); ?>;<?php } ?>
|
34 |
+
<?php if ( !empty( $css['border_color'] ) && !empty( $css['border_width'] ) ) { ?>border: <?php echo esc_attr($css['border_width']) . 'px' ?> solid <?php echo esc_attr($css['border_color']); ?>;<?php } ?>
|
35 |
+
max-width: <?php echo ( !empty( $css['width'] ) ) ? esc_attr( $css['width'] ) : 'auto'; ?>;
|
36 |
+
}
|
37 |
+
#spu-bg-<?php echo $box->ID; ?> {
|
38 |
+
opacity: <?php echo ( !empty( $css['bgopacity'] ) ) ? esc_attr($css['bgopacity']) : 0; ?>;
|
39 |
+
}
|
40 |
+
</style>
|
41 |
+
<div class="spu-bg" id="spu-bg-<?php echo $box->ID; ?>"></div>
|
42 |
+
<div class="spu-box spu-<?php echo esc_attr( $opts['css']['position'] ); ?> spu-total-<?php echo $total_shortcodes[$box->ID];?>" id="spu-<?php echo $box->ID; ?>"
|
43 |
+
data-box-id="<?php echo $box->ID ; ?>" data-trigger="<?php echo esc_attr( $opts['trigger'] ); ?>"
|
44 |
+
data-trigger-number="<?php echo esc_attr( absint( $opts['trigger_number'] ) ); ?>"
|
45 |
+
data-animation="<?php echo esc_attr($opts['animation']); ?>" data-cookie="<?php echo esc_attr( absint ( $opts['cookie'] ) ); ?>" data-test-mode="<?php echo esc_attr($opts['test_mode']); ?>"
|
46 |
+
data-auto-hide="<?php echo esc_attr($opts['auto_hide']); ?>" data-bgopa="<?php echo esc_attr($css['bgopacity']);?>" data-advanced-close="1"
|
47 |
+
style="left:-99999px" <?php echo apply_filters( 'spu/popup/data_attrs', $data_attrs );?>>
|
48 |
+
<div class="spu-content"><?php echo $content; ?></div>
|
49 |
+
<span class="spu-close">×</span>
|
50 |
+
<span class="spu-timer"></span>
|
51 |
+
</div>
|
52 |
+
<!-- / Popups Box -->
|
53 |
+
<?php
|
54 |
+
do_action( 'spu/popup/after_popup', $box, $opts, $css);
|
public/views/public.php
DELETED
@@ -1,16 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Represents the view for the public-facing component of the plugin.
|
4 |
-
*
|
5 |
-
* This typically includes any information, if any, that is rendered to the
|
6 |
-
* frontend of the theme when the plugin is activated.
|
7 |
-
*
|
8 |
-
* @package Plugin_Name
|
9 |
-
* @author Your Name <email@example.com>
|
10 |
-
* @license GPL-2.0+
|
11 |
-
* @link http://example.com
|
12 |
-
* @copyright 2014 Your Name or Company Name
|
13 |
-
*/
|
14 |
-
?>
|
15 |
-
|
16 |
-
<!-- This file is used to markup the public facing aspect of the plugin. -->
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|