Hustle – Pop-Ups, Slide-ins and Email Opt-ins - Version 4.4.4

Version Description

Download this release

Release Info

Developer WPMUDEV
Plugin Icon 128x128 Hustle – Pop-Ups, Slide-ins and Email Opt-ins
Version 4.4.4
Comparing to
See all releases

Code changes from version 4.3.2 to 4.4.4

Files changed (30) hide show
  1. popover-load-js.php +167 -0
  2. popover.php +14 -9
  3. popoverincludes/classes/functions.php +0 -48
  4. popoverincludes/classes/popoveradmin.php +120 -306
  5. popoverincludes/classes/popoverajax.php +202 -169
  6. popoverincludes/classes/popoverpublic.php +61 -387
  7. popoverincludes/css/fullbackground/images/closemessage.png +0 -0
  8. popoverincludes/css/fullbackground/images/closemessagebland.png +0 -0
  9. popoverincludes/css/fullbackground/images/loading.gif +0 -0
  10. popoverincludes/css/fullbackground/images/opaque.png +0 -0
  11. popoverincludes/css/fullbackground/images/opaque80.png +0 -0
  12. popoverincludes/css/fullbackground/popover.php +16 -0
  13. popoverincludes/css/fullbackground/style.css +99 -0
  14. popoverincludes/css/fullbackgroundfixed/images/closemessage.png +0 -0
  15. popoverincludes/css/fullbackgroundfixed/images/closemessagebland.png +0 -0
  16. popoverincludes/css/fullbackgroundfixed/images/loading.gif +0 -0
  17. popoverincludes/css/fullbackgroundfixed/images/opaque.png +0 -0
  18. popoverincludes/css/fullbackgroundfixed/images/opaque80.png +0 -0
  19. popoverincludes/css/fullbackgroundfixed/popover.php +14 -0
  20. popoverincludes/css/{popover.css → fullbackgroundfixed/style.css} +4 -4
  21. popoverincludes/css/popover.min.css +0 -111
  22. popoverincludes/external/wpmudev-dash-notification.php +67 -0
  23. popoverincludes/includes/config.php +0 -4
  24. popoverincludes/includes/functions.php +32 -10
  25. popoverincludes/js/popover.js +0 -45
  26. popoverincludes/js/popover.min.js +0 -6
  27. popoverincludes/js/popoverlegacy.js +79 -0
  28. popoverincludes/js/popoversizing.min.js +0 -2
  29. popoverincludes/languages/popover.mo +0 -0
  30. readme.txt +3 -3
