PluginProbe
Insert PHP Code Snippet / 1.3.6
Insert PHP Code Snippet v1.3.6
1.4.7 1.3.3 1.3.4 1.3.5 1.3.6 1.3.7 1.3.8 1.4 1.4.1 1.4.2 1.4.3 1.4.4 1.4.5 1.4.6 trunk 1.0 1.1 1.2 1.2.1 1.2.2 1.2.3 1.2.4 1.2.5 1.2.6 1.3 All 27 releases
insert-php-code-snippet / admin / settings.php

settings.php in Insert PHP Code Snippet 1.3.6, at admin/settings.php

198 lines 9.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 if ( ! defined( 'ABSPATH' ) )
3 exit;
4
5 global $wpdb;
6 // Load the options
7 if(!$_POST && isset($_GET['ips_notice'])&& $_GET['ips_notice'] == 'hide'){
8 if (! isset( $_REQUEST['_wpnonce'] ) || ! wp_verify_nonce( $_REQUEST['_wpnonce'],'ips-shw')){
9 wp_nonce_ays( 'ips-shw');
10 exit;
11 }
12 update_option('xyz_ips_dnt_shw_notice', "hide");
13 ?>
14 <style type='text/css'>
15 #ips_notice_td{
16 display:none !important;
17 }
18 </style>
19 <div class="xyz_system_notice_area_style1" id="xyz_system_notice_area">
20 Thanks again for using the plugin. We will never show the message again.
21 &nbsp;&nbsp;&nbsp;
22 <span id="xyz_system_notice_area_dismiss">Dismiss</span>
23 </div>
24 <?php
25 }
26
27 if($_POST){
28 if (! isset( $_REQUEST['_wpnonce'] ) || ! wp_verify_nonce( $_REQUEST['_wpnonce'], 'ips-psetting_' )) {
29 wp_nonce_ays( 'ips-psetting_' );
30 exit;
31 }
32 else{
33 $_POST=xyz_trim_deep($_POST);
34 $_POST = stripslashes_deep($_POST);
35
36 $xyz_ips_pre_ads = intval($_POST['xyz_ips_pre_ads']);
37 $xyz_ips_limit = abs(intval($_POST['xyz_ips_limit']));
38
39 if($xyz_ips_limit==0)$xyz_ips_limit=20;
40 $xyz_ips_credit = sanitize_text_field($_POST['xyz_ips_credit']);
41
42 if(($xyz_ips_credit=="ips")||($xyz_ips_credit==0))
43 update_option('xyz_credit_link',$xyz_ips_credit);
44
45 $xyz_ips_auto_insert = intval($_POST['xyz_ips_auto_insert']);
46 update_option('xyz_ips_auto_insert',$xyz_ips_auto_insert);
47
48 $xyz_ips_auto_exception = intval($_POST['xyz_ips_auto_exception']);
49 update_option('xyz_ips_auto_exception',$xyz_ips_auto_exception);
50
51 $xyz_ips_exception_email=sanitize_text_field($_POST['xyz_ips_exception_email']);
52 update_option('xyz_ips_exception_email',$xyz_ips_exception_email);
53
54 $xyz_ips_sortfield=sanitize_text_field($_POST['xyz_ips_sort_by_field']);
55
56 if(($xyz_ips_sortfield=="id")||($xyz_ips_sortfield=="title"))
57 update_option('xyz_ips_sort_field_name',$xyz_ips_sortfield);
58
59 $xyz_ips_sortorder=sanitize_text_field($_POST['xyz_ips_sort_by_order']);
60
61 if(($xyz_ips_sortorder=="asc")||($xyz_ips_sortorder=="desc"))
62 update_option('xyz_ips_sort_order',$xyz_ips_sortorder);
63
64 update_option('xyz_ips_limit',$xyz_ips_limit);
65 ?>
66 <div class="xyz_system_notice_area_style1" id="xyz_system_notice_area">
67 Settings updated successfully. &nbsp;&nbsp;&nbsp;
68 <span id="xyz_system_notice_area_dismiss">Dismiss</span>
69 </div>
70 <?php
71 }
72 }
73 ?>
74 <script type="text/javascript">
75
76 jQuery(document).ready(function() {
77 changeAutoException();
78
79 });
80
81 if(typeof changeAutoException == 'undefined')
82 {
83 function changeAutoException()
84 {
85 var auto_exception=jQuery("#xyz_ips_auto_exception").val();
86
87 if(auto_exception==1) {
88 jQuery("#xyz_ips_exception_email_tr").show();
89 }
90 else {
91 jQuery("#xyz_ips_exception_email_tr").hide();
92 }
93 }
94
95 }
96 </script>
97 <div>
98 <form method="post">
99 <?php wp_nonce_field('ips-psetting_');?>
100 <div style="float: left;width: 98%">
101 <fieldset style=" width:100%; border:1px solid #F7F7F7; padding:10px 0px 15px 10px;">
102 <legend >
103 <h3>Settings</h3>
104 </legend>
105 <table class="widefat" style="width:99%;">
106 <tr valign="top">
107 <td scope="row" >
108 <label for="xyz_ihs_sort">Sorting of snippets</label>
109 </td>
110 <td>
111 <select id="xyz_ips_sort_by_field" name="xyz_ips_sort_by_field" >
112 <option value="id" <?php if(isset($_POST['xyz_ips_sort_by_field']) && $_POST['xyz_ips_sort_by_field']=='id'){echo 'selected';} else if(get_option('xyz_ips_sort_field_name')=="id"){echo 'selected';} ?>>Based on create time</option>
113 <option value="title" <?php if(isset($_POST['xyz_ips_sort_by_field']) && $_POST['xyz_ips_sort_by_field']=='title'){ echo 'selected';}else if(get_option('xyz_ips_sort_field_name')=="title"){echo 'selected';} ?>>Based on name</option>
114 </select>
115 &nbsp;
116 <select id="xyz_ips_sort_by_order" name="xyz_ips_sort_by_order" >
117 <option value="desc" <?php if(isset($_POST['xyz_ips_sort_by_order']) && $_POST['xyz_ips_sort_by_order']=='desc'){echo 'selected';} else if(get_option('xyz_ips_sort_order')=="desc"){echo 'selected';} ?>>Descending</option>
118 <option value="asc" <?php if(isset($_POST['xyz_ips_sort_by_order']) && $_POST['xyz_ips_sort_by_order']=='asc'){ echo 'selected';}else if(get_option('xyz_ips_sort_order')=="asc"){echo 'selected';} ?>>Ascending</option>
119 </select>
120 </td>
121 </tr>
122 <tr valign="top">
123 <td scope="row" >
124 <label for="xyz_ips_credit">Credit link to author</label>
125 </td>
126 <td>
127 <select name="xyz_ips_credit" id="xyz_ips_credit">
128 <option value="ips"
129 <?php selected(get_option('xyz_credit_link'),"ips"); ?>>Enable</option>
130 <option value="0"
131 <?php if(get_option('xyz_credit_link')!="ips"){echo 'selected';} ?>>Disable</option>
132 </select>
133 </td>
134 </tr>
135 <tr valign="top">
136 <td scope="row" class="settingInput" id="">
137 <label for="xyz_ips_limit">Pagination limit</label>
138 </td>
139 <td id="">
140 <input name="xyz_ips_limit" type="text"
141 id="xyz_ips_limit" value="<?php if(isset($_POST['xyz_ips_limit']) ){echo abs(intval($_POST['xyz_ips_limit']));}else{print(get_option('xyz_ips_limit'));} ?>" />
142 </td>
143 </tr>
144 <tr valign="top">
145 <td scope="row">
146 <label for="xyz_ips_auto_insert">Autoinsert PHP opening tags</label>
147 </td>
148 <td>
149 <select name="xyz_ips_auto_insert" id="xyz_ips_auto_insert">
150 <option value="0" <?php selected(get_option('xyz_ips_auto_insert'),0);?>>Disable</option>
151 <option value="1" <?php selected(get_option('xyz_ips_auto_insert'),1);?>>Enable</option>
152 </select>
153 </td>
154 </tr>
155 <tr valign="top">
156 <td scope="row">
157 <label for="xyz_ips_auto_exception">Enabling automatic exception handling for PHP snippets</label>
158 </td>
159 <td>
160 <select name="xyz_ips_auto_exception" id="xyz_ips_auto_exception">
161 <option value="0" <?php selected(get_option('xyz_ips_auto_exception'),0);?>>Disable</option>
162 <option value="1" <?php selected(get_option('xyz_ips_auto_exception'),1);?>>Enable</option>
163 </select>
164 </td>
165 </tr>
166 <tr valign="top" id="xyz_ips_exception_email_tr" style="display:none;">
167 <td scope="row">
168 <label for="xyz_ips_exception_email">Email address for sending exception report</label>
169 </td>
170 <td>
171 <input name="xyz_ips_exception_email" type="text" id="xyz_ips_exception_email" value="<?php if(isset($_POST['xyz_ips_exception_email']) ){echo esc_attr($_POST['xyz_ips_exception_email']);}else{if(get_option('xyz_ips_exception_email')!="0"){echo esc_attr(get_option('xyz_ips_exception_email'));}} ?>" />
172
173 </td>
174 </tr>
175 <tr valign="top">
176 <td scope="row">
177 <label for="xyz_ips_pre_ads">Premium Version Ads</label>
178 </td>
179 <td>
180 <select name="xyz_ips_pre_ads" id="xyz_ips_pre_ads">
181 <option value="0" <?php selected(get_option('xyz_ips_premium_version_ads'),0);?>>Disable</option>
182 <option value="1" <?php selected(get_option('xyz_ips_premium_version_ads'),1);?>>Enable</option>
183 </select>
184 </td>
185 </tr>
186 <tr valign="top">
187 <td scope="row" class=" settingInput" id="xyz_ips_bottomBorderNone">
188 </td>
189 <td id="xyz_ips_bottomBorderNone">
190 <input style="margin:10px 0 20px 0;" id="submit" class="button-primary xyz_ips_bottonWidth" type="submit" value=" Update Settings " />
191 </td>
192 </tr>
193 </table>
194 </fieldset>
195 </div>
196 </form>
197 </div>
198