ITRO Popup Plugin - Version 4.4.1

Version Description

Code maintenance. Some bug for popup visualization fixed.

Download this release

Release Info

Developer ITRO
Plugin Icon 128x128 ITRO Popup Plugin
Version 4.4.1
Comparing to
See all releases

Code changes from version 4.4 to 4.4.1

admin/popup-admin.php CHANGED
@@ -70,7 +70,7 @@ for($i=0;$i<count($opt_name); $i++)
70
  else{$opt_val[$i] = NULL;}
71
 
72
  // Save the posted value in the database
73
- echo itro_update_option( $opt_name[$i], $opt_val[$i] );
74
 
75
  if( isset($_POST['select_' . $opt_name[$i]]) )
76
  {
@@ -161,7 +161,7 @@ if( isset($_POST[ $submitted_form ]) && $_POST[ $submitted_form ] == 'Y' || isse
161
  <fieldset>
162
  <input type="radio" id="only_selected" name="<?php echo $opt_name[18];?>" value="some"<?php if($opt_val[18]=='some'){echo 'checked="checked"';} ?>/><?php _e("Only selected pages", 'itro-plugin' ); ?><img style="vertical-align:super; cursor:help" src="<?php echo itroImages . 'question_mark.png' ; ?>" title="<?php _e("Multiple choise with CTRL+Click or SHIFT+Arrow up or down",'itro-plugin');?>">&nbsp;&nbsp;&nbsp;
163
  <input type="radio" name="<?php echo $opt_name[18];?>" value="all" <?php if($opt_val[18]=='all' ){echo 'checked="checked"';} ?>/><?php _e("All pages", 'itro-plugin' ); ?>&nbsp;&nbsp;&nbsp;
164
- <input type="radio" name="<?php echo $opt_name[18];?>" value="any" <?php if($opt_val[18]=='any' || $opt_val[18]== NULL){echo 'checked="checked"';} ?>/><?php _e("No page", 'itro-plugin' ); ?>
165
  </fieldset>
166
  <div onClick="document.getElementById('only_selected').checked = true;">
167
  <select name="<?php echo $opt_name[19]; ?>" multiple size="1">
70
  else{$opt_val[$i] = NULL;}
71
 
72
  // Save the posted value in the database
73
+ itro_update_option( $opt_name[$i], $opt_val[$i] );
74
 
75
  if( isset($_POST['select_' . $opt_name[$i]]) )
76
  {
161
  <fieldset>
162
  <input type="radio" id="only_selected" name="<?php echo $opt_name[18];?>" value="some"<?php if($opt_val[18]=='some'){echo 'checked="checked"';} ?>/><?php _e("Only selected pages", 'itro-plugin' ); ?><img style="vertical-align:super; cursor:help" src="<?php echo itroImages . 'question_mark.png' ; ?>" title="<?php _e("Multiple choise with CTRL+Click or SHIFT+Arrow up or down",'itro-plugin');?>">&nbsp;&nbsp;&nbsp;
163
  <input type="radio" name="<?php echo $opt_name[18];?>" value="all" <?php if($opt_val[18]=='all' ){echo 'checked="checked"';} ?>/><?php _e("All pages", 'itro-plugin' ); ?>&nbsp;&nbsp;&nbsp;
164
+ <input type="radio" name="<?php echo $opt_name[18];?>" value="none" <?php if($opt_val[18]=='none' || $opt_val[18]== NULL){echo 'checked="checked"';} ?>/><?php _e("No page", 'itro-plugin' ); ?>
165
  </fieldset>
166
  <div onClick="document.getElementById('only_selected').checked = true;">
167
  <select name="<?php echo $opt_name[19]; ?>" multiple size="1">
css/index.php ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ <?php
2
+ //silence is golden
3
+ ?>
css/itro-style.php CHANGED
@@ -59,7 +59,12 @@ function itro_style() { ?>
59
  else
60
  {echo 'top: 0px;' ;}
61
  }
62
- if (itro_get_option('popup_border_color') != NULL ) {echo 'border: 4px solid' . itro_get_option('popup_border_color') . ';';}?>
 
 
 
 
 
63
  border-radius: <?php echo itro_get_option('popup_border_radius'); ?>px;
64
  border-width: <?php echo itro_get_option('popup_border_width'); ?>px;
65
  width: <?php
59
  else
60
  {echo 'top: 0px;' ;}
61
  }
62
+ if (itro_get_option('popup_border_color') != NULL )
63
+ {
64
+ echo 'border: solid;';
65
+ echo 'border-color:' . itro_get_option('popup_border_color') . ';';
66
+ }
67
+ ?>
68
  border-radius: <?php echo itro_get_option('popup_border_radius'); ?>px;
69
  border-width: <?php echo itro_get_option('popup_border_width'); ?>px;
70
  width: <?php
functions/core-function.php CHANGED
@@ -3,7 +3,13 @@
3
  Copyright 2013 I.T.RO.® (email : support.itro@live.com)
4
  This file is part of ITRO Popup Plugin.
5
  */
6
-
 
 
 
 
 
 
7
 
8
  //------------------ADD MENU PAGE
9
  function itro_plugin_menu() {
@@ -114,30 +120,53 @@ function itro_display_popup()
114
  {
115
  $woo_shop = NULL;
116
  $woo_shop_id = NULL;
117
- }
118
-
119
 
120
  //this condition, control if the popup must or not by displayed in a specified page
121
-
122
  $selected_page_id = json_decode(itro_get_option('selected_page_id'));
123
  $id_match = NULL;
124
- if( isset($selected_page_id) )
 
125
  {
126
- foreach ($selected_page_id as $single_id)
127
- {
128
- if ( $single_id == get_the_id() || ( $single_id == $woo_shop_id && $woo_shop ) ) //if the selected id is the current page id popup will be displayed OR if the woo_shop_id has been selected and you are in the woocommerce standard shop page ($woo_shop == true), popup will be displayed.
 
 
 
 
 
 
 
 
 
129
  {
130
  $id_match++;
131
  }
132
- }
133
- }
134
- if ( (is_front_page() && itro_get_option('blog_home') == 'yes') || (is_home() && itro_get_option('blog_home') == 'yes') || itro_get_option('preview_id') == get_the_id() ) { $id_match++; }
135
- if( ( itro_get_option('page_selection')!='any' && !isset($_COOKIE['popup_cookie']) ) || itro_get_option('preview_id') == get_the_id())
136
- if( ($id_match != NULL) || (itro_get_option('page_selection')=='all') )
137
- {
138
- itro_style();
139
- itro_popup_template();
140
- itro_popup_js();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
141
  }
142
  }
143
 
3
  Copyright 2013 I.T.RO.® (email : support.itro@live.com)
4
  This file is part of ITRO Popup Plugin.
5
  */
6
+ //---------------------- SEND HEADER
7
+ function itro_send_header()
8
+ {
9
+ //add meta tag for IE compability
10
+ //if ( itro_get_option('ie_compability') == 'yes' )
11
+ echo '<meta http-equiv="X-UA-Compatible" content="IE=edge" />';
12
+ }
13
 
14
  //------------------ADD MENU PAGE
15
  function itro_plugin_menu() {
120
  {
121
  $woo_shop = NULL;
122
  $woo_shop_id = NULL;
123
+ }
 
124
 
125
  //this condition, control if the popup must or not by displayed in a specified page
 
126
  $selected_page_id = json_decode(itro_get_option('selected_page_id'));
127
  $id_match = NULL;
128
+
129
+ switch (itro_get_option('page_selection'))
130
  {
131
+ case 'some':
132
+ if( isset($selected_page_id) )
133
+ {
134
+ foreach ($selected_page_id as $single_id)
135
+ {
136
+ if ( $single_id == get_the_id() || ( $single_id == $woo_shop_id && $woo_shop ) ) //if the selected id is the current page id popup will be displayed OR if the woo_shop_id has been selected and you are in the woocommerce standard shop page ($woo_shop == true), popup will be displayed.
137
+ {
138
+ $id_match++;
139
+ }
140
+ }
141
+ }
142
+ if( (is_front_page() && itro_get_option('blog_home') == 'yes') || (is_home() && itro_get_option('blog_home') == 'yes') )
143
  {
144
  $id_match++;
145
  }
146
+ if( ($id_match != NULL && !isset($_COOKIE['popup_cookie'])) || itro_get_option('preview_id') == get_the_id() )
147
+ {
148
+ itro_style();
149
+ itro_popup_template();
150
+ itro_popup_js();
151
+ }
152
+ break;
153
+ case 'all':
154
+ if( !isset($_COOKIE['popup_cookie']) || itro_get_option('preview_id') == get_the_id() )
155
+ {
156
+ itro_style();
157
+ itro_popup_template();
158
+ itro_popup_js();
159
+ }
160
+ break;
161
+ case 'none':
162
+ if( itro_get_option('preview_id') == get_the_id() )
163
+ {
164
+ itro_style();
165
+ itro_popup_template();
166
+ itro_popup_js();
167
+ }
168
+ break;
169
+
170
  }
171
  }
172
 
functions/js-function.php CHANGED
@@ -7,7 +7,18 @@ This file is part of ITRO Popup Plugin.
7
  //------------ LOAD SCRIPTS FOR POPUP VISUALIZATION
8
  function itro_popup_js()
9
  { ?>
10
- <script type="text/javascript"> <?php
 
 
 
 
 
 
 
 
 
 
 
11
  if (itro_get_option('age_restriction') == NULL) //OFF age validation
12
  {
13
  if ( itro_get_option('preview_id') != get_the_id() )
@@ -23,7 +34,7 @@ function itro_popup_js()
23
  var key = event.keyCode;
24
  if(key==27)
25
  {
26
- jQuery("#itro_popup").fadeOut(function() {itro_opaco.style.visibility='Hidden';});
27
  }
28
  }; <?php
29
  }
@@ -31,29 +42,21 @@ function itro_popup_js()
31
  if( itro_get_option('popup_delay') != 0 ) //if is set the delay
32
  { ?>
33
  var delay = <?php echo itro_get_option('popup_delay') . '+' . '1'; ?> ;
34
- interval_id = setInterval(function(){popup_delay();},1000);
35
  function popup_delay()
36
  {
37
  delay--;
38
  if(delay <= 0)
39
  {
40
- clearInterval(interval_id);
41
- jQuery("#itro_popup").fadeOut(1);
42
- jQuery("#itro_opaco").fadeOut(1);
43
- itro_popup.style.visibility = 'visible';
44
- itro_opaco.style.visibility = 'visible';
45
- jQuery("#itro_opaco").fadeIn(function() {jQuery("#itro_popup").fadeIn();});
46
  }
47
  }
48
  <?php
49
  }
50
  else //if popup delay is not setted
51
  {?>
52
- jQuery("#itro_popup").fadeOut(1);
53
- jQuery("#itro_opaco").fadeOut(1);
54
- itro_popup.style.visibility = 'visible';
55
- itro_opaco.style.visibility = 'visible';
56
- jQuery("#itro_opaco").fadeIn(function() {jQuery("#itro_popup").fadeIn();});
57
  <?php
58
  }
59
 
@@ -61,23 +64,32 @@ function itro_popup_js()
61
  if ( itro_get_option('popup_time') != 0 )
62
  { ?>
63
  var popTime=<?php
64
- if( itro_get_option('popup_delay') != 0 ) { echo itro_get_option('popup_time') . '+' . itro_get_option('popup_delay'); }
65
- else { echo itro_get_option('popup_time'); }
 
 
 
 
 
 
66
  ?>;
67
- setInterval(function(){popTimer()},1000); //the countdown
68
  function popTimer()
69
  {
70
- if (popTime>0){
71
- document.getElementById("timer").innerHTML=popTime;
72
- popTime--;
 
73
  }
74
- else {itro_popup.style.visibility='Hidden'; itro_opaco.style.visibility='Hidden';
 
 
 
75
  }
76
  } <?php
77
  }
78
  }
79
- //if age restriction is enabled
80
- else
81
  {
82
  if( itro_get_option('popup_delay') != 0 )
83
  { ?>
@@ -89,22 +101,14 @@ function itro_popup_js()
89
  if(delay <= 0)
90
  {
91
  clearInterval(interval_id);
92
- jQuery("#itro_popup").fadeOut(1);
93
- jQuery("#itro_opaco").fadeOut(1);
94
- itro_popup.style.visibility = 'visible';
95
- itro_opaco.style.visibility = 'visible';
96
- jQuery("#itro_opaco").fadeIn(function() {jQuery("#itro_popup").fadeIn();});
97
  }
98
  }
99
  <?php
100
  }
101
  else
102
  {?>
103
- jQuery("#itro_popup").fadeOut(1);
104
- jQuery("#itro_opaco").fadeOut(1);
105
- itro_popup.style.visibility = 'visible';
106
- itro_opaco.style.visibility = 'visible';
107
- jQuery("#itro_opaco").fadeIn(function() {jQuery("#itro_popup").fadeIn();});
108
  <?php
109
  }
110
  }?>
