Changeset 2881052
- Timestamp:
- 03/16/2023 08:59:02 AM (3 years ago)
- Location:
- itro-popup/trunk
- Files:
-
- 5 edited
-
admin/popup-admin.php (modified) (3 diffs)
-
css/itro-style-functions.php (modified) (1 diff)
-
functions/core-function.php (modified) (4 diffs)
-
functions/database-function.php (modified) (3 diffs)
-
mc-main.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
itro-popup/trunk/admin/popup-admin.php
r2877356 r2881052 127 127 128 128 /* Save the posted value in the database */ 129 ipp_ itro_update_option($opt_name[$i], $opt_val[$i]);129 ipp_update_option($opt_name[$i], $opt_val[$i]); 130 130 131 131 if (isset($_POST['select_' . $opt_name[$i]])) { 132 ipp_ itro_update_option('select_' . $opt_name[$i], $_POST['select_' . $opt_name[$i]]);132 ipp_update_option('select_' . $opt_name[$i], $_POST['select_' . $opt_name[$i]]); 133 133 134 134 $px_opt_val[$i] = ipp_validate_data('px_' . $opt_name[$i], $_POST['px_' . $opt_name[$i]]); 135 ipp_ itro_update_option('px_' . $opt_name[$i], $_POST['px_' . $opt_name[$i]]);135 ipp_update_option('px_' . $opt_name[$i], $_POST['px_' . $opt_name[$i]]); 136 136 $perc_opt_val[$i] = ipp_validate_data('perc_' . $opt_name[$i], $_POST['perc_' . $opt_name[$i]]); 137 ipp_ itro_update_option('perc_' . $opt_name[$i], $_POST['perc_' . $opt_name[$i]]);137 ipp_update_option('perc_' . $opt_name[$i], $_POST['perc_' . $opt_name[$i]]); 138 138 } else { 139 ipp_ itro_update_option('select_' . $opt_name[$i], NULL);139 ipp_update_option('select_' . $opt_name[$i], NULL); 140 140 } 141 141 } else { … … 165 165 if (isset($_POST['selected_page_id'])) { 166 166 $selected_page_id = json_encode($_POST['selected_page_id']); 167 ipp_ itro_update_option('selected_page_id', $selected_page_id);167 ipp_update_option('selected_page_id', $selected_page_id); 168 168 } else { 169 ipp_ itro_update_option('selected_page_id', NULL);169 ipp_update_option('selected_page_id', NULL); 170 170 } 171 171 172 172 if (!empty($_POST['background_source'])) { 173 ipp_ itro_update_option('background_source', $_POST['background_source']);173 ipp_update_option('background_source', $_POST['background_source']); 174 174 } 175 175 176 176 if (isset($_POST['roles'])) { 177 177 $roles_users = json_encode($_POST['roles']); 178 ipp_ itro_update_option('roles', $roles_users);178 ipp_update_option('roles', $roles_users); 179 179 } else { 180 ipp_ itro_update_option('roles', NULL);180 ipp_update_option('roles', NULL); 181 181 } 182 182 } else { … … 190 190 check_admin_referer('ipp_save_data', 'ipp_cleardb_nonce_fld'); 191 191 if (isset($_POST['delete_data'])) { 192 ipp_ itro_update_option('delete_data', $_POST['delete_data']);192 ipp_update_option('delete_data', $_POST['delete_data']); 193 193 } else { 194 ipp_ itro_update_option('delete_data', NULL);194 ipp_update_option('delete_data', NULL); 195 195 } 196 196 } -
itro-popup/trunk/css/itro-style-functions.php
r2877733 r2881052 14 14 'perc_popup_height' 15 15 ) == 0)) { 16 ipp_ itro_update_option('select_popup_height', 'auto');16 ipp_update_option('select_popup_height', 'auto'); 17 17 } 18 18 if (ipp_itro_get_option('select_popup_width') == 'px' && ipp_itro_get_option('px_popup_width') == 0) { 19 ipp_ itro_update_option('px_popup_width', '600');19 ipp_update_option('px_popup_width', '600'); 20 20 } 21 21 if (ipp_itro_get_option('select_popup_width') == 'perc' && ipp_itro_get_option('perc_popup_width') == 0) { 22 ipp_ itro_update_option('perc_popup_width', '60');22 ipp_update_option('perc_popup_width', '60'); 23 23 } 24 24 ?> -
itro-popup/trunk/functions/core-function.php
r2877356 r2881052 52 52 ipp_itro_db_init(); 53 53 54 i tro_update_option('popup_time', 20);55 i tro_update_option('popup_delay', 0);56 i tro_update_option('cookie_time_exp', 0);57 i tro_update_option('popup_background', '#FFFFFF');58 i tro_update_option('popup_border_color', '#F7FF00');59 i tro_update_option('px_popup_width', 600);60 i tro_update_option('px_popup_height', 0);61 i tro_update_option('show_countdown', 'yes');62 i tro_update_option('auto_margin_check', 'yes');63 i tro_update_option('select_popup_width', 'px');64 i tro_update_option('select_popup_height', 'auto');65 i tro_update_option('popup_bg_opacity', 0.40);66 i tro_update_option('opaco_bg_color', '#8A8A8A');67 i tro_update_option('popup_position', 'fixed');68 i tro_update_option('popup_border_width', 3);69 i tro_update_option('popup_border_radius', 8);70 i tro_update_option('popup_padding', 2);71 i tro_update_option('page_selection', 'none');54 ipp_update_option('popup_time', 20); 55 ipp_update_option('popup_delay', 0); 56 ipp_update_option('cookie_time_exp', 0); 57 ipp_update_option('popup_background', '#FFFFFF'); 58 ipp_update_option('popup_border_color', '#F7FF00'); 59 ipp_update_option('px_popup_width', 600); 60 ipp_update_option('px_popup_height', 0); 61 ipp_update_option('show_countdown', 'yes'); 62 ipp_update_option('auto_margin_check', 'yes'); 63 ipp_update_option('select_popup_width', 'px'); 64 ipp_update_option('select_popup_height', 'auto'); 65 ipp_update_option('popup_bg_opacity', 0.40); 66 ipp_update_option('opaco_bg_color', '#8A8A8A'); 67 ipp_update_option('popup_position', 'fixed'); 68 ipp_update_option('popup_border_width', 3); 69 ipp_update_option('popup_border_radius', 8); 70 ipp_update_option('popup_padding', 2); 71 ipp_update_option('page_selection', 'none'); 72 72 73 73 switch (get_locale()) { … … 83 83 ipp_itro_update_field('custom_html', $welcome_text); 84 84 85 i tro_update_option('sample_popup', 'done');85 ipp_update_option('sample_popup', 'done'); 86 86 } 87 87 } … … 89 89 /* --------------------------CHECK THE PLUGIN VERSION */ 90 90 91 function ipp_ itro_check_ver() {91 function ipp_check_ver() { 92 92 ob_start(); 93 93 if ($GLOBALS['ITRO_VER'] != get_option('itro_curr_ver')) { 94 94 /* check and update the db */ 95 ipp_ itro_update_db();95 ipp_update_db(); 96 96 97 97 $ver = get_option('itro_curr_ver'); … … 104 104 /* --------------------------DISPLAY THE POPUP */ 105 105 106 function ipp_ itro_display_popup() {106 function ipp_display_popup() { 107 107 global $popup_fired; //it check if there is a popup visualization via shortcode or via automatic visualization 108 108 //if a shortcode was fired it stop everything -
itro-popup/trunk/functions/database-function.php
r2812089 r2881052 42 42 /* update old fixed 'wp_' prefix to the current one' */ 43 43 44 function ipp_ itro_update_db() {44 function ipp_update_db() { 45 45 global $wpdb; 46 46 $prev_ver = get_option('itro_prev_ver'); 47 47 48 48 if ($prev_ver <= 3.68) { 49 ipp_ itro_update_option('popup_border_width', 3);50 ipp_ itro_update_option('popup_border_radius', 8);49 ipp_update_option('popup_border_width', 3); 50 ipp_update_option('popup_border_radius', 8); 51 51 } 52 52 … … 64 64 // added the text for countdown 65 65 if (version_compare($prev_ver, 4.91) == -1) { 66 ipp_ itro_update_option('countdown_text', 'This popup will close in:');66 ipp_update_option('countdown_text', 'This popup will close in:'); 67 67 } 68 68 // reset the popup height after error for data sanitization 69 69 if (version_compare($prev_ver, 4.95) == -1) { 70 70 if (ipp_itro_get_option('select_popup_height') == 'px' && ipp_itro_get_option('px_popup_height') == 0) { 71 ipp_ itro_update_option('select_popup_height', 'auto');71 ipp_update_option('select_popup_height', 'auto'); 72 72 } 73 73 } … … 76 76 /* ------------------ PLUGIN OPTION DB MANAGEMENT -------------- */ 77 77 78 function ipp_ itro_update_option($opt_name, $opt_val) {78 function ipp_update_option($opt_name, $opt_val) { 79 79 80 80 global $wpdb; -
itro-popup/trunk/mc-main.php
r2877747 r2881052 60 60 function itro_get_woo_shop_id(): void 61 61 { 62 ipp_ itro_update_option('woo_shop_id', get_the_id());62 ipp_update_option('woo_shop_id', get_the_id()); 63 63 } 64 64 … … 66 66 67 67 /* check current version for db update: forced with init function due register_activation_hook not working with automatic updates */ 68 add_action( 'init', 'ipp_ itro_check_ver');68 add_action( 'init', 'ipp_check_ver'); 69 69 70 70 add_action( 'woocommerce_before_shop_loop' , 'itro_get_woo_shop_id' ); 71 71 72 add_action( 'wp_footer', 'ipp_ itro_display_popup');72 add_action( 'wp_footer', 'ipp_display_popup'); 73 73 add_action( 'wp_enqueue_scripts' , 'itro_load_script' ); 74 74
Note: See TracChangeset
for help on using the changeset viewer.