ITRO Popup Plugin - Version 4.3.1

Version Description

Improved database function compatibility and speed. (Error in IIS servers)

Download this release

Release Info

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

Code changes from version 4.2.2 to 4.3.1

functions/database-function.php CHANGED
@@ -3,82 +3,100 @@
3
  Copyright 2013 I.T.RO.® (email : support.itro@live.com)
4
  This file is part of ITRO Popup Plugin.
5
  */
6
-
 
 
 
7
  //-------Create plugin tables
8
  function itro_db_init()
9
  {
10
  global $wpdb;
11
-
12
  //------------------Option table
13
- //$option_table_name = $wpdb->prefix . "itro_plugin_option";
14
- $sql = "CREATE TABLE IF NOT EXISTS wp_itro_plugin_option
15
  (
 
 
16
  option_name varchar(255),
17
- PRIMARY KEY(option_name),
18
  option_val varchar(255)
19
  )";
20
  require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );
21
  dbDelta( $sql );
22
 
23
  //--------------Custom field table
24
- //$field_table_name = $wpdb->prefix . "itro_plugin_field";
25
- $sql = "CREATE TABLE IF NOT EXISTS wp_itro_plugin_field
26
  (
27
- field_name varchar(50),
28
- PRIMARY KEY(field_name),
 
29
  field_value TEXT
30
  )";
31
  require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );
32
- dbDelta( $sql );
33
-
34
- update_option('itro_db_init','true');
35
  }
36
 
37
  //------------------ PLUGIN OPTION DB MANAGEMENT --------------
38
  function itro_update_option($opt_name,$opt_val)
39
  {
40
  global $wpdb;
 
41
  $data_to_send = array('option_val'=> $opt_val);
42
  $where_line = array('option_name' => $opt_name);
43
- if ( !$wpdb->update( 'wp_itro_plugin_option' , $data_to_send, $where_line ) )
 
44
  {
45
- $wpdb->insert( 'wp_itro_plugin_option' , $where_line);
46
- $wpdb->update( 'wp_itro_plugin_option' , $data_to_send, $where_line );
 
 
 
 
47
  }
48
  }
49
 
50
  function itro_get_option($opt_name)
51
  {
52
  global $wpdb;
53
- $result = $wpdb->get_results("SELECT * FROM wp_itro_plugin_option WHERE option_name='$opt_name'");
 
54
  foreach($result as $pippo)
55
  {
56
  $opt_val = $pippo->option_val;
57
  }
58
- return $opt_val;
 
59
  }
60
 
61
  //------------------ CUSTOM FIELD CONTENT DB MANAGEMENT --------------
62
  function itro_update_field($field_name,$field_value)
63
  {
64
  global $wpdb;
 
65
  $data_to_send = array('field_value'=> $field_value);
66
  $where_line = array('field_name' => $field_name);
67
- if ( !$wpdb->update( 'wp_itro_plugin_field' , $data_to_send, $where_line ) )
 
 
 
 
 
 
68
  {
69
- $wpdb->insert( 'wp_itro_plugin_field' , $where_line);
70
- $wpdb->update( 'wp_itro_plugin_field' , $data_to_send, $where_line );
71
  }
72
  }
73
 
74
  function itro_get_field($field_name)
75
  {
76
  global $wpdb;
77
- $result = $wpdb->get_results("SELECT * FROM wp_itro_plugin_field WHERE field_name='$field_name'");
 
78
  foreach($result as $pippo)
79
  {
80
  $field_value = $pippo->field_value;
81
  }
82
- return $field_value;
 
83
  }
84
  ?>
3
  Copyright 2013 I.T.RO.® (email : support.itro@live.com)
4
  This file is part of ITRO Popup Plugin.
5
  */
6
+ global $wpdb;
7
+ define ('OPTION_TABLE_NAME', 'wp_itro_plugin_option');
8
+ define ('FIELD_TABLE_NAME', 'wp_itro_plugin_field');
9
+ //$wpdb->prefix
10
  //-------Create plugin tables
11
  function itro_db_init()
