PluginProbe ʕ •ᴥ•ʔ
Interactive Image Map Builder / 1.0
Interactive Image Map Builder v1.0
3.2 trunk 1.0 1.1 1.2 1.3 1.4 1.5 1.6 1.7 1.8 1.9 2.0 2.1 2.2 2.3 2.4 2.5 2.6 2.7 2.8 2.9 3.0 3.1
interactive-image-map-builder / settings / plugin-settings.php
interactive-image-map-builder / settings Last commit date
css 3 years ago add-point-html.php 3 years ago attention.php 3 years ago edit-point-html.php 3 years ago form.php 3 years ago how-to-use.php 3 years ago import-export-plugins.php 3 years ago plugin-settings.php 3 years ago save.php 3 years ago template-settings.php 3 years ago wpmart-plugins.php 3 years ago
plugin-settings.php
148 lines
1 <?php
2 if (!defined('ABSPATH'))
3 exit;
4 ?>
5 <div class="isimb-6310">
6 <h1>Plugin Settings</h1>
7 <?php
8
9 wp_enqueue_media();
10
11
12 $font_awesome = isimb_6310_get_option('isimb_6310_font_awesome_status');
13 $closeIcon = isimb_6310_get_option('isimb_6310_close_icon');
14 $desktopSize = isimb_6310_get_option('isimb_6310_desktop_size');
15 $mobileSize = isimb_6310_get_option('isimb_6310_mobile_size');
16
17 $closeIcon = $closeIcon? $closeIcon : 'https://wpmart.org/wp-content/uploads/2022/08/close.png';
18 $desktopSize = $desktopSize ? $desktopSize : 30;
19 $mobileSize = $mobileSize ? $mobileSize : 20;
20
21 if (!empty($_POST['update']) && $_POST['update'] == 'Update') {
22 $nonce = $_REQUEST['_wpnonce'];
23 if (!wp_verify_nonce($nonce, 'isimb-6310-nonce-update')) {
24 die('You do not have sufficient permissions to access this page.');
25 } else {
26
27 //fontawesome Font Start
28 if($font_awesome != ''){
29 $wpdb->query("UPDATE {$wpdb->prefix}options set
30 option_value='". $_POST['font_awesome'] ."'
31 where option_name = 'isimb_6310_font_awesome_status'");
32 }
33 else{
34 $wpdb->query("DELETE FROM {$wpdb->prefix}options where option_name='isimb_6310_font_awesome_status'");
35 $wpdb->query("INSERT INTO {$wpdb->prefix}options(option_name, option_value) VALUES ('isimb_6310_font_awesome_status', '". $_POST['font_awesome'] ."')");
36 }
37
38 $font_awesome = $_POST['font_awesome'];
39 //Next image start
40 $isimb_6310_close_icon = isimb_6310_get_option('isimb_6310_close_icon');
41 if(!$isimb_6310_close_icon){
42 $wpdb->query("DELETE FROM {$wpdb->prefix}options where option_name='isimb_6310_close_icon'");
43 $wpdb->query("INSERT INTO {$wpdb->prefix}options(option_name, option_value) VALUES ('isimb_6310_close_icon', '". $_POST['isimb_6310_close_icon'] ."')");
44 }
45 else{
46 $wpdb->query("UPDATE {$wpdb->prefix}options set
47 option_value='". $_POST['isimb_6310_close_icon'] ."'
48 where option_name = 'isimb_6310_close_icon'");
49 }
50 $closeIcon = $_POST['isimb_6310_close_icon'];
51
52
53 //Desktop Size
54 $isimb_6310_desktop_size = isimb_6310_get_option('isimb_6310_desktop_size');
55 if(!$isimb_6310_desktop_size){
56 $wpdb->query("DELETE FROM {$wpdb->prefix}options where option_name='isimb_6310_desktop_size'");
57 $wpdb->query("INSERT INTO {$wpdb->prefix}options(option_name, option_value) VALUES ('isimb_6310_desktop_size', '". $_POST['isimb_6310_desktop_size'] ."')");
58 }
59 else{
60 $wpdb->query("UPDATE {$wpdb->prefix}options set
61 option_value='". $_POST['isimb_6310_desktop_size'] ."'
62 where option_name = 'isimb_6310_desktop_size'");
63 }
64 $desktopSize = $_POST['isimb_6310_desktop_size'];
65
66 //Mobile size
67 $isimb_6310_mobile_size = isimb_6310_get_option('isimb_6310_mobile_size');
68 if(!$isimb_6310_mobile_size){
69 $wpdb->query("DELETE FROM {$wpdb->prefix}options where option_name='isimb_6310_mobile_size'");
70 $wpdb->query("INSERT INTO {$wpdb->prefix}options(option_name, option_value) VALUES ('isimb_6310_mobile_size', '". $_POST['isimb_6310_mobile_size'] ."')");
71 }
72 else{
73 $wpdb->query("UPDATE {$wpdb->prefix}options set
74 option_value='". $_POST['isimb_6310_mobile_size'] ."'
75 where option_name = 'isimb_6310_mobile_size'");
76 }
77 $mobileSize = $_POST['isimb_6310_mobile_size'];
78 }
79 }
80 ?>
81 <form action="" method="post">
82 <?php wp_nonce_field("isimb-6310-nonce-update") ?>
83 <div class="isimb-6310-modal-body-form">
84 <table width="100%" cellpadding="10" cellspacing="0">
85 <tr>
86 <td width="200px">
87 <b>Font Awesome Activation:</b><br />
88
89 </td>
90 <td width="500px" colspan="2">
91 <input type="radio" name="font_awesome" value="2" checked> Active &nbsp;&nbsp;&nbsp;
92 <input type="radio" name="font_awesome" value="1" <?php echo ($font_awesome == 1) ? ' checked':'' ?>> Inactive
93 </td>
94 </tr>
95 <tr>
96 <td width="200px"><b>Change Close Icon</b></td>
97 <td width="500px">
98 <input type="text" required name="isimb_6310_close_icon" id="close-icon-src" value="<?php echo $closeIcon ?>" class="isimb-form-input lg">
99 <input type="button" id="close-icon" value="Change Image" class="isimb-6310-btn-success">
100 </td>
101 <td>
102 <img src="<?php echo $closeIcon ?>" width="40" />
103 </td>
104 </tr>
105 <tr>
106 <td width="200px"><b>Close Icon Size in Desktop</b></td>
107 <td width="500px">
108 <input type="number" required min="10" name="isimb_6310_desktop_size" id="close-icon-src" value="<?php echo $desktopSize ?>" class="isimb-form-input lg">
109 </td>
110 </tr>
111 <tr>
112 <td width="200px"><b>Close Icon Size in Mobile</b></td>
113 <td width="500px">
114 <input type="number" required min="10" name="isimb_6310_mobile_size" id="close-icon-src" value="<?php echo $mobileSize ?>" class="isimb-form-input lg">
115 </td>
116 </tr>
117 <tr>
118 <td colspan="3">
119 <input type="submit" name="update" class="isimb-6310-btn-primary isimb-margin-right-10" value="Update" />
120 </td>
121 </tr>
122 </table>
123 </div>
124 <br class="isimb-6310-clear" />
125 </form>
126 <script type="text/javascript">
127 jQuery(document).ready(function(){
128 jQuery("body").on("click", "#close-icon", function (e) {
129 e.preventDefault();
130 var image = wp
131 .media({
132 title: "Upload Image",
133 multiple: false,
134 })
135 .open()
136 .on("select", function (e) {
137 var uploaded_image = image.state().get("selection").first();
138 var image_url = uploaded_image.toJSON().url;
139 jQuery("#close-icon-src").val(image_url);
140 });
141
142 jQuery("#isimb_6310_add_new_media").css({
143 "overflow-x": "hidden",
144 "overflow-y": "auto",
145 });
146 });
147 })
148 </script>