@@ -211,7 +211,7 @@ discard block |
||
211 | 211 | <!--<button class="yt-uix-button yt-uix-button-default" id="av-uplod">Select File</button>--> |
212 | 212 | </div><br><br> |
213 | 213 | <img src="/dynamic/pfp/<?php echo $_user['pfp']; ?>" style="width:100px;height:100px;"><br> |
214 | - <?php if($_user['pfp'] != "default.png") { ?> |
|
214 | + <?php if ($_user['pfp'] != "default.png") { ?> |
|
215 | 215 | <a href="/get/remove_profile_pic">Remove Profile Picture</a><br> |
216 | 216 | <?php } ?> |
217 | 217 | <br><hr class="thin-line-darker" style="width:unset;"> |
@@ -220,7 +220,7 @@ discard block |
||
220 | 220 | <input style="width: 169px;position: relative;top: 10px;" type="file" name="videopagebanner" id="avatar-upload"> |
221 | 221 | <!--<button class="yt-uix-button yt-uix-button-default" id="av-uplod">Select File</button>--> |
222 | 222 | </div><br> |
223 | - <?php if(!empty($_user['subbutton'])) { ?> |
|
223 | + <?php if (!empty($_user['subbutton'])) { ?> |
|
224 | 224 | <a href="/get/remove_watch_banner">Remove Watch Page Banner</a><br> |
225 | 225 | <?php } ?><br><hr class="thin-line-darker" style="width:unset;"> |
226 | 226 | |
@@ -240,17 +240,17 @@ discard block |
||
240 | 240 | |
241 | 241 | <b>Featured Video</b> |
242 | 242 | <div class="customization-module" id="featuredvid" action="/d/channel_update" enctype="multipart/form-data" style="display: inline-block;float:right;position: relative;bottom: 6px;"> |
243 | - <input style="padding: 5px;background-color: white;border: 1px solid #999;width: 291px;height: 12px;" id="biomd" placeholder="Video ID" value="<?php echo htmlspecialchars($_user['featured']);?>" name="videoid"> |
|
243 | + <input style="padding: 5px;background-color: white;border: 1px solid #999;width: 291px;height: 12px;" id="biomd" placeholder="Video ID" value="<?php echo htmlspecialchars($_user['featured']); ?>" name="videoid"> |
|
244 | 244 | </div><br><br><hr class="thin-line-darker" style="width:unset;"> |
245 | 245 | |
246 | 246 | <b>Featured Channels</b> |
247 | 247 | <div class="customization-module" id="featuredvid" action="/d/channel_update" enctype="multipart/form-data" style="display: inline-block;float:right;position: relative;bottom: 6px;"> |
248 | - <input style="padding: 5px;background-color: white;border: 1px solid #999;width: 291px;height: 12px;" id="biomd" placeholder="Seperate by commas!" value="<?php echo htmlspecialchars($_user['featured_channels']);?>" name="featuredchannels"> |
|
248 | + <input style="padding: 5px;background-color: white;border: 1px solid #999;width: 291px;height: 12px;" id="biomd" placeholder="Seperate by commas!" value="<?php echo htmlspecialchars($_user['featured_channels']); ?>" name="featuredchannels"> |
|
249 | 249 | </div><br><br><hr class="thin-line-darker" style="width:unset;"> |
250 | 250 | |
251 | 251 | <b>Website</b> |
252 | 252 | <div class="customization-module" id="featuredvid" action="/d/channel_update" enctype="multipart/form-data" style="float: right;position: relative;top: -7px;"> |
253 | - <input style="padding: 5px;background-color: white;border: 1px solid #999;width: 291px;height: 12px;" id="biomd" placeholder="Website URL" value="<?php echo htmlspecialchars($_user['website']);?>" name="website"> |
|
253 | + <input style="padding: 5px;background-color: white;border: 1px solid #999;width: 291px;height: 12px;" id="biomd" placeholder="Website URL" value="<?php echo htmlspecialchars($_user['website']); ?>" name="website"> |
|
254 | 254 | |
255 | 255 | </div><br><br><hr class="thin-line-darker" style="width:unset;"> |
256 | 256 | |
@@ -259,7 +259,7 @@ discard block |
||
259 | 259 | <span style="font-size: 11px;" class="grey-text">This will show what type of channel you are to other users.</span> |
260 | 260 | <div class="customization-module" id="channellayout" action="/d/channel_update" enctype="multipart/form-data" style="float: right;position: relative;top: -19px;"> |
261 | 261 | <select class="yt-uix-button yt-uix-button-default" style="position:relative;top:6px;" name="genre"> |
262 | - <?php foreach($categories as $category) { ?> |
|
262 | + <?php foreach ($categories as $category) { ?> |
|
263 | 263 | <option value="<?php echo $category; ?>"><?php echo $category; ?></option> |
264 | 264 | <?php } ?> |
265 | 265 | </select> |
@@ -17,7 +17,7 @@ discard block |
||
17 | 17 | $stmt->bindParam(":username", $_SESSION['siteusername']); |
18 | 18 | $stmt->bindParam(":reciever", $name); |
19 | 19 | $stmt->execute(); |
20 | -while($comment = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
20 | +while ($comment = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
21 | 21 | $stmt = $__db->prepare("DELETE FROM likes WHERE sender = :username AND reciever = :reciever"); |
22 | 22 | $stmt->execute(array( |
23 | 23 | ':username' => $_SESSION['siteusername'], |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | $stmt->bindParam(":username", $_SESSION['siteusername']); |
31 | 31 | $stmt->bindParam(":reciever", $name); |
32 | 32 | $stmt->execute(); |
33 | -while($comment = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
33 | +while ($comment = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
34 | 34 | $stmt = $__db->prepare("DELETE FROM likes WHERE sender = :username AND reciever = :reciever"); |
35 | 35 | $stmt->execute(array( |
36 | 36 | ':username' => $_SESSION['siteusername'], |
@@ -13,7 +13,7 @@ discard block |
||
13 | 13 | <?php |
14 | 14 | $name = $_GET['v']; |
15 | 15 | |
16 | -if(!isset($_SESSION['siteusername']) || !isset($_GET['v'])) { |
|
16 | +if (!isset($_SESSION['siteusername']) || !isset($_GET['v'])) { |
|
17 | 17 | header('Location: ' . $_SERVER['HTTP_REFERER']); |
18 | 18 | } |
19 | 19 | |
@@ -21,7 +21,7 @@ discard block |
||
21 | 21 | $stmt->bindParam(":username", $_SESSION['siteusername']); |
22 | 22 | $stmt->bindParam(":reciever", $name); |
23 | 23 | $stmt->execute(); |
24 | -while($comment = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
24 | +while ($comment = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
25 | 25 | $stmt = $__db->prepare("DELETE FROM likes WHERE sender = :username AND reciever = :reciever"); |
26 | 26 | $stmt->execute(array( |
27 | 27 | ':username' => $_SESSION['siteusername'], |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | $stmt->bindParam(":username", $_SESSION['siteusername']); |
35 | 35 | $stmt->bindParam(":reciever", $name); |
36 | 36 | $stmt->execute(); |
37 | -while($comment = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
37 | +while ($comment = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
38 | 38 | $stmt = $__db->prepare("DELETE FROM likes WHERE sender = :username AND reciever = :reciever"); |
39 | 39 | $stmt->execute(array( |
40 | 40 | ':username' => $_SESSION['siteusername'], |
@@ -13,7 +13,7 @@ |
||
13 | 13 | <?php $video = $__video_h->fetch_video_rid($_GET['v']); ?> |
14 | 14 | <?php |
15 | 15 | |
16 | -if($video['author'] == $_SESSION['siteusername']) { |
|
16 | +if ($video['author'] == $_SESSION['siteusername']) { |
|
17 | 17 | $stmt = $__db->prepare("DELETE FROM videos WHERE rid=:rid AND author=:author"); |
18 | 18 | $stmt->execute(array( |
19 | 19 | ':author' => $video['author'], |
@@ -12,7 +12,7 @@ |
||
12 | 12 | <?php $__time_h = new time_helper(); ?> |
13 | 13 | <?php $playlist = $__video_h->fetch_playlist_rid($_GET['id']); ?> |
14 | 14 | <?php |
15 | -if($playlist['author'] == $_SESSION['siteusername']) { |
|
15 | +if ($playlist['author'] == $_SESSION['siteusername']) { |
|
16 | 16 | $stmt = $__db->prepare("DELETE FROM playlists WHERE rid=:rid AND author=:author"); |
17 | 17 | $stmt->execute(array( |
18 | 18 | ':author' => $_SESSION['siteusername'], |
@@ -39,7 +39,7 @@ |
||
39 | 39 | $stmt = $__db->prepare("SELECT * FROM videos WHERE author = :username ORDER BY id DESC LIMIT 20"); |
40 | 40 | $stmt->bindParam(":username", $_video['author']); |
41 | 41 | $stmt->execute(); |
42 | - while($video = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
42 | + while ($video = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
43 | 43 | $video['age'] = $__time_h->time_elapsed_string($video['publish']); |
44 | 44 | $video['duration'] = $__time_h->timestamp($video['duration']); |
45 | 45 | $video['views'] = $__video_h->fetch_video_views($video['rid']); |
@@ -10,22 +10,22 @@ |
||
10 | 10 | <?php $__user_u = new user_update($__db); ?> |
11 | 11 | <?php $__db_h = new db_helper(); ?> |
12 | 12 | <?php $__time_h = new time_helper(); ?> |
13 | -<?php if(!$__video_h->video_exists($_GET['v'])) { header("Location: /?error=This video doesn't exist!"); } ?> |
|
13 | +<?php if (!$__video_h->video_exists($_GET['v'])) { header("Location: /?error=This video doesn't exist!"); } ?> |
|
14 | 14 | <?php $_video = $__video_h->fetch_video_rid($_GET['v']); ?> |
15 | 15 | <?php $_video['comments'] = $__video_h->get_comments_from_video($_video['rid']); ?> |
16 | 16 | <?php |
17 | - if($_SERVER['REQUEST_METHOD'] == 'POST') { |
|
17 | + if ($_SERVER['REQUEST_METHOD'] == 'POST') { |
|
18 | 18 | $error = array(); |
19 | 19 | $request = (object) [ |
20 | 20 | "status" => "success" |
21 | 21 | ]; |
22 | 22 | |
23 | - if(!isset($_SESSION['siteusername'])){ $error['message'] = "you are not logged in"; $error['status'] = true; } |
|
24 | - if(!$_POST['comment']){ $error['message'] = "your comment cannot be blank"; $error['status'] = true; } |
|
25 | - if(strlen($_POST['comment']) > 1000){ $error['message'] = "your comment must be shorter than 1000 characters"; $error['status'] = true; } |
|
26 | - if($__user_h->if_cooldown($_SESSION['siteusername'])) { $error['message'] = "You are on a cooldown! Wait for a minute before posting another comment."; $error['status'] = true; } |
|
23 | + if (!isset($_SESSION['siteusername'])) { $error['message'] = "you are not logged in"; $error['status'] = true; } |
|
24 | + if (!$_POST['comment']) { $error['message'] = "your comment cannot be blank"; $error['status'] = true; } |
|
25 | + if (strlen($_POST['comment']) > 1000) { $error['message'] = "your comment must be shorter than 1000 characters"; $error['status'] = true; } |
|
26 | + if ($__user_h->if_cooldown($_SESSION['siteusername'])) { $error['message'] = "You are on a cooldown! Wait for a minute before posting another comment."; $error['status'] = true; } |
|
27 | 27 | |
28 | - if(!isset($error['message'])) { |
|
28 | + if (!isset($error['message'])) { |
|
29 | 29 | $text = $_POST['comment']; |
30 | 30 | $stmt = $__db->prepare("INSERT INTO comments (toid, author, comment) VALUES (:v, :username, :comment)"); |
31 | 31 | $stmt->bindParam(":v", $_GET['v']); |
@@ -18,10 +18,10 @@ |
||
18 | 18 | $video['title'] = htmlspecialchars($video['title']); |
19 | 19 | $video['description'] = $__video_h->shorten_description($video['description'], 50); |
20 | 20 | |
21 | - if(!$__video_h->video_exists($_GET['v'])) |
|
21 | + if (!$__video_h->video_exists($_GET['v'])) |
|
22 | 22 | header("Location: /?error=Your video has not processed correctly. Try reuploading it with a shorter title, description, or tag."); |
23 | 23 | |
24 | - if($_SESSION['siteusername'] != $video['author']) |
|
24 | + if ($_SESSION['siteusername'] != $video['author']) |
|
25 | 25 | header("Location: /"); |
26 | 26 | ?> |
27 | 27 | <!DOCTYPE html> |
@@ -12,18 +12,18 @@ discard block |
||
12 | 12 | <?php $__user_u = new user_update($__db); ?> |
13 | 13 | <?php $__db_h = new db_helper(); ?> |
14 | 14 | <?php $__time_h = new time_helper(); ?> |
15 | -<?php if(!isset($_SESSION['siteusername'])) { header("Location: /sign_in"); } ?> |
|
15 | +<?php if (!isset($_SESSION['siteusername'])) { header("Location: /sign_in"); } ?> |
|
16 | 16 | <?php |
17 | - if($_SERVER['REQUEST_METHOD'] == 'POST') { |
|
17 | + if ($_SERVER['REQUEST_METHOD'] == 'POST') { |
|
18 | 18 | $error = array(); |
19 | 19 | |
20 | - if(!isset($_SESSION['siteusername'])){ $error['message'] = "You are not logged in"; $error['status'] = true; } |
|
21 | - if(!$_POST['comment']){ $error['message'] = "Your description cannot be blank"; $error['status'] = true; } |
|
22 | - if(empty(trim($_POST['title']))){ $error['message'] = "Your title cannot be blank"; $error['status'] = true; } |
|
23 | - if(strlen($_POST['comment']) > 1000){ $error['message'] = "Your description must be shorter than 1000 characters"; $error['status'] = true; } |
|
24 | - if($__user_h->if_cooldown($_SESSION['siteusername'])) { $error['message'] = "You are on a cooldown! Wait for a minute before making a playlist."; $error['status'] = true; } |
|
20 | + if (!isset($_SESSION['siteusername'])) { $error['message'] = "You are not logged in"; $error['status'] = true; } |
|
21 | + if (!$_POST['comment']) { $error['message'] = "Your description cannot be blank"; $error['status'] = true; } |
|
22 | + if (empty(trim($_POST['title']))) { $error['message'] = "Your title cannot be blank"; $error['status'] = true; } |
|
23 | + if (strlen($_POST['comment']) > 1000) { $error['message'] = "Your description must be shorter than 1000 characters"; $error['status'] = true; } |
|
24 | + if ($__user_h->if_cooldown($_SESSION['siteusername'])) { $error['message'] = "You are on a cooldown! Wait for a minute before making a playlist."; $error['status'] = true; } |
|
25 | 25 | |
26 | - if(!isset($error['message'])) { |
|
26 | + if (!isset($error['message'])) { |
|
27 | 27 | $characters = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_'; |
28 | 28 | $result = ''; |
29 | 29 | for ($i = 0; $i < 11; $i++) |
@@ -192,15 +192,15 @@ discard block |
||
192 | 192 | $stmt->execute(); |
193 | 193 | |
194 | 194 | $number_of_result = $stmt->rowCount(); |
195 | - $number_of_page = ceil ($number_of_result / $results_per_page); |
|
195 | + $number_of_page = ceil($number_of_result/$results_per_page); |
|
196 | 196 | |
197 | - if (!isset ($_GET['page']) ) { |
|
197 | + if (!isset ($_GET['page'])) { |
|
198 | 198 | $page = 1; |
199 | 199 | } else { |
200 | - $page = (int)$_GET['page']; |
|
200 | + $page = (int) $_GET['page']; |
|
201 | 201 | } |
202 | 202 | |
203 | - $page_first_result = ($page - 1) * $results_per_page; |
|
203 | + $page_first_result = ($page - 1)*$results_per_page; |
|
204 | 204 | ?> |
205 | 205 | <?php |
206 | 206 | $stmt6 = $__db->prepare("SELECT * FROM playlists WHERE author = :search ORDER BY id DESC LIMIT :pfirst, :pper"); |
@@ -245,10 +245,10 @@ discard block |
||
245 | 245 | </tr> |
246 | 246 | |
247 | 247 | <?php |
248 | - while($playlist = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
248 | + while ($playlist = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
249 | 249 | $playlist['videos'] = json_decode($playlist['videos']); |
250 | - if($__video_h->video_exists(@$playlist['videos'][0])) { |
|
251 | - if(count($playlist['videos']) != 0) { |
|
250 | + if ($__video_h->video_exists(@$playlist['videos'][0])) { |
|
251 | + if (count($playlist['videos']) != 0) { |
|
252 | 252 | $video = $__video_h->fetch_video_rid($playlist['videos'][0]); |
253 | 253 | $video['video_responses'] = $__video_h->get_video_responses($video['rid']); |
254 | 254 | $video['age'] = $__time_h->time_elapsed_string($video['publish']); |
@@ -330,7 +330,7 @@ discard block |
||
330 | 330 | </div> |
331 | 331 | </center> |
332 | 332 | |
333 | - <?php for($page = 1; $page<= $number_of_page; $page++) { ?> |
|
333 | + <?php for ($page = 1; $page <= $number_of_page; $page++) { ?> |
|
334 | 334 | <button class="yt-uix-button yt-uix-button-default" onclick="ajax_fetch_videomanager(<?php echo $page; ?>)"><?php echo $page; ?></button> |
335 | 335 | <?php } ?> |
336 | 336 | |
@@ -376,7 +376,7 @@ discard block |
||
376 | 376 | </script> |
377 | 377 | |
378 | 378 | <?php |
379 | - if($stmt6->rowCount() == 0) { echo " |
|
379 | + if ($stmt6->rowCount() == 0) { echo " |
|
380 | 380 | <br>Welcome to your playlists! You can make collections of videos for you to share with others.<br> |
381 | 381 | "; |
382 | 382 | } ?> |