@@ -17,15 +17,15 @@ discard block |
||
17 | 17 | |
18 | 18 | $results_per_page = 12; |
19 | 19 | $number_of_result = $request->search_amount; |
20 | - $number_of_page = ceil ($number_of_result / $results_per_page); |
|
20 | + $number_of_page = ceil($number_of_result/$results_per_page); |
|
21 | 21 | |
22 | - if (!isset ($_GET['page']) ) { |
|
22 | + if (!isset ($_GET['page'])) { |
|
23 | 23 | $page = 1; |
24 | 24 | } else { |
25 | - $page = (int)$_GET['page']; |
|
25 | + $page = (int) $_GET['page']; |
|
26 | 26 | } |
27 | 27 | |
28 | - $page_first_result = ($page - 1) * $results_per_page; |
|
28 | + $page_first_result = ($page - 1)*$results_per_page; |
|
29 | 29 | |
30 | 30 | $stmt6 = $__db->prepare("SELECT * FROM videos WHERE lower(title) LIKE lower(:search) ORDER BY id DESC LIMIT :pfirst, :pper"); |
31 | 31 | $stmt6->bindParam(":search", $request->like_search_term); |
@@ -219,7 +219,7 @@ discard block |
||
219 | 219 | <div id="results-main-content"> |
220 | 220 | <ol id="search-results"> |
221 | 221 | <?php |
222 | - while($video = $stmt6->fetch(PDO::FETCH_ASSOC)) { |
|
222 | + while ($video = $stmt6->fetch(PDO::FETCH_ASSOC)) { |
|
223 | 223 | $video['video_responses'] = $__video_h->get_video_responses($video['rid']); |
224 | 224 | $video['age'] = $__time_h->time_elapsed_string($video['publish']); |
225 | 225 | $video['duration'] = $__time_h->timestamp($video['duration']); |
@@ -253,7 +253,7 @@ discard block |
||
253 | 253 | </div> |
254 | 254 | </li> |
255 | 255 | <?php } ?> |
256 | - <?php if($request->search_amount == 0) |
|
256 | + <?php if ($request->search_amount == 0) |
|
257 | 257 | echo "Your search query has brought no results.<br><br>"; |
258 | 258 | ?> |
259 | 259 | </ol> |
@@ -267,7 +267,7 @@ discard block |
||
267 | 267 | </div> |
268 | 268 | <div id="search-footer-box" class="searchFooterBox"> |
269 | 269 | <div class="yt-uix-pager" role="navigation"> |
270 | - <?php for($page = 1; $page<= $number_of_page; $page++) { ?> |
|
270 | + <?php for ($page = 1; $page <= $number_of_page; $page++) { ?> |
|
271 | 271 | <a href="/results?search_query=<?php echo $request->search_term; ?>&page=<?php echo $page; ?>"> |
272 | 272 | <button class="yt-uix-button yt-uix-button-default"><?php echo $page; ?></button> |
273 | 273 | </a> |
@@ -14,17 +14,17 @@ discard block |
||
14 | 14 | "action" => "l" /* fallback */ |
15 | 15 | ]; |
16 | 16 | |
17 | -if(!isset($_SESSION['siteusername']) || !isset($_GET['id'])) |
|
17 | +if (!isset($_SESSION['siteusername']) || !isset($_GET['id'])) |
|
18 | 18 | header('Location: ' . $_SERVER['HTTP_REFERER']); |
19 | 19 | |
20 | -if(isset($_GET['a']) && $_GET['a'] == "-1") |
|
20 | +if (isset($_GET['a']) && $_GET['a'] == "-1") |
|
21 | 21 | $request->action = "d"; |
22 | 22 | |
23 | 23 | $stmt = $__db->prepare("SELECT * FROM comment_likes WHERE sender = :username AND reciever = :reciever AND type = 'l'"); |
24 | 24 | $stmt->bindParam(":username", $_SESSION['siteusername']); |
25 | 25 | $stmt->bindParam(":reciever", $request->comment_id); |
26 | 26 | $stmt->execute(); |
27 | -while($comment = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
27 | +while ($comment = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
28 | 28 | $stmt = $__db->prepare("DELETE FROM comment_likes WHERE sender = :username AND reciever = :reciever"); |
29 | 29 | $stmt->execute(array( |
30 | 30 | ':username' => $_SESSION['siteusername'], |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | $stmt->bindParam(":username", $_SESSION['siteusername']); |
38 | 38 | $stmt->bindParam(":reciever", $request->comment_id); |
39 | 39 | $stmt->execute(); |
40 | -while($comment = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
40 | +while ($comment = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
41 | 41 | $stmt = $__db->prepare("DELETE FROM comment_likes WHERE sender = :username AND reciever = :reciever"); |
42 | 42 | $stmt->execute(array( |
43 | 43 | ':username' => $_SESSION['siteusername'], |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | header('Location: ' . $_SERVER['HTTP_REFERER']); |
47 | 47 | } |
48 | 48 | |
49 | -if($request->action == "l") { |
|
49 | +if ($request->action == "l") { |
|
50 | 50 | $stmt = $__db->prepare("INSERT INTO comment_likes (sender, reciever, type) VALUES (:sender, :reciever, 'l')"); |
51 | 51 | $stmt->bindParam(":sender", $_SESSION['siteusername']); |
52 | 52 | $stmt->bindParam(":reciever", $request->comment_id); |
@@ -8,18 +8,18 @@ discard block |
||
8 | 8 | <?php $__user_u = new user_update($__db); ?> |
9 | 9 | <?php $__db_h = new db_helper(); ?> |
10 | 10 | <?php $__time_h = new time_helper(); ?> |
11 | -<?php if(!isset($_SESSION['siteusername'])) { header("Location: /sign_in"); } ?> |
|
11 | +<?php if (!isset($_SESSION['siteusername'])) { header("Location: /sign_in"); } ?> |
|
12 | 12 | <?php |
13 | - if($_SERVER['REQUEST_METHOD'] == 'POST') { |
|
13 | + if ($_SERVER['REQUEST_METHOD'] == 'POST') { |
|
14 | 14 | $error = array(); |
15 | 15 | |
16 | - if(!isset($_SESSION['siteusername'])){ $error['message'] = "You are not logged in"; $error['status'] = true; } |
|
17 | - if(!$_POST['comment']){ $error['message'] = "Your description cannot be blank"; $error['status'] = true; } |
|
18 | - if(empty(trim($_POST['title']))){ $error['message'] = "Your title cannot be blank"; $error['status'] = true; } |
|
19 | - if(strlen($_POST['comment']) > 1000){ $error['message'] = "Your description must be shorter than 1000 characters"; $error['status'] = true; } |
|
20 | - 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; } |
|
16 | + if (!isset($_SESSION['siteusername'])) { $error['message'] = "You are not logged in"; $error['status'] = true; } |
|
17 | + if (!$_POST['comment']) { $error['message'] = "Your description cannot be blank"; $error['status'] = true; } |
|
18 | + if (empty(trim($_POST['title']))) { $error['message'] = "Your title cannot be blank"; $error['status'] = true; } |
|
19 | + if (strlen($_POST['comment']) > 1000) { $error['message'] = "Your description must be shorter than 1000 characters"; $error['status'] = true; } |
|
20 | + 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; } |
|
21 | 21 | |
22 | - if(!isset($error['message'])) { |
|
22 | + if (!isset($error['message'])) { |
|
23 | 23 | $characters = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_'; |
24 | 24 | $result = ''; |
25 | 25 | for ($i = 0; $i < 11; $i++) |
@@ -188,15 +188,15 @@ discard block |
||
188 | 188 | $stmt->execute(); |
189 | 189 | |
190 | 190 | $number_of_result = $stmt->rowCount(); |
191 | - $number_of_page = ceil ($number_of_result / $results_per_page); |
|
191 | + $number_of_page = ceil($number_of_result/$results_per_page); |
|
192 | 192 | |
193 | - if (!isset ($_GET['page']) ) { |
|
193 | + if (!isset ($_GET['page'])) { |
|
194 | 194 | $page = 1; |
195 | 195 | } else { |
196 | - $page = (int)$_GET['page']; |
|
196 | + $page = (int) $_GET['page']; |
|
197 | 197 | } |
198 | 198 | |
199 | - $page_first_result = ($page - 1) * $results_per_page; |
|
199 | + $page_first_result = ($page - 1)*$results_per_page; |
|
200 | 200 | ?> |
201 | 201 | <?php |
202 | 202 | $stmt6 = $__db->prepare("SELECT * FROM playlists WHERE author = :search ORDER BY id DESC LIMIT :pfirst, :pper"); |
@@ -241,10 +241,10 @@ discard block |
||
241 | 241 | </tr> |
242 | 242 | |
243 | 243 | <?php |
244 | - while($playlist = $stmt6->fetch(PDO::FETCH_ASSOC)) { |
|
244 | + while ($playlist = $stmt6->fetch(PDO::FETCH_ASSOC)) { |
|
245 | 245 | $playlist['videos'] = json_decode($playlist['videos']); |
246 | - if($__video_h->video_exists(@$playlist['videos'][0])) { |
|
247 | - if(count($playlist['videos']) != 0) { |
|
246 | + if ($__video_h->video_exists(@$playlist['videos'][0])) { |
|
247 | + if (count($playlist['videos']) != 0) { |
|
248 | 248 | $video = $__video_h->fetch_video_rid($playlist['videos'][0]); |
249 | 249 | $video['video_responses'] = $__video_h->get_video_responses($video['rid']); |
250 | 250 | $video['age'] = $__time_h->time_elapsed_string($video['publish']); |
@@ -326,7 +326,7 @@ discard block |
||
326 | 326 | </div> |
327 | 327 | </center> |
328 | 328 | |
329 | - <?php for($page = 1; $page<= $number_of_page; $page++) { ?> |
|
329 | + <?php for ($page = 1; $page <= $number_of_page; $page++) { ?> |
|
330 | 330 | <button class="yt-uix-button yt-uix-button-default" onclick="ajax_fetch_videomanager(<?php echo $page; ?>)"><?php echo $page; ?></button> |
331 | 331 | <?php } ?> |
332 | 332 | |
@@ -372,7 +372,7 @@ discard block |
||
372 | 372 | </script> |
373 | 373 | |
374 | 374 | <?php |
375 | - if($stmt6->rowCount() == 0) { echo " |
|
375 | + if ($stmt6->rowCount() == 0) { echo " |
|
376 | 376 | <br>Welcome to your playlists! You can make collections of videos for you to share with others.<br> |
377 | 377 | "; |
378 | 378 | } ?> |
@@ -21,15 +21,15 @@ discard block |
||
21 | 21 | |
22 | 22 | $results_per_page = 12; |
23 | 23 | $number_of_result = $request->search_amount; |
24 | - $number_of_page = ceil ($number_of_result / $results_per_page); |
|
24 | + $number_of_page = ceil($number_of_result/$results_per_page); |
|
25 | 25 | |
26 | - if (!isset ($_GET['page']) ) { |
|
26 | + if (!isset ($_GET['page'])) { |
|
27 | 27 | $page = 1; |
28 | 28 | } else { |
29 | - $page = (int)$_GET['page']; |
|
29 | + $page = (int) $_GET['page']; |
|
30 | 30 | } |
31 | 31 | |
32 | - $page_first_result = ($page - 1) * $results_per_page; |
|
32 | + $page_first_result = ($page - 1)*$results_per_page; |
|
33 | 33 | |
34 | 34 | $stmt6 = $__db->prepare("SELECT * FROM playlists WHERE lower(author) LIKE lower(:search) ORDER BY id DESC LIMIT :pfirst, :pper"); |
35 | 35 | $stmt6->bindParam(":search", $request->like_search_term); |
@@ -50,10 +50,10 @@ discard block |
||
50 | 50 | </tr> |
51 | 51 | |
52 | 52 | <?php |
53 | - while($playlist = $stmt6->fetch(PDO::FETCH_ASSOC)) { |
|
53 | + while ($playlist = $stmt6->fetch(PDO::FETCH_ASSOC)) { |
|
54 | 54 | $playlist['videos'] = json_decode($playlist['videos']); |
55 | - if($__video_h->video_exists(@$playlist['videos'][0])) { |
|
56 | - if(count($playlist['videos']) != 0) { |
|
55 | + if ($__video_h->video_exists(@$playlist['videos'][0])) { |
|
56 | + if (count($playlist['videos']) != 0) { |
|
57 | 57 | $video = $__video_h->fetch_video_rid($playlist['videos'][0]); |
58 | 58 | $video['video_responses'] = $__video_h->get_video_responses($video['rid']); |
59 | 59 | $video['age'] = $__time_h->time_elapsed_string($video['publish']); |
@@ -13,7 +13,7 @@ |
||
13 | 13 | $__server->page_embeds->page_image = "/yt/imgbin/full-size-logo.png"; |
14 | 14 | $__server->page_embeds->page_url = "https://subrock.rocks/"; |
15 | 15 | ?> |
16 | -<?php if(!isset($_SESSION['siteusername'])) { header("Location: /sign_in"); } ?> |
|
16 | +<?php if (!isset($_SESSION['siteusername'])) { header("Location: /sign_in"); } ?> |
|
17 | 17 | <?php $_playlist = $__video_h->fetch_playlist_rid($_GET['id']); ?> |
18 | 18 | <!DOCTYPE html> |
19 | 19 | <html dir="ltr"> |
@@ -13,8 +13,8 @@ |
||
13 | 13 | <?php |
14 | 14 | $video = $__video_h->fetch_video_rid($_GET['id']); |
15 | 15 | |
16 | -if($video['author'] == $_SESSION['siteusername']) { |
|
17 | - if($video['commenting'] == "a") { |
|
16 | +if ($video['author'] == $_SESSION['siteusername']) { |
|
17 | + if ($video['commenting'] == "a") { |
|
18 | 18 | $__video_u->update_row($_GET['id'], "commenting", "d"); |
19 | 19 | } else { |
20 | 20 | $__video_u->update_row($_GET['id'], "commenting", "a"); |
@@ -11,7 +11,7 @@ |
||
11 | 11 | <?php $video = $__video_h->fetch_video_rid($_GET['id']); ?> |
12 | 12 | <?php |
13 | 13 | |
14 | -if($video['author'] == $_SESSION['siteusername']) { |
|
14 | +if ($video['author'] == $_SESSION['siteusername']) { |
|
15 | 15 | $stmt = $__db->prepare("DELETE FROM videos WHERE rid=:rid AND author=:author"); |
16 | 16 | $stmt->execute(array( |
17 | 17 | ':author' => $video['author'], |
@@ -12,7 +12,7 @@ |
||
12 | 12 | <?php $__time_h = new time_helper(); ?> |
13 | 13 | <?php |
14 | 14 | $_playlist = $__video_h->fetch_playlist_rid($_GET['v']); |
15 | - if($_playlist['author'] != @$_SESSION['siteusername']) { |
|
15 | + if ($_playlist['author'] != @$_SESSION['siteusername']) { |
|
16 | 16 | die(); |
17 | 17 | } |
18 | 18 |
@@ -12,7 +12,7 @@ discard block |
||
12 | 12 | <?php $__time_h = new time_helper(); ?> |
13 | 13 | <?php |
14 | 14 | $_video = $__video_h->fetch_video_rid($_GET['v']); |
15 | - if($_video['author'] != @$_SESSION['siteusername']) { |
|
15 | + if ($_video['author'] != @$_SESSION['siteusername']) { |
|
16 | 16 | die(); |
17 | 17 | } |
18 | 18 | |
@@ -37,8 +37,8 @@ discard block |
||
37 | 37 | // $__video_u->update_row($_GET['v'], "thumbnail", $request->thumbnail); |
38 | 38 | $__video_u->update_row($_GET['v'], "category", $request->category); |
39 | 39 | |
40 | - if($_SERVER['REQUEST_METHOD'] == 'POST' && @$_FILES['thumbnail']) { |
|
41 | - if(!empty($_FILES["thumbnail"]["name"])) { |
|
40 | + if ($_SERVER['REQUEST_METHOD'] == 'POST' && @$_FILES['thumbnail']) { |
|
41 | + if (!empty($_FILES["thumbnail"]["name"])) { |
|
42 | 42 | $target_dir = "dynamic/thumbs/"; |
43 | 43 | $imageFileType = strtolower(pathinfo($_FILES["thumbnail"]["name"], PATHINFO_EXTENSION)); |
44 | 44 | $target_name = md5_file($_FILES["thumbnail"]["tmp_name"]) . "." . $imageFileType; |
@@ -48,8 +48,8 @@ discard block |
||
48 | 48 | $uploadOk = true; |
49 | 49 | $movedFile = false; |
50 | 50 | |
51 | - if($imageFileType != "jpg" && $imageFileType != "png" && $imageFileType != "jpeg" |
|
52 | - && $imageFileType != "gif" ) { |
|
51 | + if ($imageFileType != "jpg" && $imageFileType != "png" && $imageFileType != "jpeg" |
|
52 | + && $imageFileType != "gif") { |
|
53 | 53 | $fileerror = 'unsupported file type. must be jpg, png, jpeg, or gif'; |
54 | 54 | $uploadOk = false; |
55 | 55 | goto skip; |