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

Version Description

  • Initial release
Download this release

Release Info

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

Version 3.0

license.txt ADDED
@@ -0,0 +1,281 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ GNU GENERAL PUBLIC LICENSE
2
+ Version 2, June 1991
3
+
4
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.
5
+ 51 Franklin St, Fifth Floor, Boston, MA 02110, USA
6
+
7
+ Everyone is permitted to copy and distribute verbatim copies
8
+ of this license document, but changing it is not allowed.
9
+
10
+ Preamble
11
+
12
+ The licenses for most software are designed to take away your
13
+ freedom to share and change it. By contrast, the GNU General Public
14
+ License is intended to guarantee your freedom to share and change free
15
+ software--to make sure the software is free for all its users. This
16
+ General Public License applies to most of the Free Software
17
+ Foundation's software and to any other program whose authors commit to
18
+ using it. (Some other Free Software Foundation software is covered by
19
+ the GNU Library General Public License instead.) You can apply it to
20
+ your programs, too.
21
+
22
+ When we speak of free software, we are referring to freedom, not
23
+ price. Our General Public Licenses are designed to make sure that you
24
+ have the freedom to distribute copies of free software (and charge for
25
+ this service if you wish), that you receive source code or can get it
26
+ if you want it, that you can change the software or use pieces of it
27
+ in new free programs; and that you know you can do these things.
28
+
29
+ To protect your rights, we need to make restrictions that forbid
30
+ anyone to deny you these rights or to ask you to surrender the rights.
31
+ These restrictions translate to certain responsibilities for you if you
32
+ distribute copies of the software, or if you modify it.
33
+
34
+ For example, if you distribute copies of such a program, whether
35
+ gratis or for a fee, you must give the recipients all the rights that
36
+ you have. You must make sure that they, too, receive or can get the
37
+ source code. And you must show them these terms so they know their
38
+ rights.
39
+
40
+ We protect your rights with two steps: (1) copyright the software, and
41
+ (2) offer you this license which gives you legal permission to copy,
42
+ distribute and/or modify the software.
43
+
44
+ Also, for each author's protection and ours, we want to make certain
45
+ that everyone understands that there is no warranty for this free
46
+ software. If the software is modified by someone else and passed on, we
47
+ want its recipients to know that what they have is not the original, so
48
+ that any problems introduced by others will not reflect on the original
49
+ authors' reputations.
50
+
51
+ Finally, any free program is threatened constantly by software
52
+ patents. We wish to avoid the danger that redistributors of a free
53
+ program will individually obtain patent licenses, in effect making the
54
+ program proprietary. To prevent this, we have made it clear that any
55
+ patent must be licensed for everyone's free use or not licensed at all.
56
+
57
+ The precise terms and conditions for copying, distribution and
58
+ modification follow.
59
+
60
+ GNU GENERAL PUBLIC LICENSE
61
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
62
+
63
+ 0. This License applies to any program or other work which contains
64
+ a notice placed by the copyright holder saying it may be distributed
65
+ under the terms of this General Public License. The "Program", below,
66
+ refers to any such program or work, and a "work based on the Program"
67
+ means either the Program or any derivative work under copyright law:
68
+ that is to say, a work containing the Program or a portion of it,
69
+ either verbatim or with modifications and/or translated into another
70
+ language. (Hereinafter, translation is included without limitation in
71
+ the term "modification".) Each licensee is addressed as "you".
72
+
73
+ Activities other than copying, distribution and modification are not
74
+ covered by this License; they are outside its scope. The act of
75
+ running the Program is not restricted, and the output from the Program
76
+ is covered only if its contents constitute a work based on the
77
+ Program (independent of having been made by running the Program).
78
+ Whether that is true depends on what the Program does.
79
+
80
+ 1. You may copy and distribute verbatim copies of the Program's
81
+ source code as you receive it, in any medium, provided that you
82
+ conspicuously and appropriately publish on each copy an appropriate
83
+ copyright notice and disclaimer of warranty; keep intact all the
84
+ notices that refer to this License and to the absence of any warranty;
85
+ and give any other recipients of the Program a copy of this License
86
+ along with the Program.
87
+
88
+ You may charge a fee for the physical act of transferring a copy, and
89
+ you may at your option offer warranty protection in exchange for a fee.
90
+
91
+ 2. You may modify your copy or copies of the Program or any portion
92
+ of it, thus forming a work based on the Program, and copy and
93
+ distribute such modifications or work under the terms of Section 1
94
+ above, provided that you also meet all of these conditions:
95
+
96
+ a) You must cause the modified files to carry prominent notices
97
+ stating that you changed the files and the date of any change.
98
+
99
+ b) You must cause any work that you distribute or publish, that in
100
+ whole or in part contains or is derived from the Program or any
101
+ part thereof, to be licensed as a whole at no charge to all third
102
+ parties under the terms of this License.
103
+
104
+ c) If the modified program normally reads commands interactively
105
+ when run, you must cause it, when started running for such
106
+ interactive use in the most ordinary way, to print or display an
107
+ announcement including an appropriate copyright notice and a
108
+ notice that there is no warranty (or else, saying that you provide
109
+ a warranty) and that users may redistribute the program under
110
+ these conditions, and telling the user how to view a copy of this
111
+ License. (Exception: if the Program itself is interactive but
112
+ does not normally print such an announcement, your work based on
113
+ the Program is not required to print an announcement.)
114
+
115
+ These requirements apply to the modified work as a whole. If
116
+ identifiable sections of that work are not derived from the Program,
117
+ and can be reasonably considered independent and separate works in
118
+ themselves, then this License, and its terms, do not apply to those
119
+ sections when you distribute them as separate works. But when you
120
+ distribute the same sections as part of a whole which is a work based
121
+ on the Program, the distribution of the whole must be on the terms of
122
+ this License, whose permissions for other licensees extend to the
123
+ entire whole, and thus to each and every part regardless of who wrote it.
124
+ Thus, it is not the intent of this section to claim rights or contest
125
+ your rights to work written entirely by you; rather, the intent is to
126
+ exercise the right to control the distribution of derivative or
127
+ collective works based on the Program.
128
+
129
+ In addition, mere aggregation of another work not based on the Program
130
+ with the Program (or with a work based on the Program) on a volume of
131
+ a storage or distribution medium does not bring the other work under
132
+ the scope of this License.
133
+
134
+ 3. You may copy and distribute the Program (or a work based on it,
135
+ under Section 2) in object code or executable form under the terms of
136
+ Sections 1 and 2 above provided that you also do one of the following:
137
+
138
+ a) Accompany it with the complete corresponding machine-readable
139
+ source code, which must be distributed under the terms of Sections
140
+ 1 and 2 above on a medium customarily used for software interchange; or,
141
+
142
+ b) Accompany it with a written offer, valid for at least three
143
+ years, to give any third party, for a charge no more than your
144
+ cost of physically performing source distribution, a complete
145
+ machine-readable copy of the corresponding source code, to be
146
+ distributed under the terms of Sections 1 and 2 above on a medium
147
+ customarily used for software interchange; or,
148
+
149
+ c) Accompany it with the information you received as to the offer
150
+ to distribute corresponding source code. (This alternative is
151
+ allowed only for noncommercial distribution and only if you
152
+ received the program in object code or executable form with such
153
+ an offer, in accord with Subsection b above.)
154
+
155
+ The source code for a work means the preferred form of the work for
156
+ making modifications to it. For an executable work, complete source
157
+ code means all the source code for all modules it contains, plus any
158
+ associated interface definition files, plus the scripts used to
159
+ control compilation and installation of the executable. However, as a
160
+ special exception, the source code distributed need not include
161
+ anything that is normally distributed (in either source or binary
162
+ form) with the major components (compiler, kernel, and so on) of the
163
+ operating system on which the executable runs, unless that component
164
+ itself accompanies the executable.
165
+
166
+ If distribution of executable or object code is made by offering
167
+ access to copy from a designated place, then offering equivalent
168
+ access to copy the source code from the same place counts as
169
+ distribution of the source code, even though third parties are not
170
+ compelled to copy the source along with the object code.
171
+
172
+ 4. You may not copy, modify, sublicense, or distribute the Program
173
+ except as expressly provided under this License. Any attempt
174
+ otherwise to copy, modify, sublicense or distribute the Program is
175
+ void, and will automatically terminate your rights under this License.
176
+ However, parties who have received copies, or rights, from you under
177
+ this License will not have their licenses terminated so long as such
178
+ parties remain in full compliance.
179
+
180
+ 5. You are not required to accept this License, since you have not
181
+ signed it. However, nothing else grants you permission to modify or
182
+ distribute the Program or its derivative works. These actions are
183
+ prohibited by law if you do not accept this License. Therefore, by
184
+ modifying or distributing the Program (or any work based on the
185
+ Program), you indicate your acceptance of this License to do so, and
186
+ all its terms and conditions for copying, distributing or modifying
187
+ the Program or works based on it.
188
+
189
+ 6. Each time you redistribute the Program (or any work based on the
190
+ Program), the recipient automatically receives a license from the
191
+ original licensor to copy, distribute or modify the Program subject to
192
+ these terms and conditions. You may not impose any further
193
+ restrictions on the recipients' exercise of the rights granted herein.
194
+ You are not responsible for enforcing compliance by third parties to
195
+ this License.
196
+
197
+ 7. If, as a consequence of a court judgment or allegation of patent
198
+ infringement or for any other reason (not limited to patent issues),
199
+ conditions are imposed on you (whether by court order, agreement or
200
+ otherwise) that contradict the conditions of this License, they do not
201
+ excuse you from the conditions of this License. If you cannot
202
+ distribute so as to satisfy simultaneously your obligations under this
203
+ License and any other pertinent obligations, then as a consequence you
204
+ may not distribute the Program at all. For example, if a patent
205
+ license would not permit royalty-free redistribution of the Program by
206
+ all those who receive copies directly or indirectly through you, then
207
+ the only way you could satisfy both it and this License would be to
208
+ refrain entirely from distribution of the Program.
209
+
210
+ If any portion of this section is held invalid or unenforceable under
211
+ any particular circumstance, the balance of the section is intended to
212
+ apply and the section as a whole is intended to apply in other
213
+ circumstances.
214
+
215
+ It is not the purpose of this section to induce you to infringe any
216
+ patents or other property right claims or to contest validity of any
217
+ such claims; this section has the sole purpose of protecting the
218
+ integrity of the free software distribution system, which is
219
+ implemented by public license practices. Many people have made
220
+ generous contributions to the wide range of software distributed
221
+ through that system in reliance on consistent application of that
222
+ system; it is up to the author/donor to decide if he or she is willing
223
+ to distribute software through any other system and a licensee cannot
224
+ impose that choice.
225
+
226
+ This section is intended to make thoroughly clear what is believed to
227
+ be a consequence of the rest of this License.
228
+
229
+ 8. If the distribution and/or use of the Program is restricted in
230
+ certain countries either by patents or by copyrighted interfaces, the
231
+ original copyright holder who places the Program under this License
232
+ may add an explicit geographical distribution limitation excluding
233
+ those countries, so that distribution is permitted only in or among
234
+ countries not thus excluded. In such case, this License incorporates
235
+ the limitation as if written in the body of this License.
236
+
237
+ 9. The Free Software Foundation may publish revised and/or new versions
238
+ of the General Public License from time to time. Such new versions will
239
+ be similar in spirit to the present version, but may differ in detail to
240
+ address new problems or concerns.
241
+
242
+ Each version is given a distinguishing version number. If the Program
243
+ specifies a version number of this License which applies to it and "any
244
+ later version", you have the option of following the terms and conditions
245
+ either of that version or of any later version published by the Free
246
+ Software Foundation. If the Program does not specify a version number of
247
+ this License, you may choose any version ever published by the Free Software
248
+ Foundation.
249
+
250
+ 10. If you wish to incorporate parts of the Program into other free
251
+ programs whose distribution conditions are different, write to the author
252
+ to ask for permission. For software which is copyrighted by the Free
253
+ Software Foundation, write to the Free Software Foundation; we sometimes
254
+ make exceptions for this. Our decision will be guided by the two goals
255
+ of preserving the free status of all derivatives of our free software and
256
+ of promoting the sharing and reuse of software generally.
257
+
258
+ NO WARRANTY
259
+
260
+ 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
261
+ FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
262
+ OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
263
+ PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
264
+ OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
265
+ MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
266
+ TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
267
+ PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
268
+ REPAIR OR CORRECTION.
269
+
270
+ 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
271
+ WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
272
+ REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
273
+ INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
274
+ OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
275
+ TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
276
+ YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
277
+ PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
278
+ POSSIBILITY OF SUCH DAMAGES.
279
+
280
+ END OF TERMS AND CONDITIONS
281
+
popover.php ADDED
@@ -0,0 +1,49 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ Plugin Name: WordPress Popup plugin
4
+ Plugin URI: http://premium.wpmudev.org
5
+ Description: This plugin adds a customisable popover to a site. The content, size, position can be changed and rules determining if the popup should show or not.
6
+ Author: Barry (Incsub)
7
+ Version: 3.0
8
+ Author URI: http://caffeinatedb.com
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
15
+ the Free Software Foundation; either version 2 of the License, or
16
+ (at your option) any later version.
17
+
18
+ This program is distributed in the hope that it will be useful,
19
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
20
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21
+ GNU General Public License for more details.
22
+
23
+ You should have received a copy of the GNU General Public License
24
+ along with this program; if not, write to the Free Software
25
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
26
+
27
+ */
28
+
29
+ // a true setting for PO_GLOBAL means that this plugin operates on a global site-admin basis
30
+ // commenting out this line means that the plugin operates on a blog by blog basis
31
+ define('PO_GLOBAL',true);
32
+
33
+ require_once('popoverincludes/classes/functions.php');
34
+ // Set up my location
35
+ set_popover_url(__FILE__);
36
+ set_popover_dir(__FILE__);
37
+
38
+ if(is_admin()) {
39
+ require_once('popoverincludes/classes/popoveradmin.php');
40
+
41
+ $popover =& new popoveradmin();
42
+ } else {
43
+ require_once('popoverincludes/classes/popoverpublic.php');
44
+
45
+ $popover =& new popoverpublic();
46
+ }
47
+
48
+
49
+ ?>
popoverincludes/classes/functions.php ADDED
@@ -0,0 +1,48 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 . '/popover/' . basename($base))) {
10
+ $popover_url = trailingslashit(WP_PLUGIN_URL . '/popover');
11
+ } else {
12
+ $popover_url = trailingslashit(WP_PLUGIN_URL . '/popover');
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 . '/popover/' . basename($base))) {
24
+ $popover_dir = trailingslashit(WP_PLUGIN_DIR . '/popover');
25
+ } else {
26
+ $popover_dir = trailingslashit(WP_PLUGIN_DIR . '/popover');
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 ADDED
@@ -0,0 +1,794 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ if(!class_exists('popoveradmin')) {
4
+
5
+ class popoveradmin {
6
+
7
+ var $build = 3;
8
+
9
+ var $db;
10
+
11
+ function __construct() {
12
+
13
+ global $wpdb;
14
+
15
+ $this->db =& $wpdb;
16
+
17
+ add_action( 'admin_menu', array(&$this, 'add_menu_pages' ) );
18
+ add_action( 'network_admin_menu', array(&$this, 'add_menu_pages' ) );
19
+
20
+ add_action( 'plugins_loaded', array(&$this, 'load_textdomain'));
21
+
22
+ // Add header files
23
+ add_action('load-settings_page_popoverssadmin', array(&$this, 'add_admin_header_popover'));
24
+ add_action('load-tools_page_popoverssadmin', array(&$this, 'add_admin_header_popover'));
25
+ }
26
+
27
+ function popoveradmin() {
28
+ $this->__construct();
29
+ }
30
+
31
+ function load_textdomain() {
32
+
33
+ $locale = apply_filters( 'popover_locale', get_locale() );
34
+ $mofile = popover_dir( "popoverincludes/languages/popover-$locale.mo" );
35
+
36
+ if ( file_exists( $mofile ) )
37
+ load_textdomain( 'popover', $mofile );
38
+
39
+ }
40
+
41
+ function add_menu_pages() {
42
+ if(is_multisite() && defined('PO_GLOBAL')) {
43
+ if(function_exists('is_network_admin') && is_network_admin()) {
44
+ // On 3.1 and in the network admin area.
45
+ add_submenu_page('settings.php', __('Pop Overs','popover'), __('Pop Overs','popover'), 'manage_options', 'popoverssadmin', array(&$this,'handle_admin_panel'));
46
+ } else {
47
+ // Not on 3.1
48
+ add_submenu_page('ms-admin.php', __('Pop Overs','popover'), __('Pop Overs','popover'), 'manage_options', 'popoverssadmin', array(&$this,'handle_admin_panel'));
49
+ }
50
+ } else {
51
+ add_submenu_page('options-general.php', __('Pop Overs','popover'), __('Pop Overs','popover'), 'manage_options', 'popoverssadmin', array(&$this,'handle_admin_panel'));
52
+ }
53
+
54
+ }
55
+
56
+ function sanitise_array($arrayin) {
57
+
58
+ foreach($arrayin as $key => $value) {
59
+ $arrayin[$key] = htmlentities(stripslashes($value) ,ENT_QUOTES, 'UTF-8');
60
+ }
61
+
62
+ return $arrayin;
63
+ }
64
+
65
+ function update_admin_header_popover() {
66
+
67
+ global $action, $page, $allowedposttags;
68
+
69
+ wp_reset_vars( array('action', 'page') );
70
+
71
+ if($action == 'updated') {
72
+ check_admin_referer('update-popover');
73
+
74
+ $usemsg = 1;
75
+
76
+ if(function_exists('get_site_option') && defined('PO_GLOBAL')) {
77
+ $updateoption = 'update_site_option';
78
+ $getoption = 'get_site_option';
79
+ } else {
80
+ $updateoption = 'update_option';
81
+ $getoption = 'get_option';
82
+ }
83
+
84
+ if(isset($_POST['popovercontent'])) {
85
+ if ( !current_user_can('unfiltered_html') ) {
86
+ if(wp_kses($_POST['popovercontent'], $allowedposttags) != $_POST['popovercontent']) {
87
+ $usemsg = 2;
88
+ }
89
+ $updateoption('popover_content', wp_kses($_POST['popovercontent'], $allowedposttags));
90
+ } else {
91
+ $updateoption('popover_content', $_POST['popovercontent']);
92
+ }
93
+
94
+ }
95
+
96
+ if(isset($_POST['popoverwidth']) || isset($_POST['popoverheight'])) {
97
+
98
+ $width = $_POST['popoverwidth'];
99
+ $height = $_POST['popoverheight'];
100
+
101
+ if($width == '') $width = '500px';
102
+ if($height == '') $height = '200px';
103
+
104
+ $updateoption('popover_size', array("width" => $width, "height" => $height));
105
+ }
106
+
107
+ if(isset($_POST['popoverleft']) || isset($_POST['popovertop'])) {
108
+
109
+ $left = $_POST['popoverleft'];
110
+ $top = $_POST['popovertop'];
111
+
112
+ if($left == '') $left = '100px';
113
+ if($top == '') $top = '100px';
114
+
115
+ $updateoption('popover_location', array("left" => $left, "top" => $top));
116
+ }
117
+
118
+ if(isset($_POST['popovermargintop']) || isset($_POST['popovermarginleft']) || isset($_POST['popovermarginright']) || isset($_POST['popovermarginbottom'])) {
119
+
120
+ $mleft = $_POST['popovermarginleft'];
121
+ $mtop = $_POST['popovermargintop'];
122
+ $mright = $_POST['popovermarginright'];
123
+ $mbottom = $_POST['popovermarginbottom'];
124
+
125
+ if($mleft == '') $mleft = '0px';
126
+ if($mtop == '') $mtop = '0px';
127
+ if($mright == '') $mright = '0px';
128
+ if($mbottom == '') $mbottom = '0px';
129
+
130
+ $updateoption('popover_margin', array('left' => $mleft, 'top' => $mtop, 'right' => $mright, 'bottom' => $mbottom));
131
+
132
+ }
133
+
134
+ if(isset($_POST['popoverbackground']) || isset($_POST['popoverforeground'])) {
135
+
136
+ $back = $_POST['popoverbackground'];
137
+ $fore = $_POST['popoverforeground'];
138
+
139
+ if($back == '') $back = 'FFFFFF';
140
+ if($fore == '') $fore = '000000';
141
+
142
+ $updateoption('popover_colour', array("back" => $back, "fore" => $fore));
143
+ }
144
+
145
+ if(isset($_POST['popovercheck'])) {
146
+
147
+ $updateoption('popover_check', $_POST['popovercheck']);
148
+
149
+ if(isset($_POST['popoverereg'])) {
150
+ $updateoption('popover_ereg', $_POST['popoverereg']);
151
+ }
152
+
153
+ if(isset($_POST['popovercount'])) {
154
+ $updateoption('popover_count', intval($_POST['popovercount']) );
155
+ }
156
+
157
+ }
158
+
159
+ if(isset($_POST['popoverusejs'])) {
160
+ $updateoption('popover_usejs', 'yes' );
161
+ } else {
162
+ $updateoption('popover_usejs', 'no' );
163
+ }
164
+
165
+ wp_safe_redirect( add_query_arg( array('msg' => $usemsg), wp_get_referer() ) );
166
+
167
+ }
168
+
169
+ }
170
+
171
+ function add_admin_header_popover() {
172
+
173
+ wp_enqueue_script('popoveradminjs', popover_url('popoverincludes/js/popoveradmin.js'), array( 'jquery-ui-sortable', 'jquery-ui-draggable', 'jquery-ui-droppable' ), $this->build);
174
+ wp_enqueue_style('popoveradmincss', popover_url('popoverincludes/css/popoveradmin.css'), array('widgets'), $this->build);
175
+
176
+ $this->update_admin_header_popover();
177
+ }
178
+
179
+ function handle_admin_panel() {
180
+
181
+ global $page;
182
+
183
+ if(function_exists('get_site_option') && defined('PO_GLOBAL')) {
184
+ $updateoption = 'update_site_option';
185
+ $getoption = 'get_site_option';
186
+ } else {
187
+ $updateoption = 'update_option';
188
+ $getoption = 'get_option';
189
+ }
190
+
191
+ $popover_content = stripslashes($getoption('popover_content', ''));
192
+ $popover_size = $getoption('popover_size', array('width' => '500px', 'height' => '200px'));
193
+ $popover_location = $getoption('popover_location', array('left' => '100px', 'top' => '100px'));
194
+ $popover_colour = $getoption('popover_colour', array('back' => 'FFFFFF', 'fore' => '000000'));
195
+ $popover_margin = $getoption('popover_margin', array('left' => '0px', 'top' => '0px', 'right' => '0px', 'bottom' => '0px'));
196
+
197
+ $popover_size = $this->sanitise_array($popover_size);
198
+ $popover_location = $this->sanitise_array($popover_location);
199
+ $popover_colour = $this->sanitise_array($popover_colour);
200
+ $popover_margin = $this->sanitise_array($popover_margin);
201
+
202
+ $popover_check = $getoption('popover_check', array());
203
+ $popover_ereg = $getoption('popover_ereg', '');
204
+ $popover_count = $getoption('popover_count', '3');
205
+
206
+ $popover_usejs = $getoption('popover_usejs', 'no' );
207
+
208
+ $messages = array();
209
+
210
+ $messages[1] = __('Your settings have been saved.','popover');
211
+ $messages[2] = __('Your popover content has been modified by the built in filter, you need to allow unfiltered html.','popover');
212
+
213
+ ?>
214
+ <div class='wrap nosubsub'>
215
+ <div class="icon32" id="icon-themes"><br></div>
216
+ <h2><?php echo __('Pop Over content settings','popover'); ?></h2>
217
+
218
+
219
+
220
+ <div class='popover-liquid-left'>
221
+
222
+ <div id='popover-left'>
223
+ <form action='?page=<?php echo $page; ?>' name='popoveredit' method='post'>
224
+
225
+ <input type='hidden' name='beingdragged' id='beingdragged' value='' />
226
+
227
+ <input type='hidden' name='popovercheck[order]' id='in-positive-rules' value='<? echo esc_attr($popover_check['order']); ?>' />
228
+
229
+ <div id='edit-popover' class='popover-holder-wrap'>
230
+ <div class='sidebar-name no-movecursor'>
231
+ <h3><?php echo _e('Edit Popover settings','popover'); ?></h3>
232
+ </div>
233
+ <div class='popover-holder'>
234
+
235
+ <div class='popover-details'>
236
+
237
+ <?php
238
+ if ( isset($_GET['msg']) ) {
239
+ echo '<div id="upmessage" class="updatedmessage"><p>' . $messages[(int) $_GET['msg']];
240
+ echo '<a href="#close" id="closemessage">' . __('close', 'popover') . '</a>';
241
+ echo '</p></div>';
242
+ $_SERVER['REQUEST_URI'] = remove_query_arg(array('message'), $_SERVER['REQUEST_URI']);
243
+ }
244
+ ?>
245
+
246
+ <label for='popovercontent'><?php _e('Popover content','popover'); ?></label><br/>
247
+ <textarea name='popovercontent' id='popovercontent' style='width: 98%' rows='5' cols='10'><?php echo stripslashes($popover_content); ?></textarea>
248
+
249
+ </div>
250
+
251
+ <h3><?php _e('Active rules','popover'); ?></h3>
252
+ <p class='description'><?php _e('These are the rules that will determine if a popover should show when a visitor arrives at your website.','popover'); ?></p>
253
+ <div id='positive-rules-holder'>
254
+ <?php
255
+
256
+ $order = explode(',', $popover_check['order']);
257
+
258
+ foreach($order as $key) {
259
+
260
+ switch($key) {
261
+
262
+ case 'supporter': if( function_exists('is_supporter') ) $this->admin_main('supporter','Blog is not a supporter', 'Shows the popover if the blog is not a supporter.', true);
263
+ break;
264
+
265
+ case 'isloggedin': $this->admin_main('isloggedin','Visitor is logged in', 'Shows the popover if the user is logged in to your site.', true);
266
+ break;
267
+ 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);
268
+ break;
269
+ case 'commented': $this->admin_main('commented','Visitor has never commented', 'Shows the popover if the user has never left a comment.', true);
270
+ break;
271
+ case 'internal': $this->admin_main('internal','Visit not via an Internal link', 'Shows the popover if the user did not arrive on this page via another page on your site.', true);
272
+ break;
273
+ case 'count': $this->admin_viewcount('count','Popover shown less than', 'Shows the popover if the user has only seen it less than the following number of times:', $popover_count);
274
+ break;
275
+
276
+ }
277
+
278
+ }
279
+
280
+
281
+ ?>
282
+ </div>
283
+ <div id='positive-rules' class='droppable-rules popovers-sortable'>
284
+ <?php _e('Drop here','membership'); ?>
285
+ </div>
286
+
287
+
288
+ <h3><?php _e('Appearance settings','popover'); ?></h3>
289
+ <table class='form-table' style=''>
290
+ <tr>
291
+ <th valign='top' scope='row' style='width: 25%;'><strong><?php _e('Pop Over Size','popover'); ?></strong></th>
292
+ <td valign='top'>
293
+ <?php _e('Width:','popover'); ?>&nbsp;
294
+ <input type='text' name='popoverwidth' id='popoverwidth' style='width: 5em;' value='<?php echo $popover_size['width']; ?>' />&nbsp;
295
+ <?php _e('Height:','popover'); ?>&nbsp;
296
+ <input type='text' name='popoverheight' id='popoverheight' style='width: 5em;' value='<?php echo $popover_size['height']; ?>' />
297
+ </td>
298
+ </tr>
299
+
300
+ <tr>
301
+ <th valign='top' scope='row' style='width: 25%;'><strong><?php _e('Pop Over Position','popover'); ?></strong></th>
302
+ <td valign='top'>
303
+ <?php _e('Left:','popover'); ?>&nbsp;
304
+ <input type='text' name='popoverleft' id='popoverleft' style='width: 5em;' value='<?php echo $popover_location['left']; ?>' />&nbsp;
305
+ <?php _e('Top:','popover'); ?>&nbsp;
306
+ <input type='text' name='popovertop' id='popovertop' style='width: 5em;' value='<?php echo $popover_location['top']; ?>' />
307
+ </td>
308
+ </tr>
309
+
310
+ <tr>
311
+ <th valign='top' scope='row' style='width: 25%;'><strong><?php _e('Pop Over Margins','popover'); ?></strong></th>
312
+ <td valign='top'>
313
+ <?php _e('Left:','popover'); ?>&nbsp;
314
+ <input type='text' name='popovermarginleft' style='width: 5em;' value='<?php echo $popover_margin['left']; ?>' />&nbsp;
315
+ <?php _e('Right:','popover'); ?>&nbsp;
316
+ <input type='text' name='popovermarginright' style='width: 5em;' value='<?php echo $popover_margin['right']; ?>' /><br/>
317
+ <?php _e('Top:','popover'); ?>&nbsp;
318
+ <input type='text' name='popovermargintop' style='width: 5em;' value='<?php echo $popover_margin['top']; ?>' />&nbsp;
319
+ <?php _e('Bottom:','popover'); ?>&nbsp;
320
+ <input type='text' name='popovermarginbottom' style='width: 5em;' value='<?php echo $popover_margin['bottom']; ?>' />
321
+ </td>
322
+ </tr>
323
+
324
+ <tr>
325
+ <th valign='top' scope='row' style='width: 25%;'>&nbsp;</th>
326
+ <td valign='top'>
327
+ <?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'"; ?> />
328
+ </td>
329
+ </tr>
330
+
331
+ </table>
332
+ <table class='form-table'>
333
+
334
+ <tr>
335
+ <th valign='top' scope='row' style='width: 25%;'><strong><?php _e('Background Colour','popover'); ?></strong></th>
336
+ <td valign='top'>
337
+ <?php _e('Hex:','popover'); ?>&nbsp;#
338
+ <input type='text' name='popoverbackground' id='popoverbackground' style='width: 10em;' value='<?php echo $popover_colour['back']; ?>' />
339
+ </td>
340
+ </tr>
341
+
342
+ <tr>
343
+ <th valign='top' scope='row' style='width: 25%;'><strong><?php _e('Font Colour','popover'); ?></strong></th>
344
+ <td valign='top'>
345
+ <?php _e('Hex:','popover'); ?>&nbsp;#
346
+ <input type='text' name='popoverforeground' id='popoverforeground' style='width: 10em;' value='<?php echo $popover_colour['fore']; ?>' />
347
+ </td>
348
+ </tr>
349
+
350
+ </table>
351
+
352
+
353
+ <div class='buttons'>
354
+ <?php
355
+ wp_original_referer_field(true, 'previous'); wp_nonce_field('update-popover');
356
+ ?>
357
+ <input type='submit' value='<?php _e('Update', 'membership'); ?>' class='button' />
358
+ <input type='hidden' name='action' value='updated' />
359
+ </div>
360
+
361
+ </div>
362
+ </div>
363
+ </form>
364
+ </div>
365
+
366
+
367
+ <div id='hiden-actions'>
368
+ <?php
369
+
370
+ if(!isset($popover_check['supporter']) && function_exists('is_supporter')) {
371
+ $this->admin_main('supporter','Blog is not a supporter', 'Shows the popover if the blog is not a supporter.', true);
372
+ }
373
+
374
+ if(!isset($popover_check['isloggedin'])) {
375
+ $this->admin_main('isloggedin','Visitor is logged in', 'Shows the popover if the user is logged in to your site.', true);
376
+ }
377
+
378
+ if(!isset($popover_check['loggedin'])) {
379
+ $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);
380
+ }
381
+
382
+ if(!isset($popover_check['commented'])) {
383
+ $this->admin_main('commented','Visitor has never commented', 'Shows the popover if the user has never left a comment.', true);
384
+ }
385
+
386
+ if(!isset($popover_check['internal'])) {
387
+ $this->admin_main('internal','Visit not via an Internal link', 'Shows the popover if the user did not arrive on this page via another page on your site.', true);
388
+ }
389
+
390
+ //$popover_count
391
+ if(!isset($popover_check['count'])) {
392
+ $this->admin_viewcount('count','Popover shown less than', 'Shows the popover if the user has only seen it less than the following number of times:', $popover_count);
393
+ }
394
+
395
+ ?>
396
+ </div> <!-- hidden-actions -->
397
+
398
+ </div> <!-- popover-liquid-left -->
399
+
400
+ <div class='popover-liquid-right'>
401
+ <div class="popover-holder-wrap">
402
+
403
+ <div class="sidebar-name no-movecursor">
404
+ <h3><?php _e('Rules', 'popover'); ?></h3>
405
+ </div>
406
+ <div class="section-holder" id="sidebar-rules" style="min-height: 98px;">
407
+ <ul class='popovers popovers-draggable'>
408
+ <?php
409
+ if(isset($popover_check['supporter']) && function_exists('is_supporter')) {
410
+ $this->admin_sidebar('supporter','Blog is not a supporter', true);
411
+ } elseif(function_exists('is_supporter')) {
412
+ $this->admin_sidebar('supporter','Blog is not a supporter', false);
413
+ }
414
+
415
+
416
+ if(isset($popover_check['isloggedin'])) {
417
+ $this->admin_sidebar('isloggedin','Visitor is logged in', true);
418
+ } else {
419
+ $this->admin_sidebar('isloggedin','Visitor is logged in', false);
420
+ }
421
+
422
+ if(isset($popover_check['loggedin'])) {
423
+ $this->admin_sidebar('loggedin','Visitor is not logged in', true);
424
+ } else {
425
+ $this->admin_sidebar('loggedin','Visitor is not logged in', false);
426
+ }
427
+
428
+ if(isset($popover_check['commented'])) {
429
+ $this->admin_sidebar('commented','Visitor has never commented', true);
430
+ } else {
431
+ $this->admin_sidebar('commented','Visitor has never commented', false);
432
+ }
433
+
434
+ if(isset($popover_check['internal'])) {
435
+ $this->admin_sidebar('internal','Visit not via an Internal link', true);
436
+ } else {
437
+ $this->admin_sidebar('internal','Visit not via an Internal link', false);
438
+ }
439
+
440
+ //$popover_count
441
+ if(isset($popover_check['count'])) {
442
+ $this->admin_sidebar('count','Popover shown less than', true);
443
+ } else {
444
+ $this->admin_sidebar('count','Popover shown less than', false);
445
+ }
446
+
447
+ ?>
448
+ </ul>
449
+ </div>
450
+
451
+ </div> <!-- popover-holder-wrap -->
452
+
453
+ </div> <!-- popover-liquid-left -->
454
+
455
+ </div> <!-- wrap -->
456
+
457
+ <?php
458
+ }
459
+
460
+ function admin_sidebar($id, $title, $data = false) {
461
+ ?>
462
+ <li class='popover-draggable' id='<?php echo $id; ?>' <?php if($data === true) echo "style='display:none;'"; ?>>
463
+ <div class='action action-draggable'>
464
+ <div class='action-top'>
465
+ <?php _e($title,'popover'); ?>
466
+ </div>
467
+ </div>
468
+ </li>
469
+ <?php
470
+ }
471
+
472
+ function admin_main($id, $title, $message, $data = false) {
473
+ if(!$data) $data = array();
474
+ ?>
475
+ <div class='popover-operation' id='main-<?php echo $id; ?>'>
476
+ <h2 class='sidebar-name'><?php _e($title, 'popover');?><span><a href='#remove' class='removelink' id='remove-<?php echo $id; ?>' title='<?php _e("Remove $title tag from this rules area.",'popover'); ?>'><?php _e('Remove','popover'); ?></a></span></h2>
477
+ <div class='inner-operation'>
478
+ <p><? _e($message, 'popover'); ?></p>
479
+ <input type='hidden' name='popovercheck[<?php echo $id; ?>]' value='yes' />
480
+ </div>
481
+ </div>
482
+ <?php
483
+ }
484
+
485
+ function admin_referer($id, $title, $message, $data = false) {
486
+ if(!$data) $data = array();
487
+ ?>
488
+ <div class='popover-operation' id='main-<?php echo $id; ?>'>
489
+ <h2 class='sidebar-name'><?php _e($title, 'popover');?><span><a href='#remove' class='removelink' id='remove-<?php echo $id; ?>' title='<?php _e("Remove $title tag from this rules area.",'popover'); ?>'><?php _e('Remove','popover'); ?></a></span></h2>
490
+ <div class='inner-operation'>
491
+ <p><? _e($message, 'popover'); ?></p>
492
+ <input type='text' name='popoverereg' id='popoverereg' style='width: 10em;' value='<?php echo esc_html($data); ?>' />
493
+ <input type='hidden' name='popovercheck[<?php echo $id; ?>]' value='yes' />
494
+ </div>
495
+ </div>
496
+ <?php
497
+ }
498
+
499
+ function admin_viewcount($id, $title, $message, $data = false) {
500
+ if(!$data) $data = array();
501
+ ?>
502
+ <div class='popover-operation' id='main-<?php echo $id; ?>'>
503
+ <h2 class='sidebar-name'><?php _e($title, 'popover');?><span><a href='#remove' class='removelink' id='remove-<?php echo $id; ?>' title='<?php _e("Remove $title tag from this rules area.",'popover'); ?>'><?php _e('Remove','popover'); ?></a></span></h2>
504
+ <div class='inner-operation'>
505
+ <p><? _e($message, 'popover'); ?></p>
506
+ <input type='text' name='popovercount' id='popovercount' style='width: 2em;' value='<?php echo esc_html($data); ?>' />&nbsp;
507
+ <?php _e('times','popover'); ?>
508
+ <input type='hidden' name='popovercheck[<?php echo $id; ?>]' value='yes' />
509
+ </div>
510
+ </div>
511
+ <?php
512
+ }
513
+
514
+ function handle_admin_panelold() {
515
+
516
+ global $allowedposttags;
517
+
518
+ if(is_multisite() && defined('PO_GLOBAL')) {
519
+ $updateoption = 'update_site_option';
520
+ $getoption = 'get_site_option';
521
+ } else {
522
+ $updateoption = 'update_option';
523
+ $getoption = 'get_option';
524
+ }
525
+
526
+ if(isset($_POST['action']) && addslashes($_POST['action']) == 'updatepopover') {
527
+
528
+ //print_r($_POST);
529
+
530
+ if(isset($_POST['popovercontent'])) {
531
+ if(defined('PO_USEKSES')) {
532
+ $updateoption('popover_content', wp_kses($_POST['popovercontent'], $allowedposttags));
533
+ } else {
534
+ $updateoption('popover_content', $_POST['popovercontent']);
535
+ }
536
+
537
+ }
538
+
539
+ if(isset($_POST['popoverwidth']) || isset($_POST['popoverheight'])) {
540
+
541
+ $width = $_POST['popoverwidth'];
542
+ $height = $_POST['popoverheight'];
543
+
544
+ if($width == '') $width = '500px';
545
+ if($height == '') $height = '200px';
546
+
547
+ $updateoption('popover_size', array("width" => $width, "height" => $height));
548
+ }
549
+
550
+ if(isset($_POST['popoverleft']) || isset($_POST['popovertop'])) {
551
+
552
+ $left = $_POST['popoverleft'];
553
+ $top = $_POST['popovertop'];
554
+
555
+ if($left == '') $left = '100px';
556
+ if($top == '') $top = '100px';
557
+
558
+ $updateoption('popover_location', array("left" => $left, "top" => $top));
559
+ }
560
+
561
+ if(isset($_POST['popovermargintop']) || isset($_POST['popovermarginleft']) || isset($_POST['popovermarginright']) || isset($_POST['popovermarginbottom'])) {
562
+
563
+ $mleft = $_POST['popovermarginleft'];
564
+ $mtop = $_POST['popovermargintop'];
565
+ $mright = $_POST['popovermarginright'];
566
+ $mbottom = $_POST['popovermarginbottom'];
567
+
568
+ if($mleft == '') $mleft = '0px';
569
+ if($mtop == '') $mtop = '0px';
570
+ if($mright == '') $mright = '0px';
571
+ if($mbottom == '') $mbottom = '0px';
572
+
573
+ $updateoption('popover_margin', array('left' => $mleft, 'top' => $mtop, 'right' => $mright, 'bottom' => $mbottom));
574
+
575
+ }
576
+
577
+ if(isset($_POST['popoverbackground']) || isset($_POST['popoverforeground'])) {
578
+
579
+ $back = $_POST['popoverbackground'];
580
+ $fore = $_POST['popoverforeground'];
581
+
582
+ if($back == '') $back = 'FFFFFF';
583
+ if($fore == '') $fore = '000000';
584
+
585
+ $updateoption('popover_colour', array("back" => $back, "fore" => $fore));
586
+ }
587
+
588
+ if(isset($_POST['popovercheck'])) {
589
+
590
+ $updateoption('popover_check', $_POST['popovercheck']);
591
+
592
+ if(isset($_POST['popoverereg'])) {
593
+ $updateoption('popover_ereg', $_POST['popoverereg']);
594
+ }
595
+
596
+ if(isset($_POST['popovercount'])) {
597
+ $updateoption('popover_count', intval($_POST['popovercount']) );
598
+ }
599
+
600
+ }
601
+
602
+ if(isset($_POST['popoverusejs'])) {
603
+ $updateoption('popover_usejs', 'yes' );
604
+ } else {
605
+ $updateoption('popover_usejs', 'no' );
606
+ }
607
+
608
+ echo '<div id="message" class="updated fade"><p>' . __('Your settings have been saved.', 'popover') . '</p></div>';
609
+
610
+ }
611
+
612
+ $popover_content = stripslashes($getoption('popover_content', ''));
613
+ $popover_size = $getoption('popover_size', array('width' => '500px', 'height' => '200px'));
614
+ $popover_location = $getoption('popover_location', array('left' => '100px', 'top' => '100px'));
615
+ $popover_colour = $getoption('popover_colour', array('back' => 'FFFFFF', 'fore' => '000000'));
616
+ $popover_margin = $getoption('popover_margin', array('left' => '0px', 'top' => '0px', 'right' => '0px', 'bottom' => '0px'));
617
+
618
+ $popover_size = $this->sanitise_array($popover_size);
619
+ $popover_location = $this->sanitise_array($popover_location);
620
+ $popover_colour = $this->sanitise_array($popover_colour);
621
+ $popover_margin = $this->sanitise_array($popover_margin);
622
+
623
+ $popover_check = $getoption('popover_check', array());
624
+ $popover_ereg = $getoption('popover_ereg', '');
625
+ $popover_count = $getoption('popover_count', '3');
626
+
627
+ $popover_usejs = $getoption('popover_usejs', 'no' );
628
+
629
+ ?>
630
+
631
+ <div class='wrap'>
632
+
633
+ <form action='' method='post'>
634
+ <input type='hidden' name='action' value='updatepopover' />
635
+ <?php wp_nonce_field('updatepopover'); ?>
636
+
637
+ <h2><?php _e('Pop Over content settings','popover'); ?></h2>
638
+ <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>
639
+
640
+ <h3><?php _e('Pop Over content','popover'); ?></h3>
641
+ <p><?php _e('Enter the content for your pop over in the text area below. HTML is allowed.','popover'); ?></p>
642
+ <textarea name='popovercontent' id='popovercontent' style='width: 90%' rows='10' cols='10'><?php echo stripslashes($popover_content); ?></textarea>
643
+
644
+ <p class="submit">
645
+ <input class="button" type="submit" name="go" value="<?php _e('Update content', 'popover'); ?>" />
646
+ </p>
647
+
648
+ <h3><?php _e('Pop Over display settings','popover'); ?></h3>
649
+ <p><?php _e('Use the options below to determine the look, and display settings for the Pop Over.','popover'); ?></p>
650
+
651
+ <table class='form-table'>
652
+
653
+ <tr>
654
+ <td valign='top' width='49%'>
655
+ <h3><?php _e('Appearance Settings','popover'); ?></h3>
656
+
657
+ <table class='form-table' style='border: 1px solid #ccc; padding-top: 10px; padding-bottom: 10px; margin-bottom: 10px;'>
658
+ <tr>
659
+ <th valign='top' scope='row' style='width: 25%;'><?php _e('Pop Over Size','popover'); ?></th>
660
+ <td valign='top'>
661
+ <?php _e('Width:','popover'); ?>&nbsp;
662
+ <input type='text' name='popoverwidth' id='popoverwidth' style='width: 5em;' value='<?php echo $popover_size['width']; ?>' />&nbsp;
663
+ <?php _e('Height:','popover'); ?>&nbsp;
664
+ <input type='text' name='popoverheight' id='popoverheight' style='width: 5em;' value='<?php echo $popover_size['height']; ?>' />
665
+ </td>
666
+ </tr>
667
+
668
+ <tr>
669
+ <th valign='top' scope='row' style='width: 25%;'><?php _e('Pop Over Position','popover'); ?></th>
670
+ <td valign='top'>
671
+ <?php _e('Left:','popover'); ?>&nbsp;
672
+ <input type='text' name='popoverleft' id='popoverleft' style='width: 5em;' value='<?php echo $popover_location['left']; ?>' />&nbsp;
673
+ <?php _e('Top:','popover'); ?>&nbsp;
674
+ <input type='text' name='popovertop' id='popovertop' style='width: 5em;' value='<?php echo $popover_location['top']; ?>' />
675
+ </td>
676
+ </tr>
677
+
678
+ <tr>
679
+ <th valign='top' scope='row' style='width: 25%;'><?php _e('Pop Over Margins','popover'); ?></th>
680
+ <td valign='top'>
681
+ <?php _e('Left:','popover'); ?>&nbsp;
682
+ <input type='text' name='popovermarginleft' style='width: 5em;' value='<?php echo $popover_margin['left']; ?>' />&nbsp;
683
+ <?php _e('Right:','popover'); ?>&nbsp;
684
+ <input type='text' name='popovermarginright' style='width: 5em;' value='<?php echo $popover_margin['right']; ?>' /><br/>
685
+ <?php _e('Top:','popover'); ?>&nbsp;
686
+ <input type='text' name='popovermargintop' style='width: 5em;' value='<?php echo $popover_margin['top']; ?>' />&nbsp;
687
+ <?php _e('Bottom:','popover'); ?>&nbsp;
688
+ <input type='text' name='popovermarginbottom' style='width: 5em;' value='<?php echo $popover_margin['bottom']; ?>' />
689
+ </td>
690
+ </tr>
691
+
692
+ <tr>
693
+ <th valign='top' scope='row' style='width: 25%;'>&nbsp;</th>
694
+ <td valign='top'>
695
+ <?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'"; ?> />
696
+ </td>
697
+ </tr>
698
+
699
+ </table>
700
+ <table class='form-table'>
701
+
702
+
703
+
704
+ <tr>
705
+ <th valign='top' scope='row' style='width: 25%;'><?php _e('Background Colour','popover'); ?></th>
706
+ <td valign='top'>
707
+ <?php _e('Hex:','popover'); ?>&nbsp;#
708
+ <input type='text' name='popoverbackground' id='popoverbackground' style='width: 10em;' value='<?php echo $popover_colour['back']; ?>' />
709
+ </td>
710
+ </tr>
711
+
712
+ <tr>
713
+ <th valign='top' scope='row' style='width: 25%;'><?php _e('Font Colour','popover'); ?></th>
714
+ <td valign='top'>
715
+ <?php _e('Hex:','popover'); ?>&nbsp;#
716
+ <input type='text' name='popoverforeground' id='popoverforeground' style='width: 10em;' value='<?php echo $popover_colour['fore']; ?>' />
717
+ </td>
718
+ </tr>
719
+
720
+ </table>
721
+
722
+ </td>
723
+
724
+ <td valign='top' width='49%'>
725
+ <h3><?php _e('Display Rules','popover'); ?></h3>
726
+
727
+ <p><?php _e('Show the Pop Over if <strong>one</strong> of the following checked rules is true.','popover'); ?></p>
728
+ <input type='hidden' name='popovercheck[none]' value='none' />
729
+ <table class='form-table'>
730
+ <?php
731
+ if(function_exists('is_supporter')) {
732
+ ?>
733
+ <tr>
734
+ <td valign='middle' style='width: 5%;'>
735
+ <input type='checkbox' name='popovercheck[notsupporter]' <?php if(isset($popover_check['notsupporter'])) echo "checked='checked'"; ?> />
736
+ </td>
737
+ <th valign='bottom' scope='row'><?php _e('Visitor is not a supporter.','popover'); ?></th>
738
+ </tr>
739
+ <?php
740
+ }
741
+ ?>
742
+ <tr>
743
+ <td valign='middle' style='width: 5%;'>
744
+ <input type='checkbox' name='popovercheck[isloggedin]' <?php if(isset($popover_check['isloggedin'])) echo "checked='checked'"; ?> />
745
+ </td>
746
+ <th valign='bottom' scope='row'><?php _e('Visitor is logged in.','popover'); ?></th>
747
+ </tr>
748
+ <tr>
749
+ <td valign='middle' style='width: 5%;'>
750
+ <input type='checkbox' name='popovercheck[loggedin]' <?php if(isset($popover_check['loggedin'])) echo "checked='checked'"; ?> />
751
+ </td>
752
+ <th valign='bottom' scope='row'><?php _e('Visitor is not logged in.','popover'); ?></th>
753
+ </tr>
754
+ <tr>
755
+ <td valign='middle' style='width: 5%;'>
756
+ <input type='checkbox' name='popovercheck[commented]' <?php if(isset($popover_check['commented'])) echo "checked='checked'"; ?> />
757
+ </td>
758
+ <th valign='bottom' scope='row'><?php _e('Visitor has never commented here before.','popover'); ?></th>
759
+ </tr>
760
+
761
+ <tr>
762
+ <td valign='middle' style='width: 5%;'>
763
+ <input type='checkbox' name='popovercheck[internal]' <?php if(isset($popover_check['internal'])) echo "checked='checked'"; ?> />
764
+ </td>
765
+ <th valign='bottom' scope='row'><?php _e('Visitor did not come from an internal page.','popover'); ?></th>
766
+ </tr>
767
+
768
+ </table>
769
+
770
+ <p><?php _e('And the visitor has seen the pop over less than','popover'); ?>&nbsp;
771
+ <input type='text' name='popovercount' id='popovercount' style='width: 2em;' value='<?php echo htmlentities($popover_count,ENT_QUOTES, 'UTF-8'); ?>' />&nbsp;
772
+ <?php _e('times','popover'); ?></p>
773
+
774
+ </td>
775
+ </tr>
776
+
777
+ </table>
778
+
779
+ <p class="submit">
780
+ <input class="button" type="submit" name="goagain" value="<?php _e('Update settings', 'popover'); ?>" />
781
+ </p>
782
+
783
+ </form>
784
+
785
+ </div>
786
+
787
+ <?php
788
+ }
789
+
790
+ }
791
+
792
+ }
793
+
794
+ ?>
popoverincludes/classes/popoverpublic.php ADDED
@@ -0,0 +1,231 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ if(!class_exists('popoverpublic')) {
4
+
5
+ class popoverpublic {
6
+
7
+ var $mylocation = '';
8
+ var $build = 3;
9
+
10
+ function __construct() {
11
+
12
+ add_action('init', array(&$this, 'selective_message_display'), 1);
13
+ add_action('wp_footer', array(&$this, 'selective_message_display'));
14
+
15
+ add_action( 'plugins_loaded', array(&$this, 'load_textdomain'));
16
+
17
+ $directories = explode(DIRECTORY_SEPARATOR,dirname(__FILE__));
18
+ $this->mylocation = $directories[count($directories)-1];
19
+
20
+ }
21
+
22
+ function popoverpublic() {
23
+ $this->__construct();
24
+ }
25
+
26
+ function load_textdomain() {
27
+
28
+ $locale = apply_filters( 'popover_locale', get_locale() );
29
+ $mofile = popover_dir( "popoverincludes/languages/popover-$locale.mo" );
30
+
31
+ if ( file_exists( $mofile ) )
32
+ load_textdomain( 'popover', $mofile );
33
+
34
+ }
35
+
36
+ function selective_message_display() {
37
+
38
+ if(is_multisite() && defined('PO_GLOBAL')) {
39
+ $getoption = 'get_site_option';
40
+ } else {
41
+ $getoption = 'get_option';
42
+ }
43
+
44
+ $popover_check = $getoption('popover_check', array());
45
+
46
+ $show = false;
47
+
48
+ if(!empty($popover_check)) {
49
+
50
+ $order = explode(',', $popover_check['order']);
51
+
52
+ foreach($order as $key) {
53
+ switch ($key) {
54
+
55
+ case "supporter":
56
+ if(function_exists('is_supporter') && !is_supporter()) {
57
+ $show = true;
58
+ } else {
59
+ return false;
60
+ }
61
+ break;
62
+
63
+ case "loggedin": if(!$this->is_loggedin()) {
64
+ $show = true;
65
+ } else {
66
+ return false;
67
+ }
68
+ break;
69
+
70
+ case "isloggedin": if($this->is_loggedin()) {
71
+ $show = true;
72
+ } else {
73
+ return false;
74
+ }
75
+ break;
76
+
77
+ case "commented": if(!$this->has_commented()) {
78
+ $show = true;
79
+ } else {
80
+ return false;
81
+ }
82
+ break;
83
+
84
+ case "internal": $internal = str_replace('http://','',get_option('siteurl'));
85
+ if(!$this->referrer_matches(addcslashes($internal,"/"))) {
86
+ $show = true;
87
+ } else {
88
+ return false;
89
+ }
90
+ break;
91
+
92
+ case "count": $popover_count = $getoption('popover_count', '3');
93
+ if($this->has_reached_limit($popover_count)) {
94
+ return false;
95
+ }
96
+ break;
97
+
98
+ }
99
+ }
100
+ }
101
+
102
+ if($show == true) {
103
+
104
+ if($this->clear_forever()) {
105
+ $show = false;
106
+ }
107
+
108
+ }
109
+
110
+ if($show == true) {
111
+ // Show the advert
112
+ wp_enqueue_style('popovercss', popover_url('popoverincludes/css/popover.css'), array(), $this->build);
113
+ wp_enqueue_script('popoverjs', popover_url('popoverincludes/js/popover.js'), array('jquery'), $this->build);
114
+
115
+ if($getoption('popover_usejs', 'no') == 'yes') {
116
+ wp_enqueue_script('popoveroverridejs', popover_url('popoverincludes/js/popoversizing.js'), array('jquery'), $this->build);
117
+ }
118
+
119
+ add_action('wp_footer', array(&$this, 'page_footer'));
120
+ wp_enqueue_script('jquery');
121
+
122
+ // Add the cookie
123
+ if ( isset($_COOKIE['popover_view_'.COOKIEHASH]) ) {
124
+ $count = intval($_COOKIE['popover_view_'.COOKIEHASH]);
125
+ if(!is_numeric($count)) $count = 0;
126
+ $count++;
127
+ } else {
128
+ $count = 1;
129
+ }
130
+ if(!headers_sent()) setcookie('popover_view_'.COOKIEHASH, $count , time() + 30000000, COOKIEPATH, COOKIE_DOMAIN);
131
+ }
132
+
133
+ }
134
+
135
+ function sanitise_array($arrayin) {
136
+
137
+ foreach($arrayin as $key => $value) {
138
+ $arrayin[$key] = htmlentities(stripslashes($value) ,ENT_QUOTES, 'UTF-8');
139
+ }
140
+
141
+ return $arrayin;
142
+ }
143
+
144
+ function page_footer() {
145
+
146
+ if(is_multisite() && defined('PO_GLOBAL')) {
147
+ $getoption = 'get_site_option';
148
+ } else {
149
+ $getoption = 'get_option';
150
+ }
151
+
152
+ $content = stripslashes($getoption('popover_content', ''));
153
+
154
+ $popover_size = $getoption('popover_size', array('width' => '500px', 'height' => '200px'));
155
+ $popover_location = $getoption('popover_location', array('left' => '100px', 'top' => '100px'));
156
+ $popover_colour = $getoption('popover_colour', array('back' => 'FFFFFF', 'fore' => '000000'));
157
+ $popover_margin = $getoption('popover_margin', array('left' => '0px', 'top' => '0px', 'right' => '0px', 'bottom' => '0px'));
158
+
159
+ $popover_size = $this->sanitise_array($popover_size);
160
+ $popover_location = $this->sanitise_array($popover_location);
161
+ $popover_colour = $this->sanitise_array($popover_colour);
162
+ $popover_margin = $this->sanitise_array($popover_margin);
163
+
164
+ if($getoption('popover_usejs', 'no') == 'yes') {
165
+ $style = '';
166
+ $box = 'color: #' . $popover_colour['fore'] . '; background: #' . $popover_colour['back'] . ';';
167
+
168
+ } else {
169
+ $style = 'left: ' . $popover_location['left'] . '; top: ' . $popover_location['top'] . ';';
170
+ $style .= 'margin-top: ' . $popover_margin['top'] . '; margin-bottom: ' . $popover_margin['bottom'] . '; margin-right: ' . $popover_margin['right'] . '; margin-left: ' . $popover_margin['left'] . ';';
171
+
172
+ $box = 'width: ' . $popover_size['width'] . '; height: ' . $popover_size['height'] . '; color: #' . $popover_colour['fore'] . '; background: #' . $popover_colour['back'] . ';';
173
+
174
+ }
175
+
176
+
177
+ ?>
178
+ <div id='messagebox' class='visiblebox' style='<?php echo $style; ?>'>
179
+ <a href='' id='closebox' title='Close this box'></a>
180
+ <div id='message' style='<?php echo $box; ?>'>
181
+ <?php echo $content; ?>
182
+ <div class='clear'></div>
183
+ <div class='claimbutton hide'><a href='#' id='clearforever'><?php _e('Never see this message again.','popover'); ?></a></div>
184
+ </div>
185
+ <div class='clear'></div>
186
+ </div>
187
+ <?php
188
+ }
189
+
190
+ function is_ie()
191
+ {
192
+ if (isset($_SERVER['HTTP_USER_AGENT']) && (strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') !== false))
193
+ return true;
194
+ else
195
+ return false;
196
+ }
197
+
198
+ function is_loggedin() {
199
+ return is_user_logged_in();
200
+ }
201
+
202
+ function has_commented() {
203
+ if ( isset($_COOKIE['comment_author_'.COOKIEHASH]) ) {
204
+ return true;
205
+ } else {
206
+ return false;
207
+ }
208
+ }
209
+
210
+
211
+ function has_reached_limit($count = 3) {
212
+ if ( isset($_COOKIE['popover_view_'.COOKIEHASH]) && addslashes($_COOKIE['popover_view_'.COOKIEHASH]) >= $count ) {
213
+ return true;
214
+ } else {
215
+ return false;
216
+ }
217
+ }
218
+
219
+ function clear_forever() {
220
+ if ( isset($_COOKIE['popover_never_view']) ) {
221
+ return true;
222
+ } else {
223
+ return false;
224
+ }
225
+ }
226
+
227
+ }
228
+
229
+ }
230
+
231
+ ?>
popoverincludes/css/popover.css ADDED
@@ -0,0 +1,88 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ div#messagebox {
2
+ position: absolute;
3
+ background: transparent url(../images/opaque.png) repeat;
4
+ z-index: 999;
5
+ padding: 10px;
6
+ visibility: hidden;
7
+ }
8
+
9
+ div#messagebox div.claimbutton {
10
+ position: absolute;
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;
18
+ }
19
+
20
+ div#messagebox div.claimbutton a:visited, div#messagebox div.claimbutton a {
21
+ font-family: "Helvetica Neue", Arial, Helvetica, Geneva, sans-serif;
22
+ color: #FFF;
23
+ text-shadow: #000 1px 1px 0px;
24
+ font-weight: bold;
25
+ padding-right: 5px;
26
+ }
27
+
28
+ #message p {
29
+ position: relative;
30
+ clear: both;
31
+ }
32
+
33
+ #messagebox #closebox {
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;
41
+ }
42
+
43
+ div#message {
44
+ position: relative;
45
+ background: #fff;
46
+ font: 0.9em "Helvetica Neue", Arial, Helvetica, Geneva, sans-serif;
47
+ min-height: 90%;
48
+ overflow: hidden;
49
+ }
50
+
51
+ div#message.waiting {
52
+ background: #fff url(../images/loading.gif) no-repeat center center;
53
+ }
54
+
55
+ div#message h2 {
56
+ color: #000;
57
+ font: bold 1.3em "Helvetica Neue", Arial, Helvetica, Geneva, sans-serif;
58
+ margin-top: 0px;
59
+ }
60
+ div#message h2 a {
61
+ text-decoration: none;
62
+ color: #000;
63
+ }
64
+
65
+ div#message blockquote {
66
+ padding: 0px;
67
+ font-weight: bold;
68
+ border-left: 5px solid #ccc;
69
+ }
70
+
71
+ div#message blockquote p{
72
+ padding: 2px 5px;
73
+ }
74
+
75
+ div#message img {
76
+ }
77
+
78
+ div#messagebox.visiblebox {
79
+ display: block;
80
+ }
81
+ div#messagebox.hiddenbox {
82
+ display: none;
83
+ }
84
+ .hide { display: none; }
85
+
86
+ .clear {
87
+ clear: both;
88
+ }
popoverincludes/css/popover.min.css ADDED
@@ -0,0 +1,111 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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/css/popoveradmin.css ADDED
@@ -0,0 +1,293 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* @override http://dev.site/wp-content/plugins/popover/popoverincludes/css/popoveradmin.css?ver=2 */
2
+
3
+ div.popover-liquid-left {
4
+ float: left;
5
+ clear: left;
6
+ width: 100%;
7
+ margin-right: -325px;
8
+ }
9
+ div.popover-liquid-right {
10
+ float: right;
11
+ clear: right;
12
+ width: 300px;
13
+ }
14
+ #popover-left {
15
+ margin-left: 5px;
16
+ margin-right: 325px;
17
+ }
18
+ #popover-left #edit-popover {
19
+ background-color: transparent;
20
+ border: 0 none;
21
+ }
22
+ div.popover-holder-wrap {
23
+ padding: 0;
24
+ margin: 10px 0 20px;
25
+ }
26
+
27
+ .sidebar-name {
28
+ background-color: #aaa;
29
+ background-image: url(../images/ed-bg.gif);
30
+ text-shadow: #FFF 0 1px 0;
31
+ border-color: #dfdfdf;
32
+ -moz-border-radius-topleft: 8px;
33
+ -moz-border-radius-topright: 8px;
34
+ -webkit-border-top-right-radius: 8px;
35
+ -webkit-border-top-left-radius: 8px;
36
+ -khtml-border-top-right-radius: 8px;
37
+ -khtml-border-top-left-radius: 8px;
38
+ border-top-right-radius: 8px;
39
+ border-top-left-radius: 8px;
40
+ }
41
+
42
+ .sidebar-name:hover {
43
+ color: #333 !Important;
44
+ cursor: move;
45
+ }
46
+
47
+ p.description {
48
+ margin: 0 12px 12px;
49
+ }
50
+
51
+ .section-holder {
52
+ border-width: 0 1px 1px;
53
+ border-style: none solid solid;
54
+ -moz-border-radius-bottomleft: 8px;
55
+ -moz-border-radius-bottomright: 8px;
56
+ -webkit-border-bottom-right-radius: 8px;
57
+ -webkit-border-bottom-left-radius: 8px;
58
+ -khtml-border-bottom-right-radius: 8px;
59
+ -khtml-border-bottom-left-radius: 8px;
60
+ border-bottom-right-radius: 8px;
61
+ border-bottom-left-radius: 8px;
62
+ background-color: #f1f1f1;
63
+ border-color: #ddd;
64
+ padding-top: 15px;
65
+ padding-bottom: 15px;
66
+ margin-bottom: 20px;
67
+ overflow: hidden;
68
+ }
69
+
70
+ .popover-holder {
71
+ position: relative;
72
+ background-color: #fff;
73
+ border-color: #ddd;
74
+ border-width: 0 1px 1px;
75
+ border-style: none solid solid;
76
+ -moz-border-radius-bottomleft: 8px;
77
+ -moz-border-radius-bottomright: 8px;
78
+ -webkit-border-bottom-right-radius: 8px;
79
+ -webkit-border-bottom-left-radius: 8px;
80
+ -khtml-border-bottom-right-radius: 8px;
81
+ -khtml-border-bottom-left-radius: 8px;
82
+ border-bottom-right-radius: 8px;
83
+ border-bottom-left-radius: 8px;
84
+ padding: 0;
85
+ }
86
+
87
+ div.popover-details {
88
+ padding-top: 10px;
89
+ padding-left: 10px;
90
+ }
91
+
92
+ .popover-holder label {
93
+ margin-bottom: 10px;
94
+ font-weight: bold;
95
+ }
96
+
97
+ input.wide {
98
+ margin-top: 5px;
99
+ width: 98%;
100
+ margin-left: 0;
101
+ margin-bottom: 5px;
102
+ }
103
+
104
+ .popover-holder h3 {
105
+ background-color: #edf3fe;
106
+ text-shadow: 0 1px 0 #FFFFFF;
107
+ color: #000;
108
+ font: normal bold 12px/2.2em "Helvetica Neue", Arial, Helvetica, Geneva, sans-serif;
109
+ margin-left: 0;
110
+ margin-right: 0;
111
+ padding-left: 10px;
112
+ padding-top: 2px;
113
+ padding-bottom: 2px;
114
+ }
115
+
116
+ .placeholder-rules {
117
+ width: 95%;
118
+ margin-left: 15px;
119
+ margin-bottom: 20px;
120
+ -moz-border-radius: 5px;
121
+ -webkit-border-radius: 5px;
122
+ -khtml-border-radius: 5px;
123
+ border-radius: 5px;
124
+ border: 2px dashed #ddd;
125
+ color: #a9a9a9;
126
+ font-weight: bold;
127
+ text-transform: uppercase;
128
+ text-align: center;
129
+ padding-top: 15px;
130
+ padding-bottom: 15px;
131
+ clear: both;
132
+ min-height: 80px;
133
+ }
134
+
135
+ .droppable-rules {
136
+ margin-right: 15px;
137
+ margin-left: 15px;
138
+ margin-bottom: 20px;
139
+ -moz-border-radius: 5px;
140
+ -webkit-border-radius: 5px;
141
+ -khtml-border-radius: 5px;
142
+ border-radius: 5px;
143
+ border: 3px dashed #ddd;
144
+ color: #a9a9a9;
145
+ font-weight: bold;
146
+ text-transform: uppercase;
147
+ text-align: center;
148
+ padding-top: 15px;
149
+ padding-bottom: 15px;
150
+ clear: both;
151
+ }
152
+
153
+ .droppable-rules.hoveringover {
154
+ border: 3px dashed #78aad3;
155
+ color: #78aad3;
156
+ }
157
+
158
+ #positive-rules {
159
+ background: #fcfcfc;
160
+ }
161
+ #negative-rules {
162
+ background: #fcfcfc;
163
+ }
164
+
165
+ .action-top {
166
+ -moz-border-radius: 6px;
167
+ -webkit-border-radius: 6px;
168
+ -khtml-border-radius: 6px;
169
+ border-radius: 6px;
170
+ border-radius: 6px;
171
+ background: #dfdfdf url("../images/gray-grad.png") repeat-x left top;
172
+ text-shadow: #fff 0 1px 0;
173
+ width: 250px;
174
+ margin-left: 10px;
175
+ padding: 5px 15px;
176
+ font-weight: bold;
177
+ border: 1px solid #ddd;
178
+ margin-bottom: 10px;
179
+ min-height: 20px;
180
+ }
181
+
182
+ .action-top:hover {
183
+ cursor: move;
184
+ }
185
+
186
+ .action-top-placeholder {
187
+ -moz-border-radius: 6px;
188
+ -webkit-border-radius: 6px;
189
+ -khtml-border-radius: 6px;
190
+ border-radius: 6px;
191
+ border-radius: 6px;
192
+ background: transparent;
193
+ width: 250px;
194
+ margin-left: 10px;
195
+ padding: 5px 15px;
196
+ font-weight: bold;
197
+ margin-bottom: 10px;
198
+ min-height: 20px;
199
+ border: 1px dashed #ddd;
200
+ }
201
+
202
+ div.popover-operation {
203
+ margin-right: 15px;
204
+ margin-left: 15px;
205
+ margin-bottom: 20px;
206
+ -moz-border-radius: 8px;
207
+ -webkit-border-radius: 8px;
208
+ -khtml-border-radius: 8px;
209
+ border-radius: 8px;
210
+ border: 1px solid #ddd;
211
+ }
212
+
213
+ #upmessage p a {
214
+ text-decoration: none;
215
+ float:right;
216
+ cursor: pointer;
217
+ }
218
+
219
+ h2.sidebar-name span {
220
+ float: right;
221
+ }
222
+ h2.sidebar-name span a {
223
+ text-decoration: none;
224
+ font-size: 11px;
225
+ }
226
+
227
+ #hiden-actions {
228
+ margin-left: 5px;
229
+ margin-right: 325px;
230
+ display: none;
231
+ }
232
+
233
+ div.popover-operation h2 {
234
+ text-shadow: 0 1px 0 #FFFFFF;
235
+ color: #000;
236
+ font: normal bold 12px/2.2em "Helvetica Neue", Arial, Helvetica, Geneva, sans-serif;
237
+ margin-left: 0;
238
+ margin-right: 0;
239
+ padding-left: 10px;
240
+ padding-top: 2px;
241
+ padding-bottom: 2px;
242
+ }
243
+
244
+ div.popover-operation .inner-operation {
245
+ padding: 10px;
246
+ font-size: 12px;
247
+ background: #fff;
248
+ -moz-border-radius-bottomleft: 8px;
249
+ -moz-border-radius-bottomright: 8px;
250
+ -webkit-border-bottom-right-radius: 8px;
251
+ -webkit-border-bottom-left-radius: 8px;
252
+ -khtml-border-bottom-right-radius: 8px;
253
+ -khtml-border-bottom-left-radius: 8px;
254
+ border-bottom-right-radius: 8px;
255
+ border-bottom-left-radius: 8px;
256
+ }
257
+
258
+ div.popover-operation .inner-operation p {
259
+ margin-top: 0;
260
+ }
261
+
262
+ div.popover-operation .inner-operation p.description {
263
+ margin: 10px 0 0;
264
+ }
265
+
266
+ #positive-rules-holder, #negative-rules-holder {
267
+ clear: both;
268
+ }
269
+
270
+ div.buttons {
271
+ text-align: right;
272
+ padding: 10px 15px 10px 10px;
273
+ }
274
+ div.buttons a.cancellink {
275
+ margin-right: 10px;
276
+ font-size: 12px;
277
+ text-decoration: underline;
278
+ color: #797979;
279
+ }
280
+
281
+ .no-movecursor {
282
+ cursor: auto !Important;
283
+ }
284
+
285
+ #upmessage p {
286
+ padding: 5px;
287
+ margin-top: 0;
288
+ margin-bottom: 10px;
289
+ background-color: #ffffe0;
290
+ border: 1px solid #e6db55;
291
+ margin-right: 15px;
292
+ }
293
+
popoverincludes/images/closemessage.png ADDED
Binary file
popoverincludes/images/closemessagebland.png ADDED
Binary file
popoverincludes/images/ed-bg.gif ADDED
Binary file
popoverincludes/images/gray-grad.png ADDED
Binary file
popoverincludes/images/loading.gif ADDED
Binary file
popoverincludes/images/opaque.png ADDED
Binary file
popoverincludes/js/popover.js ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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(this).parents('#messagebox').removeClass('visiblebox').addClass('hiddenbox');
13
+ createCookie('popover_never_view', 'hidealways', 365);
14
+ return false;
15
+ }
16
+
17
+ function removeMessageBox() {
18
+ jQuery(this).parent('#messagebox').removeClass('visiblebox').addClass('hiddenbox');
19
+ return false;
20
+ }
21
+
22
+ function boardReady() {
23
+ jQuery('#clearforever').click(removeMessageBoxForever);
24
+ jQuery('#closebox').click(removeMessageBox);
25
+
26
+ jQuery('#message').hover( function() {jQuery('.claimbutton').removeClass('hide');}, function() {jQuery('.claimbutton').addClass('hide');});
27
+ jQuery('#messagebox').css('visibility', 'visible');
28
+ }
29
+
30
+ jQuery(window).load(boardReady);
popoverincludes/js/popover.min.js ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
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/popoveradmin.js ADDED
@@ -0,0 +1,63 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ function popoverremoveaction() {
2
+ var section = jQuery(this).attr('id');
3
+ var sectionname = section.replace('remove-','');
4
+
5
+ jQuery('#main-' + sectionname).appendTo('#hiden-actions');
6
+ jQuery('#' + sectionname).show();
7
+
8
+ // Move from the fields
9
+ jQuery('#in-positive-rules').val( jQuery('#in-positive-rules').val().replace(',' + sectionname, ''));
10
+
11
+ return false;
12
+ }
13
+
14
+ function popoverremovemessage() {
15
+
16
+ jQuery('#upmessage').remove();
17
+ return false;
18
+ }
19
+
20
+ function popoverReady() {
21
+
22
+ jQuery('.popover-draggable').draggable({
23
+ opacity: 0.7,
24
+ helper: 'clone',
25
+ start: function(event, ui) {
26
+ jQuery('input#beingdragged').val( jQuery(this).attr('id') );
27
+ },
28
+ stop: function(event, ui) {
29
+ jQuery('input#beingdragged').val( '' );
30
+ }
31
+ });
32
+
33
+ jQuery('.droppable-rules').droppable({
34
+ hoverClass: 'hoveringover',
35
+ drop: function(event, ui) {
36
+ moving = jQuery('input#beingdragged').val();
37
+ ruleplace = jQuery(this).attr('id');
38
+ if(moving != '') {
39
+ jQuery('#main-' + moving).appendTo('#' + ruleplace + '-holder');
40
+ jQuery('#' + moving).hide();
41
+
42
+ // put the name in the relevant holding input field
43
+ jQuery('#in-' + ruleplace).val( jQuery('#in-' + ruleplace).val() + ',' + moving );
44
+ }
45
+ }
46
+ });
47
+
48
+ jQuery('#positive-rules-holder').sortable({
49
+ opacity: 0.7,
50
+ helper: 'clone',
51
+ placeholder: 'placeholder-rules',
52
+ update: function(event, ui) {
53
+ jQuery('#in-positive-rules').val(',' + jQuery('#positive-rules-holder').sortable('toArray').join(',').replace(/main-/gi, ''));
54
+ }
55
+ });
56
+
57
+ jQuery('a.removelink').click(popoverremoveaction);
58
+ jQuery('a#closemessage').click(popoverremovemessage);
59
+
60
+
61
+ }
62
+
63
+ jQuery(document).ready(popoverReady);
popoverincludes/js/popoversizing.js ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ function sizeReady() {
2
+ jQuery('#messagebox').width(jQuery('#message').width());
3
+ jQuery('#messagebox').height(jQuery('#message').height());
4
+
5
+ jQuery('#messagebox').css('top', (jQuery(window).height() / 2) - (jQuery('#message').height() / 2) );
6
+ jQuery('#messagebox').css('left', (jQuery(window).width() / 2) - (jQuery('#message').width() / 2) );
7
+ }
8
+
9
+ jQuery(window).load(sizeReady);
popoverincludes/js/popoversizing.min.js ADDED
@@ -0,0 +1,2 @@
 
 
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-en_US.mo ADDED
Binary file
popoverincludes/languages/popover.mo ADDED
Binary file
popoverincludes/languages/popover.po ADDED
@@ -0,0 +1,229 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ msgid ""
2
+ msgstr ""
3
+ "Project-Id-Version: PopOver\n"
4
+ "Report-Msgid-Bugs-To: \n"
5
+ "POT-Creation-Date: 2011-01-04 01:45+0100\n"
6
+ "PO-Revision-Date: 2011-01-04 01:53+0100\n"
7
+ "Last-Translator: Barry <barry@mapinated.com>\n"
8
+ "Language-Team: Incsub <barry@incsub.com>\n"
9
+ "MIME-Version: 1.0\n"
10
+ "Content-Type: text/plain; charset=UTF-8\n"
11
+ "Content-Transfer-Encoding: 8bit\n"
12
+ "X-Poedit-KeywordsList: __;gettext;gettext_noop;_e\n"
13
+ "X-Poedit-Basepath: .\n"
14
+ "X-Poedit-SearchPath-0: /Users/barrygetty/Work/wordpress/plugins/popover\n"
15
+
16
+ #: /Users/barrygetty/Work/wordpress/plugins/popover/popoverincludes/classes/popoveradmin.php:45
17
+ #: /Users/barrygetty/Work/wordpress/plugins/popover/popoverincludes/classes/popoveradmin.php:48
18
+ #: /Users/barrygetty/Work/wordpress/plugins/popover/popoverincludes/classes/popoveradmin.php:51
19
+ msgid "Pop Overs"
20
+ msgstr ""
21
+
22
+ #: /Users/barrygetty/Work/wordpress/plugins/popover/popoverincludes/classes/popoveradmin.php:210
23
+ #: /Users/barrygetty/Work/wordpress/plugins/popover/popoverincludes/classes/popoveradmin.php:632
24
+ msgid "Your settings have been saved."
25
+ msgstr ""
26
+
27
+ #: /Users/barrygetty/Work/wordpress/plugins/popover/popoverincludes/classes/popoveradmin.php:211
28
+ msgid "Your popover content has been modified by the built in filter, you need to allow unfiltered html."
29
+ msgstr ""
30
+
31
+ #: /Users/barrygetty/Work/wordpress/plugins/popover/popoverincludes/classes/popoveradmin.php:216
32
+ #: /Users/barrygetty/Work/wordpress/plugins/popover/popoverincludes/classes/popoveradmin.php:661
33
+ msgid "Pop Over content settings"
34
+ msgstr ""
35
+
36
+ #: /Users/barrygetty/Work/wordpress/plugins/popover/popoverincludes/classes/popoveradmin.php:231
37
+ msgid "Edit Popover settings"
38
+ msgstr ""
39
+
40
+ #: /Users/barrygetty/Work/wordpress/plugins/popover/popoverincludes/classes/popoveradmin.php:240
41
+ msgid "close"
42
+ msgstr ""
43
+
44
+ #: /Users/barrygetty/Work/wordpress/plugins/popover/popoverincludes/classes/popoveradmin.php:246
45
+ msgid "Popover content"
46
+ msgstr ""
47
+
48
+ #: /Users/barrygetty/Work/wordpress/plugins/popover/popoverincludes/classes/popoveradmin.php:251
49
+ msgid "Active rules"
50
+ msgstr ""
51
+
52
+ #: /Users/barrygetty/Work/wordpress/plugins/popover/popoverincludes/classes/popoveradmin.php:252
53
+ msgid "These are the rules that will determine if a popover should show when a visitor arrives at your website."
54
+ msgstr ""
55
+
56
+ #: /Users/barrygetty/Work/wordpress/plugins/popover/popoverincludes/classes/popoveradmin.php:288
57
+ msgid "Drop here"
58
+ msgstr ""
59
+
60
+ #: /Users/barrygetty/Work/wordpress/plugins/popover/popoverincludes/classes/popoveradmin.php:292
61
+ msgid "Appearance settings"
62
+ msgstr ""
63
+
64
+ #: /Users/barrygetty/Work/wordpress/plugins/popover/popoverincludes/classes/popoveradmin.php:295
65
+ #: /Users/barrygetty/Work/wordpress/plugins/popover/popoverincludes/classes/popoveradmin.php:683
66
+ msgid "Pop Over Size"
67
+ msgstr ""
68
+
69
+ #: /Users/barrygetty/Work/wordpress/plugins/popover/popoverincludes/classes/popoveradmin.php:297
70
+ #: /Users/barrygetty/Work/wordpress/plugins/popover/popoverincludes/classes/popoveradmin.php:685
71
+ msgid "Width:"
72
+ msgstr ""
73
+
74
+ #: /Users/barrygetty/Work/wordpress/plugins/popover/popoverincludes/classes/popoveradmin.php:299
75
+ #: /Users/barrygetty/Work/wordpress/plugins/popover/popoverincludes/classes/popoveradmin.php:687
76
+ msgid "Height:"
77
+ msgstr ""
78
+
79
+ #: /Users/barrygetty/Work/wordpress/plugins/popover/popoverincludes/classes/popoveradmin.php:305
80
+ #: /Users/barrygetty/Work/wordpress/plugins/popover/popoverincludes/classes/popoveradmin.php:693
81
+ msgid "Pop Over Position"
82
+ msgstr ""
83
+
84
+ #: /Users/barrygetty/Work/wordpress/plugins/popover/popoverincludes/classes/popoveradmin.php:307
85
+ #: /Users/barrygetty/Work/wordpress/plugins/popover/popoverincludes/classes/popoveradmin.php:317
86
+ #: /Users/barrygetty/Work/wordpress/plugins/popover/popoverincludes/classes/popoveradmin.php:695
87
+ #: /Users/barrygetty/Work/wordpress/plugins/popover/popoverincludes/classes/popoveradmin.php:705
88
+ msgid "Left:"
89
+ msgstr ""
90
+
91
+ #: /Users/barrygetty/Work/wordpress/plugins/popover/popoverincludes/classes/popoveradmin.php:309
92
+ #: /Users/barrygetty/Work/wordpress/plugins/popover/popoverincludes/classes/popoveradmin.php:321
93
+ #: /Users/barrygetty/Work/wordpress/plugins/popover/popoverincludes/classes/popoveradmin.php:697
94
+ #: /Users/barrygetty/Work/wordpress/plugins/popover/popoverincludes/classes/popoveradmin.php:709
95
+ msgid "Top:"
96
+ msgstr ""
97
+
98
+ #: /Users/barrygetty/Work/wordpress/plugins/popover/popoverincludes/classes/popoveradmin.php:315
99
+ #: /Users/barrygetty/Work/wordpress/plugins/popover/popoverincludes/classes/popoveradmin.php:703
100
+ msgid "Pop Over Margins"
101
+ msgstr ""
102
+
103
+ #: /Users/barrygetty/Work/wordpress/plugins/popover/popoverincludes/classes/popoveradmin.php:319
104
+ #: /Users/barrygetty/Work/wordpress/plugins/popover/popoverincludes/classes/popoveradmin.php:707
105
+ msgid "Right:"
106
+ msgstr ""
107
+
108
+ #: /Users/barrygetty/Work/wordpress/plugins/popover/popoverincludes/classes/popoveradmin.php:323
109
+ #: /Users/barrygetty/Work/wordpress/plugins/popover/popoverincludes/classes/popoveradmin.php:711
110
+ msgid "Bottom:"
111
+ msgstr ""
112
+
113
+ #: /Users/barrygetty/Work/wordpress/plugins/popover/popoverincludes/classes/popoveradmin.php:331
114
+ #: /Users/barrygetty/Work/wordpress/plugins/popover/popoverincludes/classes/popoveradmin.php:719
115
+ msgid "or just override the above with JS"
116
+ msgstr ""
117
+
118
+ #: /Users/barrygetty/Work/wordpress/plugins/popover/popoverincludes/classes/popoveradmin.php:339
119
+ #: /Users/barrygetty/Work/wordpress/plugins/popover/popoverincludes/classes/popoveradmin.php:729
120
+ msgid "Background Colour"
121
+ msgstr ""
122
+
123
+ #: /Users/barrygetty/Work/wordpress/plugins/popover/popoverincludes/classes/popoveradmin.php:341
124
+ #: /Users/barrygetty/Work/wordpress/plugins/popover/popoverincludes/classes/popoveradmin.php:349
125
+ #: /Users/barrygetty/Work/wordpress/plugins/popover/popoverincludes/classes/popoveradmin.php:731
126
+ #: /Users/barrygetty/Work/wordpress/plugins/popover/popoverincludes/classes/popoveradmin.php:739
127
+ msgid "Hex:"
128
+ msgstr ""
129
+
130
+ #: /Users/barrygetty/Work/wordpress/plugins/popover/popoverincludes/classes/popoveradmin.php:347
131
+ #: /Users/barrygetty/Work/wordpress/plugins/popover/popoverincludes/classes/popoveradmin.php:737
132
+ msgid "Font Colour"
133
+ msgstr ""
134
+
135
+ #: /Users/barrygetty/Work/wordpress/plugins/popover/popoverincludes/classes/popoveradmin.php:361
136
+ msgid "Update"
137
+ msgstr ""
138
+
139
+ #: /Users/barrygetty/Work/wordpress/plugins/popover/popoverincludes/classes/popoveradmin.php:416
140
+ msgid "Rules"
141
+ msgstr ""
142
+
143
+ #: /Users/barrygetty/Work/wordpress/plugins/popover/popoverincludes/classes/popoveradmin.php:500
144
+ #: /Users/barrygetty/Work/wordpress/plugins/popover/popoverincludes/classes/popoveradmin.php:513
145
+ #: /Users/barrygetty/Work/wordpress/plugins/popover/popoverincludes/classes/popoveradmin.php:527
146
+ msgid "Remove"
147
+ msgstr ""
148
+
149
+ #: /Users/barrygetty/Work/wordpress/plugins/popover/popoverincludes/classes/popoveradmin.php:531
150
+ #: /Users/barrygetty/Work/wordpress/plugins/popover/popoverincludes/classes/popoveradmin.php:809
151
+ msgid "times"
152
+ msgstr ""
153
+
154
+ #: /Users/barrygetty/Work/wordpress/plugins/popover/popoverincludes/classes/popoveradmin.php:662
155
+ msgid "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."
156
+ msgstr ""
157
+
158
+ #: /Users/barrygetty/Work/wordpress/plugins/popover/popoverincludes/classes/popoveradmin.php:664
159
+ msgid "Pop Over content"
160
+ msgstr ""
161
+
162
+ #: /Users/barrygetty/Work/wordpress/plugins/popover/popoverincludes/classes/popoveradmin.php:665
163
+ msgid "Enter the content for your pop over in the text area below. HTML is allowed."
164
+ msgstr ""
165
+
166
+ #: /Users/barrygetty/Work/wordpress/plugins/popover/popoverincludes/classes/popoveradmin.php:669
167
+ msgid "Update content"
168
+ msgstr ""
169
+
170
+ #: /Users/barrygetty/Work/wordpress/plugins/popover/popoverincludes/classes/popoveradmin.php:672
171
+ msgid "Pop Over display settings"
172
+ msgstr ""
173
+
174
+ #: /Users/barrygetty/Work/wordpress/plugins/popover/popoverincludes/classes/popoveradmin.php:673
175
+ msgid "Use the options below to determine the look, and display settings for the Pop Over."
176
+ msgstr ""
177
+
178
+ #: /Users/barrygetty/Work/wordpress/plugins/popover/popoverincludes/classes/popoveradmin.php:679
179
+ msgid "Appearance Settings"
180
+ msgstr ""
181
+
182
+ #: /Users/barrygetty/Work/wordpress/plugins/popover/popoverincludes/classes/popoveradmin.php:749
183
+ msgid "Display Rules"
184
+ msgstr ""
185
+
186
+ #: /Users/barrygetty/Work/wordpress/plugins/popover/popoverincludes/classes/popoveradmin.php:751
187
+ msgid "Show the Pop Over if <strong>one</strong> of the following checked rules is true."
188
+ msgstr ""
189
+
190
+ #: /Users/barrygetty/Work/wordpress/plugins/popover/popoverincludes/classes/popoveradmin.php:761
191
+ msgid "Visitor is not a supporter."
192
+ msgstr ""
193
+
194
+ #: /Users/barrygetty/Work/wordpress/plugins/popover/popoverincludes/classes/popoveradmin.php:770
195
+ msgid "Visitor is logged in."
196
+ msgstr ""
197
+
198
+ #: /Users/barrygetty/Work/wordpress/plugins/popover/popoverincludes/classes/popoveradmin.php:776
199
+ msgid "Visitor is not logged in."
200
+ msgstr ""
201
+
202
+ #: /Users/barrygetty/Work/wordpress/plugins/popover/popoverincludes/classes/popoveradmin.php:782
203
+ msgid "Visitor has never commented here before."
204
+ msgstr ""
205
+
206
+ #: /Users/barrygetty/Work/wordpress/plugins/popover/popoverincludes/classes/popoveradmin.php:788
207
+ msgid "Visitor came from a search engine."
208
+ msgstr ""
209
+
210
+ #: /Users/barrygetty/Work/wordpress/plugins/popover/popoverincludes/classes/popoveradmin.php:794
211
+ msgid "Visitor did not come from an internal page."
212
+ msgstr ""
213
+
214
+ #: /Users/barrygetty/Work/wordpress/plugins/popover/popoverincludes/classes/popoveradmin.php:800
215
+ msgid "Visitor referrer matches"
216
+ msgstr ""
217
+
218
+ #: /Users/barrygetty/Work/wordpress/plugins/popover/popoverincludes/classes/popoveradmin.php:807
219
+ msgid "And the visitor has seen the pop over less than"
220
+ msgstr ""
221
+
222
+ #: /Users/barrygetty/Work/wordpress/plugins/popover/popoverincludes/classes/popoveradmin.php:817
223
+ msgid "Update settings"
224
+ msgstr ""
225
+
226
+ #: /Users/barrygetty/Work/wordpress/plugins/popover/popoverincludes/classes/popoverpublic.php:199
227
+ msgid "Never see this message again."
228
+ msgstr ""
229
+
readme.txt ADDED
@@ -0,0 +1,72 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ === WordPress PopUp ===
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.1.2
6
+ Stable tag: 3.0
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 plan old ad.
9
+
10
+ == Description ==
11
+
12
+ One of the most effective ways to advertise your mailing list, special offer or simply to show ads is via javascript 'pop over' on your site.
13
+
14
+ And that's exactly what his easy-to-use and guaranteed-to-work plugin does.
15
+
16
+ Check out the impact it has had on WPMU DEV!
17
+
18
+ The popover ad, for WPMU DEV running on WPMU.org - which uses this plugin, delivers visitors to WPMU DEV Premium that look atdouble the number of pages and stay doubly as long as visitors that come via Adwords!
19
+
20
+
21
+ You can either use this plugin for all pages on your entire site, by placing it in /mu-plugins/, or allow each individual blog control over it by placing it in /plugins/ - it's easy.
22
+
23
+ Once you've done that, it's really simple, just activate it and visit Settings > Pop Overs.
24
+
25
+ Then paste in your ad code... whether its javascript or, like us, an image.
26
+
27
+ And select it's size, borders, background color, position and even font color.
28
+
29
+ Then, set the display rules, namely:
30
+
31
+ Show the Pop Over if one of the following checked rules is true:
32
+
33
+ Visitor is not logged in.
34
+
35
+ Visitor has never commented here before.
36
+ Visitor did not come from an internal page.
37
+ And the visitor has seen the pop over less than X times
38
+
39
+ And you're good to go!
40
+
41
+ And of course it even contains a link allowing users to click it and never see the popover again... just to take care of the complainers!
42
+
43
+ Not that we've ever had a single complaint!
44
+
45
+ Enjoy :)
46
+
47
+ == Installation ==
48
+
49
+ WordPress Installation Instructions:
50
+
51
+ ----------------------------------------------------------------------
52
+
53
+ 1) Place the popover directory in the plugins directory
54
+ 2) Activate the plugin
55
+
56
+
57
+ WPMU Installation Instructions:
58
+
59
+ ----------------------------------------------------------------------
60
+
61
+ 1) Place the popover.php file in the mu-plugins directory
62
+ 2) Place the popoverincludes in the mu-plugins directory
63
+
64
+ For site-wide control, leave as is.
65
+
66
+
67
+ For blog by blog control - comment out the PO_GLOBAL line at the top of the plugin file.
68
+
69
+ == Changelog ==
70
+
71
+ = 3.0 =
72
+ * Initial release
testheadfooter.php ADDED
@@ -0,0 +1,87 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ Plugin Name: Test Head Footer
4
+ Plugin URI: http://gist.github.com/378450
5
+ Description: Tests for the existence and functionality of wp_head and wp_footer in the active theme
6
+ Author: Matt Martz
7
+ Author URI: http://sivel.net/
8
+ Version: 1.0
9
+
10
+ Copyright (c) 2010 Matt Martz (http://sivel.net/)
11
+ Test Head Footer is released under the GNU General Public License (GPL)
12
+ http://www.gnu.org/licenses/gpl-2.0.txt
13
+ */
14
+
15
+ // Lets not do anything until init
16
+ add_action( 'init', 'test_head_footer_init' );
17
+ function test_head_footer_init() {
18
+ // Hook in at admin_init to perform the check for wp_head and wp_footer
19
+ add_action( 'admin_init', 'check_head_footer' );
20
+
21
+ // If test-head query var exists hook into wp_head
22
+ if ( isset( $_GET['test-head'] ) )
23
+ add_action( 'wp_head', 'test_head', 99999 ); // Some obscene priority, make sure we run last
24
+
25
+ // If test-footer query var exists hook into wp_footer
26
+ if ( isset( $_GET['test-footer'] ) )
27
+ add_action( 'wp_footer', 'test_footer', 99999 ); // Some obscene priority, make sure we run last
28
+ }
29
+
30
+ // Echo a string that we can search for later into the head of the document
31
+ // This should end up appearing directly before </head>
32
+ function test_head() {
33
+ echo '<!--wp_head-->';
34
+ }
35
+
36
+ // Echo a string that we can search for later into the footer of the document
37
+ // This should end up appearing directly before </body>
38
+ function test_footer() {
39
+ echo '<!--wp_footer-->';
40
+ }
41
+
42
+ // Check for the existence of the strings where wp_head and wp_footer should have been called from
43
+ function check_head_footer() {
44
+ // Build the url to call, NOTE: uses home_url and thus requires WordPress 3.0
45
+ $url = add_query_arg( array( 'test-head' => '', 'test-footer' => '' ), home_url() );
46
+ // Perform the HTTP GET ignoring SSL errors
47
+ $response = wp_remote_get( $url, array( 'sslverify' => false ) );
48
+ // Grab the response code and make sure the request was sucessful
49
+ $code = (int) wp_remote_retrieve_response_code( $response );
50
+ if ( $code == 200 ) {
51
+ global $head_footer_errors;
52
+ $head_footer_errors = array();
53
+
54
+ // Strip all tabs, line feeds, carriage returns and spaces
55
+ $html = preg_replace( '/[\t\r\n\s]/', '', wp_remote_retrieve_body( $response ) );
56
+
57
+ // Check to see if we found the existence of wp_head
58
+ if ( ! strstr( $html, '<!--wp_head-->' ) )
59
+ $head_footer_errors['nohead'] = 'Is missing the call to <?php wp_head(); ?> which should appear directly before </head>';
60
+ // Check to see if we found the existence of wp_footer
61
+ if ( ! strstr( $html, '<!--wp_footer-->' ) )
62
+ $head_footer_errors['nofooter'] = 'Is missing the call to <?php wp_footer(); ?> which should appear directly before </body>';
63
+
64
+ // Check to see if we found wp_head and if was located in the proper spot
65
+ if ( ! strstr( $html, '<!--wp_head--></head>' ) && ! isset( $head_footer_errors['nohead'] ) )
66
+ $head_footer_errors[] = 'Has the call to <?php wp_head(); ?> but it is not called directly before </head>';
67
+ // Check to see if we found wp_footer and if was located in the proper spot
68
+ if ( ! strstr( $html, '<!--wp_footer--></body>' ) && ! isset( $head_footer_errors['nofooter'] ) )
69
+ $head_footer_errors[] = 'Has the call to <?php wp_footer(); ?> but it is not called directly before </body>';
70
+
71
+ // If we found errors with the existence of wp_head or wp_footer hook into admin_notices to complain about it
72
+ if ( ! empty( $head_footer_errors ) )
73
+ add_action ( 'admin_notices', 'test_head_footer_notices' );
74
+ }
75
+ }
76
+
77
+ // Output the notices
78
+ function test_head_footer_notices() {
79
+ global $head_footer_errors;
80
+
81
+ // If we made it here it is because there were errors, lets loop through and state them all
82
+ echo '<div class="error"><p><strong>Your active theme:</strong></p><ul>';
83
+ foreach ( $head_footer_errors as $error )
84
+ echo '<li>' . esc_html( $error ) . '</li>';
85
+ echo '</ul></div>';
86
+ }
87
+ ?>