12
  {
13
  global $wpdb;
 
14
  //------------------Option table
15
+ $option_table_name = OPTION_TABLE_NAME;
16
+ $sql = "CREATE TABLE IF NOT EXISTS $option_table_name
17
  (
18
+ option_id int NOT NULL AUTO_INCREMENT,
19
+ PRIMARY KEY(option_id),
20
  option_name varchar(255),
 
21
  option_val varchar(255)
22
  )";
23
  require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );
24
  dbDelta( $sql );
25
 
26
  //--------------Custom field table
27
+ $field_table_name = FIELD_TABLE_NAME;
28
+ $sql = "CREATE TABLE IF NOT EXISTS $field_table_name
29
  (
30
+ field_id int NOT NULL AUTO_INCREMENT,
31
+ PRIMARY KEY(field_id),
32
+ field_name varchar(255),
33
  field_value TEXT
34
  )";
35
  require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );
36
+ dbDelta( $sql );
 
 
37
  }
38
 
39
  //------------------ PLUGIN OPTION DB MANAGEMENT --------------
40
  function itro_update_option($opt_name,$opt_val)
41
  {
42
  global $wpdb;
43
+ $option_table_name = OPTION_TABLE_NAME;
44
  $data_to_send = array('option_val'=> $opt_val);
45
  $where_line = array('option_name' => $opt_name);
46
+ $wp_query = $wpdb->get_results("SELECT * FROM $option_table_name WHERE option_name='$opt_name'");
47
+ if ( $wp_query == NULL )
48
  {
49
+ $wpdb->insert( $option_table_name , $where_line);
50
+ $wpdb->update( $option_table_name , $data_to_send, $where_line );
51
+ }
52
+ else
53
+ {
54
+ $wpdb->update( $option_table_name , $data_to_send, $where_line );
55
  }
56
  }
57
 
58
  function itro_get_option($opt_name)
59
  {
60
  global $wpdb;
61
+ $option_table_name = OPTION_TABLE_NAME;
62
+ $result = $wpdb->get_results("SELECT * FROM $option_table_name WHERE option_name='$opt_name'");
63
  foreach($result as $pippo)
64
  {
65
  $opt_val = $pippo->option_val;
66
  }
67
+ if(isset($opt_val)) {return ($opt_val);}
68
+ else {return (NULL);}
69
  }
70
 
71
  //------------------ CUSTOM FIELD CONTENT DB MANAGEMENT --------------
72
  function itro_update_field($field_name,$field_value)
73
  {
74
  global $wpdb;
75
+ $field_table_name = FIELD_TABLE_NAME;
76
  $data_to_send = array('field_value'=> $field_value);
77
  $where_line = array('field_name' => $field_name);
78
+ $wp_query = $wpdb->get_results("SELECT * FROM $field_table_name WHERE field_name='$field_name'");
79
+ if ( $wp_query == NULL )
80
+ {
81
+ $wpdb->insert( $field_table_name , $where_line);
82
+ $wpdb->update( $field_table_name , $data_to_send, $where_line );
83
+ }
84
+ else
85
  {
86
+ $wpdb->update( $field_table_name , $data_to_send, $where_line );
 
87
  }
88
  }
89
 
90
  function itro_get_field($field_name)
91
  {
92
  global $wpdb;
93
+ $field_table_name = FIELD_TABLE_NAME;
94
+ $result = $wpdb->get_results("SELECT * FROM $field_table_name WHERE field_name='$field_name'");
95
  foreach($result as $pippo)
96
  {
97
  $field_value = $pippo->field_value;
98
  }
99
+ if(isset($field_value)) {return ($field_value);}
100
+ else {return (NULL);}
101
  }
102
  ?>