7
  //------------ LOAD SCRIPTS FOR POPUP VISUALIZATION
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
23
  {
24
  if ( itro_get_option('preview_id') != get_the_id() )
34
  var key = event.keyCode;
35
  if(key==27)
36
  {
37
+ jQuery("#itro_popup").fadeOut(function() {itro_opaco.style.visibility='Hidden';});
38
  }
39
  }; <?php
40
  }
42
  if( itro_get_option('popup_delay') != 0 ) //if is set the delay
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
58
  {?>
59
+ itro_enter_anim();
 
 
 
 
60
  <?php
61
  }
62
 
64
  if ( itro_get_option('popup_time') != 0 )
65
  { ?>
66
  var popTime=<?php
67
+ if( itro_get_option('popup_delay') != 0 )
68
+ {
69
+ echo itro_get_option('popup_time') . '+' . itro_get_option('popup_delay');
70
+ }
71
+ else
72
+ {
73
+ echo itro_get_option('popup_time');
74
+ }
75
  ?>;
76
+ interval_id = setInterval(function(){popTimer()},1000); //the countdown
77
  function popTimer()
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
 
93
  {
94
  if( itro_get_option('popup_delay') != 0 )
95
  { ?>
101
  if(delay <= 0)
102
  {
103
  clearInterval(interval_id);
104
+ itro_enter_anim();
 
 
 
 
105
  }
106
  }
107
  <?php
108
  }
109
  else
110
  {?>
111
+ itro_enter_anim();
 
 
 
 
112
  <?php
113
  }
114
  }?>