popover-load-js.php ADDED
@@ -0,0 +1,167 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ * Popover selective loading file - had to move from JS to PHP because we needed some extra processing that couldn't be handled in a JS file :(
4
+ */
5
+ // Header settings code based on code from load-scripts.php
6
+ error_reporting(0);
7
+
8
+ $compress = ( isset($_GET['c']) && $_GET['c'] );
9
+ $force_gzip = ( $compress && 'gzip' == $_GET['c'] );
10
+ $expires_offset = 31536000;
11
+ $out = '';
12
+
13
+ header('Content-Type: application/x-javascript; charset=UTF-8');
14
+ header('Expires: ' . gmdate( "D, d M Y H:i:s", time() + $expires_offset ) . ' GMT');
15
+ header("Cache-Control: public, max-age=$expires_offset");
16
+
17
+ if ( $compress && ! ini_get('zlib.output_compression') && 'ob_gzhandler' != ini_get('output_handler') && isset($_SERVER['HTTP_ACCEPT_ENCODING']) ) {
18
+ header('Vary: Accept-Encoding'); // Handle proxies
19
+ if ( false !== stripos($_SERVER['HTTP_ACCEPT_ENCODING'], 'deflate') && function_exists('gzdeflate') && ! $force_gzip ) {
20
+ header('Content-Encoding: deflate');
21
+ $out = gzdeflate( $out, 3 );
22
+ } elseif ( false !== stripos($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip') && function_exists('gzencode') ) {
23
+ header('Content-Encoding: gzip');
24
+ $out = gzencode( $out, 3 );
25
+ }
26
+ }
27
+
28
+ define( 'POPOVERJSLOCATION', dirname($_SERVER["SCRIPT_FILENAME"]) );
29
+ define( 'ABSPATH', dirname(dirname(dirname(POPOVERJSLOCATION))) . '/' );
30
+ define( 'WPINC', 'wp-includes' );
31
+
32
+ // Load WordPress so that we can get some bits and pieces.
33
+ require_once( ABSPATH . 'wp-load.php');
34
+
35
+ ?>
36
+ //
37
+ // Javascript file to selectively load the WPMUDEV Pop Up
38
+ //
39
+ // Written by Barry (Incsub)
40
+ //
41
+ //
42
+ //
43
+
44
+ // Where the admin-ajax.php file is relative to the domain - have to hardcode for now due to this being a JS file
45
+ var po_adminajax = '<?php echo admin_url( 'admin-ajax.php' ); ?>';
46
+
47
+ // Enable us to get some cookie information - from http://stackoverflow.com/questions/5639346/shortest-function-for-reading-a-cookie-in-javascript
48
+ function po_get_cookie(name) {
49
+
50
+ var nameEQ = name + "=";
51
+ var ca = document.cookie.split(';');
52
+ for(var i=0;i < ca.length;i++) {
53
+ var c = ca[i];
54
+ while (c.charAt(0)==' ') c = c.substring(1,c.length);
55
+ if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
56
+ }
57
+ return null;
58
+ }
59
+
60
+ function po_createCookie(name,value,days) {
61
+ if (days) {
62
+ var date = new Date();
63
+ date.setTime(date.getTime()+(days*24*60*60*1000));
64
+ var expires = "; expires="+date.toGMTString();
65
+ }
66
+ else var expires = "";
67
+ document.cookie = name+"="+value+expires+"; path=/";
68
+ }
69
+
70
+ function po_removeMessageBoxForever() {
71
+ jQuery('#darkbackground').remove();
72
+ jQuery(this).parents(popovername).remove();
73
+ po_createCookie('popover_never_view', 'hidealways', 365);
74
+ return false;
75
+ }
76
+
77
+ function po_removeMessageBox() {
78
+ jQuery('#darkbackground').remove();
79
+ jQuery(this).parents(popovername).remove();
80
+ return false;
81
+ }
82
+
83
+ function po_loadMessageBox( ) {
84
+
85
+ // move the data back to the data variable, from mydata so we can use it without changing a chunk of code :)
86
+ data = mydata;
87
+
88
+ if( data['html'] != '' ) {
89
+ // Set the name for other functions to use
90
+ popovername = '#' + data['name'];
91
+
92
+ jQuery( '<style type="text/css">' + data['style'] + '</style>' ).appendTo('head');
93
+ jQuery( data['html'] ).appendTo('body');
94
+
95
+ if( data['usejs'] == 'yes' ) {
96
+
97
+ jQuery('#' + data['name']).width(jQuery('#message').width());
98
+ jQuery('#' + data['name']).height(jQuery('#message').height());
99
+
100
+ jQuery('#' + data['name']).css('top', (jQuery(window).height() / 2) - (jQuery('#message').height() / 2) );
101
+ jQuery('#' + data['name']).css('left', (jQuery(window).width() / 2) - (jQuery('#message').width() / 2) );
102
+ }
103
+
104
+ jQuery('#' + data['name']).css('visibility', 'visible');
105
+ jQuery('#darkbackground').css('visibility', 'visible');
106
+
107
+ jQuery('#clearforever').click(po_removeMessageBoxForever);
108
+ jQuery('#closebox').click(po_removeMessageBox);
109
+
110
+ jQuery('#message').hover( function() {jQuery('.claimbutton').removeClass('hide');}, function() {jQuery('.claimbutton').addClass('hide');});
111
+ }
112
+
113
+ }
114
+
115
+ function po_onsuccess( data ) {
116
+ // set the data to be a global variable so we can grab it after the timeout
117
+ mydata = data;
118
+
119
+ if(data['name'] != 'nopoover') {
120
+ window.setTimeout( po_loadMessageBox, data['delay'] );
121
+ }
122
+
123
+ }
124
+
125
+ function po_load_popover() {
126
+
127
+ var theajax = po_adminajax;
128
+ var thefrom = window.location;
129
+ var thereferrer = document.referrer;
130
+
131
+ // Check if we are forcing a popover - if not then set it to a default value of 0
132
+ if (typeof force_popover === 'undefined') {
133
+ force_popover = 0;
134
+ }
135
+
136
+ jQuery.ajax( {
137
+ url : theajax,
138
+ dataType : 'jsonp',
139
+ jsonpCallback : 'po_onsuccess',
140
+ data : { action : 'popover_selective_ajax',
141
+ thefrom : thefrom.toString(),
142
+ thereferrer : thereferrer.toString(),
143
+ active_popover : force_popover.toString()
144
+ },
145
+ success : function(data) {
146
+
147
+ }
148
+ }
149
+ );
150
+
151
+ return false;
152
+ }
153
+
154
+
155
+ // The main function
156
+ function po_selectiveLoad() {
157
+
158
+ po_load_popover();
159
+
160
+ }
161
+
162
+ // Call when the page is fully loaded
163
+ jQuery(window).load(po_selectiveLoad);
164
+
165
+ <?php
166
+ exit;
167
+ ?>
popover.php CHANGED
@@ -1,14 +1,14 @@
1
  <?php
2
  /*
3
- Plugin Name: WordPress PopUp
4
  Plugin URI: http://premium.wpmudev.org
5
  Description: Allows you to display a fancy popup (powered as a popover!) to visitors sitewide or per blog, a *very* effective way of advertising a mailing list, special offer or running a plain old ad.
6
  Author: Barry (Incsub)
7
- Version: 4.3.2
8
  Author URI: http://premium.wpmudev.org
9
- WDP ID: 230
10
 
11
- Copyright 2007-2010 Incsub (http://incsub.com)
12
 
13
  This program is free software; you can redistribute it and/or modify
14
  it under the terms of the GNU General Public License as published by
@@ -33,19 +33,24 @@ set_popover_url(__FILE__);
33
  set_popover_dir(__FILE__);
34
 
35
  if(is_admin()) {
 
 
36
  require_once('popoverincludes/includes/class_wd_help_tooltips.php');
37
  require_once('popoverincludes/classes/popover.help.php');
38
  require_once('popoverincludes/classes/popoveradmin.php');
 
39
 
40
  $popover = new popoveradmin();
41
- //$popoverajax = new popoverajax();
42
  } else {
 
 
 
 
43
  require_once('popoverincludes/classes/popoverpublic.php');
44
 
45
  $popover = new popoverpublic();
 
46
  }
47
 
48
- load_popover_addons();
49
-
50
-
51
- ?>
1
  <?php
2
  /*
3
+ Plugin Name: WordPress PopUp Plugin
4
  Plugin URI: http://premium.wpmudev.org
5
  Description: Allows you to display a fancy popup (powered as a popover!) to visitors sitewide or per blog, a *very* effective way of advertising a mailing list, special offer or running a plain old ad.
6
  Author: Barry (Incsub)
7
+ Version: 4.4.4
8
  Author URI: http://premium.wpmudev.org
9
+ WDP ID: 123
10
 
11
+ Copyright Incsub (http://incsub.com)
12
 
13
  This program is free software; you can redistribute it and/or modify
14
  it under the terms of the GNU General Public License as published by
33
  set_popover_dir(__FILE__);
34
 
35
  if(is_admin()) {
36
+ include_once('popoverincludes/external/wpmudev-dash-notification.php');
37
+
38
  require_once('popoverincludes/includes/class_wd_help_tooltips.php');
39
  require_once('popoverincludes/classes/popover.help.php');
40
  require_once('popoverincludes/classes/popoveradmin.php');
41
+ require_once('popoverincludes/classes/popoverajax.php');
42
 
43
  $popover = new popoveradmin();
44
+ $popoverajax = new popoverajax();
45
  } else {
46
+ // Adding ajax so we don't have to duplicate checking functionality in the public class
47
+ // NOTE: it's not being used for ajax here
48
+ require_once('popoverincludes/classes/popoverajax.php');
49
+
50
  require_once('popoverincludes/classes/popoverpublic.php');
51
 
52
  $popover = new popoverpublic();
53
+ $popoverajax = new popoverajax();
54
  }
55
 
56
+ load_popover_addons();
 
 
 
popoverincludes/classes/functions.php DELETED
@@ -1,48 +0,0 @@
1
- <?php
2
-
3
- function set_popover_url($base) {
4
-
5
- global $popover_url;
6
-
7
- if(defined('WPMU_PLUGIN_URL') && defined('WPMU_PLUGIN_DIR') && file_exists(WPMU_PLUGIN_DIR . '/' . basename($base))) {
8
- $popover_url = trailingslashit(WPMU_PLUGIN_URL);
9
- } elseif(defined('WP_PLUGIN_URL') && defined('WP_PLUGIN_DIR') && file_exists(WP_PLUGIN_DIR . '/wordpress-popup/' . basename($base))) {
10
- $popover_url = trailingslashit(WP_PLUGIN_URL . '/wordpress-popup');
11
- } else {
12
- $popover_url = trailingslashit(WP_PLUGIN_URL . '/wordpress-popup');
13
- }
14
-
15
- }
16
-
17
- function set_popover_dir($base) {
18
-
19
- global $popover_dir;
20
-
21
- if(defined('WPMU_PLUGIN_DIR') && file_exists(WPMU_PLUGIN_DIR . '/' . basename($base))) {
22
- $popover_dir = trailingslashit(WPMU_PLUGIN_URL);
23
- } elseif(defined('WP_PLUGIN_DIR') && file_exists(WP_PLUGIN_DIR . '/wordpress-popup/' . basename($base))) {
24
- $popover_dir = trailingslashit(WP_PLUGIN_DIR . '/wordpress-popup');
25
- } else {
26
- $popover_dir = trailingslashit(WP_PLUGIN_DIR . '/wordpress-popup');
27
- }
28
-
29
-
30
- }
31
-
32
- function popover_url($extended) {
33
-
34
- global $popover_url;
35
-
36
- return $popover_url . $extended;
37
-
38
- }
39
-
40
- function popover_dir($extended) {
41
-
42
- global $popover_dir;
43
-
44
- return $popover_dir . $extended;
45
-
46
-
47
- }
48
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
popoverincludes/classes/popoveradmin.php CHANGED
@@ -30,6 +30,7 @@ if(!class_exists('popoveradmin')) {
30
  // Add header files
31
  add_action('load-toplevel_page_popover', array(&$this, 'add_admin_header_popover_menu'));
32
  add_action('load-pop-overs_page_popoveraddons', array(&$this, 'add_admin_header_popover_addons'));
 
33
 
34
  // Ajax calls
35
  add_action( 'wp_ajax_popover_update_order', array(&$this, 'ajax_update_popover_order') );
@@ -108,6 +109,8 @@ if(!class_exists('popoveradmin')) {
108
  $addnew = add_submenu_page('popover', __('Create New Pop Over','popover'), __('Create New','popover'), 'manage_options', "popover&amp;action=add", array(&$this,'handle_addnewpopover_panel'));
109
  add_submenu_page('popover', __('Manage Add-ons Plugins','popover'), __('Add-ons','popover'), 'manage_options', "popoveraddons", array(&$this,'handle_addons_panel'));
110
 
 
 
111
  }
112
 
113
  function sanitise_array($arrayin) {
@@ -275,6 +278,16 @@ if(!class_exists('popoveradmin')) {
275
 
276
  }
277
 
 
 
 
 
 
 
 
 
 
 
278
  function has_existing_popover() {
279
 
280
  if(function_exists('get_site_option') && defined('PO_GLOBAL') && PO_GLOBAL == true) {
@@ -383,7 +396,7 @@ if(!class_exists('popoveradmin')) {
383
 
384
  function get_popovers() {
385
 
386
- $sql = $this->db->prepare( "SELECT * FROM {$this->popover} ORDER BY popover_order ASC" );
387
 
388
  return $this->db->get_results( $sql );
389
 
@@ -474,6 +487,14 @@ if(!class_exists('popoveradmin')) {
474
  $popover['popover_settings']['notonurl'] = explode("\n", $_POST['popovernotonurl']);
475
  }
476
 
 
 
 
 
 
 
 
 
477
  $popover['popover_settings'] = serialize($popover['popover_settings']);
478
 
479
  if(isset($_POST['addandactivate'])) {
@@ -543,6 +564,14 @@ if(!class_exists('popoveradmin')) {
543
  $popover['popover_settings']['notonurl'] = explode("\n", $_POST['popovernotonurl']);
544
  }
545
 
 
 
 
 
 
 
 
 
546
  $popover['popover_settings'] = serialize($popover['popover_settings']);
547
 
548
  return $this->db->update( $this->popover, $popover, array( 'id' => $id ) );
@@ -830,6 +859,12 @@ if(!class_exists('popoveradmin')) {
830
  case 'notonurl': _e('Not on specific URL', 'popover');
831
  break;
832
 
 
 
 
 
 
 
833
  default: echo apply_filters('popover_nice_rule_name', $key);
834
  break;
835
  }
@@ -947,6 +982,9 @@ if(!class_exists('popoveradmin')) {
947
  $popover_onurl = (isset($popover->popover_settings['onurl'])) ? $popover->popover_settings['onurl'] : '';
948
  $popover_notonurl = (isset($popover->popover_settings['notonurl'])) ? $popover->popover_settings['notonurl'] : '';
949
 
 
 
 
950
  $popover_onurl = $this->sanitise_array($popover_onurl);
951
  $popover_notonurl = $this->sanitise_array($popover_notonurl);
952
 
@@ -1001,14 +1039,10 @@ if(!class_exists('popoveradmin')) {
1001
  $order = array();
1002
  }
1003
 
1004
-
1005
  foreach($order as $key) {
1006
 
1007
  switch($key) {
1008
 
1009
- case 'supporter': if( function_exists('is_pro_site') ) $this->admin_main('supporter','Site is not a Pro-site', 'Shows the popover if the site is not a Pro-site.', true);
1010
- break;
1011
-
1012
  case 'isloggedin': $this->admin_main('isloggedin','Visitor is logged in', 'Shows the popover if the user is logged in to your site.', true);
1013
  break;
1014
  case 'loggedin': $this->admin_main('loggedin','Visitor is not logged in', 'Shows the popover if the user is <strong>not</strong> logged in to your site.', true);
@@ -1028,7 +1062,6 @@ if(!class_exists('popoveradmin')) {
1028
  case 'notonurl': $this->admin_urllist('notonurl','Not on specific URL', 'Shows the popover if the user is not on a certain URL (enter one URL per line)', $popover_notonurl);
1029
  break;
1030
 
1031
-
1032
  default: do_action('popover_active_rule_' . $key);
1033
  do_action('popover_active_rule', $key);
1034
  break;
@@ -1195,10 +1228,6 @@ if(!class_exists('popoveradmin')) {
1195
 
1196
  <div id='hiden-actions'>
1197
  <?php
1198
- if(!isset($popover_check['supporter']) && function_exists('is_pro_site')) {
1199
- $this->admin_main('supporter','Site is not a Pro-site', 'Shows the popover if the site is not a Pro-site.', true);
1200
- }
1201
-
1202
  if(!isset($popover_check['isloggedin'])) {
1203
  $this->admin_main('isloggedin','Visitor is logged in', 'Shows the popover if the user is logged in to your site.', true);
1204
  }
@@ -1253,12 +1282,6 @@ if(!class_exists('popoveradmin')) {
1253
  <ul class='popovers popovers-draggable'>
1254
  <?php
1255
 
1256
- if(isset($popover_check['supporter']) && function_exists('is_pro_site')) {
1257
- $this->admin_sidebar('supporter','Site is not a Pro-site', 'Shows the popover if the site is not a Pro-site.', true);
1258
- } elseif(function_exists('is_pro_site')) {
1259
- $this->admin_sidebar('supporter','Site is not a Pro-site', 'Shows the popover if the site is not a Pro-site.', false);
1260
- }
1261
-
1262
  if(isset($popover_check['isloggedin'])) {
1263
  $this->admin_sidebar('isloggedin','Visitor is logged in', 'Shows the popover if the user is logged in to your site.', true);
1264
  } else {
@@ -1411,296 +1434,6 @@ if(!class_exists('popoveradmin')) {
1411
  <?php
1412
  }
1413
 
1414
-
1415
- function handle_admin_panelold() {
1416
-
1417
- global $allowedposttags;
1418
-
1419
- if(is_multisite() && defined('PO_GLOBAL')) {
1420
- $updateoption = 'update_site_option';
1421
- $getoption = 'get_site_option';
1422
- } else {
1423
- $updateoption = 'update_option';
1424
- $getoption = 'get_option';
1425
- }
1426
-
1427
- if(isset($_POST['action']) && addslashes($_POST['action']) == 'updatepopover') {
1428
-
1429
- //print_r($_POST);
1430
-
1431
- if(isset($_POST['popovercontent'])) {
1432
- if(defined('PO_USEKSES')) {
1433
- $updateoption('popover_content', wp_kses($_POST['popovercontent'], $allowedposttags));
1434
- } else {
1435
- $updateoption('popover_content', $_POST['popovercontent']);
1436
- }
1437
-
1438
- }
1439
-
1440
- if(isset($_POST['popoverwidth']) || isset($_POST['popoverheight'])) {
1441
-
1442
- $width = $_POST['popoverwidth'];
1443
- $height = $_POST['popoverheight'];
1444
-
1445
- if($width == '') $width = '500px';
1446
- if($height == '') $height = '200px';
1447
-
1448
- $updateoption('popover_size', array("width" => $width, "height" => $height));
1449
- }
1450
-
1451
- if(isset($_POST['popoverleft']) || isset($_POST['popovertop'])) {
1452
-
1453
- $left = $_POST['popoverleft'];
1454
- $top = $_POST['popovertop'];
1455
-
1456
- if($left == '') $left = '100px';
1457
- if($top == '') $top = '100px';
1458
-
1459
- $updateoption('popover_location', array("left" => $left, "top" => $top));
1460
- }
1461
-
1462
- if(isset($_POST['popovermargintop']) || isset($_POST['popovermarginleft']) || isset($_POST['popovermarginright']) || isset($_POST['popovermarginbottom'])) {
1463
-
1464
- $mleft = $_POST['popovermarginleft'];
1465
- $mtop = $_POST['popovermargintop'];
1466
- $mright = $_POST['popovermarginright'];
1467
- $mbottom = $_POST['popovermarginbottom'];
1468
-
1469
- if($mleft == '') $mleft = '0px';
1470
- if($mtop == '') $mtop = '0px';
1471
- if($mright == '') $mright = '0px';
1472
- if($mbottom == '') $mbottom = '0px';
1473
-
1474
- $updateoption('popover_margin', array('left' => $mleft, 'top' => $mtop, 'right' => $mright, 'bottom' => $mbottom));
1475
-
1476
- }
1477
-
1478
- if(isset($_POST['popoverbackground']) || isset($_POST['popoverforeground'])) {
1479
-
1480
- $back = $_POST['popoverbackground'];
1481
- $fore = $_POST['popoverforeground'];
1482
-
1483
- if($back == '') $back = 'FFFFFF';
1484
- if($fore == '') $fore = '000000';
1485
-
1486
- $updateoption('popover_colour', array("back" => $back, "fore" => $fore));
1487
- }
1488
-
1489
- if(isset($_POST['popovercheck'])) {
1490
-
1491
- $updateoption('popover_check', $_POST['popovercheck']);
1492
-
1493
- if(isset($_POST['popoverereg'])) {
1494
- $updateoption('popover_ereg', $_POST['popoverereg']);
1495
- }
1496
-
1497
- if(isset($_POST['popovercount'])) {
1498
- $updateoption('popover_count', intval($_POST['popovercount']) );
1499
- }
1500
-
1501
- }
1502
-
1503
- if(isset($_POST['popoverusejs'])) {
1504
- $updateoption('popover_usejs', 'yes' );
1505
- } else {
1506
- $updateoption('popover_usejs', 'no' );
1507
- }
1508
-
1509
- echo '<div id="message" class="updated fade"><p>' . __('Your settings have been saved.', 'popover') . '</p></div>';
1510
-
1511
- }
1512
-
1513
- $popover_content = stripslashes($getoption('popover_content', ''));
1514
- $popover_size = $getoption('popover_size', array('width' => '500px', 'height' => '200px'));
1515
- $popover_location = $getoption('popover_location', array('left' => '100px', 'top' => '100px'));
1516
- $popover_colour = $getoption('popover_colour', array('back' => 'FFFFFF', 'fore' => '000000'));
1517
- $popover_margin = $getoption('popover_margin', array('left' => '0px', 'top' => '0px', 'right' => '0px', 'bottom' => '0px'));
1518
-
1519
- $popover_size = $this->sanitise_array($popover_size);
1520
- $popover_location = $this->sanitise_array($popover_location);
1521
- $popover_colour = $this->sanitise_array($popover_colour);
1522
- $popover_margin = $this->sanitise_array($popover_margin);
1523
-
1524
- $popover_check = $getoption('popover_check', array());
1525
- $popover_ereg = $getoption('popover_ereg', '');
1526
- $popover_count = $getoption('popover_count', '3');
1527
-
1528
- $popover_usejs = $getoption('popover_usejs', 'no' );
1529
-
1530
- ?>
1531
-
1532
- <div class='wrap'>
1533
-
1534
- <form action='' method='post'>
1535
- <input type='hidden' name='action' value='updatepopover' />
1536
- <?php wp_nonce_field('updatepopover'); ?>
1537
-
1538
- <h2><?php _e('Pop Over content settings','popover'); ?></h2>
1539
- <p><?php _e('Use the settings below to modify the content of your pop over and the rules that will determine when, or if, it will be displayed.','popover'); ?></p>
1540
-
1541
- <h3><?php _e('Pop Over content','popover'); ?></h3>
1542
- <p><?php _e('Enter the content for your pop over in the text area below. HTML is allowed.','popover'); ?></p>
1543
- <textarea name='popovercontent' id='popovercontent' style='width: 90%' rows='10' cols='10'><?php echo stripslashes($popover_content); ?></textarea>
1544
-
1545
- <p class="submit">
1546
- <input class="button" type="submit" name="go" value="<?php _e('Update content', 'popover'); ?>" />
1547
- </p>
1548
-
1549
- <h3><?php _e('Pop Over display settings','popover'); ?></h3>
1550
- <p><?php _e('Use the options below to determine the look, and display settings for the Pop Over.','popover'); ?></p>
1551
-
1552
- <table class='form-table'>
1553
-
1554
- <tr>
1555
- <td valign='top' width='49%'>
1556
- <h3><?php _e('Appearance Settings','popover'); ?></h3>
1557
-
1558
- <table class='form-table' style='border: 1px solid #ccc; padding-top: 10px; padding-bottom: 10px; margin-bottom: 10px;'>
1559
- <tr>
1560
- <th valign='top' scope='row' style='width: 25%;'><?php _e('Pop Over Size','popover'); ?></th>
1561
- <td valign='top'>
1562
- <?php _e('Width:','popover'); ?>&nbsp;
1563
- <input type='text' name='popoverwidth' id='popoverwidth' style='width: 5em;' value='<?php echo $popover_size['width']; ?>' />&nbsp;
1564
- <?php _e('Height:','popover'); ?>&nbsp;
1565
- <input type='text' name='popoverheight' id='popoverheight' style='width: 5em;' value='<?php echo $popover_size['height']; ?>' />
1566
- </td>
1567
- </tr>
1568
-
1569
- <tr>
1570
- <th valign='top' scope='row' style='width: 25%;'><?php _e('Pop Over Position','popover'); ?></th>
1571
- <td valign='top'>
1572
- <?php _e('Left:','popover'); ?>&nbsp;
1573
- <input type='text' name='popoverleft' id='popoverleft' style='width: 5em;' value='<?php echo $popover_location['left']; ?>' />&nbsp;
1574
- <?php _e('Top:','popover'); ?>&nbsp;
1575
- <input type='text' name='popovertop' id='popovertop' style='width: 5em;' value='<?php echo $popover_location['top']; ?>' />
1576
- </td>
1577
- </tr>
1578
-
1579
- <tr>
1580
- <th valign='top' scope='row' style='width: 25%;'><?php _e('Pop Over Margins','popover'); ?></th>
1581
- <td valign='top'>
1582
- <?php _e('Left:','popover'); ?>&nbsp;
1583
- <input type='text' name='popovermarginleft' style='width: 5em;' value='<?php echo $popover_margin['left']; ?>' />&nbsp;
1584
- <?php _e('Right:','popover'); ?>&nbsp;
1585
- <input type='text' name='popovermarginright' style='width: 5em;' value='<?php echo $popover_margin['right']; ?>' /><br/>
1586
- <?php _e('Top:','popover'); ?>&nbsp;
1587
- <input type='text' name='popovermargintop' style='width: 5em;' value='<?php echo $popover_margin['top']; ?>' />&nbsp;
1588
- <?php _e('Bottom:','popover'); ?>&nbsp;
1589
- <input type='text' name='popovermarginbottom' style='width: 5em;' value='<?php echo $popover_margin['bottom']; ?>' />
1590
- </td>
1591
- </tr>
1592
-
1593
- <tr>
1594
- <th valign='top' scope='row' style='width: 25%;'>&nbsp;</th>
1595
- <td valign='top'>
1596
- <?php _e('or just override the above with JS','popover'); ?>&nbsp;<input type='checkbox' name='popoverusejs' id='popoverusejs' value='yes' <?php if($popover_usejs == 'yes') echo "checked='checked'"; ?> />
1597
- </td>
1598
- </tr>
1599
-
1600
- </table>
1601
- <table class='form-table'>
1602
-
1603
-
1604
-
1605
- <tr>
1606
- <th valign='top' scope='row' style='width: 25%;'><?php _e('Background Colour','popover'); ?></th>
1607
- <td valign='top'>
1608
- <?php _e('Hex:','popover'); ?>&nbsp;#
1609
- <input type='text' name='popoverbackground' id='popoverbackground' style='width: 10em;' value='<?php echo $popover_colour['back']; ?>' />
1610
- </td>
1611
- </tr>
1612
-
1613
- <tr>
1614
- <th valign='top' scope='row' style='width: 25%;'><?php _e('Font Colour','popover'); ?></th>
1615
- <td valign='top'>
1616
- <?php _e('Hex:','popover'); ?>&nbsp;#
1617
- <input type='text' name='popoverforeground' id='popoverforeground' style='width: 10em;' value='<?php echo $popover_colour['fore']; ?>' />
1618
- </td>
1619
- </tr>
1620
-
1621
- </table>
1622
-
1623
- </td>
1624
-
1625
- <td valign='top' width='49%'>
1626
- <h3><?php _e('Display Rules','popover'); ?></h3>
1627
-
1628
- <p><?php _e('Show the Pop Over if <strong>one</strong> of the following checked rules is true.','popover'); ?></p>
1629
- <input type='hidden' name='popovercheck[none]' value='none' />
1630
- <table class='form-table'>
1631
- <?php
1632
- if(function_exists('is_supporter')) {
1633
- ?>
1634
- <tr>
1635
- <td valign='middle' style='width: 5%;'>
1636
- <input type='checkbox' name='popovercheck[notsupporter]' <?php if(isset($popover_check['notsupporter'])) echo "checked='checked'"; ?> />
1637
- </td>
1638
- <th valign='bottom' scope='row'><?php _e('Visitor is not a supporter.','popover'); ?></th>
1639
- </tr>
1640
- <?php
1641
- }
1642
- ?>
1643
- <tr>
1644
- <td valign='middle' style='width: 5%;'>
1645
- <input type='checkbox' name='popovercheck[isloggedin]' <?php if(isset($popover_check['isloggedin'])) echo "checked='checked'"; ?> />
1646
- </td>
1647
- <th valign='bottom' scope='row'><?php _e('Visitor is logged in.','popover'); ?></th>
1648
- </tr>
1649
- <tr>
1650
- <td valign='middle' style='width: 5%;'>
1651
- <input type='checkbox' name='popovercheck[loggedin]' <?php if(isset($popover_check['loggedin'])) echo "checked='checked'"; ?> />
1652
- </td>
1653
- <th valign='bottom' scope='row'><?php _e('Visitor is not logged in.','popover'); ?></th>
1654
- </tr>
1655
- <tr>
1656
- <td valign='middle' style='width: 5%;'>
1657
- <input type='checkbox' name='popovercheck[commented]' <?php if(isset($popover_check['commented'])) echo "checked='checked'"; ?> />
1658
- </td>
1659
- <th valign='bottom' scope='row'><?php _e('Visitor has never commented here before.','popover'); ?></th>
1660
- </tr>
1661
- <tr>
1662
- <td valign='middle' style='width: 5%;'>
1663
- <input type='checkbox' name='popovercheck[searchengine]' <?php if(isset($popover_check['searchengine'])) echo "checked='checked'"; ?> />
1664
- </td>
1665
- <th valign='bottom' scope='row'><?php _e('Visitor came from a search engine.','popover'); ?></th>
1666
- </tr>
1667
- <tr>
1668
- <td valign='middle' style='width: 5%;'>
1669
- <input type='checkbox' name='popovercheck[internal]' <?php if(isset($popover_check['internal'])) echo "checked='checked'"; ?> />
1670
- </td>
1671
- <th valign='bottom' scope='row'><?php _e('Visitor did not come from an internal page.','popover'); ?></th>
1672
- </tr>
1673
- <tr>
1674
- <td valign='middle' style='width: 5%;'>
1675
- <input type='checkbox' name='popovercheck[referrer]' <?php if(isset($popover_check['referrer'])) echo "checked='checked'"; ?> />
1676
- </td>
1677
- <th valign='bottom' scope='row'><?php _e('Visitor referrer matches','popover'); ?>&nbsp;
1678
- <input type='text' name='popoverereg' id='popoverereg' style='width: 10em;' value='<?php echo htmlentities($popover_ereg,ENT_QUOTES, 'UTF-8'); ?>' />
1679
- </th>
1680
- </tr>
1681
-
1682
- </table>
1683
-
1684
- <p><?php _e('And the visitor has seen the pop over less than','popover'); ?>&nbsp;
1685
- <input type='text' name='popovercount' id='popovercount' style='width: 2em;' value='<?php echo htmlentities($popover_count,ENT_QUOTES, 'UTF-8'); ?>' />&nbsp;
1686
- <?php _e('times','popover'); ?></p>
1687
-
1688
- </td>
1689
- </tr>
1690
-
1691
- </table>
1692
-
1693
- <p class="submit">
1694
- <input class="button" type="submit" name="goagain" value="<?php _e('Update settings', 'popover'); ?>" />
1695
- </p>
1696
-
1697
- </form>
1698
-
1699
- </div>
1700
-
1701
- <?php
1702
- }
1703
-
1704
  function handle_addons_panel_updates() {
1705
  global $action, $page;
1706
 
@@ -1943,6 +1676,87 @@ if(!class_exists('popoveradmin')) {
1943
  <?php
1944
  }
1945
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1946
  }
1947
 
1948
  }
30
  // Add header files
31
  add_action('load-toplevel_page_popover', array(&$this, 'add_admin_header_popover_menu'));
32
  add_action('load-pop-overs_page_popoveraddons', array(&$this, 'add_admin_header_popover_addons'));
33
+ add_action('load-pop-overs_page_popoversettings', array(&$this, 'add_admin_header_popover_settings'));
34
 
35
  // Ajax calls
36
  add_action( 'wp_ajax_popover_update_order', array(&$this, 'ajax_update_popover_order') );
109
  $addnew = add_submenu_page('popover', __('Create New Pop Over','popover'), __('Create New','popover'), 'manage_options', "popover&amp;action=add", array(&$this,'handle_addnewpopover_panel'));
110
  add_submenu_page('popover', __('Manage Add-ons Plugins','popover'), __('Add-ons','popover'), 'manage_options', "popoveraddons", array(&$this,'handle_addons_panel'));
111
 
112
+ add_submenu_page('popover', __('Settings','popover'), __('Settings','popover'), 'manage_options', "popoversettings", array(&$this,'handle_settings_page'));
113
+
114
  }
115
 
116
  function sanitise_array($arrayin) {
278
 
279
  }
280
 
281
+ function add_admin_header_popover_settings() {
282
+
283
+ global $action, $page;
284
+
285
+ wp_reset_vars( array('action', 'page') );
286
+
287
+ $this->update_settings_page();
288
+
289
+ }
290
+
291
  function has_existing_popover() {
292
 
293
  if(function_exists('get_site_option') && defined('PO_GLOBAL') && PO_GLOBAL == true) {
396
 
397
  function get_popovers() {
398
 
399
+ $sql = "SELECT * FROM {$this->popover} ORDER BY popover_order ASC";
400
 
401
  return $this->db->get_results( $sql );
402
 
487
  $popover['popover_settings']['notonurl'] = explode("\n", $_POST['popovernotonurl']);
488
  }
489
 
490
+ if(isset($_POST['popoverincountry'])) {
491
+ $popover['popover_settings']['incountry'] = $_POST['popoverincountry'];
492
+ }
493
+
494
+ if(isset($_POST['popovernotincountry'])) {
495
+ $popover['popover_settings']['notincountry'] = $_POST['popovernotincountry'];
496
+ }
497
+
498
  $popover['popover_settings'] = serialize($popover['popover_settings']);
499
 
500
  if(isset($_POST['addandactivate'])) {
564
  $popover['popover_settings']['notonurl'] = explode("\n", $_POST['popovernotonurl']);
565
  }
566
 
567
+ if(isset($_POST['popoverincountry'])) {
568
+ $popover['popover_settings']['incountry'] = $_POST['popoverincountry'];
569
+ }
570
+
571
+ if(isset($_POST['popovernotincountry'])) {
572
+ $popover['popover_settings']['notincountry'] = $_POST['popovernotincountry'];
573
+ }
574
+
575
  $popover['popover_settings'] = serialize($popover['popover_settings']);
576
 
577
  return $this->db->update( $this->popover, $popover, array( 'id' => $id ) );
859
  case 'notonurl': _e('Not on specific URL', 'popover');
860
  break;
861
 
862
+ case 'incountry': _e('In a specific country', 'popover');
863
+ break;
864
+
865
+ case 'notincountry': _e('Not in a specific country', 'popover');
866
+ break;
867
+
868
  default: echo apply_filters('popover_nice_rule_name', $key);
869
  break;
870
  }
982
  $popover_onurl = (isset($popover->popover_settings['onurl'])) ? $popover->popover_settings['onurl'] : '';
983
  $popover_notonurl = (isset($popover->popover_settings['notonurl'])) ? $popover->popover_settings['notonurl'] : '';
984
 
985
+ $popover_incountry = (isset($popover->popover_settings['incountry'])) ? $popover->popover_settings['incountry'] : '';
986
+ $popover_notincountry = (isset($popover->popover_settings['notincountry'])) ? $popover->popover_settings['notincountry'] : '';
987
+
988
  $popover_onurl = $this->sanitise_array($popover_onurl);
989
  $popover_notonurl = $this->sanitise_array($popover_notonurl);
990
 
1039
  $order = array();
1040
  }
1041
 
 
1042
  foreach($order as $key) {
1043
 
1044
  switch($key) {
1045
 
 
 
 
1046
  case 'isloggedin': $this->admin_main('isloggedin','Visitor is logged in', 'Shows the popover if the user is logged in to your site.', true);
1047
  break;
1048
  case 'loggedin': $this->admin_main('loggedin','Visitor is not logged in', 'Shows the popover if the user is <strong>not</strong> logged in to your site.', true);
1062
  case 'notonurl': $this->admin_urllist('notonurl','Not on specific URL', 'Shows the popover if the user is not on a certain URL (enter one URL per line)', $popover_notonurl);
1063
  break;
1064
 
 
1065
  default: do_action('popover_active_rule_' . $key);
1066
  do_action('popover_active_rule', $key);
1067
  break;
1228
 
1229
  <div id='hiden-actions'>
1230
  <?php
 
 
 
 
1231
  if(!isset($popover_check['isloggedin'])) {
1232
  $this->admin_main('isloggedin','Visitor is logged in', 'Shows the popover if the user is logged in to your site.', true);
1233
  }
1282
  <ul class='popovers popovers-draggable'>
1283
  <?php
1284
 
 
 
 
 
 
 
1285
  if(isset($popover_check['isloggedin'])) {
1286
  $this->admin_sidebar('isloggedin','Visitor is logged in', 'Shows the popover if the user is logged in to your site.', true);
1287
  } else {
1434
  <?php
1435
  }
1436
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1437
  function handle_addons_panel_updates() {
1438
  global $action, $page;
1439
 
1676
  <?php
1677
  }
1678
 
1679
+
1680
+ function handle_settings_page() {
1681
+
1682
+ global $action, $page;
1683
+
1684
+ $messages = array();
1685
+ $messages[1] = __('Your settings have been updated.','popover');
1686
+
1687
+ ?>
1688
+ <div class='wrap nosubsub'>
1689
+
1690
+ <div class="icon32" id="icon-options-general"><br></div>
1691
+ <h2><?php _e('Pop Over Settings','popover'); ?></h2>
1692
+
1693
+ <?php
1694
+ if ( isset($_GET['msg']) ) {
1695
+ echo '<div id="message" class="updated fade"><p>' . $messages[(int) $_GET['msg']] . '</p></div>';
1696
+ $_SERVER['REQUEST_URI'] = remove_query_arg(array('message'), $_SERVER['REQUEST_URI']);
1697
+ }
1698
+ ?>
1699
+ <div id="poststuff" class="metabox-holder m-settings">
1700
+ <form action='?page=<?php echo $page; ?>' method='post'>
1701
+
1702
+ <input type='hidden' name='page' value='<?php echo $page; ?>' />
1703
+ <input type='hidden' name='action' value='updatesettings' />
1704
+
1705
+ <?php
1706
+ wp_nonce_field('update-popover-settings');
1707
+ ?>
1708
+
1709
+ <div class="postbox">
1710
+ <h3 class="hndle" style='cursor:auto;'><span><?php _e('Pop Over loading method','popover'); ?></span></h3>
1711
+ <div class="inside">
1712
+ <p><?php _e('Select the loading method you want to use for your Pop Overs.','popover'); ?></p>
1713
+ <ul>
1714
+ <li><em><?php _e('- Page Footer : The pop over is included as part of the page html.','popover'); ?></em></li>
1715
+ <li><em><?php _e('- External Load : The pop over is loaded separately from the page, this is the best option if you are running a caching system.','popover'); ?></em></li>
1716
+ </ul>
1717
+
1718
+ <table class="form-table">
1719
+ <tbody>
1720
+ <tr valign="top">
1721
+ <th scope="row"><?php _e('Pop Over loaded using','popover'); ?></th>
1722
+ <td>
1723
+ <?php
1724
+ $settings = get_popover_option('popover-settings', array( 'loadingmethod' => 'external'));
1725
+ ?>
1726
+ <select name='loadingmethod' id='loadingmethod'>
1727
+ <option value="footer" <?php if($settings['loadingmethod'] == 'footer') echo "selected='selected'"; ?>><?php _e('Page Footer','popover'); ?></option>
1728
+ <option value="external" <?php if($settings['loadingmethod'] == 'external') echo "selected='selected'"; ?>><?php _e('External Load','popover'); ?></option>
1729
+ </select>
1730
+ </td>
1731
+ </tr>
1732
+ </tbody>
1733
+ </table>
1734
+ </div>
1735
+ </div>
1736
+
1737
+ <p class="submit">
1738
+ <input type="submit" name="Submit" class="button-primary" value="<?php esc_attr_e('Save Changes', 'popover') ?>" />
1739
+ </p>
1740
+
1741
+ </form>
1742
+ </div>
1743
+ </div> <!-- wrap -->
1744
+ <?php
1745
+ }
1746
+
1747
+ function update_settings_page() {
1748
+
1749
+ if(isset($_POST['action']) && $_POST['action'] == 'updatesettings') {
1750
+
1751
+ check_admin_referer('update-popover-settings');
1752
+
1753
+ update_popover_option( 'popover-settings', $_POST );
1754
+
1755
+ wp_safe_redirect( add_query_arg('msg', 1, wp_get_referer()) );
1756
+ }
1757
+
1758
+ }
1759
+
1760
  }
1761
 
1762
  }
popoverincludes/classes/popoverajax.php CHANGED
@@ -1,14 +1,20 @@
1
  <?php
 
 
 
 
 
2
  if(!class_exists('popoverajax')) {
3
 
4
  class popoverajax {
5
 
6
  var $mylocation = '';
7
- var $build = 3;
8
  var $db;
9
 
10
- var $tables = array( 'popover' );
11
  var $popover;
 
12
 
13
  var $activepopover = false;
14
 
@@ -22,23 +28,33 @@ if(!class_exists('popoverajax')) {
22
  $this->$table = popover_db_prefix($this->db, $table);
23
  }
24
 
25
- //add_action('init', array(&$this, 'selective_message_display'), 1);
26
 
27
  add_action( 'plugins_loaded', array(&$this, 'load_textdomain'));
28
 
29
  $directories = explode(DIRECTORY_SEPARATOR,dirname(__FILE__));
30
  $this->mylocation = $directories[count($directories)-1];
31
 
32
- // Adding in Ajax calls - need to be in the admin area as it uses admin_url :/
33
- add_action('wp_ajax_po_popover', array(&$this, 'selective_message_display') );
34
- add_action('wp_ajax_nopriv_po_popover', array(&$this, 'selective_message_display') );
35
-
36
  }
37
 
38
  function popoverajax() {
39
  $this->__construct();
40
  }
41
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
42
  function load_textdomain() {
43
 
44
  $locale = apply_filters( 'popover_locale', get_locale() );
@@ -50,14 +66,23 @@ if(!class_exists('popoverajax')) {
50
  }
51
 
52
  function get_active_popovers() {
53
- $sql = $this->db->prepare( "SELECT * FROM {$this->popover} WHERE popover_active = 1 ORDER BY popover_order ASC" );
54
 
55
  return $this->db->get_results( $sql );
56
  }
57
 
58
- function selective_message_display() {
 
 
 
 
 
 
 
59
 
60
- die('hello');
 
 
61
 
62
  if(function_exists('get_site_option') && defined('PO_GLOBAL') && PO_GLOBAL == true) {
63
  $updateoption = 'update_site_option';
@@ -94,12 +119,17 @@ if(!class_exists('popoverajax')) {
94
 
95
  $popover_usejs = $popover->popover_settings['popover_usejs'];
96
 
97
- $popoverstyle = $popover->popover_settings['popover_style'];
 
 
98
 
99
- $popover_delay = $popover->popover_settings['popoverdelay'];
100
 
101
- $popover_onurl = $popover->popover_settings['onurl'];
102
- $popover_notonurl = $popover->popover_settings['notonurl'];
 
 
 
103
 
104
  $popover_onurl = $this->sanitise_array($popover_onurl);
105
  $popover_notonurl = $this->sanitise_array($popover_notonurl);
@@ -136,19 +166,19 @@ if(!class_exists('popoverajax')) {
136
  break;
137
 
138
  case "searchengine":
139
- if(!$this->is_fromsearchengine()) {
140
  $show = false;
141
  }
142
  break;
143
 
144
- case "internal": $internal = str_replace('http://','',get_option('home'));
145
- if($this->referrer_matches(addcslashes($internal,"/"))) {
146
  $show = false;
147
  }
148
  break;
149
 
150
  case "referrer": $match = $popover_ereg;
151
- if(!$this->referrer_matches(addcslashes($match,"/"))) {
152
  $show = false;
153
  }
154
  break;
@@ -158,12 +188,25 @@ if(!class_exists('popoverajax')) {
158
  }
159
  break;
160
 
161
- case 'onurl': if(!$this->onurl( $popover_onurl )) {
 
 
 
 
 
162
  $show = false;
163
  }
164
  break;
165
 
166
- case 'notonurl': if($this->onurl( $popover_notonurl )) {
 
 
 
 
 
 
 
 
167
  $show = false;
168
  }
169
  break;
@@ -177,6 +220,15 @@ if(!class_exists('popoverajax')) {
177
 
178
  }
179
  }
 
 
 
 
 
 
 
 
 
180
  }
181
 
182
  if($show == true) {
@@ -189,194 +241,150 @@ if(!class_exists('popoverajax')) {
189
 
190
  if($show == true) {
191
 
192
- // Store the active popover so we know what we are using in the footer.
193
- $this->activepopover = $popover;
 
194
 
195
- wp_enqueue_script('jquery');
196
 
197
- $popover_messagebox = 'a' . md5(date('d')) . '-po';
198
  // Show the advert
199
- wp_enqueue_script('popoverjs', popover_url('popoverincludes/js/popover.js'), array('jquery'), $this->build);
200
  if(!empty($popover_delay) && $popover_delay != 'immediate') {
201
  // Set the delay
202
- wp_localize_script('popoverjs', 'popover', array( 'messagebox' => '#' . $popover_messagebox,
203
- 'messagedelay' => $popover_delay * 1000
204
- ));
205
  } else {
206
- wp_localize_script('popoverjs', 'popover', array( 'messagebox' => '#' . $popover_messagebox,
207
- 'messagedelay' => 0
208
- ));
209
  }
210
 
211
  if($popover_usejs == 'yes') {
212
- wp_enqueue_script('popoveroverridejs', popover_url('popoverincludes/js/popoversizing.js'), array('jquery'), $this->build);
213
- }
214
-
215
- add_action('wp_head', array(&$this, 'page_header'));
216
- add_action('wp_footer', array(&$this, 'page_footer'));
217
-
218
- // Add the cookie
219
- if ( isset($_COOKIE['popover_view_'.COOKIEHASH]) ) {
220
- $count = intval($_COOKIE['popover_view_'.COOKIEHASH]);
221
- if(!is_numeric($count)) $count = 0;
222
- $count++;
223
  } else {
224
- $count = 1;
225
  }
226
- if(!headers_sent()) setcookie('popover_view_'.COOKIEHASH, $count , time() + 30000000, COOKIEPATH, COOKIE_DOMAIN);
227
-
228
- break;
229
- }
230
-
231
 
232
- }
 
233
 
234
- }
235
-
236
- }
237
-
238
- function sanitise_array($arrayin) {
239
-
240
- foreach($arrayin as $key => $value) {
241
- $arrayin[$key] = htmlentities(stripslashes($value) ,ENT_QUOTES, 'UTF-8');
242
- }
243
-
244
- return $arrayin;
245
- }
246
 
247
- function page_header() {
248
 
249
- if(!$this->activepopover) {
250
- return;
251
- }
252
 
253
- $popover = $this->activepopover;
 
 
 
 
254
 
255
- $popover_title = stripslashes($popover->popover_title);
256
- $popover_content = stripslashes($popover->popover_content);
257
 
258
- $popover_size = $popover->popover_settings['popover_size'];
259
- $popover_location = $popover->popover_settings['popover_location'];
260
- $popover_colour = $popover->popover_settings['popover_colour'];
261
- $popover_margin = $popover->popover_settings['popover_margin'];
262
 
263
- $popover_size = $this->sanitise_array($popover_size);
264
- $popover_location = $this->sanitise_array($popover_location);
265
- $popover_colour = $this->sanitise_array($popover_colour);
266
- $popover_margin = $this->sanitise_array($popover_margin);
 
 
 
267
 
268
- $popover_check = $popover->popover_settings['popover_check'];
269
- $popover_ereg = $popover->popover_settings['popover_ereg'];
270
- $popover_count = $popover->popover_settings['popover_count'];
271
 
272
- $popover_usejs = $popover->popover_settings['popover_usejs'];
 
 
 
 
 
 
 
273
 
274
- $popoverstyle = $popover->popover_settings['popover_style'];
 
275
 
276
- $popover_hideforever = $popover->popover_settings['popoverhideforeverlink'];
277
 
278
- $popover_delay = $popover->popover_settings['popoverdelay'];
279
 
280
- $popover_messagebox = 'a' . md5(date('d')) . '-po';
281
 
282
- $availablestyles = apply_filters( 'popover_available_styles_directory', array() );
283
- $availablestylesurl = apply_filters( 'popover_available_styles_url', array() );
 
 
 
 
 
 
 
284
 
285
- if( in_array($popoverstyle, array_keys($availablestyles)) ) {
286
- // Add the styles
287
- if(file_exists(trailingslashit($availablestyles[$popoverstyle]) . 'style.css')) {
288
- ob_start();
289
- include_once( trailingslashit($availablestyles[$popoverstyle]) . 'style.css' );
290
- $content = ob_get_contents();
291
- ob_end_clean();
292
 
293
- echo "<style type='text/css'>\n";
294
- $content = str_replace('#messagebox', '#' . $popover_messagebox, $content);
295
- $content = str_replace('%styleurl%', trailingslashit($availablestylesurl[$popoverstyle]), $content);
296
- echo $content;
297
- echo "</style>\n";
298
  }
299
 
300
  }
301
 
302
- }
303
-
304
- function page_footer() {
305
-
306
- if(!$this->activepopover) {
307
- return;
308
- }
309
-
310
- $popover = $this->activepopover;
311
-
312
- $popover_title = stripslashes($popover->popover_title);
313
- $popover_content = stripslashes($popover->popover_content);
314
-
315
- $popover_size = $popover->popover_settings['popover_size'];
316
- $popover_location = $popover->popover_settings['popover_location'];
317
- $popover_colour = $popover->popover_settings['popover_colour'];
318
- $popover_margin = $popover->popover_settings['popover_margin'];
319
-
320
- $popover_size = $this->sanitise_array($popover_size);
321
- $popover_location = $this->sanitise_array($popover_location);
322
- $popover_colour = $this->sanitise_array($popover_colour);
323
- $popover_margin = $this->sanitise_array($popover_margin);
324
 
325
- $popover_check = $popover->popover_settings['popover_check'];
326
- $popover_ereg = $popover->popover_settings['popover_ereg'];
327
- $popover_count = $popover->popover_settings['popover_count'];
328
 
329
- $popover_usejs = $popover->popover_settings['popover_usejs'];
330
-
331
- $popoverstyle = $popover->popover_settings['popover_style'];
332
-
333
- $popover_hideforever = $popover->popover_settings['popoverhideforeverlink'];
334
-
335
- $popover_delay = $popover->popover_settings['popoverdelay'];
336
-
337
- $style = '';
338
- $backgroundstyle = '';
339
-
340
- if($popover_usejs == 'yes') {
341
- $style = 'z-index:999999;';
342
- $box = 'color: #' . $popover_colour['fore'] . '; background: #' . $popover_colour['back'] . ';';
343
- $style .= 'left: -1000px; top: =100px;';
344
- } else {
345
- $style = 'left: ' . $popover_location['left'] . '; top: ' . $popover_location['top'] . ';' . ' z-index:999999;';
346
- $style .= 'margin-top: ' . $popover_margin['top'] . '; margin-bottom: ' . $popover_margin['bottom'] . '; margin-right: ' . $popover_margin['right'] . '; margin-left: ' . $popover_margin['left'] . ';';
347
 
348
- $box = 'width: ' . $popover_size['width'] . '; height: ' . $popover_size['height'] . '; color: #' . $popover_colour['fore'] . '; background: #' . $popover_colour['back'] . ';';
349
 
 
 
350
  }
351
 
352
- if(!empty($popover_delay) && $popover_delay != 'immediate') {
353
- // Hide the popover initially
354
- $style .= ' visibility: hidden;';
355
- $backgroundstyle .= ' visibility: hidden;';
356
- }
357
 
358
- $availablestyles = apply_filters( 'popover_available_styles_directory', array() );
359
 
360
- if( in_array($popoverstyle, array_keys($availablestyles)) ) {
361
- $popover_messagebox = 'a' . md5(date('d')) . '-po';
362
 
363
- if(file_exists(trailingslashit($availablestyles[$popoverstyle]) . 'popover.php')) {
364
- ob_start();
365
- include_once( trailingslashit($availablestyles[$popoverstyle]) . 'popover.php' );
366
- ob_end_flush();
 
 
 
 
 
 
 
367
  }
368
  }
369
-
370
-
371
  }
372
 
373
- function is_fromsearchengine() {
374
- $ref = $_SERVER['HTTP_REFERER'];
375
-
376
- $SE = array('/search?', '.google.', 'web.info.com', 'search.', 'del.icio.us/search', 'soso.com', '/search/', '.yahoo.', '.bing.' );
377
 
378
  foreach ($SE as $url) {
379
- if (strpos($ref,$url)!==false) return true;
 
 
 
 
 
 
 
 
 
 
 
380
  }
381
  return false;
382
  }
@@ -401,9 +409,9 @@ if(!class_exists('popoverajax')) {
401
  }
402
  }
403
 
404
- function referrer_matches($check) {
405
 
406
- if(preg_match( '/' . $check . '/i', $_SERVER['HTTP_REFERER'] )) {
407
  return true;
408
  } else {
409
  return false;
@@ -436,23 +444,47 @@ if(!class_exists('popoverajax')) {
436
  return trailingslashit($url);
437
  }
438
 
439
- function onurl( $urllist = array() ) {
440
 
441
  $urllist = array_map( 'trim', $urllist );
442
 
443
  if(!empty($urllist)) {
444
- if(in_array($this->myURL(), $urllist)) {
445
- // we are on the list
446
- return true;
447
- } else {
448
- return false;
449
  }
 
 
450
  } else {
451
  return true;
452
  }
453
 
454
  }
455
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
456
  function clear_forever() {
457
  if ( isset($_COOKIE['popover_never_view']) ) {
458
  return true;
@@ -462,5 +494,6 @@ if(!class_exists('popoverajax')) {
462
  }
463
 
464
  }
 
465
  }
466
  ?>
1
  <?php
2
+ /*
3
+ * The processing part of the popover plugin
4
+ * - was previously in popoverpublic.php
5
+ */
6
+
7
  if(!class_exists('popoverajax')) {
8
 
9
  class popoverajax {
10
 
11
  var $mylocation = '';
12
+ var $build = 5;
13
  var $db;
14
 
15
+ var $tables = array( 'popover', 'popover_ip_cache' );
16
  var $popover;
17
+ var $popover_ip_cache;
18
 
19
  var $activepopover = false;
20
 
28
  $this->$table = popover_db_prefix($this->db, $table);
29
  }
30
 
31
+ add_action('init', array(&$this, 'initialise_ajax'), 99);
32
 
33
  add_action( 'plugins_loaded', array(&$this, 'load_textdomain'));
34
 
35
  $directories = explode(DIRECTORY_SEPARATOR,dirname(__FILE__));
36
  $this->mylocation = $directories[count($directories)-1];
37
 
 
 
 
 
38
  }
39
 
40
  function popoverajax() {
41
  $this->__construct();
42
  }
43
 
44
+ function initialise_ajax() {
45
+
46
+ $settings = get_popover_option('popover-settings', array( 'loadingmethod' => 'external'));
47
+
48
+ switch( $settings['loadingmethod'] ) {
49
+
50
+ case 'external': add_action( 'wp_ajax_popover_selective_ajax', array(&$this,'ajax_selective_message_display') );
51
+ add_action( 'wp_ajax_nopriv_popover_selective_ajax', array(&$this,'ajax_selective_message_display') );
52
+ break;
53
+
54
+ }
55
+
56
+ }
57
+
58
  function load_textdomain() {
59
 
60
  $locale = apply_filters( 'popover_locale', get_locale() );
66
  }
67
 
68
  function get_active_popovers() {
69
+ $sql = $this->db->prepare( "SELECT * FROM {$this->popover} WHERE popover_active = %d ORDER BY popover_order ASC", 1 );
70
 
71
  return $this->db->get_results( $sql );
72
  }
73
 
74
+ function ajax_selective_message_display() {
75
+
76
+ if(isset($_GET['callback'])) {
77
+ $data = $this->selective_message_display();
78
+ echo $_GET['callback'] . "(" . json_encode($data) . ")";
79
+ }
80
+
81
+ exit;
82
 
83
+ }
84
+
85
+ function selective_message_display() {
86
 
87
  if(function_exists('get_site_option') && defined('PO_GLOBAL') && PO_GLOBAL == true) {
88
  $updateoption = 'update_site_option';
119
 
120
  $popover_usejs = $popover->popover_settings['popover_usejs'];
121
 
122
+ $popoverstyle = (isset($popover->popover_settings['popover_style'])) ? $popover->popover_settings['popover_style'] : '';
123
+
124
+ $popover_hideforever = (isset($popover->popover_settings['popoverhideforeverlink'])) ? $popover->popover_settings['popoverhideforeverlink'] : '';
125
 
126
+ $popover_delay = (isset($popover->popover_settings['popoverdelay'])) ? $popover->popover_settings['popoverdelay'] : '';
127
 
128
+ $popover_onurl = (isset($popover->popover_settings['onurl'])) ? $popover->popover_settings['onurl'] : '';
129
+ $popover_notonurl = (isset($popover->popover_settings['notonurl'])) ? $popover->popover_settings['notonurl'] : '';
130
+
131
+ $popover_incountry = (isset($popover->popover_settings['incountry'])) ? $popover->popover_settings['incountry'] : '';
132
+ $popover_notincountry = (isset($popover->popover_settings['notincountry'])) ? $popover->popover_settings['notincountry'] : '';
133
 
134
  $popover_onurl = $this->sanitise_array($popover_onurl);
135
  $popover_notonurl = $this->sanitise_array($popover_notonurl);
166
  break;
167
 
168
  case "searchengine":
169
+ if(!$this->is_fromsearchengine( $_REQUEST['thereferrer'] )) {
170
  $show = false;
171
  }
172
  break;
173
 
174
+ case "internal": $internal = str_replace('^http://','',get_option('home'));
175
+ if($this->referrer_matches(addcslashes($internal,"/"), $_REQUEST['thereferrer'] )) {
176
  $show = false;
177
  }
178
  break;
179
 
180
  case "referrer": $match = $popover_ereg;
181
+ if(!$this->referrer_matches(addcslashes($match,"/"), $_REQUEST['thereferrer'])) {
182
  $show = false;
183
  }
184
  break;
188
  }
189
  break;
190
 
191
+ case 'onurl': if(!$this->onurl( $popover_onurl, $_REQUEST['thefrom'] )) {
192
+ $show = false;
193
+ }
194
+ break;
195
+
196
+ case 'notonurl': if($this->onurl( $popover_notonurl, $_REQUEST['thefrom'] )) {
197
  $show = false;
198
  }
199
  break;
200
 
201
+ case 'incountry': $incountry = $this->incountry( $popover_incountry );
202
+ if(!$incountry || $incountry === 'XX') {
203
+ $show = false;
204
+ }
205
+ break;
206
+
207
+ case 'notincountry':
208
+ $incountry = $this->incountry( $popover_notincountry );
209
+ if($incountry || $incountry === 'XX') {
210
  $show = false;
211
  }
212
  break;
220
 
221
  }
222
  }
