@@ -6,34 +6,34 @@ discard block |
||
6 | 6 | <?php require_once($_SERVER['DOCUMENT_ROOT'] . "/s/classes/user_helper.php"); ?> |
7 | 7 | <?php require_once($_SERVER['DOCUMENT_ROOT'] . "/s/classes/video_helper.php"); ?> |
8 | 8 | <?php |
9 | - $request = (object) [ |
|
10 | - "search_term" => htmlspecialchars($_GET['search_query']), |
|
11 | - "like_search_term" => "%" . htmlspecialchars($_GET['search_query']) . "%", |
|
12 | - "search_amount" => 0 /* [fallback] */ |
|
13 | - ]; |
|
9 | + $request = (object) [ |
|
10 | + "search_term" => htmlspecialchars($_GET['search_query']), |
|
11 | + "like_search_term" => "%" . htmlspecialchars($_GET['search_query']) . "%", |
|
12 | + "search_amount" => 0 /* [fallback] */ |
|
13 | + ]; |
|
14 | 14 | |
15 | - $stmt = $__db->prepare("SELECT * FROM videos WHERE lower(title) LIKE lower(:search) "); |
|
16 | - $stmt->bindParam(":search", $request->like_search_term); |
|
17 | - $stmt->execute(); |
|
18 | - $request->search_amount = $stmt->rowCount(); |
|
15 | + $stmt = $__db->prepare("SELECT * FROM videos WHERE lower(title) LIKE lower(:search) "); |
|
16 | + $stmt->bindParam(":search", $request->like_search_term); |
|
17 | + $stmt->execute(); |
|
18 | + $request->search_amount = $stmt->rowCount(); |
|
19 | 19 | |
20 | - $results_per_page = 12; |
|
21 | - $number_of_result = $request->search_amount; |
|
22 | - $number_of_page = ceil ($number_of_result / $results_per_page); |
|
20 | + $results_per_page = 12; |
|
21 | + $number_of_result = $request->search_amount; |
|
22 | + $number_of_page = ceil ($number_of_result / $results_per_page); |
|
23 | 23 | |
24 | - if (!isset ($_GET['page']) ) { |
|
25 | - $page = 1; |
|
26 | - } else { |
|
27 | - $page = (int)$_GET['page']; |
|
28 | - } |
|
24 | + if (!isset ($_GET['page']) ) { |
|
25 | + $page = 1; |
|
26 | + } else { |
|
27 | + $page = (int)$_GET['page']; |
|
28 | + } |
|
29 | 29 | |
30 | - $page_first_result = ($page - 1) * $results_per_page; |
|
30 | + $page_first_result = ($page - 1) * $results_per_page; |
|
31 | 31 | |
32 | - $stmt6 = $__db->prepare("SELECT * FROM videos WHERE lower(title) LIKE lower(:search) ORDER BY id DESC LIMIT :pfirst, :pper"); |
|
33 | - $stmt6->bindParam(":search", $request->like_search_term); |
|
34 | - $stmt6->bindParam(":pfirst", $page_first_result); |
|
35 | - $stmt6->bindParam(":pper", $results_per_page); |
|
36 | - $stmt6->execute(); |
|
32 | + $stmt6 = $__db->prepare("SELECT * FROM videos WHERE lower(title) LIKE lower(:search) ORDER BY id DESC LIMIT :pfirst, :pper"); |
|
33 | + $stmt6->bindParam(":search", $request->like_search_term); |
|
34 | + $stmt6->bindParam(":pfirst", $page_first_result); |
|
35 | + $stmt6->bindParam(":pper", $results_per_page); |
|
36 | + $stmt6->execute(); |
|
37 | 37 | ?> |
38 | 38 | <?php $__video_h = new video_helper($__db); ?> |
39 | 39 | <?php $__user_h = new user_helper($__db); ?> |
@@ -213,14 +213,14 @@ discard block |
||
213 | 213 | <div id="results-main-content"> |
214 | 214 | <ol id="search-results"> |
215 | 215 | <?php |
216 | - while($video = $stmt6->fetch(PDO::FETCH_ASSOC)) { |
|
217 | - $video['video_responses'] = $__video_h->get_video_responses($video['rid']); |
|
218 | - $video['age'] = $__time_h->time_elapsed_string($video['publish']); |
|
219 | - $video['duration'] = $__time_h->timestamp($video['duration']); |
|
220 | - $video['views'] = $__video_h->fetch_video_views($video['rid']); |
|
221 | - $video['author'] = htmlspecialchars($video['author']); |
|
222 | - $video['title'] = htmlspecialchars($video['title']); |
|
223 | - $video['description'] = $__video_h->shorten_description($video['description'], 50, true); |
|
216 | + while($video = $stmt6->fetch(PDO::FETCH_ASSOC)) { |
|
217 | + $video['video_responses'] = $__video_h->get_video_responses($video['rid']); |
|
218 | + $video['age'] = $__time_h->time_elapsed_string($video['publish']); |
|
219 | + $video['duration'] = $__time_h->timestamp($video['duration']); |
|
220 | + $video['views'] = $__video_h->fetch_video_views($video['rid']); |
|
221 | + $video['author'] = htmlspecialchars($video['author']); |
|
222 | + $video['title'] = htmlspecialchars($video['title']); |
|
223 | + $video['description'] = $__video_h->shorten_description($video['description'], 50, true); |
|
224 | 224 | ?> |
225 | 225 | <li class="yt-grid-box result-item-video *sr "> |
226 | 226 | <div id="" class="yt-uix-tile yt-lockup-list yt-tile-default yt-grid-box "> |
@@ -25,21 +25,21 @@ discard block |
||
25 | 25 | return preg_replace('/[^A-Za-z0-9\-]/', '', $string); // Removes special chars. |
26 | 26 | } |
27 | 27 | |
28 | - function addhttp($url) { |
|
29 | - if (!preg_match("~^(?:f|ht)tps?://~i", $url)) { |
|
30 | - $url = "http://" . $url; |
|
31 | - } |
|
32 | - return $url; |
|
33 | - } |
|
28 | + function addhttp($url) { |
|
29 | + if (!preg_match("~^(?:f|ht)tps?://~i", $url)) { |
|
30 | + $url = "http://" . $url; |
|
31 | + } |
|
32 | + return $url; |
|
33 | + } |
|
34 | 34 | |
35 | 35 | function check_valid_colorhex($colorCode) { |
36 | 36 | // If user accidentally passed along the # sign, strip it off |
37 | 37 | $colorCode = ltrim($colorCode, '#'); |
38 | 38 | |
39 | 39 | if ( |
40 | - ctype_xdigit($colorCode) && |
|
40 | + ctype_xdigit($colorCode) && |
|
41 | 41 | (strlen($colorCode) == 6 || strlen($colorCode) == 3)) |
42 | - return true; |
|
42 | + return true; |
|
43 | 43 | |
44 | 44 | else return false; |
45 | 45 | } |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | $_user['2009_bgcolor'] = substr($_user['2009_bgcolor'], 0, 7); |
65 | 65 | |
66 | 66 | $_user['genre'] = strtolower($_user['genre']); |
67 | - $_user['subscribed'] = $__user_h->if_subscribed(@$_SESSION['siteusername'], $_user['username']); |
|
67 | + $_user['subscribed'] = $__user_h->if_subscribed(@$_SESSION['siteusername'], $_user['username']); |
|
68 | 68 | |
69 | 69 | if(!check_valid_colorhex($_user['primary_color']) && strlen($_user['primary_color']) != 6) { $_user['primary_color'] = ""; } |
70 | 70 | if(!check_valid_colorhex($_user['secondary_color']) && strlen($_user['secondary_color']) != 6) { $_user['secondary_color'] = ""; } |
@@ -73,8 +73,8 @@ discard block |
||
73 | 73 | if(!check_valid_colorhex($_user['primary_color_text']) && strlen($_user['primary_color_text']) != 6) { $_user['primary_color_text'] = ""; } |
74 | 74 | if(!check_valid_colorhex($_user['2009_bgcolor']) && strlen($_user['2009_bgcolor']) != 6) { $_user['2009_bgcolor'] = ""; } |
75 | 75 | |
76 | - if(isset($_SESSION['siteusername'])) |
|
77 | - $__user_i->check_view_channel($_user['username'], @$_SESSION['siteusername']); |
|
76 | + if(isset($_SESSION['siteusername'])) |
|
77 | + $__user_i->check_view_channel($_user['username'], @$_SESSION['siteusername']); |
|
78 | 78 | |
79 | 79 | if($_SERVER['REQUEST_METHOD'] == 'POST') { |
80 | 80 | $error = array(); |
@@ -88,11 +88,11 @@ discard block |
||
88 | 88 | //if(ifBlocked(@$_SESSION['siteusername'], $user['username'], $__db)) { $error = "This user has blocked you!"; $error['status'] = true; } |
89 | 89 | |
90 | 90 | if(!isset($error['message'])) { |
91 | - $text = $_POST['comment']; |
|
91 | + $text = $_POST['comment']; |
|
92 | 92 | $stmt = $__db->prepare("INSERT INTO profile_comments (toid, author, comment) VALUES (:id, :username, :comment)"); |
93 | - $stmt->bindParam(":id", $_user['username']); |
|
94 | - $stmt->bindParam(":username", $_SESSION['siteusername']); |
|
95 | - $stmt->bindParam(":comment", $text); |
|
93 | + $stmt->bindParam(":id", $_user['username']); |
|
94 | + $stmt->bindParam(":username", $_SESSION['siteusername']); |
|
95 | + $stmt->bindParam(":comment", $text); |
|
96 | 96 | $stmt->execute(); |
97 | 97 | |
98 | 98 | $_user_update_utils->update_comment_cooldown_time($_SESSION['siteusername']); |
@@ -102,7 +102,7 @@ discard block |
||
102 | 102 | } |
103 | 103 | } |
104 | 104 | } |
105 | - ?> |
|
105 | + ?> |
|
106 | 106 | <!DOCTYPE html> |
107 | 107 | <html dir="ltr" xmlns:og="http://opengraphprotocol.org/schema/" lang="en"> |
108 | 108 | <!-- machid: sNW5tN3Z2SWdXaDRqNGxuNEF5MFBxM1BxWXd0VGo0Rkg3UXNTTTNCUGRDWjR0WGpHR3R1YzFR --> |
@@ -145,9 +145,9 @@ discard block |
||
145 | 145 | <div class="channel_customization"><?php require($_SERVER['DOCUMENT_ROOT'] . "/s/mod/channel_customization.php"); ?></div> |
146 | 146 | <?php } ?> |
147 | 147 | <?php |
148 | - if(empty(trim($_user['bio']))) |
|
149 | - $_user['bio'] = "This user has no description."; |
|
150 | - ?> |
|
148 | + if(empty(trim($_user['bio']))) |
|
149 | + $_user['bio'] = "This user has no description."; |
|
150 | + ?> |
|
151 | 151 | <div id="content"> |
152 | 152 | <div class="subscription-menu-expandable subscription-menu-expandable-channels3 yt-rounded ytg-wide hid"> |
153 | 153 | <div class="content" id="recommended-channels-list"></div> |
@@ -306,20 +306,20 @@ discard block |
||
306 | 306 | </div> |
307 | 307 | <ol> |
308 | 308 | <?php |
309 | - $_playlist['videos'] = json_decode($_playlist['videos']); |
|
310 | - $_playlist['count'] = 1; |
|
311 | - foreach($_playlist['videos'] as $video) { |
|
312 | - if($__video_h->video_exists($video)) { |
|
313 | - $_video = $__video_h->fetch_video_rid($video); |
|
314 | - $_video['video_responses'] = $__video_h->get_video_responses($_video['rid']); |
|
315 | - $_video['age'] = $__time_h->time_elapsed_string($_video['publish']); |
|
316 | - $_video['duration'] = $__time_h->timestamp($_video['duration']); |
|
317 | - $_video['views'] = $__video_h->fetch_video_views($_video['rid']); |
|
318 | - $_video['author'] = htmlspecialchars($_video['author']); |
|
319 | - $_video['title'] = htmlspecialchars($_video['title']); |
|
320 | - $_video['description'] = $__video_h->shorten_description($_video['description'], 50); |
|
321 | - $_playlist['title'] = htmlspecialchars($_playlist['title']); |
|
322 | - ?> |
|
309 | + $_playlist['videos'] = json_decode($_playlist['videos']); |
|
310 | + $_playlist['count'] = 1; |
|
311 | + foreach($_playlist['videos'] as $video) { |
|
312 | + if($__video_h->video_exists($video)) { |
|
313 | + $_video = $__video_h->fetch_video_rid($video); |
|
314 | + $_video['video_responses'] = $__video_h->get_video_responses($_video['rid']); |
|
315 | + $_video['age'] = $__time_h->time_elapsed_string($_video['publish']); |
|
316 | + $_video['duration'] = $__time_h->timestamp($_video['duration']); |
|
317 | + $_video['views'] = $__video_h->fetch_video_views($_video['rid']); |
|
318 | + $_video['author'] = htmlspecialchars($_video['author']); |
|
319 | + $_video['title'] = htmlspecialchars($_video['title']); |
|
320 | + $_video['description'] = $__video_h->shorten_description($_video['description'], 50); |
|
321 | + $_playlist['title'] = htmlspecialchars($_playlist['title']); |
|
322 | + ?> |
|
323 | 323 | <li class="playlist-video-item |
324 | 324 | odd |
325 | 325 | "> |
@@ -474,9 +474,9 @@ discard block |
||
474 | 474 | <h2>Featured Channels</h2> |
475 | 475 | <ul class="channel-summary-list "> |
476 | 476 | <?php |
477 | - foreach($_user['featured_channels'] as $user) { |
|
478 | - if($__user_h->user_exists($user)) { |
|
479 | - ?> |
|
477 | + foreach($_user['featured_channels'] as $user) { |
|
478 | + if($__user_h->user_exists($user)) { |
|
479 | + ?> |
|
480 | 480 | <li class="yt-tile-visible yt-uix-tile"> |
481 | 481 | <div class="channel-summary clearfix channel-summary-compact"> |
482 | 482 | <div class="channel-summary-thumb"> |
@@ -500,19 +500,19 @@ discard block |
||
500 | 500 | </div> |
501 | 501 | |
502 | 502 | <?php |
503 | - $stmt = $__db->prepare("SELECT * FROM playlists WHERE author = :search ORDER BY id DESC LIMIT 10"); |
|
504 | - $stmt->bindParam(":search", $_user['username']); |
|
505 | - $stmt->execute(); |
|
503 | + $stmt = $__db->prepare("SELECT * FROM playlists WHERE author = :search ORDER BY id DESC LIMIT 10"); |
|
504 | + $stmt->bindParam(":search", $_user['username']); |
|
505 | + $stmt->execute(); |
|
506 | 506 | |
507 | - if($stmt->rowCount() != 0) { |
|
508 | - ?> |
|
507 | + if($stmt->rowCount() != 0) { |
|
508 | + ?> |
|
509 | 509 | <div class="playlists-narrow channel-module yt-uix-c3-module-container"> |
510 | 510 | <div class="module-view gh-featured"> |
511 | 511 | <h2>Featured Playlists</h2> |
512 | 512 | <?php |
513 | - while($playlist = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
514 | - $playlist['videos'] = json_decode($playlist['videos']); |
|
515 | - ?> |
|
513 | + while($playlist = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
514 | + $playlist['videos'] = json_decode($playlist['videos']); |
|
515 | + ?> |
|
516 | 516 | <div class="playlist yt-tile-visible yt-uix-tile"> |
517 | 517 | <a href="/view_playlist?v=<?php echo $playlist['rid']; ?>"> |
518 | 518 | <span class="playlist-thumb-strip playlist-thumb-strip-252"><span class="videos videos-4 horizontal-cutoff"><span class="clip"><span class="centering-offset"><span class="centering"> |
@@ -8,10 +8,10 @@ |
||
8 | 8 | <?php $__db_h = new db_helper(); ?> |
9 | 9 | <?php $__time_h = new time_helper(); ?> |
10 | 10 | <?php |
11 | - $__server->page_embeds->page_title = "SubRocks - Replace me"; |
|
12 | - $__server->page_embeds->page_description = "SubRocks is a site dedicated to bring back the 2012 layout of YouTube."; |
|
13 | - $__server->page_embeds->page_image = "/yt/imgbin/full-size-logo.png"; |
|
14 | - $__server->page_embeds->page_url = "https://subrock.rocks/"; |
|
11 | + $__server->page_embeds->page_title = "SubRocks - Replace me"; |
|
12 | + $__server->page_embeds->page_description = "SubRocks is a site dedicated to bring back the 2012 layout of YouTube."; |
|
13 | + $__server->page_embeds->page_image = "/yt/imgbin/full-size-logo.png"; |
|
14 | + $__server->page_embeds->page_url = "https://subrock.rocks/"; |
|
15 | 15 | ?> |
16 | 16 | <!DOCTYPE html> |
17 | 17 | <html> |
@@ -8,17 +8,17 @@ |
||
8 | 8 | <?php $__db_h = new db_helper(); ?> |
9 | 9 | <?php $__time_h = new time_helper(); ?> |
10 | 10 | <?php |
11 | - if(!$__video_h->video_exists($_GET['v'])) |
|
12 | - header("Location: /?error=Your video has not processed correctly. Try reuploading it with a shorter title, description, or tag."); |
|
11 | + if(!$__video_h->video_exists($_GET['v'])) |
|
12 | + header("Location: /?error=Your video has not processed correctly. Try reuploading it with a shorter title, description, or tag."); |
|
13 | 13 | |
14 | - $video = $__video_h->fetch_video_rid($_GET['v']); |
|
15 | - $video['video_responses'] = $__video_h->get_video_responses($video['rid']); |
|
16 | - $video['age'] = $__time_h->time_elapsed_string($video['publish']); |
|
17 | - $video['duration'] = $__time_h->timestamp($video['duration']); |
|
18 | - $video['views'] = $__video_h->fetch_video_views($video['rid']); |
|
19 | - $video['author'] = htmlspecialchars($video['author']); |
|
20 | - $video['title'] = htmlspecialchars($video['title']); |
|
21 | - $video['description'] = $__video_h->shorten_description($video['description'], 50); |
|
14 | + $video = $__video_h->fetch_video_rid($_GET['v']); |
|
15 | + $video['video_responses'] = $__video_h->get_video_responses($video['rid']); |
|
16 | + $video['age'] = $__time_h->time_elapsed_string($video['publish']); |
|
17 | + $video['duration'] = $__time_h->timestamp($video['duration']); |
|
18 | + $video['views'] = $__video_h->fetch_video_views($video['rid']); |
|
19 | + $video['author'] = htmlspecialchars($video['author']); |
|
20 | + $video['title'] = htmlspecialchars($video['title']); |
|
21 | + $video['description'] = $__video_h->shorten_description($video['description'], 50); |
|
22 | 22 | |
23 | 23 | if($_SESSION['siteusername'] != $video['author']) |
24 | 24 | header("Location: /"); |