images/index.php ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ <?php
2
+ //silence is golden
3
+ ?>
languages/index.php ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ <?php
2
+ //silence is golden
3
+ ?>
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.4
12
  Author URI: http://www.itro.eu/
13
  */
14
 
15
  global $ITRO_VER;
16
- $ITRO_VER = 4.4;
17
  define('itroLocalPath', __DIR__);
18
  define('itroPath', plugins_url() . '/itro-popup/');
19
  define('itroImages', plugins_url() . '/itro-popup/images/');
@@ -53,6 +53,7 @@ function itro_get_woo_shop_id()
53
 
54
  add_action( 'woocommerce_before_shop_loop' , 'itro_get_woo_shop_id' );
55
 
 
56
  add_action( 'wp_footer','itro_display_popup');
57
  add_action( 'wp_enqueue_scripts' , 'itro_load_script' );
58
 
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.4.1
12
  Author URI: http://www.itro.eu/
13
  */
14
 
15
  global $ITRO_VER;
16
+ $ITRO_VER = 4.41;
17
  define('itroLocalPath', __DIR__);
18
  define('itroPath', plugins_url() . '/itro-popup/');
19
  define('itroImages', plugins_url() . '/itro-popup/images/');
53
 
54
  add_action( 'woocommerce_before_shop_loop' , 'itro_get_woo_shop_id' );