223
+
224
+ // Check for forced popover and if set then output that one instead of any other
225
+ if(isset($_REQUEST['active_popover']) && (int) $_REQUEST['active_popover'] != 0) {
226
+ if($popover->id == (int) $_REQUEST['active_popover']) {
227
+ $show = true;
228
+ } else {
229
+ $show = false;
230
+ }
231
+ }
232
  }
233
 
234
  if($show == true) {
241
 
242
  if($show == true) {
243
 
244
+ // return the popover to the calling function
245
+
246
+ $popover = array();
247
 
248
+ $popover['name'] = 'a' . md5(date('d')) . '-po';
249
 
 
250
  // Show the advert
 
251
  if(!empty($popover_delay) && $popover_delay != 'immediate') {
252
  // Set the delay
253
+ $popover['delay'] = $popover_delay * 1000;
 
 
254
  } else {
255
+ $popover['delay'] = 0;
 
 
256
  }
257
 
258
  if($popover_usejs == 'yes') {
259
+ $popover['usejs'] = 'yes';
 
 
 
 
 
 
 
 
 
 
260
  } else {
261
+ $popover['usejs'] = 'no';
262
  }
 
 
 
 
 
263
 
264
+ $style = '';
265
+ $backgroundstyle = '';
266
 
267
+ if($popover_usejs == 'yes') {
268
+ $style = 'z-index:999999;';
269
+ $box = 'color: #' . $popover_colour['fore'] . '; background: #' . $popover_colour['back'] . ';';
270
+ $style .= 'left: -1000px; top: =100px;';
271
+ } else {
272
+ $style = 'left: ' . $popover_location['left'] . '; top: ' . $popover_location['top'] . ';' . ' z-index:999999;';
273
+ $style .= 'margin-top: ' . $popover_margin['top'] . '; margin-bottom: ' . $popover_margin['bottom'] . '; margin-right: ' . $popover_margin['right'] . '; margin-left: ' . $popover_margin['left'] . ';';
 
 
 
 
 
274
 
275
+ $box = 'width: ' . $popover_size['width'] . '; height: ' . $popover_size['height'] . '; color: #' . $popover_colour['fore'] . '; background: #' . $popover_colour['back'] . ';';
276
 
277
+ }
 
 
278
 
279
+ if(!empty($popover_delay) && $popover_delay != 'immediate') {
280
+ // Hide the popover initially
281
+ $style .= ' visibility: hidden;';
282
+ $backgroundstyle .= ' visibility: hidden;';
283
+ }
284
 
285
+ $availablestyles = apply_filters( 'popover_available_styles_directory', array() );
 
286
 
287
+ $popover['html'] = '';
288
+ if( in_array($popoverstyle, array_keys($availablestyles)) ) {
289
+ $popover_messagebox = 'a' . md5(date('d')) . '-po';
 
290
 
291
+ if(file_exists(trailingslashit($availablestyles[$popoverstyle]) . 'popover.php')) {
292
+ ob_start();
293
+ include_once( trailingslashit($availablestyles[$popoverstyle]) . 'popover.php' );
294
+ $popover['html'] = ob_get_contents();
295
+ ob_end_clean();
296
+ }
297
+ }
298
 
299
+ $availablestylesurl = apply_filters( 'popover_available_styles_url', array() );
 
 
300
 
301
+ $popover['style'] = '';
302
+ if( in_array($popoverstyle, array_keys($availablestyles)) ) {
303
+ // Add the styles
304
+ if(file_exists(trailingslashit($availablestyles[$popoverstyle]) . 'style.css')) {
305
+ ob_start();
306
+ include_once( trailingslashit($availablestyles[$popoverstyle]) . 'style.css' );
307
+ $content = ob_get_contents();
308
+ ob_end_clean();
309
 
310
+ $popover['style'] = str_replace('#messagebox', '#' . $popover_messagebox, $content);
311
+ $popover['style'] = str_replace('%styleurl%', trailingslashit($availablestylesurl[$popoverstyle]), $popover['style']);
312
 
313
+ }
314
 
315
+ }
316
 
 
317
 
318
+ // Add the cookie
319
+ if ( isset($_COOKIE['popover_view_'.COOKIEHASH]) ) {
320
+ $count = intval($_COOKIE['popover_view_'.COOKIEHASH]);
321
+ if(!is_numeric($count)) $count = 0;
322
+ $count++;
323
+ } else {
324
+ $count = 1;
325
+ }
326
+ if(!headers_sent()) setcookie('popover_view_'.COOKIEHASH, $count , time() + 30000000, COOKIEPATH, COOKIE_DOMAIN);
327
 
 
 
 
 
 
 
 
328
 
329
+ return $popover;
330
+ // Exit from the for - as we have sent a popover
331
+ break;
332
+ }
 
333
  }
