This repository has been archived by the owner on Mar 5, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7
/
setting.php
executable file
·78 lines (64 loc) · 2.87 KB
/
setting.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
<?php
include 'language.php';
add_action( 'admin_menu', 'my_plugin_menu' );
function my_plugin_menu() {
global $language;
add_menu_page( $language[0], $language[0], 'manage_options', 'smms-image-library', 'my_plugin_library' );
add_submenu_page( 'smms-image-library', $language[1], $language[1], 'manage_options', 'smms-image-library', 'my_plugin_library' );
add_submenu_page( 'smms-image-library', $language[2], $language[2], 'manage_options', 'smms-image', 'my_plugin_options' );
}
function my_plugin_library(){
@require_once( 'library.php' );
}
function my_plugin_options() {
global $language;
if(isset($_POST['DataSubmit']))
{
$Uploader = array(
'Content' => trim(@$_POST['content']),
'Comment' => trim(@$_POST['comment']),
'Authorization' => trim(@$_POST['authorization']),
'Nolocal' => trim(@$_POST['no_local'])
);
@update_option('SMMS_DATA', $Uploader);
echo '<div class="updated" id="message"><p>'.$language[3].'</p></div>';
}
$Uploader = get_option('SMMS_DATA');
$Content = $Uploader['Content'] !== '' ? 'checked="checked"' : '';
$Comment = $Uploader['Comment'] !== '' ? 'checked="checked"' : '';
$Nolocal = $Uploader['Nolocal'] !== '' ? 'checked="checked"' : '';
$Authorization = $Uploader['Authorization'];
if ( !current_user_can( 'manage_options' ) ) {
wp_die( __( 'You do not have sufficient permissions to access this page.' ) );
}
echo get_option('WPLANG');
echo '<div class="wrap">';
echo '<h2>'.$language[4].'</h2>';
echo '<p> '.$language[5].'</p>';
echo '<form method = "post">';
echo '<table class = "form-table">';
echo '<tbody>';
echo '<tr valign="top">';
echo '<th scope="row">Authorization'.$language[2].'</th>';
echo '<td><label><input value = "'.$Authorization.'" type = "text" name = "authorization" size="40"> <a target="_blank" href="https://sm.ms/home/apitoken">'.$language[6].'</a></label></td>';
echo '</tr>';
echo '<tr valign="top">';
echo '<th scope="row">'.$language[7].'</th>';
echo '<td><label><input value = "true" type = "checkbox" name = "content" '.$Content.'> '.$language[8].'</label></td>';
echo '</tr>';
echo '<tr valign="top">';
echo '<th scope="row">'.$language[9].'</th>';
echo '<td><label><input value = "true" type = "checkbox" name = "comment" '.$Comment.'> '.$language[10].'</label></td>';
echo '</tr>';
echo '<tr valign="top">';
echo '<th scope="row">'.$language[11].'</th>';
echo '<td><label><input value = "true" type = "checkbox" name = "no_local" '.$Nolocal.'> '.$language[12].'</label></td>';
echo '</tr>';
echo '</tbody>';
echo '</table>';
echo '<p class = "submit">';
echo '<input class = "button button-primary" type = "submit" name = "DataSubmit" id = "submit" value = "'.$language[13].'" /> ';
echo '</p>';
echo '</table>';
echo '</div>';
}