PluginProbe
Insert Html Snippet / 1.2.1
Insert Html Snippet v1.2.1
1.4.6 trunk 1.0 1.0.1 1.1 1.1.1 1.2 1.2.1 1.2.2 1.2.3 1.2.4 1.2.5 1.3 1.3.1 1.3.2 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 All 27 releases
insert-html-snippet / admin / settings.php

settings.php in Insert Html Snippet 1.2.1, at admin/settings.php

130 lines 4.4 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 global $wpdb;
5 // Load the options
6
7
8 if(isset($_GET['ihsap_notice'])&& $_GET['ihsap_notice'] == 'hide')
9 {
10 update_option('xyz_ihsap_dnt_shw_notice', "hide");
11 ?>
12 <style type='text/css'>
13 #ihs_notice_td
14 {
15 display:none;
16 }
17 </style>
18 <div class="system_notice_area_style1" id="system_notice_area">
19 Thanks again for using the plugin. We will never show the message again.
20 &nbsp;&nbsp;&nbsp;<span
21 id="system_notice_area_dismiss">Dismiss</span>
22 </div>
23 <?php
24 }
25
26
27
28 if($_POST){
29 if (! isset( $_REQUEST['_wpnonce'] ) || ! wp_verify_nonce( $_REQUEST['_wpnonce'], 'snipp-setting_' )) {
30 wp_nonce_ays( 'snipp-setting_' );
31 exit;
32 }
33 else {
34 $_POST=xyz_trim_deep($_POST);
35 $_POST = stripslashes_deep($_POST);
36 $xyz_ihs_limit = abs(intval($_POST['xyz_ihs_limit']));
37 if($xyz_ihs_limit==0)$xyz_ihs_limit=20;
38 $xyz_ihs_credit = $_POST['xyz_ihs_credit'];
39 if($xyz_ihs_credit=="ihs" || $xyz_ihs_credit==0)
40 {
41 update_option('xyz_credit_link',$xyz_ihs_credit);
42 }
43
44 $xyz_ihs_sortfield=$_POST['xyz_ihs_sort_by_field'];
45 if(($xyz_ihs_sortfield=="title")||($xyz_ihs_sortfield=="id"))
46 {
47 update_option('xyz_ihs_sort_field_name',$xyz_ihs_sortfield);
48 }
49
50 $xyz_ihs_sortorder=$_POST['xyz_ihs_sort_by_order'];
51 if(($xyz_ihs_sortorder=="asc")||($xyz_ihs_sortorder=="desc"))
52 {
53 update_option('xyz_ihs_sort_order',$xyz_ihs_sortorder);
54 }
55
56
57 update_option('xyz_ihs_limit',$xyz_ihs_limit);
58
59
60
61 ?>
62 <div class="system_notice_area_style1" id="system_notice_area">
63 Settings updated successfully. &nbsp;&nbsp;&nbsp;
64 <span id="system_notice_area_dismiss">Dismiss</span>
65 </div>
66 <?php
67 }
68 }
69 ?>
70 <div>
71 <form method="post">
72 <?php wp_nonce_field('snipp-setting_');?>
73 <div style="float: left;width: 98%">
74 <fieldset style=" width:100%; border:1px solid #F7F7F7; padding:10px 0px 15px 10px;">
75 <legend ><h3>
76 Settings
77 </h3></legend>
78 <table class="widefat" style="width:99%;">
79 <tr valign="top">
80 <td scope="row" >
81 <label for="xyz_ihs_sort">Sorting of snippets</label>
82 </td>
83 <td>
84 <select id="xyz_ihs_sort_by_field" name="xyz_ihs_sort_by_field">
85 <option value="id" <?php if(isset($_POST['xyz_ihs_sort_by_field']) && $_POST['xyz_ihs_sort_by_field']=='id'){echo 'selected';} else if(get_option('xyz_ihs_sort_field_name')=="id"){echo 'selected';} ?>>Based on create time</option>
86 <option value="title" <?php if(isset($_POST['xyz_ihs_sort_by_field']) && $_POST['xyz_ihs_sort_by_field']=='title'){ echo 'selected';}elseif(get_option('xyz_ihs_sort_field_name')=="title"){echo 'selected';} ?>>Based on name</option>
87 </select>
88 &nbsp;
89 <select id="xyz_ihs_sort_by_order" name="xyz_ihs_sort_by_order" >
90 <option value="asc" <?php if(isset($_POST['xyz_ihs_sort_by_order']) && $_POST['xyz_ihs_sort_by_order']=='asc'){ echo 'selected';}elseif(get_option('xyz_ihs_sort_order')=="asc"){echo 'selected';} ?>>Ascending</option>
91 <option value="desc" <?php if(isset($_POST['xyz_ihs_sort_by_order']) && $_POST['xyz_ihs_sort_by_order']=='desc'){echo 'selected';} elseif(get_option('xyz_ihs_sort_order')=="desc"){echo 'selected';} ?>>Descending</option>
92 </select>
93 </td>
94 </tr>
95 <tr valign="top">
96 <td scope="row" >
97 <label for="xyz_ihs_credit">Credit link to author</label>
98 </td>
99 <td>
100 <select name="xyz_ihs_credit" id="xyz_ihs_credit">
101 <option value="ihs"
102 <?php selected(get_option('xyz_credit_link'),"ihs"); ?>>Enable</option>
103 <option value="0"
104 <?php if(get_option('xyz_credit_link')!="ihs"){echo 'selected';} ?>>Disable</option>
105 </select>
106 </td>
107 </tr>
108 <tr valign="top">
109 <td scope="row" class=" settingInput" id="">
110 <label for="xyz_ihs_limit">Pagination limit</label>
111 </td>
112 <td id="">
113 <input name="xyz_ihs_limit" type="text"
114 id="xyz_ihs_limit" value="
115 <?php if(isset($_POST['xyz_ihs_limit']) ){echo abs(intval($_POST['xyz_ihs_limit']));}else{print(get_option('xyz_ihs_limit'));} ?>" />
116 </td>
117 </tr>
118 <tr valign="top">
119 <td scope="row" class=" settingInput" id="bottomBorderNone">
120 </td>
121 <td id="bottomBorderNone">
122 <input style="margin:10px 0 20px 0;" id="submit" class="button-primary bottonWidth" type="submit" value=" Update Settings " />
123 </td>
124 </tr>
125 </table>
126 </fieldset>
127 </div>
128 </form>
129 </div>
130