334
 
335
  }
336
 
337
+ // There is no popover to show - so send back a no-popover message
338
+ return array( 'name' => 'nopopover' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
339
 
 
 
 
340
 
341
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
342
 
343
+ function sanitise_array($arrayin) {
344
 
345
+ foreach( (array) $arrayin as $key => $value) {
346
+ $arrayin[$key] = htmlentities(stripslashes($value) ,ENT_QUOTES, 'UTF-8');
347
  }
348
 
349
+ return $arrayin;
350
+ }
 
 
 
351
 
352
+ function is_fromsearchengine( $ref = '') {
353
 
354
+ $SE = array('/search?', '.google.', 'web.info.com', 'search.', 'del.icio.us/search', 'soso.com', '/search/', '.yahoo.', '.bing.' );
 
355
 
356
+ foreach ($SE as $url) {
357
+ if (strpos( $ref, $url) !== false ) {
358
+ if($url == '.google.') {
359
+ if( $this->is_googlesearch( $ref) ) {
360
+ return true;
361
+ } else {
362
+ return false;
363
+ }
364
+ } else {
365
+ return true;
366
+ }
367
  }
368
  }
369
+ return false;
 
370
  }
371
 
372
+ function is_googlesearch( $ref = '' ) {
373
+ $SE = array('.google.');
 
 
374
 
375
  foreach ($SE as $url) {
376
+ if (strpos($ref,$url) !== false ) {
377
+ // We've found a google referrer - get the query strings and check its a web source
378
+ $qs = parse_url( $ref, PHP_URL_QUERY );
379
+ $qget = array();
380
+ foreach(explode('&', $qs) as $keyval) {
381
+ list( $key, $value ) = explode('=', $keyval);
382
+ $qget[ trim($key) ] = trim($value);
383
+ }
384
+ if(array_key_exists('source', $qget) && $qget['source'] == 'web') {
385
+ return true;
386
+ }
387
+ }
388
  }
389
  return false;
390
  }
409
  }
