-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
408 lines (380 loc) · 16 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
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
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
<!--
"index.php"
This page uses the youtube api in order to load the videoIds from a playlistId.
As it gets the videoIds, it sends them to the server through an ajax call to
"server.php". The server then scrapes youtube for the metadata and stores it all
in the database. Additionally, it stores the videoIds in a session variable so when
this page redirects to the player, the videoIds are stored in the session variable.
TODO
-Before even calling the youtube api, it should check if the playlist is on the
database, in which case it shouldn't even call the youtube api as all the info is
in the database
-Most of kyle's work should be incorporated here as his work is used to get the
playlistId which my code then uses
-Additionally, I think user's should be able to pick more than one playlist as most
aren't at least 60 videos. This wouldn't be too difficult as the play.php just needs
the videoIds stored in the session variable and then pulls the metadata from the
database
-fix search IDs into classes since we use them in 2 different spots
-->
<?php
include("./php/getmostpopular.php");
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="">
<meta name="author" content="">
<title>Hour of Power</title>
<!-- Bootstrap Core CSS -->
<link href="css/bootstrap.min.css" rel="stylesheet">
<!-- Custom CSS -->
<link href="css/agency.css" rel="stylesheet">
<link href="css/kylecss.css" rel="stylesheet">
<!-- Custom Fonts -->
<link href="font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css">
<link href="http://fonts.googleapis.com/css?family=Montserrat:400,700" rel="stylesheet" type="text/css">
<link href='http://fonts.googleapis.com/css?family=Kaushan+Script' rel='stylesheet' type='text/css'>
<link href='http://fonts.googleapis.com/css?family=Droid+Serif:400,700,400italic,700italic' rel='stylesheet' type='text/css'>
<link href='http://fonts.googleapis.com/css?family=Roboto+Slab:400,100,300,700' rel='stylesheet' type='text/css'>
</head>
<body id="page-top" class="index">
<!-- Navigation -->
<nav class="navbar navbar-default navbar-fixed-top">
<div class="container">
<!-- Brand and toggle get grouped for better mobile display -->
<div class="navbar-header page-scroll">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand page-scroll" href="#page-top">Hour of Power</a>
</div>
<!-- Collect the nav links, forms, and other content for toggling -->
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav navbar-right">
<li class="hidden">
<a href="#page-top"></a>
</li>
<li>
<a class="page-scroll" href="#mostpopular">Popular</a>
</li>
<li>
<a class="page-scroll" href="#about">About</a>
</li>
<li>
<a class="page-scroll" href="#contact">Contact</a>
</li>
<li>
<div id="noti_Container">
<a class="page-scroll" href="./mylist.html">My List</a>
<div class="noti_bubble" style="display:none"></div>
</div>
</li>
</ul>
</div>
<!-- /.navbar-collapse -->
</div>
<!-- /.container-fluid -->
</nav>
<!-- Header -->
<header>
<div class="container">
<form class="navbar-form" role="search" action="results.php" method="GET">
<div class="input-group searchHeader" id="mid-page">
<input type="text" class="form-control searchBar" name="search_query" id="query_bot" placeholder="Start Searching, So We Can Start Drinking!">
<div class="input-group-btn">
<button class="btn btn-default" type="submit"><i class="glyphicon glyphicon-search"></i></button>
</div>
</div>
</form>
<div class="intro-text">
<div class="intro-lead-in">You Look A Little Thirsty!</div>
<div class="intro-heading">We Can Fix That.</div>
<a href="#mostpopular" class="page-scroll btn btn-xl">Let's Drink!</a>
</div>
</div>
</header>
<!-- Services Section -->
<section id="mostpopular">
<div class="container">
<div class="row">
<div class="col-lg-12 text-center">
<h2 class="section-heading">Most Popular</h2>
</div>
</div>
<div class="row">
<div class="col-sm-4 portfolio-item">
<a href="playlist.html?plist=<?php echo $mostpopularids[0];?>" class="portfolio-link" data-toggle="modal">
<div class="caption">
<div class="caption-content">
<?php echo $titles[0]; ?>
</div>
</div>
<table>
<tr>
<td><img class="img-responsive" src="http://img.youtube.com/vi/<?php echo $vid1[0]; ?>/mqdefault.jpg" alt=""></td>
<td><img class="img-responsive" src="http://img.youtube.com/vi/<?php echo $vid2[0]; ?>/mqdefault.jpg" alt=""></td>
</tr>
<tr>
<td><img class="img-responsive" src="http://img.youtube.com/vi/<?php echo $vid3[0]; ?>/mqdefault.jpg" alt=""></td>
<td><img class="img-responsive" src="http://img.youtube.com/vi/<?php echo $vid4[0]; ?>/mqdefault.jpg" alt=""></td>
</tr>
</table>
</a>
</div>
<div class="col-sm-4 portfolio-item">
<a href="playlist.html?plist=<?php echo $mostpopularids[1]?>" class="portfolio-link" data-toggle="modal">
<div class="caption">
<div class="caption-content">
<?php echo $titles[1] ?>
</div>
</div>
<table id="table1">
<tr>
<td><img class="img-responsive" src="http://img.youtube.com/vi/<?php echo $vid1[1]; ?>/mqdefault.jpg" alt=""></td>
<td><img class="img-responsive" src="http://img.youtube.com/vi/<?php echo $vid2[1]; ?>/mqdefault.jpg" alt=""></td>
</tr>
<tr>
<td><img class="img-responsive" src="http://img.youtube.com/vi/<?php echo $vid3[1]; ?>/mqdefault.jpg" alt=""></td>
<td><img class="img-responsive" src="http://img.youtube.com/vi/<?php echo $vid4[1]; ?>/mqdefault.jpg" alt=""></td>
</tr>
</table>
</a>
</div>
<div class="col-sm-4 portfolio-item">
<a href="playlist.html?plist=<?php echo $mostpopularids[2]?>" class="portfolio-link" data-toggle="modal">
<div class="caption">
<div class="caption-content">
<?php echo $titles[2] ?>
</div>
</div>
<table>
<tr>
<td><img class="img-responsive" src="http://img.youtube.com/vi/<?php echo $vid1[2]; ?>/mqdefault.jpg" alt=""></td>
<td><img class="img-responsive" src="http://img.youtube.com/vi/<?php echo $vid2[2]; ?>/mqdefault.jpg" alt=""></td>
</tr>
<tr>
<td><img class="img-responsive" src="http://img.youtube.com/vi/<?php echo $vid3[2]; ?>/mqdefault.jpg" alt=""></td>
<td><img class="img-responsive" src="http://img.youtube.com/vi/<?php echo $vid4[2]; ?>/mqdefault.jpg" alt=""></td>
</tr>
</table>
</a>
</div>
<div class="col-sm-4 portfolio-item">
<a href="playlist.html?plist=<?php echo $mostpopularids[3]?>" class="portfolio-link" data-toggle="modal">
<div class="caption">
<div class="caption-content">
<?php echo $titles[3] ?>
</div>
</div>
<table>
<tr>
<td><img class="img-responsive" src="http://img.youtube.com/vi/<?php echo $vid1[3]; ?>/mqdefault.jpg" alt=""></td>
<td><img class="img-responsive" src="http://img.youtube.com/vi/<?php echo $vid2[3]; ?>/mqdefault.jpg" alt=""></td>
</tr>
<tr>
<td><img class="img-responsive" src="http://img.youtube.com/vi/<?php echo $vid3[3]; ?>/mqdefault.jpg" alt=""></td>
<td><img class="img-responsive" src="http://img.youtube.com/vi/<?php echo $vid4[3]; ?>/mqdefault.jpg" alt=""></td>
</tr>
</table>
</a>
</div>
<div class="col-sm-4 portfolio-item">
<a href="playlist.html?plist=<?php echo $mostpopularids[4]?>" class="portfolio-link" data-toggle="modal">
<div class="caption">
<div class="caption-content">
<?php echo $titles[4] ?>
</div>
</div>
<table>
<tr>
<td><img class="img-responsive" src="http://img.youtube.com/vi/<?php echo $vid1[4]; ?>/mqdefault.jpg" alt=""></td>
<td><img class="img-responsive" src="http://img.youtube.com/vi/<?php echo $vid2[4]; ?>/mqdefault.jpg" alt=""></td>
</tr>
<tr>
<td><img class="img-responsive" src="http://img.youtube.com/vi/<?php echo $vid3[4]; ?>/mqdefault.jpg" alt=""></td>
<td><img class="img-responsive" src="http://img.youtube.com/vi/<?php echo $vid4[4]; ?>/mqdefault.jpg" alt=""></td>
</tr>
</table>
</a>
</div>
<div class="col-sm-4 portfolio-item">
<a href="playlist.html?plist=<?php echo $mostpopularids[5]?>" class="portfolio-link" data-toggle="modal">
<div class="caption">
<div class="caption-content">
<?php echo $titles[5] ?>
</div>
</div>
<table>
<tr>
<td><img class="img-responsive" src="http://img.youtube.com/vi/<?php echo $vid1[5]; ?>/mqdefault.jpg" alt=""></td>
<td><img class="img-responsive" src="http://img.youtube.com/vi/<?php echo $vid2[5]; ?>/mqdefault.jpg" alt=""></td>
</tr>
<tr>
<td><img class="img-responsive" src="http://img.youtube.com/vi/<?php echo $vid3[5]; ?>/mqdefault.jpg" alt=""></td>
<td><img class="img-responsive" src="http://img.youtube.com/vi/<?php echo $vid4[5]; ?>/mqdefault.jpg" alt=""></td>
</tr>
</table>
</a>
</div>
</div>
</div>
</section>
<!-- About Section -->
<section id="about">
<div class="container">
<div class="row">
<div class="col-lg-12 text-center">
<h2 class="section-heading">What is this thing? </h2>
<h3 class="section-subheading text-muted">This is an app used to create your own custom power hour playlist. You pick the songs, we'll handle the rest.</h3>
<h3 class="section-subheading text-muted">Every time the song changes, take a shot of beer. It's that simple.</h3>
<h3 class="section-subheading text-muted">This application was made to fill
the need of video power hours on the web. Don't you want something
cool to watch while you drink? But who wants to put in the work of downloading videos,
cutting them up, and putting them together. That's why we're here. To
make life simple. We like to drink and we know you do, too.</h3>
</div>
</div>
</div>
</section>
<!-- Team Section -->
<!-- <section id="team">
<div class="container">
<div class="row">
<div class="col-lg-12 text-center">
<h2 class="section-heading">Our Team</h2>
<h3 class="section-subheading text-muted">We're Just A Couple Of Guys Trying To Make The World A Better Place.</h3>
</div>
</div>
<div class="row">
<div class="col-sm-4">
<div class="team-member">
<img src="img/team/mike_profile.jpg" class="img-responsive img-circle" alt="">
<h4>Mike Rogers</h4>
<p class="text-muted">Downloader/Developer</p>
<ul class="list-inline social-buttons">
<li><a href="#"><i class="fa fa-twitter"></i></a>
</li>
<li><a href="#"><i class="fa fa-facebook"></i></a>
</li>
<li><a href="#"><i class="fa fa-linkedin"></i></a>
</li>
</ul>
</div>
</div>
<div class="col-sm-4">
<div class="team-member">
<img src="img/team/erik_profile.jpg" class="img-responsive img-circle" alt="">
<h4>Erik Schembor</h4>
<p class="text-muted">Developer</p>
<ul class="list-inline social-buttons">
<li><a href="#"><i class="fa fa-twitter"></i></a>
</li>
<li><a href="#"><i class="fa fa-facebook"></i></a>
</li>
<li><a href="#"><i class="fa fa-linkedin"></i></a>
</li>
</ul>
</div>
</div>
<div class="col-sm-4">
<div class="team-member">
<img src="img/team/kyle_profile.jpg" class="img-responsive img-circle" alt="">
<h4>Kyle Lyke</h4>
<p class="text-muted">Developer</p>
<ul class="list-inline social-buttons">
<li><a href="#"><i class="fa fa-twitter"></i></a>
</li>
<li><a href="https://www.facebook.com/kyle.lyke.5"><i class="fa fa-facebook"></i></a>
</li>
<li><a href="https://www.linkedin.com/profile/view?id=230107629&trk=nav_responsive_tab_profile"><i class="fa fa-linkedin"></i></a>
</li>
</ul>
</div>
</div>
</div>
</div>
</section> -->
<section id="contact">
<div class="container">
<div class="row">
<div class="col-lg-12 text-center">
<h2 class="section-heading">Contact Us At [email protected]</h2>
<h3 class="section-subheading text-muted">We're Still Working On Our Domain.</h3>
</div>
</div>
</div>
</section>
<footer>
<div class="container">
<div class="row">
<div class="col-sm-4">
<span class="copyright">Copyright © Your Website 2014</span>
</div>
<div class="col-sm-4">
<ul class="list-inline social-buttons">
<li><a href="#"><i class="fa fa-twitter"></i></a>
</li>
<li><a href="#"><i class="fa fa-facebook"></i></a>
</li>
<li><a href="#"><i class="fa fa-linkedin"></i></a>
</li>
</ul>
</div>
<div class="col-sm-4">
<ul class="list-inline quicklinks">
<li><a href="#">Privacy Policy</a>
</li>
<li><a href="#">Terms of Use</a>
</li>
</ul>
</div>
</div>
</div>
</footer>
<!-- jQuery -->
<script src="js/jquery.js"></script>
<script src="js/jquery-ui.min.js"></script>
<script src="js/lodash.js"></script>
<!-- Bootstrap Core JavaScript -->
<script src="js/bootstrap.min.js"></script>
<!-- Plugin JavaScript -->
<script src="http://cdnjs.cloudflare.com/ajax/libs/jquery-easing/1.3/jquery.easing.min.js"></script>
<script src="js/classie.js"></script>
<script src="js/cbpAnimatedHeader.js"></script>
<!-- Contact Form JavaScript -->
<script src="js/jqBootstrapValidation.js"></script>
<!-- Custom Theme JavaScript -->
<script src="js/agency.js"></script>
<script type="text/javascript">
$(document).ready(function(){
if(sessionStorage.getItem('myListMap_size') > 0) {
$(".noti_bubble").text(sessionStorage.getItem('myListMap_size'));
$(".noti_bubble").show();
console.log(sessionStorage.getItem('myListMap_size'));
}
});
function onClientLoad() {
gapi.client.setApiKey('AIzaSyCR5In4DZaTP6IEZQ0r1JceuvluJRzQNLE');
gapi.client.load('youtube', 'v3');
}
function test(){
console.log("you pressed enter");
}
$(window).scroll(function() {
if ($(document).scrollTop() > 130) {
$('#topsearch').fadeIn("slow");
} else {
$('#topsearch').fadeOut("slow");
}
});
</script>
<script src="https://apis.google.com/js/client.js?onload=onClientLoad"></script>
</body>
</html>