-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmain.php
176 lines (172 loc) · 11.2 KB
/
main.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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
<?php
require '../../../zb_system/function/c_system_base.php';
require '../../../zb_system/function/c_system_admin.php';
$zbp->Load();
if (!$zbp->CheckRights('root')) {$zbp->ShowError(6);exit();}
if (!$zbp->CheckPlugin('APlayer')) {$zbp->ShowError(48);die();}
require '../../../zb_system/admin/admin_header.php';
require '../../../zb_system/admin/admin_top.php';
if(isset($_POST['api'])){
$tips = '';
foreach($_POST as $k => $v) $$k = $v; $tips = '';
if(empty($api)){
$zbp->ShowHint('bad', 'API 地址不允许为空!');
} else {
if ($api != ($zbp->Config('APlayer')->api)) {
$zbp->Config('APlayer')->api = $api;
$tips .= 'API 地址设置成功;';
}
}
$mutex = in_array('mutex', $options) ? 1 : 0;
$narrow = in_array('narrow', $options) ? 1 : 0;
$autoplay = in_array('autoplay', $options) ? 1 : 0;
$mix = in_array('mix', $options) ? 1 : 0;
$parselist = in_array('parselist', $options) ? 1 : 0;
if ($narrow != $zbp->Config('APlayer')->narrow) {
$zbp->Config('APlayer')->narrow = $narrow;
$tips .= '设置已应用;';
}
if ($autoplay != $zbp->Config('APlayer')->autoplay) {
$zbp->Config('APlayer')->autoplay = $autoplay;
$tips .= '设置已应用;';
}
if ($mutex != $zbp->Config('APlayer')->mutex) {
$zbp->Config('APlayer')->mutex = $mutex;
$tips .= '设置已应用;';
}
if ($theme != $zbp->Config('APlayer')->theme) {
$zbp->Config('APlayer')->theme = $theme;
$tips .= '设置已应用;';
}
if ($mode != $zbp->Config('APlayer')->mode) {
$zbp->Config('APlayer')->mode = $mode;
$tips .= '设置已应用;';
}
if ($preload != $zbp->Config('APlayer')->preload) {
$zbp->Config('APlayer')->preload = $preload;
$tips .= '设置已应用;';
}
if ($mix != $zbp->Config('APlayer')->mix) {
$zbp->Config('APlayer')->mix = $mix;
$tips .= '设置已应用;';
}
if ($parselist != $zbp->Config('APlayer')->parselist) {
$zbp->Config('APlayer')->parselist = $parselist;
$tips .= '设置已应用;';
}
$zbp->SaveConfig('APlayer');
if (!empty($tips)) {
$tips = explode(";",$tips);
for ($i=0;$i<count($tips)-1;$i++) $zbp->ShowHint('good', $tips[$i]);
} else $zbp->ShowHint('bad', '设置未更改');
}
?>
<link rel="stylesheet" href="jcolor/jcolor.min.css" type="text/css" />
<style>table,td,th,tr,.api,tr.color1,tr.color2,tr.color3,tr.color4 { background: rgba(0,0,0,0)!important; border: 2px solid rgba(100,100,100,0.2)!important; }</style>
<script type="text/javascript" src="jcolor/jcolor.min.js"></script>
<!-- 背景图取自 pixiv,作品ID:62477678。 (https://www.pixiv.net/member_illust.php?mode=medium&illust_id=62477678) -->
<div id="divMain" style="border-radius: 3px; padding: 10px; background: white url(<?php echo $zbp->host; ?>zb_users/plugin/APlayer/bg.png) no-repeat right bottom;">
<div class="divHeader"><a href="https://app.zblogcn.com/?id=1321" target="_blank">APlayer for Z-BlogPHP</a> - 插件配置</div>
<div id="divMain2">
<form id="form1" name="form1" method="post">
<table width="90%" style='padding:0px;margin:0px;' cellspacing='0' cellpadding='0' class="tableBorder">
<tr>
<th width='20%'><p align="center">设置</p></th>
<th width='70%'><p align="center">选项</p></th>
</tr>
<?php
$config = array(
'api' => $zbp->Config('APlayer')->api,
'narrow' => $zbp->Config('APlayer')->narrow,
'autoplay' => $zbp->Config('APlayer')->autoplay,
'mutex' => $zbp->Config('APlayer')->mutex,
'theme' => $zbp->Config('APlayer')->theme,
'mode' => $zbp->Config('APlayer')->mode,
'preload' => $zbp->Config('APlayer')->preload,
'mix' => $zbp->Config('APlayer')->mix,
'parselist' => $zbp->Config('APlayer')->parselist
);
?>
<tr>
<td><b><p align="center">API 地址</p></b></td>
<td><p align="left"><input class="api" name="api" type="text" size="100%" value="<?php echo $config['api']; ?>" /></p></td>
</tr>
<tr>
<td><b><p align="center">附加/默认设置</p></b></td>
<td>
<p align="left"></p>
<p align="left"> 预加载:
<input type="radio" name="preload" value="0" <?php if($config['preload']==0){echo 'checked="checked"';} ?>/>自动
<input type="radio" name="preload" value="1" <?php if($config['preload']==1){echo 'checked="checked"';} ?>/>开启
<input type="radio" name="preload" value="2" <?php if($config['preload']==2){echo 'checked="checked"';} ?>/>关闭
</p>
<p align="left"> 播放模式:
<input type="radio" name="mode" value="0" <?php if($config['mode']==0){echo 'checked="checked"';} ?>/>顺序
<input type="radio" name="mode" value="1" <?php if($config['mode']==1){echo 'checked="checked"';} ?>/>随机
<input type="radio" name="mode" value="2" <?php if($config['mode']==2){echo 'checked="checked"';} ?>/>单曲循环
<input type="radio" name="mode" value="3" <?php if($config['mode']==3){echo 'checked="checked"';} ?>/>列表循环
</p>
<p align="left">
简洁模式 <input type="checkbox" name="options[]" value="narrow" <?php if($config['narrow']==1){echo 'checked="checked"';} ?>/>
自动播放 <input type="checkbox" name="options[]" value="autoplay" <?php if($config['autoplay']==1){echo 'checked="checked"';} ?>/>
静音其他实例 <input type="checkbox" name="options[]" value="mutex" <?php if($config['mutex']==1){echo 'checked="checked"';} ?>/>
获取歌词翻译 <input type="checkbox" name="options[]" value="mix" <?php if($config['mix']==1){echo 'checked="checked"';} ?>/>
解析列表页标签 <input type="checkbox" name="options[]" value="parselist" <?php if($config['parselist']==1){echo 'checked="checked"';} ?>/>
</p>
<p align="left">---------------------------------------------------------</p>
<p align="left">
自定义颜色
<input type="text" size="6" id="color" name="theme" value="<?php echo $zbp->Config('APlayer')->theme; ?>"/>
<a onclick="color_picker($('#color').val());">预览颜色</a>
<a class="APlayer-theme-color" style="float:left;padding:6px 10px"></a>
</p>
<p align="left">
推荐配色
<a onclick="color_picker('#FADFA3');" style="background-color:#FADFA3;border:1px solid #aaa"> </a>
<a onclick="color_picker('#7addeb');" style="background-color:#7addeb;border:1px solid #aaa"> </a>
<a onclick="color_picker('#dab3db');" style="background-color:#dab3db;border:1px solid #aaa"> </a>
<a onclick="color_picker('#e69184');" style="background-color:#e69184;border:1px solid #aaa"> </a>
<a onclick="color_picker('#acec8e');" style="background-color:#acec8e;border:1px solid #aaa"> </a>
<a onclick="color_picker('#ffffff');" style="background-color:#ffffff;border:1px solid #aaa"> </a>
</p>
<script>
function color_picker(hex) {
$("#color").val(hex);$("#color").css("background-color",hex);
$('.APlayer-theme-color').colorpicker().destroy();
$('.APlayer-theme-color').colorpicker({
labels: true,
color: hex,
colorSpace: 'rgb',
expandEvent: 'mouseenter',
collapseEvent: 'mouseleave mousewheel'
});
$('.APlayer-theme-color').on('newcolor', function (ev, colorpicker) {
$("#color").val(colorpicker.toString('rgb'));$("#color").css("background-color",colorpicker.toString('rgb'));
});
}
color_picker('<?php echo $zbp->Config('APlayer')->theme; ?>');
</script>
<p align="left">---------------------------------------------------------</p>
<p align="left"> ◊ <a href="http://diygod.me" target="_blank">关于作者</a> | <a href="https://github.com/DIYgod/APlayer/issues" target="_blank">意见反馈</a> | <a href="https://www.anotherhome.net/2167" target="_blank">关于 APlayer 播放器</a></p>
<p align="left"></p>
</td>
</tr>
</table>
<div style="width:90%;float:inherit">
<div style="float:left;padding:10px 0">
©2017 <a href="https://www.fghrsh.net" target="_blank" style="color:#333333">FGHRSH</a> - <a href="https://www.fghrsh.net/post/77.html" target="_blank" style="color:#333333">APlayer for Z-BlogPHP V1.4</a> (APlayer 1.6.0)
</div>
<div style="float:right;padding:5px 0;">
<input type="Submit" class="button" value="保存设置" />
</div>
</div>
</form>
</div>
</div>
</div>
<?php require $blogpath . 'zb_system/admin/admin_footer.php'; RunTime();