410
  }
411
 
412
+ function referrer_matches($check, $referer = '') {
413
 
414
+ if(preg_match( '/' . $check . '/i', $referer )) {
415
  return true;
416
  } else {
417
  return false;
444
  return trailingslashit($url);
445
  }
446
 
447
+ function onurl( $urllist = array(), $url = '' ) {
448
 
449
  $urllist = array_map( 'trim', $urllist );
450
 
451
  if(!empty($urllist)) {
452
+ foreach( $urllist as $ul ) {
453
+ if(preg_match( '#' . $ul . '#i', $url )) {
454
+ return true;
455
+ }
 
456
  }
457
+ // if we are here then there hasn't been a match
458
+ return false;
459
  } else {
460
  return true;
461
  }
462
 
463
  }
464
 
465
+ function insertonduplicate($table, $data) {
466
+
467
+ global $wpdb;
468
+
469
+ $fields = array_keys($data);
470
+ $formatted_fields = array();
471
+ foreach ( $fields as $field ) {
472
+ $form = '%s';
473
+ $formatted_fields[] = $form;
474
+ }
475
+ $sql = "INSERT INTO `$table` (`" . implode( '`,`', $fields ) . "`) VALUES ('" . implode( "','", $formatted_fields ) . "')";
476
+ $sql .= " ON DUPLICATE KEY UPDATE ";
477
+
478
+ $dup = array();
479
+ foreach($fields as $field) {
480
+ $dup[] = "`" . $field . "` = VALUES(`" . $field . "`)";
481
+ }
482
+
483
+ $sql .= implode(',', $dup);
484
+
485
+ return $wpdb->query( $wpdb->prepare( $sql, $data) );
486
+ }
487
+
488
  function clear_forever() {
489
  if ( isset($_COOKIE['popover_never_view']) ) {
490
  return true;
494
  }
495
 
496
  }
497
+
498
  }
499
  ?>
