Version Description
jQuery conflict resolved. Main js function now are rightly loaded by wp_enqueue_scripts.
Download this release
Release Info
Developer | ITRO |
Plugin | ITRO Popup Plugin |
Version | 4.5.1 |
Comparing to | |
See all releases |
Code changes from version 4.4.4 to 4.5.1
- admin/popup-admin.php +7 -3
- functions/core-function.php +140 -1
- functions/js-function.php +3 -146
- mc-main.php +7 -7
- readme.txt +13 -5
- scripts/itro-admin-scripts.js +74 -0
- scripts/itro-scripts.js +67 -0
admin/popup-admin.php
CHANGED
@@ -3,6 +3,7 @@
|
|
3 |
Copyright 2013 I.T.RO.® (email : support.itro@live.com)
|
4 |
This file is part of ITRO Popup Plugin.
|
5 |
*/
|
|
|
6 |
|
7 |
if ( !current_user_can( 'manage_options' ) ) {
|
8 |
wp_die( __( 'You do not have sufficient permissions to access this page.' ) );
|
@@ -133,7 +134,7 @@ if( isset($_POST[ $submitted_form ]) && $_POST[ $submitted_form ] == 'Y' || isse
|
|
133 |
|
134 |
<div style="display:table; width:100%;">
|
135 |
<h1 style="float:left;"><?php _e( 'I.T.RO. Popup Plugin - Settings', 'itro-plugin');?></h1>
|
136 |
-
<h4 style="float:right; margin-right:30px;">VER <?php echo
|
137 |
</div>
|
138 |
|
139 |
<form id="optionForm" method="post">
|
@@ -421,8 +422,7 @@ if( isset($_POST[ $submitted_form ]) && $_POST[ $submitted_form ] == 'Y' || isse
|
|
421 |
<div id="rightColumn">
|
422 |
<input type="hidden" name="<?php echo $submitted_form; ?>" value="Y">
|
423 |
<!------- Custom html field -------->
|
424 |
-
|
425 |
-
<p class="wpstyle" onClick="onOff_customHtmlForm();"><?php _e("Your text (or HTML code:)", 'itro-plugin' ); ?> </p>
|
426 |
<div id="customHtmlForm">
|
427 |
<?php
|
428 |
$content = stripslashes($field_value[0]);
|
@@ -457,6 +457,10 @@ if( isset($_POST[ $submitted_form ]) && $_POST[ $submitted_form ] == 'Y' || isse
|
|
457 |
<img alt="" border="0" src="https://www.paypalobjects.com/it_IT/i/scr/pixel.gif" width="1" height="1">
|
458 |
</form>
|
459 |
</div>
|
|
|
|
|
|
|
|
|
460 |
</div>
|
461 |
|
462 |
<?php if( isset($_POST['delete_data_hidden']) && $_POST['delete_data_hidden'] == 'Y' ) { itro_update_option('delete_data',$_POST['delete_data']); } ?>
|
3 |
Copyright 2013 I.T.RO.® (email : support.itro@live.com)
|
4 |
This file is part of ITRO Popup Plugin.
|
5 |
*/
|
6 |
+
global $ITRO_VER;
|
7 |
|
8 |
if ( !current_user_can( 'manage_options' ) ) {
|
9 |
wp_die( __( 'You do not have sufficient permissions to access this page.' ) );
|
134 |
|
135 |
<div style="display:table; width:100%;">
|
136 |
<h1 style="float:left;"><?php _e( 'I.T.RO. Popup Plugin - Settings', 'itro-plugin');?></h1>
|
137 |
+
<h4 style="float:right; margin-right:30px;">VER: <?php echo $ITRO_VER; ?></h4>
|
138 |
</div>
|
139 |
|
140 |
<form id="optionForm" method="post">
|
422 |
<div id="rightColumn">
|
423 |
<input type="hidden" name="<?php echo $submitted_form; ?>" value="Y">
|
424 |
<!------- Custom html field -------->
|
425 |
+
<p class="wpstyle" onClick="jQuery('#customHtmlForm').toggle();"><?php _e("Your text (or HTML code:)", 'itro-plugin' ); ?> </p>
|
|
|
426 |
<div id="customHtmlForm">
|
427 |
<?php
|
428 |
$content = stripslashes($field_value[0]);
|
457 |
<img alt="" border="0" src="https://www.paypalobjects.com/it_IT/i/scr/pixel.gif" width="1" height="1">
|
458 |
</form>
|
459 |
</div>
|
460 |
+
<p class="wpstyle" onClick="jQuery('#debug_info').toggle();"><?php _e("System Status", 'itro-plugin' ); ?> </p>
|
461 |
+
<form method="POST" action="" id="debug_info" style="display:none;">
|
462 |
+
<?php echo itro_get_serverinfo(); ?>
|
463 |
+
</form>
|
464 |
</div>
|
465 |
|
466 |
<?php if( isset($_POST['delete_data_hidden']) && $_POST['delete_data_hidden'] == 'Y' ) { itro_update_option('delete_data',$_POST['delete_data']); } ?>
|
functions/core-function.php
CHANGED
@@ -99,7 +99,7 @@ function itro_init()
|
|
99 |
'post_type' => 'page',
|
100 |
);
|
101 |
/* Insert the post into the database */
|
102 |
-
|
103 |
itro_update_option('preview_id',$preview_id);
|
104 |
}
|
105 |
}
|
@@ -203,4 +203,143 @@ function itro_list_pages()
|
|
203 |
</select>
|
204 |
<?php
|
205 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
206 |
?>
|
99 |
'post_type' => 'page',
|
100 |
);
|
101 |
/* Insert the post into the database */
|
102 |
+
@$preview_id = wp_insert_post( $preview_post );
|
103 |
itro_update_option('preview_id',$preview_id);
|
104 |
}
|
105 |
}
|
203 |
</select>
|
204 |
<?php
|
205 |
}
|
206 |
+
|
207 |
+
/* ------------------------- DEBUG INFORMATION ON ADMIN PANNEL */
|
208 |
+
function itro_get_serverinfo()
|
209 |
+
{
|
210 |
+
global $wpdb;
|
211 |
+
global $wp_version;
|
212 |
+
|
213 |
+
$sqlversion = $wpdb->get_var("SELECT VERSION() AS version");
|
214 |
+
$mysqlinfo = $wpdb->get_results("SHOW VARIABLES LIKE 'sql_mode'");
|
215 |
+
if (is_array($mysqlinfo)) $sql_mode = $mysqlinfo[0]->Value;
|
216 |
+
if (empty($sql_mode)) $sql_mode = __('Not set', 'itro-plugin' );
|
217 |
+
if(ini_get('safe_mode')) $safe_mode = __('On', 'itro-plugin' );
|
218 |
+
else $safe_mode = __('Off', 'itro-plugin' );
|
219 |
+
if(ini_get('allow_url_fopen')) $allow_url_fopen = __('On', 'itro-plugin' );
|
220 |
+
else $allow_url_fopen = __('Off', 'itro-plugin' );
|
221 |
+
if(ini_get('upload_max_filesize')) $upload_max = ini_get('upload_max_filesize');
|
222 |
+
else $upload_max = __('N/A', 'itro-plugin' );
|
223 |
+
if(ini_get('post_max_size')) $post_max = ini_get('post_max_size');
|
224 |
+
else $post_max = __('N/A', 'itro-plugin' );
|
225 |
+
if(ini_get('max_execution_time')) $max_execute = ini_get('max_execution_time');
|
226 |
+
else $max_execute = __('N/A', 'itro-plugin' );
|
227 |
+
if(ini_get('memory_limit')) $memory_limit = ini_get('memory_limit');
|
228 |
+
else $memory_limit = __('N/A', 'itro-plugin' );
|
229 |
+
if (function_exists('memory_get_usage')) $memory_usage = round(memory_get_usage() / 1024 / 1024, 2) . __(' MByte', 'itro-plugin' );
|
230 |
+
else $memory_usage = __('N/A', 'itro-plugin' );
|
231 |
+
if (is_callable('exif_read_data')) $exif = __('Yes', 'itro-plugin' ). " ( V" . substr(phpversion('exif'),0,4) . ")" ;
|
232 |
+
else $exif = __('No', 'itro-plugin' );
|
233 |
+
if (is_callable('iptcparse')) $iptc = __('Yes', 'itro-plugin' );
|
234 |
+
else $iptc = __('No', 'itro-plugin' );
|
235 |
+
if (is_callable('xml_parser_create')) $xml = __('Yes', 'itro-plugin' );
|
236 |
+
else $xml = __('No', 'itro-plugin' );
|
237 |
+
|
238 |
+
if ( function_exists( 'wp_get_theme' ) )
|
239 |
+
{
|
240 |
+
$theme = wp_get_theme();
|
241 |
+
} else {
|
242 |
+
$theme = get_theme( get_current_theme() );
|
243 |
+
}
|
244 |
+
|
245 |
+
|
246 |
+
if ( function_exists( 'is_multisite' ) )
|
247 |
+
{
|
248 |
+
if ( is_multisite() )
|
249 |
+
{
|
250 |
+
$ms = __('Yes', 'itro-plugin' );
|
251 |
+
}
|
252 |
+
else
|
253 |
+
{
|
254 |
+
$ms = __('No', 'itro-plugin' );
|
255 |
+
}
|
256 |
+
|
257 |
+
}
|
258 |
+
else $ms = __('N/A', 'itro-plugin' );
|
259 |
+
|
260 |
+
$siteurl = get_option('siteurl');
|
261 |
+
$homeurl = get_option('home');
|
262 |
+
$db_version = get_option('db_version');
|
263 |
+
|
264 |
+
$debug_info = Array(
|
265 |
+
__('Operating System', 'itro-plugin' ) => PHP_OS,
|
266 |
+
__('Server', 'itro-plugin' ) => $_SERVER["SERVER_SOFTWARE"],
|
267 |
+
__('Memory usage', 'itro-plugin' ) => $memory_usage,
|
268 |
+
__('MYSQL Version', 'itro-plugin' ) => $sqlversion,
|
269 |
+
__('SQL Mode', 'itro-plugin' ) => $sql_mode,
|
270 |
+
__('PHP Version', 'itro-plugin' ) => PHP_VERSION,
|
271 |
+
__('PHP Safe Mode', 'itro-plugin' ) => $safe_mode,
|
272 |
+
__('PHP Allow URL fopen', 'itro-plugin' ) => $allow_url_fopen,
|
273 |
+
__('PHP Memory Limit', 'itro-plugin' ) => $memory_limit,
|
274 |
+
__('PHP Max Upload Size', 'itro-plugin' ) => $upload_max,
|
275 |
+
__('PHP Max Post Size', 'itro-plugin' ) => $post_max,
|
276 |
+
__('PHP Max Script Execute Time', 'itro-plugin' ) => $max_execute,
|
277 |
+
__('PHP Exif support', 'itro-plugin' ) => $exif,
|
278 |
+
__('PHP IPTC support', 'itro-plugin' ) => $iptc,
|
279 |
+
__('PHP XML support', 'itro-plugin' ) => $xml,
|
280 |
+
__('Site URL', 'itro-plugin' ) => $siteurl,
|
281 |
+
__('Home URL', 'itro-plugin' ) => $homeurl,
|
282 |
+
__('WordPress Version', 'itro-plugin' ) => $wp_version,
|
283 |
+
__('WordPress DB Version', 'itro-plugin' ) => $db_version,
|
284 |
+
__('Multisite', 'itro-plugin' ) => $ms,
|
285 |
+
__('Active Theme', 'itro-plugin' ) => $theme['Name'].' '.$theme['Version']
|
286 |
+
);
|
287 |
+
$debug_info['Active Plugins'] = null;
|
288 |
+
$active_plugins = $inactive_plugins = Array();
|
289 |
+
$plugins = get_plugins();
|
290 |
+
foreach ($plugins as $path => $plugin) {
|
291 |
+
if ( is_plugin_active( $path ) ) {
|
292 |
+
$debug_info[$plugin['Name']] = $plugin['Version'];
|
293 |
+
} else {
|
294 |
+
$inactive_plugins[$plugin['Name']] = $plugin['Version'];
|
295 |
+
}
|
296 |
+
}
|
297 |
+
$debug_info['Inactive Plugins'] = null;
|
298 |
+
$debug_info = array_merge( $debug_info, (array)$inactive_plugins );
|
299 |
+
|
300 |
+
$mail_text = __( "ITRO Popup Plugin - Debug info", 'itro-plugin' ) . "\r\n------------------\r\n\r\n";
|
301 |
+
$page_text = "";
|
302 |
+
if ( !empty( $debug_info ) )
|
303 |
+
{
|
304 |
+
foreach($debug_info as $name => $value)
|
305 |
+
{
|
306 |
+
if ($value !== null) {
|
307 |
+
$page_text .= "<li><strong>$name</strong> $value</li>";
|
308 |
+
$mail_text .= "$name: $value\r\n";
|
309 |
+
}
|
310 |
+
else
|
311 |
+
{
|
312 |
+
$page_text .= "</ul><h2>$name</h2><ul class='itro_debug_settings'>";
|
313 |
+
$mail_text .= "\r\n$name\r\n----------\r\n";
|
314 |
+
}
|
315 |
+
}
|
316 |
+
}
|
317 |
+
do if ( !empty( $_REQUEST['itro_debug_submit'] ) ) {
|
318 |
+
$nonce=$_REQUEST['itro_debug_nonce'];
|
319 |
+
if (! wp_verify_nonce($nonce, 'itro-debug-nonce') ) {
|
320 |
+
echo "<div class='itro_debug_error'>" . __( "Form submission error: verification check failed.", 'itro-plugin' ) . "</div>";
|
321 |
+
break;
|
322 |
+
}
|
323 |
+
if ($_REQUEST['itro_debug_send_email'])
|
324 |
+
{
|
325 |
+
if (wp_mail($_REQUEST['itro_debug_send_email'], sprintf( __( "ITRO Debug Mail From Site %s.", 'itro-plugin'), $siteurl), $mail_text ) )
|
326 |
+
{
|
327 |
+
echo "<div class='itro_debug_mail_sent'>" . sprintf( __( "Sent to %s.", 'itro-plugin' ), $_REQUEST['itro_debug_send_email'] ) . "</div>";
|
328 |
+
}
|
329 |
+
else
|
330 |
+
{
|
331 |
+
echo "<div class='itro_debug_error'>" . sprintf( __( "Failed to send to %s.", 'itro-plugin' ), $_REQUEST['itro_debug_send_email'] ) . "</div>";
|
332 |
+
}
|
333 |
+
}
|
334 |
+
else
|
335 |
+
{
|
336 |
+
echo "<div class='itro_debug_error'>" . __( 'Error: please enter an e-mail address before submitting.', 'itro-plugin' ) . "</div>";
|
337 |
+
}
|
338 |
+
} while(0); // control structure for use with break
|
339 |
+
$nonce = wp_create_nonce('itro-debug-nonce');
|
340 |
+
$buf = '<textarea style="width:100%; height:400px; resize:none;" onclick="select();">' . $mail_text . '</textarea>';
|
341 |
+
//'<input name="itro_debug_send_email" type="text" value="" placeholder="' . __( "E-mail debug information", 'itro-plugin' ) . '"><input name="itro_debug_nonce" type="hidden" value="' .
|
342 |
+
//$nonce . '"><input name="itro_debug_submit" type="submit" value="' . __( 'Submit', 'itro-plugin' ) . '" class="button-primary"><p>';
|
343 |
+
return $buf;
|
344 |
+
}
|
345 |
?>
|
functions/js-function.php
CHANGED
@@ -8,15 +8,6 @@ This file is part of ITRO Popup Plugin.
|
|
8 |
function itro_popup_js()
|
9 |
{ ?>
|
10 |
<script type="text/javascript">
|
11 |
-
/* manage fade in animation */
|
12 |
-
function itro_enter_anim()
|
13 |
-
{
|
14 |
-
itro_popup.style.visibility = '';
|
15 |
-
itro_opaco.style.visibility = '';
|
16 |
-
itro_popup.style.display = 'none';
|
17 |
-
itro_opaco.style.display = 'none';
|
18 |
-
jQuery("#itro_opaco").fadeIn(function() {jQuery("#itro_popup").fadeIn();});
|
19 |
-
}
|
20 |
|
21 |
<?php
|
22 |
if (itro_get_option('age_restriction') == NULL) /* OFF age validation */
|
@@ -43,15 +34,6 @@ function itro_popup_js()
|
|
43 |
{ ?>
|
44 |
var delay = <?php echo itro_get_option('popup_delay') . '+' . '1'; ?> ;
|
45 |
interval_id_delay = setInterval(function(){popup_delay();},1000);
|
46 |
-
function popup_delay()
|
47 |
-
{
|
48 |
-
delay--;
|
49 |
-
if(delay <= 0)
|
50 |
-
{
|
51 |
-
clearInterval(interval_id_delay);
|
52 |
-
itro_enter_anim();
|
53 |
-
}
|
54 |
-
}
|
55 |
<?php
|
56 |
}
|
57 |
else /* if popup delay is not setted */
|
@@ -74,19 +56,7 @@ function itro_popup_js()
|
|
74 |
}
|
75 |
?>;
|
76 |
interval_id = setInterval(function(){popTimer()},1000); /* the countdown */
|
77 |
-
|
78 |
-
{
|
79 |
-
if (popTime>0)
|
80 |
-
{
|
81 |
-
document.getElementById("timer").innerHTML=popTime;
|
82 |
-
popTime--;
|
83 |
-
}
|
84 |
-
else
|
85 |
-
{
|
86 |
-
clearInterval(interval_id);
|
87 |
-
jQuery("#itro_popup").fadeOut(function() {itro_opaco.style.visibility='Hidden';});
|
88 |
-
}
|
89 |
-
} <?php
|
90 |
}
|
91 |
}
|
92 |
else /* if age restriction is enabled */
|
@@ -95,15 +65,6 @@ function itro_popup_js()
|
|
95 |
{ ?>
|
96 |
var delay = <?php echo itro_get_option('popup_delay') . '+' . '1'; ?> ;
|
97 |
interval_id = setInterval(function(){popup_delay();},1000);
|
98 |
-
function popup_delay()
|
99 |
-
{
|
100 |
-
delay--;
|
101 |
-
if(delay <= 0)
|
102 |
-
{
|
103 |
-
clearInterval(interval_id);
|
104 |
-
itro_enter_anim();
|
105 |
-
}
|
106 |
-
}
|
107 |
<?php
|
108 |
}
|
109 |
else
|
@@ -111,43 +72,14 @@ function itro_popup_js()
|
|
111 |
itro_enter_anim();
|
112 |
<?php
|
113 |
}
|
114 |
-
}
|
115 |
|
116 |
-
function itro_set_cookie(c_name,value,exhours)
|
117 |
-
{
|
118 |
-
var exdate=new Date();
|
119 |
-
exdate.setTime(exdate.getTime() + (exhours * 3600 * 1000));
|
120 |
-
var c_value=escape(value) + ((exhours==null) ? "" : "; expires="+exdate.toUTCString());
|
121 |
-
document.cookie=c_name + "=" + c_value + "; path=/";
|
122 |
-
}
|
123 |
-
<?php
|
124 |
/* ------- AUTOMATIC TOP MARGIN */
|
125 |
if( itro_get_option('auto_margin_check') != NULL )
|
126 |
{?>
|
127 |
var browserWidth = 0, browserHeight = 0;
|
128 |
-
|
129 |
setInterval(function(){marginRefresh()},100); /* refresh every 0.1 second the popup top margin (needed for browser window resizeing) */
|
130 |
-
|
131 |
-
{
|
132 |
-
if( typeof( window.innerWidth ) == 'number' )
|
133 |
-
{
|
134 |
-
/* Non-IE */
|
135 |
-
browserWidth = window.innerWidth;
|
136 |
-
browserHeight = window.innerHeight;
|
137 |
-
} else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) )
|
138 |
-
{
|
139 |
-
/* IE 6+ in 'standards compliant mode' */
|
140 |
-
browserWidth = document.documentElement.clientWidth;
|
141 |
-
browserHeight = document.documentElement.clientHeight;
|
142 |
-
} else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) )
|
143 |
-
{
|
144 |
-
/* IE 4 compatible */
|
145 |
-
browserWidth = document.body.clientWidth;
|
146 |
-
browserHeight = document.body.clientHeight;
|
147 |
-
}
|
148 |
-
popupHeight = document.getElementById('itro_popup').offsetHeight ; /* get the actual px size of popup div */
|
149 |
-
document.getElementById('itro_popup').style.top = (browserHeight - popupHeight)/2 + "px"; /* update the top margin of popup */
|
150 |
-
}<?php
|
151 |
}?>
|
152 |
</script>
|
153 |
<?php
|
@@ -260,81 +192,6 @@ function itro_slidebar($slider_target_id,$slider_value,$slider_min,$slider_max,$
|
|
260 |
} <?php
|
261 |
} ?>
|
262 |
</script><?php
|
263 |
-
}
|
264 |
-
|
265 |
-
/* -------------- LOAD SCRIPTS FOR ADMIN PANNEL */
|
266 |
-
function itro_admin_js()
|
267 |
-
{ ?>
|
268 |
-
<script type="text/javascript">
|
269 |
-
function itro_pos(e)
|
270 |
-
{
|
271 |
-
e = e || window.event;
|
272 |
-
x_pos = e.clientX;
|
273 |
-
}
|
274 |
-
|
275 |
-
function itro_mutual_check(checkbox_id_1,checkbox_id_2,box)
|
276 |
-
{
|
277 |
-
if (!box)
|
278 |
-
{
|
279 |
-
if( checkbox_id_2 == '' ) {document.getElementById(checkbox_id_1).checked = !document.getElementById(checkbox_id_1).checked; return 1;}
|
280 |
-
if( checkbox_id_1 == '' ) {return 0;}
|
281 |
-
if(checkbox_id_1 == checkbox_id_2) { return 0; }
|
282 |
-
document.getElementById(checkbox_id_1).checked = !document.getElementById(checkbox_id_1).checked;
|
283 |
-
if( document.getElementById(checkbox_id_1).checked || document.getElementById(checkbox_id_2).checked )
|
284 |
-
{ document.getElementById(checkbox_id_2).checked = !document.getElementById(checkbox_id_1).checked; }
|
285 |
-
}
|
286 |
-
else
|
287 |
-
{
|
288 |
-
if( document.getElementById(checkbox_id_1).checked || document.getElementById(checkbox_id_2).checked )
|
289 |
-
{ document.getElementById(checkbox_id_2).checked = !document.getElementById(checkbox_id_1).checked; }
|
290 |
-
}
|
291 |
-
}
|
292 |
-
jQuery(document).ready(function() {
|
293 |
-
|
294 |
-
var orig_send_to_editor = window.send_to_editor;
|
295 |
-
var uploadID = ''; /*setup the var in a global scope*/
|
296 |
-
|
297 |
-
jQuery('#upload_button').click(function() {
|
298 |
-
uploadID = jQuery(this).prev('input'); /*set the uploadID variable to the value of the input before the upload button*/
|
299 |
-
formfield = jQuery('.upload').attr('name');
|
300 |
-
tb_show('', 'media-upload.php?type=image&amp;amp;TB_iframe=true');
|
301 |
-
|
302 |
-
/* restore send_to_editor() when tb closed */
|
303 |
-
jQuery("#TB_window").bind('tb_unload', function () {
|
304 |
-
window.send_to_editor = orig_send_to_editor;
|
305 |
-
});
|
306 |
-
|
307 |
-
/* temporarily redefine send_to_editor() */
|
308 |
-
window.send_to_editor = function(html) {
|
309 |
-
imgurl = jQuery('img',html).attr('src');
|
310 |
-
uploadID.val(imgurl); /*assign the value of the image src to the input*/
|
311 |
-
document.getElementById('yes_bg').checked=true;
|
312 |
-
tb_remove();
|
313 |
-
};
|
314 |
-
return false;
|
315 |
-
});
|
316 |
-
});
|
317 |
-
|
318 |
-
var itro_option_state;
|
319 |
-
function itro_check_state(state_check_id)
|
320 |
-
{
|
321 |
-
itro_option_state = state_check_id.selected;
|
322 |
-
}
|
323 |
-
|
324 |
-
function itro_select(target_id)
|
325 |
-
{
|
326 |
-
target_id.selected = !itro_option_state;
|
327 |
-
itro_option_state = !itro_option_state;
|
328 |
-
}
|
329 |
-
|
330 |
-
function itro_set_cookie(c_name,value,exhours)
|
331 |
-
{
|
332 |
-
var exdate=new Date();
|
333 |
-
exdate.setTime(exdate.getTime() + (exhours * 3600 * 1000));
|
334 |
-
var c_value=escape(value) + ((exhours==null) ? "" : "; expires="+exdate.toUTCString());
|
335 |
-
document.cookie=c_name + "=" + c_value + "; path=/";
|
336 |
-
}
|
337 |
-
</script><?php
|
338 |
}
|
339 |
|
340 |
/* show and hide parts of admin pannel such as top margin and basic settings */
|
8 |
function itro_popup_js()
|
9 |
{ ?>
|
10 |
<script type="text/javascript">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11 |
|
12 |
<?php
|
13 |
if (itro_get_option('age_restriction') == NULL) /* OFF age validation */
|
34 |
{ ?>
|
35 |
var delay = <?php echo itro_get_option('popup_delay') . '+' . '1'; ?> ;
|
36 |
interval_id_delay = setInterval(function(){popup_delay();},1000);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
37 |
<?php
|
38 |
}
|
39 |
else /* if popup delay is not setted */
|
56 |
}
|
57 |
?>;
|
58 |
interval_id = setInterval(function(){popTimer()},1000); /* the countdown */
|
59 |
+
<?php
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
60 |
}
|
61 |
}
|
62 |
else /* if age restriction is enabled */
|
65 |
{ ?>
|
66 |
var delay = <?php echo itro_get_option('popup_delay') . '+' . '1'; ?> ;
|
67 |
interval_id = setInterval(function(){popup_delay();},1000);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
68 |
<?php
|
69 |
}
|
70 |
else
|
72 |
itro_enter_anim();
|
73 |
<?php
|
74 |
}
|
75 |
+
}
|
76 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
77 |
/* ------- AUTOMATIC TOP MARGIN */
|
78 |
if( itro_get_option('auto_margin_check') != NULL )
|
79 |
{?>
|
80 |
var browserWidth = 0, browserHeight = 0;
|
|
|
81 |
setInterval(function(){marginRefresh()},100); /* refresh every 0.1 second the popup top margin (needed for browser window resizeing) */
|
82 |
+
<?php
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
83 |
}?>
|
84 |
</script>
|
85 |
<?php
|
192 |
} <?php
|
193 |
} ?>
|
194 |
</script><?php
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
195 |
}
|
196 |
|
197 |
/* show and hide parts of admin pannel such as top margin and basic settings */
|
mc-main.php
CHANGED
@@ -8,12 +8,12 @@ Plugin URI: http://www.itro.eu/
|
|
8 |
Description: EN - Show a perfecly centered customizable popup and a popup-system for age-restricted site and allow to insert own HTML code. IT - Visualizza un popup perfettamente centrato e personalizzabile con possibile blocco per i siti con restrizioni di eta' e permette di inserire il proprio codice HTML.
|
9 |
Author: I.T.RO.(c) Sez. Informatica
|
10 |
E-mail: support.itro@live.com
|
11 |
-
Version: 4.
|
12 |
Author URI: http://www.itro.eu/
|
13 |
*/
|
14 |
|
15 |
global $ITRO_VER;
|
16 |
-
$ITRO_VER = 4.
|
17 |
define('itroLocalPath', __DIR__);
|
18 |
define('itroPath', plugins_url() . '/itro-popup/');
|
19 |
define('itroImages', plugins_url() . '/itro-popup/images/');
|
@@ -33,7 +33,9 @@ function itro_admin_scripts()
|
|
33 |
{
|
34 |
wp_enqueue_script('media-upload');
|
35 |
wp_enqueue_script('thickbox');
|
36 |
-
wp_enqueue_script('jquery-effects-highlight');
|
|
|
|
|
37 |
}
|
38 |
|
39 |
function itro_load_admin_styles()
|
@@ -43,7 +45,8 @@ function itro_load_admin_styles()
|
|
43 |
|
44 |
function itro_load_script()
|
45 |
{
|
46 |
-
wp_enqueue_script('jquery');
|
|
|
47 |
}
|
48 |
|
49 |
function itro_get_woo_shop_id()
|
@@ -57,10 +60,7 @@ add_action( 'wp_head','itro_send_header');
|
|
57 |
add_action( 'wp_footer','itro_display_popup');
|
58 |
add_action( 'wp_enqueue_scripts' , 'itro_load_script' );
|
59 |
|
60 |
-
|
61 |
-
add_action('admin_head', 'itro_admin_js');
|
62 |
add_action('admin_print_scripts', 'itro_admin_scripts');
|
63 |
add_action('admin_print_styles', 'itro_load_admin_styles');
|
64 |
add_action('admin_menu', 'itro_plugin_menu');
|
65 |
-
|
66 |
?>
|
8 |
Description: EN - Show a perfecly centered customizable popup and a popup-system for age-restricted site and allow to insert own HTML code. IT - Visualizza un popup perfettamente centrato e personalizzabile con possibile blocco per i siti con restrizioni di eta' e permette di inserire il proprio codice HTML.
|
9 |
Author: I.T.RO.(c) Sez. Informatica
|
10 |
E-mail: support.itro@live.com
|
11 |
+
Version: 4.5.1
|
12 |
Author URI: http://www.itro.eu/
|
13 |
*/
|
14 |
|
15 |
global $ITRO_VER;
|
16 |
+
$ITRO_VER = 4.51;
|
17 |
define('itroLocalPath', __DIR__);
|
18 |
define('itroPath', plugins_url() . '/itro-popup/');
|
19 |
define('itroImages', plugins_url() . '/itro-popup/images/');
|
33 |
{
|
34 |
wp_enqueue_script('media-upload');
|
35 |
wp_enqueue_script('thickbox');
|
36 |
+
wp_enqueue_script('jquery-effects-highlight');
|
37 |
+
wp_enqueue_script('jquery-effects-fade');
|
38 |
+
wp_enqueue_script( 'itro-scripts', itroPath . '/scripts/itro-admin-scripts.js', array( 'jquery' ) );
|
39 |
}
|
40 |
|
41 |
function itro_load_admin_styles()
|
45 |
|
46 |
function itro_load_script()
|
47 |
{
|
48 |
+
wp_enqueue_script( 'jquery' );
|
49 |
+
wp_enqueue_script( 'itro-scripts', itroPath . '/scripts/itro-scripts.js', array( 'jquery' ) );
|
50 |
}
|
51 |
|
52 |
function itro_get_woo_shop_id()
|
60 |
add_action( 'wp_footer','itro_display_popup');
|
61 |
add_action( 'wp_enqueue_scripts' , 'itro_load_script' );
|
62 |
|
|
|
|
|
63 |
add_action('admin_print_scripts', 'itro_admin_scripts');
|
64 |
add_action('admin_print_styles', 'itro_load_admin_styles');
|
65 |
add_action('admin_menu', 'itro_plugin_menu');
|
|
|
66 |
?>
|
readme.txt
CHANGED
@@ -1,10 +1,10 @@
|
|
1 |
=== ITRO Popup Plugin ===
|
2 |
Contributors: ITRO
|
3 |
Donate link: http://www.itro.eu/index.php/donate/
|
4 |
-
Tags: popup, age restriction, block, violence, age validation, adult, adult content, content warning, wp editor, fancy box, fancy popup, custom popup, advertising popup,
|
5 |
Requires at least: 3.0.1
|
6 |
Tested up to: 3.3
|
7 |
-
Stable tag: 4.
|
8 |
License: GPLv3 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-3.0.html
|
10 |
|
@@ -75,6 +75,12 @@ DONATE NOW! - HELP US TO DEVELOP FOR YOU! [DONATE NOW](http://www.itro.eu/?page_
|
|
75 |
no screenshot avaliable
|
76 |
|
77 |
== Changelog ==
|
|
|
|
|
|
|
|
|
|
|
|
|
78 |
= 4.4.4 =
|
79 |
Code maintenance. Opaque background not showing with popup delay setted bug fixed.
|
80 |
Use of wpdb query instead of sql direct command on uninstall.
|
@@ -218,9 +224,11 @@ bug fixed: color table now works in admin pannel.
|
|
218 |
First released version.
|
219 |
|
220 |
== Upgrade Notice ==
|
221 |
-
= 4.
|
222 |
-
|
223 |
-
|
|
|
|
|
224 |
|
225 |
== Notes ==
|
226 |
FOR TUTORIAL AND FAQ VISIT THE OFFICIAL SITE [CLICK HERE!](http://www.itro.eu/?page_id=390)
|
1 |
=== ITRO Popup Plugin ===
|
2 |
Contributors: ITRO
|
3 |
Donate link: http://www.itro.eu/index.php/donate/
|
4 |
+
Tags: popup, popup message, popup box, popup ads, popup advertising, age restriction, popup block, violence, age validation, adult, adult content, content warning, content warning popup, wp editor, fancy box, fancy popup, custom popup, advertising popup, pop-up, lightbox, lightbox popup,
|
5 |
Requires at least: 3.0.1
|
6 |
Tested up to: 3.3
|
7 |
+
Stable tag: 4.5.1
|
8 |
License: GPLv3 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-3.0.html
|
10 |
|
75 |
no screenshot avaliable
|
76 |
|
77 |
== Changelog ==
|
78 |
+
= 4.5.1 =
|
79 |
+
jQuery conflict resolved. Main js function now are rightly loaded by wp_enqueue_scripts.
|
80 |
+
|
81 |
+
= 4.5 =
|
82 |
+
Automatically retrieve debug info for quick support. Code manteniance.
|
83 |
+
|
84 |
= 4.4.4 =
|
85 |
Code maintenance. Opaque background not showing with popup delay setted bug fixed.
|
86 |
Use of wpdb query instead of sql direct command on uninstall.
|
224 |
First released version.
|
225 |
|
226 |
== Upgrade Notice ==
|
227 |
+
= 4.5.1 =
|
228 |
+
jQuery conflict resolved. Main js function now are rightly loaded by wp_enqueue_scripts func.
|
229 |
+
|
230 |
+
= 4.5 =
|
231 |
+
Automatically retrieve debug info for quick support. Code manteniance.
|
232 |
|
233 |
== Notes ==
|
234 |
FOR TUTORIAL AND FAQ VISIT THE OFFICIAL SITE [CLICK HERE!](http://www.itro.eu/?page_id=390)
|
scripts/itro-admin-scripts.js
ADDED
@@ -0,0 +1,74 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/* -------------- SCRIPTS FOR ADMIN PANNEL */
|
2 |
+
|
3 |
+
function itro_pos(e)
|
4 |
+
{
|
5 |
+
e = e || window.event;
|
6 |
+
x_pos = e.clientX;
|
7 |
+
}
|
8 |
+
|
9 |
+
function itro_mutual_check(checkbox_id_1,checkbox_id_2,box)
|
10 |
+
{
|
11 |
+
if (!box)
|
12 |
+
{
|
13 |
+
if( checkbox_id_2 == '' ) {document.getElementById(checkbox_id_1).checked = !document.getElementById(checkbox_id_1).checked; return 1;}
|
14 |
+
if( checkbox_id_1 == '' ) {return 0;}
|
15 |
+
if(checkbox_id_1 == checkbox_id_2) { return 0; }
|
16 |
+
document.getElementById(checkbox_id_1).checked = !document.getElementById(checkbox_id_1).checked;
|
17 |
+
if( document.getElementById(checkbox_id_1).checked || document.getElementById(checkbox_id_2).checked )
|
18 |
+
{ document.getElementById(checkbox_id_2).checked = !document.getElementById(checkbox_id_1).checked; }
|
19 |
+
}
|
20 |
+
else
|
21 |
+
{
|
22 |
+
if( document.getElementById(checkbox_id_1).checked || document.getElementById(checkbox_id_2).checked )
|
23 |
+
{ document.getElementById(checkbox_id_2).checked = !document.getElementById(checkbox_id_1).checked; }
|
24 |
+
}
|
25 |
+
}
|
26 |
+
|
27 |
+
jQuery(document).ready(function()
|
28 |
+
{
|
29 |
+
var orig_send_to_editor = window.send_to_editor;
|
30 |
+
var uploadID = ''; /*setup the var in a global scope*/
|
31 |
+
|
32 |
+
jQuery('#upload_button').click(function()
|
33 |
+
{
|
34 |
+
uploadID = jQuery(this).prev('input'); /*set the uploadID variable to the value of the input before the upload button*/
|
35 |
+
formfield = jQuery('.upload').attr('name');
|
36 |
+
tb_show('', 'media-upload.php?type=image&amp;amp;TB_iframe=true');
|
37 |
+
|
38 |
+
/* restore send_to_editor() when tb closed */
|
39 |
+
jQuery("#TB_window").bind('tb_unload', function ()
|
40 |
+
{
|
41 |
+
window.send_to_editor = orig_send_to_editor;
|
42 |
+
});
|
43 |
+
|
44 |
+
/* temporarily redefine send_to_editor() */
|
45 |
+
window.send_to_editor = function(html)
|
46 |
+
{
|
47 |
+
imgurl = jQuery('img',html).attr('src');
|
48 |
+
uploadID.val(imgurl); /*assign the value of the image src to the input*/
|
49 |
+
document.getElementById('yes_bg').checked=true;
|
50 |
+
tb_remove();
|
51 |
+
};
|
52 |
+
return false;
|
53 |
+
});
|
54 |
+
});
|
55 |
+
|
56 |
+
var itro_option_state;
|
57 |
+
function itro_check_state(state_check_id)
|
58 |
+
{
|
59 |
+
itro_option_state = state_check_id.selected;
|
60 |
+
}
|
61 |
+
|
62 |
+
function itro_select(target_id)
|
63 |
+
{
|
64 |
+
target_id.selected = !itro_option_state;
|
65 |
+
itro_option_state = !itro_option_state;
|
66 |
+
}
|
67 |
+
|
68 |
+
function itro_set_cookie(c_name,value,exhours)
|
69 |
+
{
|
70 |
+
var exdate=new Date();
|
71 |
+
exdate.setTime(exdate.getTime() + (exhours * 3600 * 1000));
|
72 |
+
var c_value=escape(value) + ((exhours==null) ? "" : "; expires="+exdate.toUTCString());
|
73 |
+
document.cookie=c_name + "=" + c_value + "; path=/";
|
74 |
+
}
|
scripts/itro-scripts.js
ADDED
@@ -0,0 +1,67 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/* manage fade in animation */
|
2 |
+
function itro_enter_anim()
|
3 |
+
{
|
4 |
+
itro_popup.style.visibility = '';
|
5 |
+
itro_opaco.style.visibility = '';
|
6 |
+
itro_popup.style.display = 'none';
|
7 |
+
itro_opaco.style.display = 'none';
|
8 |
+
jQuery("#itro_opaco").fadeIn(function() {jQuery("#itro_popup").fadeIn();});
|
9 |
+
}
|
10 |
+
|
11 |
+
/* function for automatic top margin refresh, to center the popup vertically */
|
12 |
+
function marginRefresh()
|
13 |
+
{
|
14 |
+
if( typeof( window.innerWidth ) == 'number' )
|
15 |
+
{
|
16 |
+
/* Non-IE */
|
17 |
+
browserWidth = window.innerWidth;
|
18 |
+
browserHeight = window.innerHeight;
|
19 |
+
} else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) )
|
20 |
+
{
|
21 |
+
/* IE 6+ in 'standards compliant mode' */
|
22 |
+
browserWidth = document.documentElement.clientWidth;
|
23 |
+
browserHeight = document.documentElement.clientHeight;
|
24 |
+
} else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) )
|
25 |
+
{
|
26 |
+
/* IE 4 compatible */
|
27 |
+
browserWidth = document.body.clientWidth;
|
28 |
+
browserHeight = document.body.clientHeight;
|
29 |
+
}
|
30 |
+
popupHeight = document.getElementById('itro_popup').offsetHeight ; /* get the actual px size of popup div */
|
31 |
+
document.getElementById('itro_popup').style.top = (browserHeight - popupHeight)/2 + "px"; /* update the top margin of popup */
|
32 |
+
}
|
33 |
+
|
34 |
+
/* function for countdown to show popup when the delay is set */
|
35 |
+
function popup_delay()
|
36 |
+
{
|
37 |
+
delay--;
|
38 |
+
if(delay <= 0)
|
39 |
+
{
|
40 |
+
clearInterval(interval_id_delay);
|
41 |
+
itro_enter_anim();
|
42 |
+
}
|
43 |
+
}
|
44 |
+
|
45 |
+
/* countdown for automatic closing */
|
46 |
+
function popTimer()
|
47 |
+
{
|
48 |
+
if (popTime>0)
|
49 |
+
{
|
50 |
+
document.getElementById("timer").innerHTML=popTime;
|
51 |
+
popTime--;
|
52 |
+
}
|
53 |
+
else
|
54 |
+
{
|
55 |
+
clearInterval(interval_id);
|
56 |
+
jQuery("#itro_popup").fadeOut(function() {itro_opaco.style.visibility='Hidden';});
|
57 |
+
}
|
58 |
+
}
|
59 |
+
|
60 |
+
/* function use to set the cookie for next visualization time */
|
61 |
+
function itro_set_cookie(c_name,value,exhours)
|
62 |
+
{
|
63 |
+
var exdate=new Date();
|
64 |
+
exdate.setTime(exdate.getTime() + (exhours * 3600 * 1000));
|
65 |
+
var c_value=escape(value) + ((exhours==null) ? "" : "; expires="+exdate.toUTCString());
|
66 |
+
document.cookie=c_name + "=" + c_value + "; path=/";
|
67 |
+
}
|