55
 
56
+ 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
 
readme.txt CHANGED
@@ -4,7 +4,7 @@ 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, ads, ads popup, pop-up, lightbox, lightbox popup,
5
  Requires at least: 3.0.1
6
  Tested up to: 3.3
7
- Stable tag: 4.4
8
  License: GPLv3 or later
9
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
10
 
@@ -75,6 +75,9 @@ 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 =
79
  Popup can be disabled for mobile devices. Close cross can be changed for dark or light background.
80
 
@@ -205,6 +208,9 @@ bug fixed: color table now works in admin pannel.
205
  First released version.
206
 
207
  == Upgrade Notice ==
 
 
 
208
  Popup can be disabled for mobile devices. Close cross can be changed for dark or light background.
209
 
210
  == Notes ==
4
  Tags: popup, age restriction, block, violence, age validation, adult, adult content, content warning, wp editor, fancy box, fancy popup, custom popup, advertising popup, ads, ads popup, pop-up, lightbox, lightbox popup,
5
  Requires at least: 3.0.1
6
  Tested up to: 3.3
7
+ Stable tag: 4.4.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.4.1 =
79
+ Code maintenance. Some bug for popup visualization fixed.
80
+
81
  = 4.4 =
82
  Popup can be disabled for mobile devices. Close cross can be changed for dark or light background.