popoverincludes/classes/popoverpublic.php CHANGED
@@ -14,6 +14,8 @@ if(!class_exists('popoverpublic')) {
14
 
15
  var $activepopover = false;
16
 
 
 
17
  function __construct() {
18
 
19
  global $wpdb;
@@ -24,7 +26,8 @@ if(!class_exists('popoverpublic')) {
24
  $this->$table = popover_db_prefix($this->db, $table);
25
  }
26
 
27
- add_action('init', array(&$this, 'selective_message_display'), 99);
 
28
 
29
  add_action( 'plugins_loaded', array(&$this, 'load_textdomain'));
30
 
@@ -88,381 +91,53 @@ if(!class_exists('popoverpublic')) {
88
 
89
  }
90
 
91
- function get_active_popovers() {
92
- $sql = $this->db->prepare( "SELECT * FROM {$this->popover} WHERE popover_active = 1 ORDER BY popover_order ASC" );
93
-
94
- return $this->db->get_results( $sql );
95
- }
96
-
97
- function selective_message_display() {
98
-
99
- if(function_exists('get_site_option') && defined('PO_GLOBAL') && PO_GLOBAL == true) {
100
- $updateoption = 'update_site_option';
101
- $getoption = 'get_site_option';
102
- } else {
103
- $updateoption = 'update_option';
104
- $getoption = 'get_option';
105
- }
106
-
107
- $popovers = $this->get_active_popovers();
108
-
109
- if(!empty($popovers)) {
110
-
111
- foreach( (array) $popovers as $popover ) {
112
-
113
- // We have an active popover so extract the information and test it
114
- $popover_title = stripslashes($popover->popover_title);
115
- $popover_content = stripslashes($popover->popover_content);
116
- $popover->popover_settings = unserialize($popover->popover_settings);
117
-
118
- $popover_size = $popover->popover_settings['popover_size'];
119
- $popover_location = $popover->popover_settings['popover_location'];
120
- $popover_colour = $popover->popover_settings['popover_colour'];
121
- $popover_margin = $popover->popover_settings['popover_margin'];
122
-
123
- $popover_size = $this->sanitise_array($popover_size);
124
- $popover_location = $this->sanitise_array($popover_location);
125
- $popover_colour = $this->sanitise_array($popover_colour);
126
- $popover_margin = $this->sanitise_array($popover_margin);
127
-
128
- $popover_check = $popover->popover_settings['popover_check'];
129
- $popover_ereg = $popover->popover_settings['popover_ereg'];
130
- $popover_count = $popover->popover_settings['popover_count'];
131
-
132
- $popover_usejs = $popover->popover_settings['popover_usejs'];
133
-
134
- $popoverstyle = (isset($popover->popover_settings['popover_style'])) ? $popover->popover_settings['popover_style'] : '';
135
-
136
- $popover_hideforever = (isset($popover->popover_settings['popoverhideforeverlink'])) ? $popover->popover_settings['popoverhideforeverlink'] : '';
137
-
138
- $popover_delay = (isset($popover->popover_settings['popoverdelay'])) ? $popover->popover_settings['popoverdelay'] : '';
139
-
140
- $popover_onurl = (isset($popover->popover_settings['onurl'])) ? $popover->popover_settings['onurl'] : '';
141
- $popover_notonurl = (isset($popover->popover_settings['notonurl'])) ? $popover->popover_settings['notonurl'] : '';
142
-
143
- $popover_onurl = $this->sanitise_array($popover_onurl);
144
- $popover_notonurl = $this->sanitise_array($popover_notonurl);
145
-
146
- $show = true;
147
-
148
- if(!empty($popover_check)) {
149
-
150
- $order = explode(',', $popover_check['order']);
151
-
152
- foreach($order as $key) {
153
-
154
- switch ($key) {
155
-
156
- case "supporter":
157
- if(function_exists('is_pro_site') && is_pro_site()) {
158
- $show = false;
159
- }
160
- break;
161
-
162
- case "loggedin": if($this->is_loggedin()) {
163
- $show = false;
164
- }
165
- break;
166
-
167
- case "isloggedin": if(!$this->is_loggedin()) {
168
- $show = false;
169
- }
170
- break;
171
-
172
- case "commented": if($this->has_commented()) {
173
- $show = false;
174
- }
175
- break;
176
-
177
- case "searchengine":
178
- if(!$this->is_fromsearchengine()) {
179
- $show = false;
180
- }
181
- break;
182
-
183
- case "internal": $internal = str_replace('http://','',get_option('home'));
184
- if($this->referrer_matches(addcslashes($internal,"/"))) {
185
- $show = false;
186
- }
187
- break;
188
 
189
- case "referrer": $match = $popover_ereg;
190
- if(!$this->referrer_matches(addcslashes($match,"/"))) {
191
- $show = false;
192
- }
193
- break;
194
 
195
- case "count": if($this->has_reached_limit($popover_count)) {
196
- $show = false;
197
- }
198
- break;
199
 
200
- case 'onurl': if(!$this->onurl( $popover_onurl )) {
201
- $show = false;
202
- }
203
- break;
204
 
205
- case 'notonurl': if($this->onurl( $popover_notonurl )) {
206
- $show = false;
207
- }
208
- break;
209
-
210
- default: if(has_filter('popover_process_rule_' . $key)) {
211
- if(!apply_filters( 'popover_process_rule_' . $key, false )) {
212
- $show = false;
213
- }
214
- }
215
- break;
216
-
217
- }
218
- }
219
- }
220
-
221
- if($show == true) {
222
-
223
- if($this->clear_forever()) {
224
- $show = false;
225
- }
226
-
227
- }
228
-
229
- if($show == true) {
230
-
231
- // Store the active popover so we know what we are using in the footer.
232
- $this->activepopover = $popover;
233
-
234
- wp_enqueue_script('jquery');
235
-
236
- $popover_messagebox = 'a' . md5(date('d')) . '-po';
237
- // Show the advert
238
- wp_enqueue_script('popoverjs', popover_url('popoverincludes/js/popover.js'), array('jquery'), $this->build);
239
- if(!empty($popover_delay) && $popover_delay != 'immediate') {
240
- // Set the delay
241
- wp_localize_script('popoverjs', 'popover', array( 'messagebox' => '#' . $popover_messagebox,
242
- 'messagedelay' => $popover_delay * 1000
243
- ));
244
- } else {
245
- wp_localize_script('popoverjs', 'popover', array( 'messagebox' => '#' . $popover_messagebox,
246
- 'messagedelay' => 0
247
- ));
248
- }
249
-
250
- if($popover_usejs == 'yes') {
251
- wp_enqueue_script('popoveroverridejs', popover_url('popoverincludes/js/popoversizing.js'), array('jquery'), $this->build);
252
- }
253
-
254
- add_action('wp_head', array(&$this, 'page_header'));
255
- add_action('wp_footer', array(&$this, 'page_footer'));
256
-
257
- // Add the cookie
258
- if ( isset($_COOKIE['popover_view_'.COOKIEHASH]) ) {
259
- $count = intval($_COOKIE['popover_view_'.COOKIEHASH]);
260
- if(!is_numeric($count)) $count = 0;
261
- $count++;
262
- } else {
263
- $count = 1;
264
- }
265
- if(!headers_sent()) setcookie('popover_view_'.COOKIEHASH, $count , time() + 30000000, COOKIEPATH, COOKIE_DOMAIN);
266
-
267
- break;
268
- }
269
-
270
-
271
- }
272
 
273
  }
274
 
275
  }
276
 
277
- function sanitise_array($arrayin) {
278
-
279
- foreach( (array) $arrayin as $key => $value) {
280
- $arrayin[$key] = htmlentities(stripslashes($value) ,ENT_QUOTES, 'UTF-8');
281
- }
282
-
283
- return $arrayin;
284
- }
285
 
286
- function page_header() {
287
-
288
- if(!$this->activepopover) {
289
- return;
290
- }
291
-
292
- $popover = $this->activepopover;
293
-
294
- $popover_title = stripslashes($popover->popover_title);
295
- $popover_content = stripslashes($popover->popover_content);
296
-
297
- $popover_size = $popover->popover_settings['popover_size'];
298
- $popover_location = $popover->popover_settings['popover_location'];
299
- $popover_colour = $popover->popover_settings['popover_colour'];
300
- $popover_margin = $popover->popover_settings['popover_margin'];
301
-
302
- $popover_size = $this->sanitise_array($popover_size);
303
- $popover_location = $this->sanitise_array($popover_location);
304
- $popover_colour = $this->sanitise_array($popover_colour);
305
- $popover_margin = $this->sanitise_array($popover_margin);
306
-
307
- $popover_check = $popover->popover_settings['popover_check'];
308
- $popover_ereg = $popover->popover_settings['popover_ereg'];
309
- $popover_count = $popover->popover_settings['popover_count'];
310
-
311
- $popover_usejs = $popover->popover_settings['popover_usejs'];
312
-
313
- $popoverstyle = $popover->popover_settings['popover_style'];
314
-
315
- $popover_hideforever = $popover->popover_settings['popoverhideforeverlink'];
316
-
317
- $popover_delay = $popover->popover_settings['popoverdelay'];
318
-
319
- $popover_messagebox = 'a' . md5(date('d')) . '-po';
320
-
321
- $availablestyles = apply_filters( 'popover_available_styles_directory', array() );
322
- $availablestylesurl = apply_filters( 'popover_available_styles_url', array() );
323
-
324
- if( in_array($popoverstyle, array_keys($availablestyles)) ) {
325
- // Add the styles
326
- if(file_exists(trailingslashit($availablestyles[$popoverstyle]) . 'style.css')) {
327
- ob_start();
328
- include_once( trailingslashit($availablestyles[$popoverstyle]) . 'style.css' );
329
- $content = ob_get_contents();
330
- ob_end_clean();
331
-
332
- echo "<style type='text/css'>\n";
333
- $content = str_replace('#messagebox', '#' . $popover_messagebox, $content);
334
- $content = str_replace('%styleurl%', trailingslashit($availablestylesurl[$popoverstyle]), $content);
335
- echo $content;
336
- echo "</style>\n";
337
- }
338
 
 
 
 
339
  }
340
 
341
  }
342
 
343
- function page_footer() {
344
-
345
- if(!$this->activepopover) {
346
- return;
347
- }
348
-
349
- $popover = $this->activepopover;
350
-
351
- $popover_title = stripslashes($popover->popover_title);
352
- $popover_content = stripslashes($popover->popover_content);
353
-
354
- $popover_size = $popover->popover_settings['popover_size'];
355
- $popover_location = $popover->popover_settings['popover_location'];
356
- $popover_colour = $popover->popover_settings['popover_colour'];
357
- $popover_margin = $popover->popover_settings['popover_margin'];
358
-
359
- $popover_size = $this->sanitise_array($popover_size);
360
- $popover_location = $this->sanitise_array($popover_location);
361
- $popover_colour = $this->sanitise_array($popover_colour);
362
- $popover_margin = $this->sanitise_array($popover_margin);
363
-
364
- $popover_check = $popover->popover_settings['popover_check'];
365
- $popover_ereg = $popover->popover_settings['popover_ereg'];
366
- $popover_count = $popover->popover_settings['popover_count'];
367
 
368
- $popover_usejs = $popover->popover_settings['popover_usejs'];
369
-
370
- $popoverstyle = $popover->popover_settings['popover_style'];
371
-
372
- $popover_hideforever = $popover->popover_settings['popoverhideforeverlink'];
373
-
374
- $popover_delay = $popover->popover_settings['popoverdelay'];
375
-
376
- $style = '';
377
- $backgroundstyle = '';
378
-
379
- if($popover_usejs == 'yes') {
380
- $style = 'z-index:999999;';
381
- $box = 'color: #' . $popover_colour['fore'] . '; background: #' . $popover_colour['back'] . ';';
382
- $style .= 'left: -1000px; top: =100px;';
383
- } else {
384
- $style = 'left: ' . $popover_location['left'] . '; top: ' . $popover_location['top'] . ';' . ' z-index:999999;';
385
- $style .= 'margin-top: ' . $popover_margin['top'] . '; margin-bottom: ' . $popover_margin['bottom'] . '; margin-right: ' . $popover_margin['right'] . '; margin-left: ' . $popover_margin['left'] . ';';
386
-
387
- $box = 'width: ' . $popover_size['width'] . '; height: ' . $popover_size['height'] . '; color: #' . $popover_colour['fore'] . '; background: #' . $popover_colour['back'] . ';';
388
 
 
 
 
389
  }
390
 
391
- if(!empty($popover_delay) && $popover_delay != 'immediate') {
392
- // Hide the popover initially
393
- $style .= ' visibility: hidden;';
394
- $backgroundstyle .= ' visibility: hidden;';
395
- }
396
-
397
- $availablestyles = apply_filters( 'popover_available_styles_directory', array() );
398
-
399
- if( in_array($popoverstyle, array_keys($availablestyles)) ) {
400
- $popover_messagebox = 'a' . md5(date('d')) . '-po';
401
-
402
- if(file_exists(trailingslashit($availablestyles[$popoverstyle]) . 'popover.php')) {
403
- ob_start();
404
- include_once( trailingslashit($availablestyles[$popoverstyle]) . 'popover.php' );
405
- ob_end_flush();
406
- }
407
- }
408
-
409
-
410
- }
411
-
412
- function is_fromsearchengine() {
413
- $ref = $_SERVER['HTTP_REFERER'];
414
-
415
- $SE = array('/search?', '.google.', 'web.info.com', 'search.', 'del.icio.us/search', 'soso.com', '/search/', '.yahoo.', '.bing.' );
416
-
417
- foreach ($SE as $url) {
418
- if (strpos($ref,$url)!==false) return true;
419
- }
420
- return false;
421
- }
422
-
423
- function is_ie()
424
- {
425
- if (isset($_SERVER['HTTP_USER_AGENT']) && (strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') !== false))
426
- return true;
427
- else
428
- return false;
429
- }
430
-
431
- function is_loggedin() {
432
- return is_user_logged_in();
433
- }
434
-
435
- function has_commented() {
436
- if ( isset($_COOKIE['comment_author_'.COOKIEHASH]) ) {
437
- return true;
438
- } else {
439
- return false;
440
- }
441
- }
442
-
443
- function referrer_matches($check) {
444
-
445
- $referer = (isset($_SERVER['HTTP_REFERER'])) ? $_SERVER['HTTP_REFERER'] : '';
446
-
447
- if(preg_match( '/' . $check . '/i', $referer )) {
448
- return true;
449
- } else {
450
- return false;
451
- }
452
-
453
- }
454
-
455
- function has_reached_limit($count = 3) {
456
- if ( isset($_COOKIE['popover_view_'.COOKIEHASH]) && addslashes($_COOKIE['popover_view_'.COOKIEHASH]) >= $count ) {
457
- return true;
458
- } else {
459
- return false;
460
- }
461
  }
462
 
463
  function myURL() {
464
 
465
- if ($_SERVER["HTTPS"] == "on") {
466
  $url .= "https://";
467
  } else {
468
  $url = 'http://';
@@ -477,52 +152,51 @@ if(!class_exists('popoverpublic')) {
477
  return trailingslashit($url);
478
  }
479
 
480
- function onurl( $urllist = array() ) {
481
 
482
- $urllist = array_map( 'trim', $urllist );
483
 
484
- if(!empty($urllist)) {
485
- if(in_array($this->myURL(), $urllist)) {
486
- // we are on the list
487
- return true;
488
- } else {
489
- return false;
490
- }
491
- } else {
492
- return true;
493
- }
494
 
495
- }
 
 
496
 
497
- function insertonduplicate($table, $data) {
498
 
499
- global $wpdb;
 
500
 
501
- $fields = array_keys($data);
502
- $formatted_fields = array();
503
- foreach ( $fields as $field ) {
504
- $form = '%s';
505
- $formatted_fields[] = $form;
506
- }
507
- $sql = "INSERT INTO `$table` (`" . implode( '`,`', $fields ) . "`) VALUES ('" . implode( "','", $formatted_fields ) . "')";
508
- $sql .= " ON DUPLICATE KEY UPDATE ";
 
 
509
 
510
- $dup = array();
511
- foreach($fields as $field) {
512
- $dup[] = "`" . $field . "` = VALUES(`" . $field . "`)";
513
  }
514
 
515
- $sql .= implode(',', $dup);
516
 
517
- return $wpdb->query( $wpdb->prepare( $sql, $data) );
 
 
 
 
 
 
 
 
518
  }
519
 
520
- function clear_forever() {
521
- if ( isset($_COOKIE['popover_never_view']) ) {
522
- return true;
523
- } else {
524
- return false;
525
- }
526
  }
527
 
528
  }
14
 
15
  var $activepopover = false;
16
 
17
+ var $thepopover;
18
+
19
  function __construct() {
20
 
21
  global $wpdb;
26
  $this->$table = popover_db_prefix($this->db, $table);
27
  }
28
 
29
+ // Adds the JS to the themes header - this replaces all previous methods of loading
30
+ add_action( 'init', array( &$this, 'initialise_plugin') );
31
 
32
  add_action( 'plugins_loaded', array(&$this, 'load_textdomain'));
33
 
91
 
92
  }
93
 
94
+ function initialise_plugin() {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
95
 
96
+ $settings = get_popover_option('popover-settings', array( 'loadingmethod' => 'external'));
 
 
 
 
97
 
98
+ switch( $settings['loadingmethod'] ) {
 
 
 
99
 
100
+ case 'external': $this->add_selective_javascript();
101
+ break;
 
 
102
 
103
+ case 'footer': $this->add_popover_files();
104
+ break;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
105
 
106
  }
107
 
108
  }
109
 
110
+ function add_selective_javascript() {
111
+ global $pagenow;
 
 
 
 
 
 
112
 
113
+ if(!in_array($pagenow, array('wp-login.php', 'wp-register.php'))) {
114
+ // We need javascript so make sure we load it here
115
+ wp_enqueue_script('jquery');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
116
 
117
+ // Now to register our new js file
118
+ wp_register_script( 'popoverselective', popover_url('popover-load-js.php') );
119
+ wp_enqueue_script( 'popoverselective' );
120
  }
121
 
122
  }
123
 
124
+ function add_frontend_selective_javascript() {
125
+ global $pagenow;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
126
 
127
+ if(!in_array($pagenow, array('wp-login.php', 'wp-register.php'))) {
128
+ // We need javascript so make sure we load it here
129
+ wp_enqueue_script('jquery');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
130
 
131
+ // Now to register our new js file
132
+ wp_register_script( 'popoverselective', popover_url('popover-load-custom-js.php') );
133
+ wp_enqueue_script( 'popoverselective' );
134
  }
135
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
136
  }
137
 
138
  function myURL() {
139
 
140
+ if ( isset($_SERVER["HTTPS"]) && strtolower($_SERVER["HTTPS"]) == "on") {
141
  $url .= "https://";
142
  } else {
143
  $url = 'http://';
152
  return trailingslashit($url);
153
  }
154
 
155
+ function add_popover_files() {
156
 
157
+ global $popoverajax;
158
 
159
+ if( method_exists( $popoverajax, 'selective_message_display') ) {
 
 
 
 
 
 
 
 
 
160
 
161
+ // Set up the rquest information from here - this is passed in using the standard JS interface so we need to fake it
162
+ $_REQUEST['thereferrer'] = (isset($_SERVER['HTTP_REFERER'])) ? $_SERVER['HTTP_REFERER'] : '';
163
+ $_REQUEST['thefrom'] = $this->myURL();
164
 
165
+ $this->thepopover = $popoverajax->selective_message_display();
166
 
167
+ if( isset($this->thepopover['name']) && $this->thepopover['name'] != 'nopopover' ) {
168
+ wp_enqueue_script('jquery');
169
 
170
+ wp_enqueue_script('popoverlegacyjs', popover_url('popoverincludes/js/popoverlegacy.js'), array('jquery'), $this->build);
171
+ wp_localize_script('popoverlegacyjs', 'popover', array( 'divname' => $this->thepopover['name'],
172
+ 'usejs' => $this->thepopover['usejs'],
173
+ 'delay' => $this->thepopover['delay']
174
+ ));
175
+
176
+ add_action('wp_head', array(&$this, 'output_header_content'));
177
+ add_action('wp_footer', array(&$this, 'output_footer_content'));
178
+
179
+ }
180
 
 
 
 
181
  }
182
 
183
+ }
184
 
185
+ function output_header_content() {
186
+ // Output the styles
187
+ ?>
188
+ <style type="text/css">
189
+ <?php
190
+ echo $this->thepopover['style'];
191
+ ?>
192
+ </style>
193
+ <?php
194
  }
195
 
196
+ function output_footer_content() {
197
+
198
+ echo $this->thepopover['html'];
199
+
 
 
200
  }
201
 
202
  }
popoverincludes/css/fullbackground/images/closemessage.png ADDED
Binary file
popoverincludes/css/fullbackground/images/closemessagebland.png ADDED
Binary file
popoverincludes/css/fullbackground/images/loading.gif ADDED
Binary file
popoverincludes/css/fullbackground/images/opaque.png ADDED
Binary file
popoverincludes/css/fullbackground/images/opaque80.png ADDED
Binary file
popoverincludes/css/fullbackground/popover.php ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <div id='darkbackground' style='<?php echo $backgroundstyle; ?>'>
2
+ <div id='<?php echo $popover_messagebox; ?>' class='visiblebox' style='<?php echo $style; ?>'>
3
+ <a href='' id='closebox' title='Close this box'></a>
4
+ <div id='message' style='<?php echo $box; ?>'>
5
+ <?php echo do_shortcode($popover_content); ?>
6
+ <div class='clear'></div>
7
+ <?php if($popover_hideforever != 'yes') {
8
+ ?>
9
+ <div class='claimbutton hide'><a href='#' id='clearforever'><?php _e('Never see this message again.','popover'); ?></a></div>
10
+ <?php
11
+ }
12
+ ?>
13
+ </div>
14
+ <div class='clear'></div>
15
+ </div>
16
+ </div>
popoverincludes/css/fullbackground/style.css ADDED
@@ -0,0 +1,99 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #darkbackground {
2
+ position: fixed;
3
+ background: transparent url(%styleurl%images/opaque80.png) repeat;
4
+ top: 0;
5
+ width: 100%;
6
+ left: 0;
7
+ height: 100%;
8
+ z-index: 99999;
9
+ visibility: visible;
10
+ }
11
+
12
+ div#messagebox {
13
+ position: absolute;
14
+ background: transparent url(%styleurl%images/opaque.png) repeat;
15
+ z-index: 999;
16
+ padding: 10px;
17
+ visibility: visible;
18
+ }
19
+
20
+ div#messagebox div.claimbutton {
21
+ position: absolute;
22
+ bottom: 0;
23
+ right: 0;
24
+ width: 100%;
25
+ background: transparent url(%styleurl%images/opaque.png) repeat;
26
+ text-align: right;
27
+ padding-top: 5px;
28
+ padding-bottom: 5px;
29
+ }
30
+
31
+ div#messagebox div.claimbutton a:visited, div#messagebox div.claimbutton a {
32
+ font-family: "Helvetica Neue", Arial, Helvetica, Geneva, sans-serif;
33
+ color: #FFF;
34
+ text-shadow: #000 1px 1px 0px;
35
+ font-weight: bold;
36
+ padding-right: 5px;
37
+ }
38
+
39
+ #message p {
40
+ position: relative;
41
+ clear: both;
42
+ }
43
+
44
+ #messagebox #closebox {
45
+ position: absolute;
46
+ width: 30px;
47
+ height: 29px;
48
+ background: transparent url(%styleurl%images/closemessagebland.png) no-repeat;
49
+ top: -5px;
50
+ left: -5px;
51
+ z-index: 5;
52
+ }
53
+
54
+ div#message {
55
+ position: relative;
56
+ background: #fff;
57
+ font: 0.9em "Helvetica Neue", Arial, Helvetica, Geneva, sans-serif;
58
+ min-height: 90%;
59
+ overflow: hidden;
60
+ }
61
+
62
+ div#message.waiting {
63
+ background: #fff url(%styleurl%images/loading.gif) no-repeat center center;
64
+ }
65
+
66
+ div#message h2 {
67
+ color: #000;
68
+ font: bold 1.3em "Helvetica Neue", Arial, Helvetica, Geneva, sans-serif;
69
+ margin-top: 0px;
70
+ }
71
+ div#message h2 a {
72
+ text-decoration: none;
73
+ color: #000;
74
+ }
75
+
76
+ div#message blockquote {
77
+ padding: 0px;
78
+ font-weight: bold;
79
+ border-left: 5px solid #ccc;
80
+ }
81
+
82
+ div#message blockquote p{
83
+ padding: 2px 5px;
84
+ }
85
+
86
+ div#message img {
87
+ }
88
+
89
+ div#messagebox.visiblebox {
90
+ display: block;
91
+ }
92
+ div#messagebox.hiddenbox {
93
+ display: none;
94
+ }
95
+ .hide { display: none; }
96
+
97
+ .clear {
98
+ clear: both;
99
+ }
popoverincludes/css/fullbackgroundfixed/images/closemessage.png ADDED
Binary file
popoverincludes/css/fullbackgroundfixed/images/closemessagebland.png ADDED
Binary file
popoverincludes/css/fullbackgroundfixed/images/loading.gif ADDED
Binary file
popoverincludes/css/fullbackgroundfixed/images/opaque.png ADDED
Binary file
popoverincludes/css/fullbackgroundfixed/images/opaque80.png ADDED
Binary file
popoverincludes/css/fullbackgroundfixed/popover.php ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <div id='<?php echo $popover_messagebox; ?>' class='visiblebox' style='position: fixed; <?php echo $style; ?>'>
2
+ <a href='' id='closebox' title='Close this box'></a>
3
+ <div id='message' style='<?php echo $box; ?>'>
4
+ <?php echo do_shortcode($popover_content); ?>
5
+ <div class='clear'></div>
6
+ <?php if($popover_hideforever != 'yes') {
7
+ ?>
8
+ <div class='claimbutton hide'><a href='#' id='clearforever'><?php _e('Never see this message again.','popover'); ?></a></div>
9
+ <?php
10
+ }
11
+ ?>
12
+ </div>
13
+ <div class='clear'></div>
14
+ </div>
popoverincludes/css/{popover.css → fullbackgroundfixed/style.css} RENAMED
@@ -1,6 +1,6 @@
1
  div#messagebox {