functions/js-function.php CHANGED
@@ -154,11 +154,15 @@ function itro_slidebar($slider_target_id,$slider_value,$slider_min,$slider_max,$
154
  {
155
  if($multi_slider != NULL)
156
  {
157
- if( itro_get_option('select_' . $slider_target_id) != $multi_slider )
158
  {
159
  $slider_display = 'display:none;';
160
  //$js_input_display = 'document.getElementById("'. $slider_target_id .'").style.display = "none";' ;
161
  }
 
 
 
 
162
  $target_opt_name = $slider_target_id;
163
  $slider_container_id = $slider_target_id . '_slider_container';
164
 
@@ -170,6 +174,7 @@ function itro_slidebar($slider_target_id,$slider_value,$slider_min,$slider_max,$
170
  {
171
  $js_slider_container_id = $slider_target_id . '_slider_container';
172
  $js_slider_id = $slider_target_id . '_slider';
 
173
  }
174
  ?>
175
 
@@ -218,35 +223,39 @@ function itro_slidebar($slider_target_id,$slider_value,$slider_min,$slider_max,$
218
 
219
  }
220
 
221
- <?php $slider_target_id = $target_opt_name; ?>
222
-
223
- //---function disable
224
- function itro_disable_<?php echo $slider_target_id; ?>()
225
  {
226
- document.getElementById("px_<?php echo $slider_target_id; ?>").style.display = "none";
227
- document.getElementById("perc_<?php echo $slider_target_id; ?>").style.display = "none";
228
- document.getElementById("px_<?php echo $slider_container_id; ?>").style.display = "none";
229
- document.getElementById("perc_<?php echo $slider_container_id; ?>").style.display = "none";
230
- }
231
 
232
- //---function enable
233
- function itro_enable_<?php echo $slider_target_id; ?>(dim_type)
234
- {
235
- if(dim_type == 'perc')
236
  {
237
- document.getElementById("perc_<?php echo $slider_container_id; ?>").style.display = "block";
238
- document.getElementById("perc_<?php echo $slider_target_id; ?>").style.display = "inline";
239
  document.getElementById("px_<?php echo $slider_target_id; ?>").style.display = "none";
240
- document.getElementById("px_<?php echo $slider_container_id; ?>").style.display = "none";
241
- }
242
- if(dim_type == 'px')
243
- {
244
- document.getElementById("px_<?php echo $slider_container_id; ?>").style.display = "block";
245
- document.getElementById("px_<?php echo $slider_target_id; ?>").style.display = "inline";
246
  document.getElementById("perc_<?php echo $slider_target_id; ?>").style.display = "none";
 
247
  document.getElementById("perc_<?php echo $slider_container_id; ?>").style.display = "none";
248
  }
249
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
250
  </script><?php
251
  }
252
 
154
  {
155
  if($multi_slider != NULL)
156
  {
157
+ if( itro_get_option('select_' . $slider_target_id) != $multi_slider ) //esempio select_popup_width = 'px' o 'perc'
158
  {
159
  $slider_display = 'display:none;';
160
  //$js_input_display = 'document.getElementById("'. $slider_target_id .'").style.display = "none";' ;
161
  }
162
+ else
163
+ {
164
+ $slider_display = '';
165
+ }
166
  $target_opt_name = $slider_target_id;
167
  $slider_container_id = $slider_target_id . '_slider_container';
168
 
174
  {
175
  $js_slider_container_id = $slider_target_id . '_slider_container';
176
  $js_slider_id = $slider_target_id . '_slider';
177
+ $slider_display = '';
178
  }
179
  ?>
180
 
223
 
224
  }
225
 
226
+ <?php
227
+ if($multi_slider != NULL)
 
 
228
  {
229
+ $slider_target_id = $target_opt_name; ?>
 
 
 
 
230
 
231
+ //---function disable
232
+ function itro_disable_<?php echo $slider_target_id; ?>()
 
 
233
  {
 
 
234
  document.getElementById("px_<?php echo $slider_target_id; ?>").style.display = "none";
 
 
 
 
 
 
235
  document.getElementById("perc_<?php echo $slider_target_id; ?>").style.display = "none";
236
+ document.getElementById("px_<?php echo $slider_container_id; ?>").style.display = "none";
237
  document.getElementById("perc_<?php echo $slider_container_id; ?>").style.display = "none";
238
  }
239
+
240
+ //---function enable
241
+ function itro_enable_<?php echo $slider_target_id; ?>(dim_type)
242
+ {
243
+ if(dim_type == 'perc')
244
+ {
245
+ document.getElementById("perc_<?php echo $slider_container_id; ?>").style.display = "block";
246
+ document.getElementById("perc_<?php echo $slider_target_id; ?>").style.display = "inline";
247
+ document.getElementById("px_<?php echo $slider_target_id; ?>").style.display = "none";
248
+ document.getElementById("px_<?php echo $slider_container_id; ?>").style.display = "none";
249
+ }
250
+ if(dim_type == 'px')
251
+ {
252
+ document.getElementById("px_<?php echo $slider_container_id; ?>").style.display = "block";
253
+ document.getElementById("px_<?php echo $slider_target_id; ?>").style.display = "inline";
254
+ document.getElementById("perc_<?php echo $slider_target_id; ?>").style.display = "none";
255
+ document.getElementById("perc_<?php echo $slider_container_id; ?>").style.display = "none";
256
+ }
257
+ } <?php
258
+ } ?>
259
  </script><?php
260
  }
261
 
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.2.2
12
  Author URI: http://www.itro.eu/
13
  */
14
 
15
  global $ITRO_VER;
16
- $ITRO_VER = 4.22;
17
  define('itroLocalPath', __DIR__);
18
  define('itroPath', plugins_url() . '/itro-popup/');
19
  define('itroImages', plugins_url() . '/itro-popup/images/');
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.3.1
12
  Author URI: http://www.itro.eu/
13
  */
14
 
15
  global $ITRO_VER;
16
+ $ITRO_VER = 4.31;
17
  define('itroLocalPath', __DIR__);
18
  define('itroPath', plugins_url() . '/itro-popup/');
19
  define('itroImages', plugins_url() . '/itro-popup/images/');
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, ads, ads popup, pop-up, lightbox, lightbox popup,
5
  Requires at least: 3.0.1
6
  Tested up to: 3.5.1
7
- Stable tag: 4.2.2
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.2.2 =
79
  Fixed bug on activation and deactivation: the popup content and setting now don't reset.
80
 
@@ -193,13 +199,7 @@ bug fixed: color table now works in admin pannel.
193
  First released version.
194
 
195
  == Upgrade Notice ==
196
- 4.2.2
197
- Fixed bug on activation and deactivation: the popup content and setting now don't reset.
198
- 4.2.1
199
- Border width bug fixed. Enter button bug fixed. Padding bug fixed. Database function changed for better compatibility
200
- 4.2
201
- Age validation cookie bug on refresh page fixed. Added delete cookie button. Resolved OpenGraph metatag bug.
202
- New hook for better compatibility.
203
 
204
  == Notes ==
205
  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, 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.5.1
7
+ Stable tag: 4.3.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.3.1 =
79
+ Improved database function compatibility and speed. (Error in IIS servers)
80
+
81
+ = 4.3 =
82
+ Heavy bugs fixed. With WP_DEBUG true plugin generated a lot of errors.
83
+
84
  = 4.2.2 =
85
  Fixed bug on activation and deactivation: the popup content and setting now don't reset.
86
 
199
  First released version.
200
 
201
  == Upgrade Notice ==
202
+ Improved database function compatibility and speed. (Error in IIS servers)
 
 
 
 
 
 
203
 
204
  == Notes ==
205
  FOR TUTORIAL AND FAQ VISIT THE OFFICIAL SITE [CLICK HERE!](http://www.itro.eu/?page_id=390)
uninstall.php CHANGED
@@ -13,12 +13,10 @@ else
13
  delete_option('itro_prev_ver');
14
  delete_option('delete_data');
15
 
16
- $con = mysql_connect(DB_HOST,DB_USER,DB_PASSWORD);
17
- if (!$con){die('Could not connect: ' . mysql_error());}
18
- mysql_select_db(DB_NAME);
19
 
20
- mysql_query('DROP TABLE wp_itro_plugin_option');
21
- mysql_query('DROP TABLE wp_itro_plugin_field');
22
  }
23
  }
24
  ?>
13
  delete_option('itro_prev_ver');
14
  delete_option('delete_data');
15
 
16
+ $con = mysqli_connect(DB_HOST,DB_USER,DB_PASSWORD,DB_NAME);
 
 
17
 
18
+ mysqli_query($con, 'DROP TABLE wp_itro_plugin_option');
19
+ mysqli_query($con, 'DROP TABLE wp_itro_plugin_field');
20
  }
21
  }
22
  ?>