83
 
208
  First released version.
209
 
210
  == Upgrade Notice ==
211
+ = 4.4.1 =
212
+ Code maintenance. Some bug for popup visualization fixed.
213
+ = 4.4 =
214
  Popup can be disabled for mobile devices. Close cross can be changed for dark or light background.
215
 
216
  == Notes ==
scripts/index.php ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ <?php
2
+ //silence is golden
3
+ ?>
scripts/jscolor/index.php ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ <?php
2
+ //silence is golden
3
+ ?>
templates/itro-popup-template.php CHANGED
@@ -2,19 +2,8 @@
2
  function itro_popup_template()
3
  { ?>
4
  <div id="itro_popup" style="visibility:hidden">
5
- <div id="popup_content"><?php
6
- $custom_field = stripslashes(itro_get_field('custom_html')); //insert custom html code
7
- echo str_replace("\r\n",'',$custom_field); //return the string whitout new line
8
- if ( itro_get_option('age_restriction') == 'yes' )
9
- {?>
10
- <p id="age_button_area" align="center">
11
- <input type="button" id="ageEnterButton" onClick="itro_set_cookie('popup_cookie','one_time_popup',<?php echo itro_get_option('cookie_time_exp'); ?>); jQuery('#itro_popup').fadeOut(function(){itro_opaco.style.visibility='hidden';})" value="<?php echo itro_get_option('enter_button_text');?>">
12
- <input type="button" id="ageLeaveButton" onClick="javascript:window.open('<?php echo itro_get_option('leave_button_url')?>','_self');" value="<?php echo itro_get_option('leave_button_text');?>">
13
- </p><?php
14
- }
15
- ?>
16
- </div> <?php
17
- if( itro_get_option('age_restriction') == NULL )
18
  {
19
  if( itro_get_option('popup_time') != 0 )
20
  {
@@ -37,6 +26,18 @@ function itro_popup_template()
37
  _e('CLOSE','itro-plugin');
38
  echo '" onclick="jQuery(\'#itro_popup\').fadeOut(function(){itro_opaco.style.visibility=\'hidden\';})">';
39
  }?>
 
 
 
 
 
 
 
 
 
 
 
 
40
  </div>
41
  <div id="itro_opaco" style="visibility:hidden"></div>
42
  <?php
2
  function itro_popup_template()
3
  { ?>
4
  <div id="itro_popup" style="visibility:hidden">
5
+ <?php
6
+ if( itro_get_option('age_restriction') == NULL ) //age restriction off
 
 
 
 
 
 
 
 
 
 
 
7
  {
8
  if( itro_get_option('popup_time') != 0 )
9
  {
26
  _e('CLOSE','itro-plugin');
27
  echo '" onclick="jQuery(\'#itro_popup\').fadeOut(function(){itro_opaco.style.visibility=\'hidden\';})">';
28
  }?>
29
+ <div id="popup_content"><?php
30
+ $custom_field = stripslashes(itro_get_field('custom_html')); //insert custom html code
31
+ echo str_replace("\r\n",'',$custom_field); //return the string whitout new line
32
+ if ( itro_get_option('age_restriction') == 'yes' )
33
+ {?>
34
+ <p id="age_button_area" align="center">
35
+ <input type="button" id="ageEnterButton" onClick="itro_set_cookie('popup_cookie','one_time_popup',<?php echo itro_get_option('cookie_time_exp'); ?>); jQuery('#itro_popup').fadeOut(function(){itro_opaco.style.visibility='hidden';})" value="<?php echo itro_get_option('enter_button_text');?>">
36
+ <input type="button" id="ageLeaveButton" onClick="javascript:window.open('<?php echo itro_get_option('leave_button_url')?>','_self');" value="<?php echo itro_get_option('leave_button_text');?>">
37
+ </p><?php
38
+ }
39
+ ?>
40
+ </div>
41
  </div>
42
  <div id="itro_opaco" style="visibility:hidden"></div>
43
  <?php