-
Notifications
You must be signed in to change notification settings - Fork 16
/
index.php
174 lines (167 loc) · 6.09 KB
/
index.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
<?php
require("common.php");
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>MP3音乐盘</title>
<LINK media=screen href="bootstrap/css/bootstrap.css" type="text/css" rel="stylesheet">
<link href="js/skins/default.css" rel="stylesheet" />
<style>
boby{
background-color: #EBF0EF;
}
.hero-unit
{
position:absolute;
}
#left-side
{
float:left;
width:500px;
}
#right-side
{
float:right;
width:300px;
padding-top:25px;
}
</style>
</head>
<body >
<div class="navbar">
<div class="navbar-inner">
<div class="container">
<ul class="nav">
<li class="active">
<a href="./">首页</a>
</li>
<li><a href="list.php">已上传文件</a></li>
<li><a href="http://blog.star7th.com/2015/05/1509.html" target="_blank">技术博客</a></li>
<li ><a href="http://weibo.com/n33n" target="_blank">@第七星尘</a></li>
</ul>
</div>
</div>
</div><!-- end navbar-->
<div class="container">
<div class="hero-unit">
<div id="left-side">
<form id="local" enctype="multipart/form-data" method="post" name="form_upFile">
<span id="uploadImg">
<input type="file" name="f" id="upFile"/>
<input type="hidden" name="MAX_FILE_SIZE" value="10480000" />
<input name="submit1" type="submit" value="开始上传" class="btn" onclick="form_upFile.submit()"/>
</span>
</form>
<?php
require("upload.php");//上传处理文件
?>
<form action="" method="post" name="form_config" >
<span>你可以在下面手动填写非本空间的MP3网络地址。
<br>
若上传文件的请保持系统的自动填写。</span>
<table>
<tr>
<td>mp3网络地址:</td>
<td><input name="mp3file" type="text" value="<?php if(isset($url)) echo $url?>" size="50"></td>
</tr>
<tr>
<td>默认音量</td>
<td><input name="dewvolume" type="text" value="100" size="6">%</td>
</tr>
<tr>
<td>播放控制</td>
<td>
<input name="dewstart" type="radio" id="dewstart" value="1" checked="checked" /> 自动播放
<input name="dewstart" type="radio" id="dewstart" value="0" /> 手动播放
</td>
</tr>
<tr>
<td>是否循环</td>
<td>
<input name="dewreplay" type="radio" value="1" checked="checked">循环播放
<input name="dewreplay" type="radio" value="0" >不循环
</td>
</tr>
<tr>
<td><strong>播放器样式:</strong></td>
</tr>
<tr>
<td>
<input type="radio" name="dewversion" value="dewplayer" checked="checked"> 经典样式
</td>
<td>
<object type="application/x-shockwave-flash" data="dewplayer.swf" width="200" height="20" id="dewplayer"><param name="movie" value="dewplayer.swf" /></object>
<br>
</td>
</tr>
<tr>
<td>
<input type="radio" name="dewversion" value="dewplayer_mini"> 迷你样式
</td>
<td>
<object type="application/x-shockwave-flash" data="dewplayer_mini.swf?mp3=<?php echo $bgmusic?>&autostart=1&volume=100" width="160" height="20" id="dewplayer-mini"><param name="movie" value="dewplayer_mini.swf" /></object>
<br>
</td>
</tr>
<tr><td><br><input type="button" class="btn" value="生成flash代码" onclick="create_code()"></td></tr>
</table>
</form>
</div><!-- end left-side -->
<div id="right-side">
<ul class="nav nav-pills nav-stacked">
<li>已上传的音乐:(可以直接点击使用)</li>
<?php
$sql="select * from mp3 order by datetime desc limit 10";
$result=mysql_query($sql)OR die("<br>读取数据库错误!<br>");
if($num=mysql_num_rows($result))
{
while($row=mysql_fetch_array($result))
{
echo "<li><a href=\"?url=".$row['url']."\">".$row['name']."</a></li>";
}
}
?>
</ul>
<p><a href="list.php">点击此处浏览更多...</a></p>
</div>
</div>
</div><!-- end container-->
<script src="js/artDialog.min.js"></script>
<script >
function create_code()
{
var weburl="<?php echo WEB_URL ;?>";
var Mp3file = document.form_config.mp3file.value;
var Volume= document.form_config.dewvolume.value;
for (i = 0; i < document.getElementsByName("dewstart").length; i++)
{
if(document.getElementsByName("dewstart")[i].checked)
{
Autostart= document.getElementsByName("dewstart")[i].value;
}
}
for (i = 0; i < document.getElementsByName("dewreplay").length; i++)
{
if(document.getElementsByName("dewreplay")[i].checked)
{
Autoreplay= document.getElementsByName("dewreplay")[i].value;
}
}
for (i = 0; i < document.getElementsByName("dewversion").length; i++)
{
if(document.getElementsByName("dewversion")[i].checked)
{
Dewversion = document.getElementsByName("dewversion")[i].value;
}
}
var content=" <textarea cols=\"140\" rows=\"4\" style=\"margin: 10px 10px 10px; width: 440px; height: 77px;\">"+weburl+"/"+Dewversion+".swf?mp3="+Mp3file+"&autostart="+Autostart+"&autoreplay="+Autoreplay+"&volume="+Volume+"</textarea><br>"+"请复制上面的代码到你所需要插入flash的地方,如论坛等。你也可以用浏览器<a href=\""+weburl+"/"+Dewversion+".swf?mp3="+Mp3file+"&autostart="+Autostart+"&autoreplay="+Autoreplay+"&volume="+Volume+"\" target=\"_bank\" >预览</a>";
art.dialog({
title: '成功生成代码!',
content: content
});
}
</script>
</body>
</html>