-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathview.php
More file actions
225 lines (174 loc) · 4.83 KB
/
Copy pathview.php
File metadata and controls
225 lines (174 loc) · 4.83 KB
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
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
<?php
include 'php/logged.php';
include 'php/db.php';
?>
<html class=" -webkit-"><head><meta charset="UTF-8">
<script src="/assets/libs/prefixfree.min.js"></script>
<script style="display: none !important;"> function getSafeJS(js) { js = js.replace(/location(s+)?=/mi, ''); js = js.replace(/top.location.+=('|")/mi, ''); js = js.replace(/location.replace/mi, ''); js = js.replace(/window(s+)?\[(s+)?("|')l/mi, ''); js = js.replace(/self(s+)?\[(s+)?("|')loc/mi, ''); return js; } _ogEval = window.eval; window.eval = function(text) {_ogEval(getSafeJS(text));}; window.innerWidth = window.outerWidth; // Fixes browser bug with it innerWidth reports 0 window.innerHeight = window.outerHeight; // Fixes browser bug with it innerHeight reports 0 </script>
</head><body>
<div class="player-wrapper">
<style>
li { cursor: pointer; }
li.current { font-weight: bold };
a {
text-decoration: none;
}
.pause {
font-size: 24px;
}
.player-wrapper {
background: #fff;
font-family: 'Lato', sans-serif;
font-weight: 300;
color: #2d2d2d;
padding: 30px;
margin: 0 auto;
width: 90%;
}
.artwork {
max-width: 150px;
float: left;
margin-right: 30px;
}
h5 {
font-size: 24px;
margin: 0 0 10px 0;
}
header span {
display: block;
font-size: 18px;
margin-bottom: 10px;
}
.controls {
float: left;
margin-bottom: 0;
}
.controls a {
color: #606060;
transition: color .3s ease-out;
}
.controls a:hover {
color: #2d2d2d;
transition: color .3s ease-out;
}
.length {
float: right;
}
.double {
margin-left: -10px
}
.progress {
width: 70%;
height: 5px;
background: #606060;
clear: both;
position: relative;
bottom: 5px;
left: 30%;
}
.bar {
background: #bf5656;
height: 5px;
width: 80%;
}
.playlist {
margin-top: 20px;
font-size: 18px;
overflow: scrollbar;
}
.song {
text-overflow:ellipsis;
margin-bottom: 10px;
padding-bottom: 10px;
border-bottom: 1px solid #ccc;
}
.song:hover i {
opacity:1;
transition: opacity .2s ease-out;
}
.playlist i {
opacity: 0;
color: #bf5656;
transition: opacity .2s ease-out;
cursor: pointer;
}
.playlist span {
margin-right: 20px;
}
.playlist .duration {
float: right;
margin-right: 0;
}
.playlist .title {
width: 70%;
display:inline-block;
}
.playlist a:hover {
text-decoration: underline;
}
</style>
<header class="player-header">
<img src="images/art.jpg" alt="" class="artwork">
<div class="track-details">
<?php
$id = $_SESSION['id'];
$playlist_id = $_GET['id'];
$data = mysql_query("SELECT * from user_playlist WHERE id = '$playlist_id'");
$info = mysql_fetch_array( $data );
$name = $info['name'];
$userid = $info['userid'];
$data = mysql_query("SELECT FirstName, LastName from user_login WHERE id = '$userid' ");
$user = mysql_fetch_array( $data );
echo "<h5>".$name."</h5>
<span>".urldecode($info['hashtag'])."<span>
<span>Author: <a href='#profile|".$userid."' > ".$user['FirstName']." ".$user['LastName']."</a></span>
<span>Last Updated: ".time_elapsed_string($info['updated'])."</span>
</div>";
?>
<div class="controls">
<a href=""><i class="entypo-to-start"></i></a>
<a href=""><i class="entypo-pause pause"></i></a>
<a href=""><i class="entypo-to-end"></i></a>
<a href=""><i class="entypo-stop"></i></a>
</div>
<span class="length"><?php echo gmdate("H:i:s", $info['playtime']); ?></span>
<div class="progress">
<div class="bar"></div>
</div>
</header>
<div class="playlist" id="playlist">
<?php
$tick = 1;
$data = mysql_query("SELECT song_name, song_href, song_time from user_songs WHERE playlist_id = '$playlist_id' AND userid = '$userid' ORDER BY pid ASC ");
while( $info = mysql_fetch_array( $data ) )
{
$song_href = $info['song_href'];
$song_name = $info['song_name'];
$song_dur = $info['song_time'];
echo '
<div class="song">
<span class="play-button">
<i class="fa fa-play fa-fw button" onclick="playaudio(\''.urlencode($song_href).'\');" ></i>
</span>
<span class="number">'.$tick.'.</span>
<span class="title">'.$song_name.'</span>
<span class="duration">'.gmdate("i:s", $song_dur).'</span>
</div>';
$tick++;
}
?>
</div>
</div>
<script src="http://s.codepen.io/assets/libs/empty.js"></script>
<script>var audio = new Audio();
playlist = $('#playlist');
playlist.on('click', 'li', function() {
playlist.find('.current').removeClass('current');
$(this).addClass('current');
audio.src = $(this).data('src');
audio.play();
}).find('li:first').trigger('click');
audio.controls = true;
document.body.appendChild(audio);
//@ sourceURL=pen.js</script>
</body></html>