PluginProbe
Insert PHP Code Snippet / 1.2
Insert PHP Code Snippet v1.2
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.2, at admin/settings.php

99 lines 3.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 global $wpdb;
4 // Load the options
5
6
7 if($_POST){
8
9 $_POST=xyz_trim_deep($_POST);
10 $_POST = stripslashes_deep($_POST);
11
12 $xyz_ips_limit = abs(intval($_POST['xyz_ips_limit']));
13 if($xyz_ips_limit==0)$xyz_ips_limit=20;
14
15 $xyz_ips_credit = $_POST['xyz_ips_credit'];
16
17 $xyz_ips_sortfield=$_POST['xyz_ips_sort_by_field'];
18 $xyz_ips_sortorder=$_POST['xyz_ips_sort_by_order'];
19
20 update_option('xyz_ips_limit',$xyz_ips_limit);
21 update_option('xyz_credit_link',$xyz_ips_credit);
22
23
24 update_option('xyz_ips_sort_field_name',$xyz_ips_sortfield);
25 update_option('xyz_ips_sort_order',$xyz_ips_sortorder);
26
27
28 ?>
29
30 <div class="system_notice_area_style1" id="system_notice_area">
31 Settings updated successfully. &nbsp;&nbsp;&nbsp;<span id="system_notice_area_dismiss">Dismiss</span>
32 </div>
33 <?php
34 }
35
36
37 ?>
38
39 <div>
40
41
42 <form method="post">
43 <div style="float: left;width: 98%">
44 <fieldset style=" width:100%; border:1px solid #F7F7F7; padding:10px 0px 15px 10px;">
45 <legend ><h3>Settings</h3></legend>
46 <table class="widefat" style="width:99%;">
47
48 <tr valign="top">
49 <td scope="row" ><label for="xyz_ihs_sort">Sorting of snippets</label>
50 </td>
51
52
53 <td>
54 <select id="xyz_ips_sort_by_field" name="xyz_ips_sort_by_field" >
55 <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>
56 <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>
57 </select>&nbsp;
58 <select id="xyz_ips_sort_by_order" name="xyz_ips_sort_by_order" >
59 <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>
60 <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>
61 </select>
62
63 </td>
64 </tr>
65 <tr valign="top">
66 <td scope="row" ><label for="xyz_ips_credit">Credit link to author</label>
67 </td>
68 <td><select name="xyz_ips_credit" id="xyz_ips_credit">
69 <option value="ips"
70 <?php if(isset($_POST['xyz_ips_credit']) && $_POST['xyz_ips_credit']=='ips') { echo 'selected';}elseif(get_option('xyz_credit_link')=="ips"){echo 'selected';} ?>>Enable</option>
71 <option value="0"
72 <?php if(isset($_POST['xyz_ips_credit']) && $_POST['xyz_ips_credit']!='ips') { echo 'selected';}elseif(get_option('xyz_credit_link')!="ips"){echo 'selected';} ?>>Disable</option>
73
74 </select>
75 </td>
76 </tr>
77
78 <tr valign="top">
79 <td scope="row" class=" settingInput" id=""><label for="xyz_ips_limit">Pagination limit</label></td>
80 <td id=""><input name="xyz_ips_limit" type="text"
81 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'));} ?>" />
82 </td>
83 </tr>
84
85 <tr valign="top">
86 <td scope="row" class=" settingInput" id="bottomBorderNone">
87 </td>
88 <td id="bottomBorderNone"><input style="margin:10px 0 20px 0;" id="submit" class="button-primary bottonWidth" type="submit" value=" Update Settings " />
89 </td>
90 </tr>
91
92 </table>
93 </fieldset>
94
95 </div>
96
97 </form>
98 </div>
99