2
  position: absolute;
3
- background: transparent url(../images/opaque.png) repeat;
4
  z-index: 999;
5
  padding: 10px;
6
  visibility: hidden;
@@ -11,7 +11,7 @@ div#messagebox div.claimbutton {
11
  bottom: 0;
12
  right: 0;
13
  width: 100%;
14
- background: transparent url(../images/opaque.png) repeat;
15
  text-align: right;
16
  padding-top: 5px;
17
  padding-bottom: 5px;
@@ -34,7 +34,7 @@ div#messagebox div.claimbutton a:visited, div#messagebox div.claimbutton a {
34
  position: absolute;
35
  width: 30px;
36
  height: 29px;
37
- background: transparent url(../images/closemessagebland.png) no-repeat;
38
  top: -5px;
39
  left: -5px;
40
  z-index: 5;
@@ -49,7 +49,7 @@ div#message {
49
  }
50
 
51
  div#message.waiting {
52
- background: #fff url(../images/loading.gif) no-repeat center center;
53
  }
54
 
55
  div#message h2 {
1
  div#messagebox {
2
  position: absolute;
3
+ background: transparent url(%styleurl%images/opaque.png) repeat;
4
  z-index: 999;
5
  padding: 10px;
6
  visibility: hidden;
11
  bottom: 0;
12
  right: 0;
13
  width: 100%;
14
+ background: transparent url(%styleurl%images/opaque.png) repeat;
15
  text-align: right;
16
  padding-top: 5px;
17
  padding-bottom: 5px;
34
  position: absolute;
35
  width: 30px;
36
  height: 29px;
37
+ background: transparent url(%styleurl%images/closemessagebland.png) no-repeat;
38
  top: -5px;
39
  left: -5px;
40
  z-index: 5;
49
  }
50
 
51
  div#message.waiting {
52
+ background: #fff url(%styleurl%images/loading.gif) no-repeat center center;
53
  }
54
 
55
  div#message h2 {
popoverincludes/css/popover.min.css DELETED
@@ -1,111 +0,0 @@
1
- *{margin:0;padding:0;}
2
- body{background:#72572b;margin:0;}
3
- body, th, td, input, textarea{color:#333333;font-family:"Trebuchet MS";font-size:12px;}
4
- input, textarea{font-weight:bold;}
5
- input.text{background:#FFFFFF;border:none;padding:1px;}
6
- input.button{background:#000000;border:1px solid #000000;color:#ffffff;}
7
- h1, h2, h3{color:#626456;}
8
- h1{font-size:2.5em;font-weight:lighter;letter-spacing:-.075em;}
9
- h2{color:#CCCCCC;font-size:1em;font-weight:lighter;}
10
- h3{font-size:1em;}
11
- p, ul, ol{font-size:1.1em;line-height:1.8em;margin-top:1.5em;}
12
- ul, ol{margin-left:3em;}
13
- blockquote{margin-left:3em;margin-right:3em;}
14
- a{color:#72572b;text-decoration:none;}
15
- a:hover{border:none;color:#000;text-decoration:underline}
16
- h1 a, h2 a, h3 a{border:none;color:#333333;text-decoration:none;}
17
- h1 a:hover, h2 a:hover, h3 a:hover{background:none;color:#c2a32e;}
18
- hr{display:none;}
19
- #wrapper{}
20
- #header{background-color:#91723d;height:40px;margin:0 auto;width:1018px;}
21
- #menu{float:right;padding:10px;}
22
- #menu ul{line-height:normal;list-style:none;margin:0;padding:0;}
23
- #menu li{float:left;}
24
- #menu a{color:#FFFFFF;display:block;float:left;font-size:1em;height:20px;margin-right:1px;padding:0px 20px 0 20px;text-decoration:none;}
25
- #menu a:hover{background:#72572b;color:#ffffff;}
26
- #menu .current_page_item a{background:#72572b;color:#ffffff;}
27
- #search{float:left;padding:10px;width:270px;}
28
- #search fieldset{border:none;}
29
- #search #s{padding:3px;width:140px;}
30
- #search #x{width:60px;}
31
- #logo{background:url(images/header.jpg) no-repeat left top;border:10px solid #ffffff;border-bottom:none;height:160px;margin:0 auto;width:998px;}
32
- #logo h1, #logo h2{margin:0;padding:0;text-align:right}
33
- #logo h1{color:#2C2E22;padding:55px 15px 0 20px;}
34
- #logo h1 a:hover{text-decoration:none}
35
- #logo h2{color:#CCC;margin:3px 20px 0 17px;padding:5px;}
36
- #logo p{clear:left;color:#C2C5B1;font-size:1.2em;font-weight:bold;line-height:normal;margin:0;padding:0 0 0 20px;}
37
- #logo a{color:#FFF;}
38
- #page{background:#FFF;border:10px solid #ffffff;border-bottom:none;border-top:none;margin:0 auto;padding:20px 0px 0 0px;width:998px;}
39
- #content{float:left;padding:0px 0px 0px 20px;width:570px;}
40
- .post{}
41
- .post .title{font-weight:normal;margin:0;}
42
- h1.title{color:#333;font-size:2em;padding-left:15px;text-transform:uppercase;}
43
- h2.title{color:#72572b;font-size:1.2em;padding-bottom:20px;padding-left:15px;text-transform:uppercase;}
44
- .desctitle{font-size:10px;}
45
- .post h1.title{font-size:2em;height:30px;padding:0px 0 0 15px;text-transform:uppercase;}
46
- .post .entry{padding:0 10px 30px 15px;text-align:justify;}
47
- .post .meta{border-bottom:1px dotted #CCCCCC;color:#999999;font-family:Arial, Helvetica, sans-serif;font-size:10px;margin:0;padding:5px 0px 0px 15px;}
48
- .post .meta a{color:#999999;}
49
- .post .links{margin:0;}
50
- .post .tags{background:url(images/img04.gif) repeat-x;font-size:.8em;font-weight:bold;margin:0;text-transform:uppercase;}
51
- .post .links a, .post .tags a{border:none;}
52
- #recent-posts{}
53
- #recent-posts ul li{background:url(images/img04.gif) repeat-x left bottom;font-size:0.8em;padding:3px 3px 3px 15px;}
54
- #recent-posts h2{background:url(images/img12.gif) no-repeat left top;height:25px;margin:0;padding:2px 5px 5px 30px;}
55
- #recent-posts h3{background:url(images/img04.gif) repeat-x left bottom;font-size:13px;margin:0;padding:15px 0 0 15px;}
56
- #recent-posts p{font-size:13px;line-height:22px;margin:0 0 10px 0;padding:15px 0 0 15px;}
57
- .sidebar{float:left;}
58
- .sidebar ul{list-style:none;margin:0;padding:0;}
59
- .sidebar li{margin-bottom:2em;}
60
- .sidebar li ul{}
61
- .sidebar li li{margin:0;}
62
- .sidebar li h2{margin:0 0 0.7em 0;}
63
- #sidebar1{padding-left:10px;width:180px;}
64
- #sidebar1 li h2{background:url(images/cat-head.gif) no-repeat left top;height:25px;margin:0 0 0.2em 0;padding:4px 5px 5px 10px;color:#FFF;font-size:16px;font-weight:bold;text-transform:uppercase}
65
- #sidebar1 li ul{background:url(images/img04.gif) repeat-x;line-height:normal;}
66
- #sidebar1 li li{background:url(images/img04.gif) repeat-x left bottom;font-size:.8em;padding:5px;}
67
- #sidebar2{padding:0px 0px 0px 20px;width:180px;}
68
- #sidebar2 li h2{background:url(images/cat-head.gif) no-repeat left top;height:25px;margin:0 0 1em 0;padding:4px 5px 5px 10px;color:#FFF;font-size:16px;font-weight:bold;text-transform:uppercase}
69
- #sidebar2 li ul{background:url(images/img04.gif) repeat-x;line-height:normal;}
70
- #sidebar2 li li{background:url(images/img04.gif) repeat-x left bottom;font-size:.8em;padding:5px;}
71
- #sidebar2 li a{border:none;padding-left:10px;}
72
- #sidebar2 li a:hover{border:none;padding-left:10px;}
73
- #calendar{margin:0 auto;}
74
- #calendar caption{font-weight:bold;}
75
- #calendar table{border-collapse:collapse;text-align:center;width:220px;}
76
- #calendar thead th{background:#CCCCCC;color:#FFFFFF;}
77
- #calendar tbody td{background:#EEEEEE;}
78
- #calendar #today{background:#B8D03B;color:#FFFFFF;font-weight:bold;}
79
- #calendar a{font-weight:bold;}
80
- #calendar #prev{text-align:left;}
81
- #calendar #next{text-align:right;}
82
- #design{background:#FFFFFF url(images/lines2.gif) bottom right no-repeat;height:138px;}
83
- #footer{background-color:#91723d;border-top:5px solid #72572b;color:#FFFFFF;font-size:9px;padding:5px;text-align:center;}
84
- #footer a{color:#CCCCCC;}
85
- .info{background-color:#F5F5F5;border-bottom:2px solid #72572b;border-top:3px solid #E1E1E1;margin-bottom:20px;padding:10px;}
86
- .comlabel{background:url(images/lines.gif) bottom center no-repeat;color:#666666;font-size:13px;font-weight:lighter;margin-top:10px;padding:60px;}
87
- .comtext{background-color:#72572b;border:5px solid #FFFFFF;color:#FFFFFF;padding:5px;}
88
- .postlabel{background:url(images/lines.gif) bottom center no-repeat;color:#666666;font-size:13px;font-weight:lighter;margin:10px 0px 10px 0px;padding:60px;}
89
- .posttext{background-color:#19727d;border:5px solid #FFFFFF;color:#FFFFFF;padding:5px;}
90
- .commentlist{list-style:none;}
91
- .authorcomment{background-color:#efefef;margin:10px 0px 0px 0px;padding:3px;}
92
- .odd{border-bottom:2px solid #E5E5E5;color:#333333;padding:2px 10px 2px 10px;}
93
- .odd a:link{color:#000;}
94
- .commenttext{color:#000000;color:#666666;font-size:10px;margin:0px 0px 10px 0px;padding:5px 10px 5px 10px;text-transform:uppercase;}
95
- #author, #email, #url{background:#efefef;border:1px solid #cbcbcb;font:13px'Lucida Grande','Lucida Sans Unicode', Helvetica, Tahoma, Arial, Verdana, sans-serif;margin-bottom:0.6em;margin-top:5px;padding:3px;width:40%;}
96
- #comment{background:#efefef;border:1px solid #cbcbcb;font:13px'Lucida Grande','Lucida Sans Unicode', Helvetica, Tahoma, Arial, Verdana, sans-serif;margin-bottom:0.6em;margin-top:5px;padding:3px;width:100%;}
97
- #submit{background-color:#efefef;border-bottom:2px solid #CCCCCC;border-left:1px solid #E4E4E4;border-right:2px solid #CCCCCC;border-top:1px solid #E4E4E4;font:13px'Lucida Grande','Lucida Sans Unicode', Helvetica, Tahoma, Arial, Verdana, sans-serif;padding:3px;}
98
- acronym, abbr, span.caps{cursor:help;}
99
- acronym, abbr{border-bottom:1px dashed #999;}
100
- blockquote{border-left:5px solid #ddd;margin:15px 30px 0 10px;padding-left:20px;}
101
- blockquote cite{display:block;margin:5px 0 0;}
102
- .center{text-align:center;}
103
- hr{display:none;}
104
- a img{border:none;}
105
- .alignright{background-color:#EAEAEA;float:right;padding:5px;}
106
- .alignleft{background-color:#EAEAEA;float:left;padding:5px;}
107
- img.centered{display:block;margin-left:auto;margin-right:auto;}
108
- img.alignright{display:inline;margin:0 0 2px 7px;padding:4px;}
109
- img.alignleft{display:inline;margin:0 7px 2px 0;padding:4px;}
110
- pre{background:#f3f2ed;border:solid 1px #9a9a9a;color:blue;margin:10px;padding:10px;}
111
- code{color:#000;font-size:1.0em;}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
popoverincludes/external/wpmudev-dash-notification.php ADDED
@@ -0,0 +1,67 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ ///////////////////////////////////////////////////////////////////////////
3
+ /* -------------------- WPMU DEV Dashboard Notice -------------------- */
4
+ if ( !class_exists('WPMUDEV_Dashboard_Notice') ) {
5
+ class WPMUDEV_Dashboard_Notice {
6
+
7
+ var $version = '2.0';
8
+
9
+ function WPMUDEV_Dashboard_Notice() {
10
+ add_action( 'plugins_loaded', array( &$this, 'init' ) );
11
+ }
12
+
13
+ function init() {
14
+ if ( !class_exists( 'WPMUDEV_Update_Notifications' ) && current_user_can( 'install_plugins' ) && is_admin() ) {
15
+ remove_action( 'admin_notices', 'wdp_un_check', 5 );
16
+ remove_action( 'network_admin_notices', 'wdp_un_check', 5 );
17
+ if ( file_exists(WP_PLUGIN_DIR . '/wpmudev-updates/update-notifications.php') ) {
18
+ add_action( 'all_admin_notices', array( &$this, 'activate_notice' ), 5 );
19
+ } else {
20
+ add_action( 'all_admin_notices', array( &$this, 'install_notice' ), 5 );
21
+ add_filter( 'plugins_api', array( &$this, 'filter_plugin_info' ), 10, 3 );
22
+ }
23
+ }
24
+ }
25
+
26
+ function filter_plugin_info($res, $action, $args) {
27
+ global $wp_version;
28
+ $cur_wp_version = preg_replace('/-.*$/', '', $wp_version);
29
+
30
+ if ( $action == 'plugin_information' && strpos($args->slug, 'install_wpmudev_dash') !== false ) {
31
+ $res = new stdClass;
32
+ $res->name = 'WPMU DEV Dashboard';
33
+ $res->slug = 'wpmu-dev-dashboard';
34
+ $res->version = '';
35
+ $res->rating = 100;
36
+ $res->homepage = 'http://premium.wpmudev.org/project/wpmu-dev-dashboard/';
37
+ $res->download_link = "http://premium.wpmudev.org/wdp-un.php?action=install_wpmudev_dash";
38
+ $res->tested = $cur_wp_version;
39
+
40
+ return $res;
41
+ }
42
+
43
+ return false;
44
+ }
45
+
46
+ function auto_install_url() {
47
+ $function = is_multisite() ? 'network_admin_url' : 'admin_url';
48
+ return wp_nonce_url($function("update.php?action=install-plugin&plugin=install_wpmudev_dash"), "install-plugin_install_wpmudev_dash");
49
+ }
50
+
51
+ function activate_url() {
52
+ $function = is_multisite() ? 'network_admin_url' : 'admin_url';
53
+ return wp_nonce_url($function('plugins.php?action=activate&plugin=wpmudev-updates%2Fupdate-notifications.php'), 'activate-plugin_wpmudev-updates/update-notifications.php');
54
+ }
55
+
56
+ function install_notice() {
57
+ echo '<div class="error fade"><p>' . sprintf(__('Easily get updates, support, and one-click WPMU DEV plugin/theme installations right from in your dashboard - <strong><a href="%s" title="Install Now &raquo;">install the free WPMU DEV Dashboard plugin</a></strong>. &nbsp;&nbsp;&nbsp;<small><a href="http://premium.wpmudev.org/wpmu-dev/update-notifications-plugin-information/">(find out more)</a></small>', 'wpmudev'), $this->auto_install_url()) . '</p></div>';
58
+ }
59
+
60
+ function activate_notice() {
61
+ echo '<div class="updated fade"><p>' . sprintf(__('Updates, Support, Premium Plugins, Community - <strong><a href="%s" title="Activate Now &raquo;">activate the WPMU DEV Dashboard plugin now</a></strong>.', 'wpmudev'), $this->activate_url()) . '</a></p></div>';
62
+ }
63
+
64
+ }
65
+ new WPMUDEV_Dashboard_Notice();
66
+ }
67
+ ?>
popoverincludes/includes/config.php CHANGED
@@ -2,8 +2,4 @@
2
  // a true setting for PO_GLOBAL means that this plugin operates on a global site-admin basis
3
  // setting this to false means that the plugin operates on a blog by blog basis
4
  if(!defined('PO_GLOBAL')) define('PO_GLOBAL', false);
5
- // The url that we are using to return the country - it should only return the country code for the passed IP address
6
- if(!defined('PO_REMOTE_IP_URL')) define('PO_REMOTE_IP_URL', 'http://api.hostip.info/country.php?ip=%ip%');
7
- // If there is a problem with the API, then you can set a default country to use for popover showing. Set this to false if you'd rather have the popover not show in such circumstances
8
- if(!defined('PO_DEFAULT_COUNTRY')) define('PO_DEFAULT_COUNTRY', 'US');
9
  ?>
2
  // a true setting for PO_GLOBAL means that this plugin operates on a global site-admin basis
3
  // setting this to false means that the plugin operates on a blog by blog basis
4
  if(!defined('PO_GLOBAL')) define('PO_GLOBAL', false);
 
 
 
 
5
  ?>
popoverincludes/includes/functions.php CHANGED
@@ -1,14 +1,4 @@
1
  <?php
2
- /* -------------------- Update Notifications Notice -------------------- */
3
- if ( !function_exists( 'wdp_un_check' ) ) {
4
- add_action( 'admin_notices', 'wdp_un_check', 5 );
5
- add_action( 'network_admin_notices', 'wdp_un_check', 5 );
6
- function wdp_un_check() {
7
- if ( !class_exists( 'WPMUDEV_Update_Notifications' ) && current_user_can( 'edit_users' ) )
8
- echo '<div class="error fade"><p>' . __('Please install the latest version of <a href="http://premium.wpmudev.org/project/update-notifications/" title="Download Now &raquo;">our free Update Notifications plugin</a> which helps you stay up-to-date with the most stable, secure versions of WPMU DEV themes and plugins. <a href="http://premium.wpmudev.org/wpmu-dev/update-notifications-plugin-information/">More information &raquo;</a>', 'wpmudev') . '</a></p></div>';
9
- }
10
- }
11
- /* --------------------------------------------------------------------- */
12
 
13
  function set_popover_url($base) {
14
 
@@ -136,6 +126,7 @@ function P_style_urls( $styles = array() ) {
136
 
137
  $styles['Default'] = popover_url('popoverincludes/css/default');
138
  $styles['Default Fixed'] = popover_url('popoverincludes/css/fixed');
 
139
 
140
  return $styles;
141
  }
@@ -144,6 +135,7 @@ add_filter( 'popover_available_styles_url', 'P_style_urls');
144
  function P_style_dirs() {
145
  $styles['Default'] = popover_dir('popoverincludes/css/default');
146
  $styles['Default Fixed'] = popover_dir('popoverincludes/css/fixed');
 
147
 
148
  return $styles;
149
  }
@@ -407,4 +399,34 @@ function P_CountryList() {
407
 
408
  }
409
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
410
  ?>
1
  <?php
 
 
 
 
 
 
 
 
 
 
2
 
3
  function set_popover_url($base) {
4
 
126
 
127
  $styles['Default'] = popover_url('popoverincludes/css/default');
128
  $styles['Default Fixed'] = popover_url('popoverincludes/css/fixed');
129
+ $styles['Dark Background Fixed'] = popover_url('popoverincludes/css/fullbackground');
130
 
131
  return $styles;
132
  }
135
  function P_style_dirs() {
136
  $styles['Default'] = popover_dir('popoverincludes/css/default');
137
  $styles['Default Fixed'] = popover_dir('popoverincludes/css/fixed');
138
+ $styles['Dark Background Fixed'] = popover_dir('popoverincludes/css/fullbackground');
139
 
140
  return $styles;
141
  }
399
 
400
  }
401
 
402
+ function get_popover_option($key, $default = false) {
403
+
404
+ if(is_multisite() && function_exists('is_plugin_active_for_network') && is_plugin_active_for_network('wordpress-popup/popover.php')) {
405
+ return get_site_option($key, $default);
406
+ } else {
407
+ return get_option($key, $default);
408
+ }
409
+
410
+ }
411
+
412
+ function update_popover_option($key, $value) {
413
+
414
+ if(is_multisite() && function_exists('is_plugin_active_for_network') && is_plugin_active_for_network('wordpress-popup/popover.php')) {
415
+ return update_site_option($key, $value);
416
+ } else {
417
+ return update_option($key, $value);
418
+ }
419
+
420
+ }
421
+
422
+ function delete_popover_option($key) {
423
+
424
+ if(is_multisite() && function_exists('is_plugin_active_for_network') && is_plugin_active_for_network('wordpress-popup/popover.php')) {
425
+ return delete_site_option($key);
426
+ } else {
427
+ return delete_option($key);
428
+ }
429
+
430
+ }
431
+
432
  ?>
popoverincludes/js/popover.js DELETED
@@ -1,45 +0,0 @@
1
- function createCookie(name,value,days) {
2
- if (days) {
3
- var date = new Date();
4
- date.setTime(date.getTime()+(days*24*60*60*1000));
5
- var expires = "; expires="+date.toGMTString();
6
- }
7
- else var expires = "";
8
- document.cookie = name+"="+value+expires+"; path=/";
9
- }
10
-
11
- function removeMessageBoxForever() {
12
- jQuery('#darkbackground').remove();
13
- jQuery(this).parents(popover.messagebox).remove();
14
- createCookie('popover_never_view', 'hidealways', 365);
15
- return false;
16
- }
17
-
18
- function removeMessageBox() {
19
- jQuery('#darkbackground').remove();
20
- jQuery(this).parents(popover.messagebox).remove();
21
- return false;
22
- }
23
-
24
- function showMessageBox() {
25
- jQuery(popover.messagebox).css('visibility', 'visible');
26
- jQuery('#darkbackground').css('visibility', 'visible');
27
- }
28
-
29
- function newShowMessageBox() {
30
-
31
-
32
-
33
- }
34
-
35
- function boardReady() {
36
- jQuery('#clearforever').click(removeMessageBoxForever);
37
- jQuery('#closebox').click(removeMessageBox);
38
-
39
- jQuery('#message').hover( function() {jQuery('.claimbutton').removeClass('hide');}, function() {jQuery('.claimbutton').addClass('hide');});
40
-
41
- window.setTimeout( showMessageBox, popover.messagedelay );
42
-
43
- }
44
-
45
- jQuery(window).load(boardReady);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
popoverincludes/js/popover.min.js DELETED
@@ -1,6 +0,0 @@
1
- function createCookie(name,value,days){if(days){var date=new Date();date.setTime(date.getTime()+(days*24*60*60*1000));var expires="; expires="+date.toGMTString();}
2
- else var expires="";document.cookie=name+"="+value+expires+"; path=/";}
3
- function removeMessageBoxForever(){jQuery(this).parents('#messagebox').removeClass('visiblebox').addClass('hiddenbox');createCookie('popover_never_view','hidealways',365);return false;}
4
- function removeMessageBox(){jQuery(this).parent('#messagebox').removeClass('visiblebox').addClass('hiddenbox');return false;}
5
- function boardReady(){jQuery('#clearforever').click(removeMessageBoxForever);jQuery('#closebox').click(removeMessageBox);jQuery('#message').hover(function(){jQuery('.claimbutton').removeClass('hide');},function(){jQuery('.claimbutton').addClass('hide');});jQuery('#messagebox').css('visibility','visible');}
6
- jQuery(window).load(boardReady);
 
 
 
 
 
 
popoverincludes/js/popoverlegacy.js ADDED
@@ -0,0 +1,79 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ //
2
+ // Legacy Javascript file to selectively load the WPMUDEV Pop Up
3
+ //
4
+ // Written by Barry (Incsub)
5
+ //
6
+
7
+ // Enable us to get some cookie information - from http://stackoverflow.com/questions/5639346/shortest-function-for-reading-a-cookie-in-javascript
8
+ function po_get_cookie(name) {
9
+
10
+ var nameEQ = name + "=";
11
+ var ca = document.cookie.split(';');
12
+ for(var i=0;i < ca.length;i++) {
13
+ var c = ca[i];
14
+ while (c.charAt(0)==' ') c = c.substring(1,c.length);
15
+ if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
16
+ }
17
+ return null;
18
+ }
19
+
20
+ function po_createCookie(name,value,days) {
21
+ if (days) {
22
+ var date = new Date();
23
+ date.setTime(date.getTime()+(days*24*60*60*1000));
24
+ var expires = "; expires="+date.toGMTString();
25
+ }
26
+ else var expires = "";
27
+ document.cookie = name+"="+value+expires+"; path=/";
28
+ }
29
+
30
+ function po_removeMessageBoxForever() {
31
+ jQuery('#darkbackground').remove();
32
+ jQuery(this).parents( '#' + popover.divname ).remove();
33
+ po_createCookie('popover_never_view', 'hidealways', 365);
34
+ return false;
35
+ }
36
+
37
+ function po_removeMessageBox() {
38
+ jQuery('#darkbackground').remove();
39
+ jQuery(this).parents( '#' + popover.divname ).remove();
40
+ return false;
41
+ }
42
+
43
+ function po_loadMessageBox( ) {
44
+
45
+ if( popover.usejs == 'yes' ) {
46
+
47
+ jQuery('#' + popover.divname ).width(jQuery('#message').width());
48
+ jQuery('#' + popover.divname ).height(jQuery('#message').height());
49
+
50
+ jQuery('#' + popover.divname ).css('top', (jQuery(window).height() / 2) - (jQuery('#message').height() / 2) );
51
+ jQuery('#' + popover.divname).css('left', (jQuery(window).width() / 2) - (jQuery('#message').width() / 2) );
52
+ }
53
+
54
+ jQuery('#' + popover.divname ).css('visibility', 'visible');
55
+ jQuery('#darkbackground').css('visibility', 'visible');
56
+
57
+ jQuery('#clearforever').click(po_removeMessageBoxForever);
58
+ jQuery('#closebox').click(po_removeMessageBox);
59
+
60
+ jQuery('#message').hover( function() {jQuery('.claimbutton').removeClass('hide');}, function() {jQuery('.claimbutton').addClass('hide');});
61
+
62
+ }
63
+
64
+ function po_load_popover() {
65
+
66
+ window.setTimeout( po_loadMessageBox, popover.delay );
67
+
68
+ }
69
+
70
+
71
+ // The main function
72
+ function po_selectiveLoad() {
73
+
74
+ po_load_popover();
75
+
76
+ }
77
+
78
+ // Call when the page is fully loaded
79
+ jQuery(window).load(po_selectiveLoad);
popoverincludes/js/popoversizing.min.js DELETED
@@ -1,2 +0,0 @@
1
- function sizeReady(){jQuery('#messagebox').width(jQuery('#message').width());jQuery('#messagebox').height(jQuery('#message').height());jQuery('#messagebox').css('top',(jQuery(window).height()/2)-(jQuery('#message').height()/2));jQuery('#messagebox').css('left',(jQuery(window).width()/2)-(jQuery('#message').width()/2));}
2
- jQuery(window).load(sizeReady);
 
 
popoverincludes/languages/popover.mo DELETED
Binary file
readme.txt CHANGED
@@ -2,10 +2,10 @@
2
  Contributors: WPMUDEV
3
  Tags: buddypress, wpmu, wpmu plugin, buddypress plugin, making money, seo, Advertising, multisite, Advertising
4
  Requires at least: 3.1
5
- Tested up to: 3.3.2
6
- Stable tag: 4.3.2
7
 
8
- Allows you to display a fancy popup (powered as a popover!) to visitors sitewide or per blog, a *very* effective way of advertising a mailing list, special offer or running a plain old ad.
9
 
10
  == Description ==
11
 
2
  Contributors: WPMUDEV
3
  Tags: buddypress, wpmu, wpmu plugin, buddypress plugin, making money, seo, Advertising, multisite, Advertising
4
  Requires at least: 3.1
5
+ Tested up to: 3.5.1
6
+ Stable tag: 4.4.4
7
 
8
+ Allows you to display a fancy popup to visitors, a *very* effective way of advertising a mailing list, special offer or running a plain old ad.
9
 
10
  == Description ==
11