@@ -21,15 +21,15 @@ discard block |
||
21 | 21 | "db_connected" => false, |
22 | 22 | ], |
23 | 23 | |
24 | - "video_properties" => (object) [ "status" => "unloaded" ], |
|
25 | - "user_properties" => (object) [ "status" => "unloaded" ], |
|
26 | - "group_properties" => (object) [ "status" => "unloaded" ], |
|
27 | - "forum_properties" => (object) [ "status" => "unloaded" ], |
|
24 | + "video_properties" => (object) ["status" => "unloaded"], |
|
25 | + "user_properties" => (object) ["status" => "unloaded"], |
|
26 | + "group_properties" => (object) ["status" => "unloaded"], |
|
27 | + "forum_properties" => (object) ["status" => "unloaded"], |
|
28 | 28 | ]; |
29 | 29 | |
30 | 30 | try |
31 | 31 | { |
32 | - $__db = new PDO("mysql:host=".$__server->db_properties->db_host.";dbname=".$__server->db_properties->db_database.";charset=utf8mb4", |
|
32 | + $__db = new PDO("mysql:host=" . $__server->db_properties->db_host . ";dbname=" . $__server->db_properties->db_database . ";charset=utf8mb4", |
|
33 | 33 | $__server->db_properties->db_user, |
34 | 34 | $__server->db_properties->db_password, |
35 | 35 | [ |
@@ -39,9 +39,9 @@ discard block |
||
39 | 39 | ); |
40 | 40 | $__server->db_properties->db_connected = true; |
41 | 41 | } |
42 | - catch(PDOException $e) |
|
42 | + catch (PDOException $e) |
|
43 | 43 | { |
44 | - die("An error occured connecting to the database: ".$e->getMessage()); |
|
44 | + die("An error occured connecting to the database: " . $e->getMessage()); |
|
45 | 45 | } |
46 | 46 | |
47 | 47 | session_start(); |
@@ -38,8 +38,7 @@ |
||
38 | 38 | ] |
39 | 39 | ); |
40 | 40 | $__server->db_properties->db_connected = true; |
41 | - } |
|
42 | - catch(PDOException $e) |
|
41 | + } catch(PDOException $e) |
|
43 | 42 | { |
44 | 43 | die("An error occured connecting to the database: ".$e->getMessage()); |
45 | 44 | } |
@@ -7,7 +7,7 @@ discard block |
||
7 | 7 | <?php $__user_h = new user_helper($__db); ?> |
8 | 8 | <?php $__db_h = new db_helper(); ?> |
9 | 9 | <?php $__time_h = new time_helper(); ?> |
10 | -<?php if(!$__video_h->video_exists($_GET['v'])) { header("Location: /?error=This video doesn't exist!"); } ?> |
|
10 | +<?php if (!$__video_h->video_exists($_GET['v'])) { header("Location: /?error=This video doesn't exist!"); } ?> |
|
11 | 11 | <?php |
12 | 12 | $_video = $__video_h->fetch_video_rid($_GET['v']); |
13 | 13 | $_video['video_responses'] = $__video_h->get_video_responses($_video['rid']); |
@@ -80,19 +80,19 @@ discard block |
||
80 | 80 | </h4> |
81 | 81 | </div> |
82 | 82 | </div> |
83 | - <?php if(!isset($_SESSION['siteusername'])) { ?> |
|
83 | + <?php if (!isset($_SESSION['siteusername'])) { ?> |
|
84 | 84 | <div class="comments-post-container clearfix"> |
85 | 85 | <div class="comments-post-alert"> |
86 | 86 | <a href="/sign_in">Sign In</a> or <a href="/sign_up">Sign Up</a><span class="comments-post-form-rollover-text"> now to post a comment!</span> |
87 | 87 | </div> |
88 | 88 | </div> |
89 | - <?php } else if($_video['commenting'] == "d") { ?> |
|
89 | + <?php } else if ($_video['commenting'] == "d") { ?> |
|
90 | 90 | <div class="comments-post-container clearfix"> |
91 | 91 | <div class="comments-post-alert"> |
92 | 92 | This video has comemnting disabled! |
93 | 93 | </div> |
94 | 94 | </div> |
95 | - <?php } else if($__user_h->if_blocked($_video['author'], $_SESSION['siteusername'])) { ?> |
|
95 | + <?php } else if ($__user_h->if_blocked($_video['author'], $_SESSION['siteusername'])) { ?> |
|
96 | 96 | <div class="comments-post-container clearfix"> |
97 | 97 | <div class="comments-post-alert"> |
98 | 98 | This user has blocked you! |
@@ -139,15 +139,15 @@ discard block |
||
139 | 139 | $stmt->execute(); |
140 | 140 | |
141 | 141 | $number_of_result = $stmt->rowCount(); |
142 | - $number_of_page = ceil ($number_of_result / $results_per_page); |
|
142 | + $number_of_page = ceil($number_of_result/$results_per_page); |
|
143 | 143 | |
144 | - if (!isset ($_GET['page']) ) { |
|
144 | + if (!isset ($_GET['page'])) { |
|
145 | 145 | $page = 1; |
146 | 146 | } else { |
147 | - $page = (int)$_GET['page']; |
|
147 | + $page = (int) $_GET['page']; |
|
148 | 148 | } |
149 | 149 | |
150 | - $page_first_result = ($page - 1) * $results_per_page; |
|
150 | + $page_first_result = ($page - 1)*$results_per_page; |
|
151 | 151 | |
152 | 152 | $stmt = $__db->prepare("SELECT * FROM comments WHERE toid = :rid ORDER BY id DESC LIMIT :pfirst, :pper"); |
153 | 153 | $stmt->bindParam(":rid", $_video['rid']); |
@@ -155,7 +155,7 @@ discard block |
||
155 | 155 | $stmt->bindParam(":pper", $results_per_page); |
156 | 156 | $stmt->execute(); |
157 | 157 | |
158 | - while($comment = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
158 | + while ($comment = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
159 | 159 | ?> |
160 | 160 | |
161 | 161 | <li class="comment yt-tile-default " data-author-viewing="" data-author-id="-uD01K8FQTeOSS5sniRFzQ" data-id="HdQrMeklJ_5hd_uPDRcvtdaMk2pMVS8d9sufcfiGx0U" data-score="0"> |
@@ -11,23 +11,23 @@ |
||
11 | 11 | <?php |
12 | 12 | $_video = $__video_h->fetch_video_rid($_GET['v']); |
13 | 13 | $_video['video_responses'] = $__video_h->get_video_responses($_video['rid']); |
14 | - $_video['age'] = $__time_h->time_elapsed_string($_video['publish']); |
|
15 | - $_video['duration'] = $__time_h->timestamp($_video['duration']); |
|
16 | - $_video['views'] = $__video_h->fetch_video_views($_video['rid']); |
|
17 | - $_video['author'] = htmlspecialchars($_video['author']); |
|
18 | - $_video['title'] = htmlspecialchars($_video['title']); |
|
19 | - $_video['description'] = $__video_h->shorten_description($_video['description'], 50); |
|
14 | + $_video['age'] = $__time_h->time_elapsed_string($_video['publish']); |
|
15 | + $_video['duration'] = $__time_h->timestamp($_video['duration']); |
|
16 | + $_video['views'] = $__video_h->fetch_video_views($_video['rid']); |
|
17 | + $_video['author'] = htmlspecialchars($_video['author']); |
|
18 | + $_video['title'] = htmlspecialchars($_video['title']); |
|
19 | + $_video['description'] = $__video_h->shorten_description($_video['description'], 50); |
|
20 | 20 | |
21 | - $__server->page_embeds->page_title = "SubRocks - All Comments"; |
|
22 | - $__server->page_embeds->page_description = "SubRocks is a site dedicated to bring back the 2012 layout of YouTube."; |
|
23 | - $__server->page_embeds->page_image = "/yt/imgbin/full-size-logo.png"; |
|
24 | - $__server->page_embeds->page_url = "https://subrock.rocks/"; |
|
21 | + $__server->page_embeds->page_title = "SubRocks - All Comments"; |
|
22 | + $__server->page_embeds->page_description = "SubRocks is a site dedicated to bring back the 2012 layout of YouTube."; |
|
23 | + $__server->page_embeds->page_image = "/yt/imgbin/full-size-logo.png"; |
|
24 | + $__server->page_embeds->page_url = "https://subrock.rocks/"; |
|
25 | 25 | ?> |
26 | 26 | <?php |
27 | - $__server->page_embeds->page_title = "SubRocks - All Comments"; |
|
28 | - $__server->page_embeds->page_description = "SubRocks is a site dedicated to bring back the 2012 layout of YouTube."; |
|
29 | - $__server->page_embeds->page_image = "/yt/imgbin/full-size-logo.png"; |
|
30 | - $__server->page_embeds->page_url = "https://subrock.rocks/"; |
|
27 | + $__server->page_embeds->page_title = "SubRocks - All Comments"; |
|
28 | + $__server->page_embeds->page_description = "SubRocks is a site dedicated to bring back the 2012 layout of YouTube."; |
|
29 | + $__server->page_embeds->page_image = "/yt/imgbin/full-size-logo.png"; |
|
30 | + $__server->page_embeds->page_url = "https://subrock.rocks/"; |
|
31 | 31 | ?> |
32 | 32 | <?php $_video['comments'] = $__video_h->get_comments_from_video($_video['rid']); ?> |
33 | 33 | <!DOCTYPE html> |
@@ -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 - Sign Up"; |
|
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 - Sign Up"; |
|
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,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 - Sign In"; |
|
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 - Sign In"; |
|
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> |
@@ -10,10 +10,10 @@ |
||
10 | 10 | <?php $__time_h = new time_helper(); ?> |
11 | 11 | <?php if(!isset($_SESSION['siteusername'])) { header("Location: /sign_in"); } ?> |
12 | 12 | <?php |
13 | - $__server->page_embeds->page_title = "SubRocks - Upload Video"; |
|
14 | - $__server->page_embeds->page_description = "SubRocks is a site dedicated to bring back the 2012 layout of YouTube."; |
|
15 | - $__server->page_embeds->page_image = "/yt/imgbin/full-size-logo.png"; |
|
16 | - $__server->page_embeds->page_url = "https://subrock.rocks/"; |
|
13 | + $__server->page_embeds->page_title = "SubRocks - Upload Video"; |
|
14 | + $__server->page_embeds->page_description = "SubRocks is a site dedicated to bring back the 2012 layout of YouTube."; |
|
15 | + $__server->page_embeds->page_image = "/yt/imgbin/full-size-logo.png"; |
|
16 | + $__server->page_embeds->page_url = "https://subrock.rocks/"; |
|
17 | 17 | ?> |
18 | 18 | <!DOCTYPE html> |
19 | 19 | <html> |
@@ -8,7 +8,7 @@ discard block |
||
8 | 8 | <?php $__user_h = new user_helper($__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 | 13 | $__server->page_embeds->page_title = "SubRocks - Upload Video"; |
14 | 14 | $__server->page_embeds->page_description = "SubRocks is a site dedicated to bring back the 2012 layout of YouTube."; |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | <b>Category</b> <br> |
97 | 97 | <select style="margin-top:5px;" name="category" class="yt-uix-button yt-uix-button-default"> |
98 | 98 | <?php $categories = ["None", "Film & Animation", "Autos & Vehicles", "Music", "Pets & Animals", "Sports", "Travel & Events", "Gaming", "People & Blogs", "Comedy", "Entertainment", "News & Politics", "Howto & Style", "Education", "Science & Technology", "Nonprofits & Activism"]; ?> |
99 | - <?php foreach($categories as $categoryTag) { ?> |
|
99 | + <?php foreach ($categories as $categoryTag) { ?> |
|
100 | 100 | <option value="<?php echo $categoryTag; ?>"><?php echo $categoryTag; ?></option> |
101 | 101 | <?php } ?> |
102 | 102 | </select><br><br> |
@@ -9,10 +9,10 @@ |
||
9 | 9 | <?php $__time_h = new time_helper(); ?> |
10 | 10 | <?php if(!isset($_SESSION['siteusername'])) { header("Location: /sign_in"); } ?> |
11 | 11 | <?php |
12 | - $__server->page_embeds->page_title = "SubRocks - Subscriptions"; |
|
13 | - $__server->page_embeds->page_description = "SubRocks is a site dedicated to bring back the 2012 layout of YouTube."; |
|
14 | - $__server->page_embeds->page_image = "/yt/imgbin/full-size-logo.png"; |
|
15 | - $__server->page_embeds->page_url = "https://subrock.rocks/"; |
|
12 | + $__server->page_embeds->page_title = "SubRocks - Subscriptions"; |
|
13 | + $__server->page_embeds->page_description = "SubRocks is a site dedicated to bring back the 2012 layout of YouTube."; |
|
14 | + $__server->page_embeds->page_image = "/yt/imgbin/full-size-logo.png"; |
|
15 | + $__server->page_embeds->page_url = "https://subrock.rocks/"; |
|
16 | 16 | ?> |
17 | 17 | <!DOCTYPE html> |
18 | 18 | <html dir="ltr"> |
@@ -7,7 +7,7 @@ discard block |
||
7 | 7 | <?php $__user_h = new user_helper($__db); ?> |
8 | 8 | <?php $__db_h = new db_helper(); ?> |
9 | 9 | <?php $__time_h = new time_helper(); ?> |
10 | -<?php if(!isset($_SESSION['siteusername'])) { header("Location: /sign_in"); } ?> |
|
10 | +<?php if (!isset($_SESSION['siteusername'])) { header("Location: /sign_in"); } ?> |
|
11 | 11 | <?php |
12 | 12 | $__server->page_embeds->page_title = "SubRocks - Subscriptions"; |
13 | 13 | $__server->page_embeds->page_description = "SubRocks is a site dedicated to bring back the 2012 layout of YouTube."; |
@@ -163,7 +163,7 @@ discard block |
||
163 | 163 | ?> |
164 | 164 | |
165 | 165 | <div class="my_videos_ajax"> |
166 | - <?php while($user = $stmt->fetch(PDO::FETCH_ASSOC)) { ?> |
|
166 | + <?php while ($user = $stmt->fetch(PDO::FETCH_ASSOC)) { ?> |
|
167 | 167 | <div style="width: 33%;display: inline-block;"> |
168 | 168 | <img style="width: 50px;height:50px;" src="/dynamic/pfp/<?php echo $__user_h->fetch_pfp($user['reciever']); ?>"> |
169 | 169 | <span style="display: inline-block; vertical-align:top;width: 100px;font-size: 11px;"> |
@@ -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 - Edit Video"; |
|
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 - Edit Video"; |
|
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 | <?php if(!isset($_SESSION['siteusername'])) { header("Location: /sign_in"); } ?> |
17 | 17 | <?php $_video = $__video_h->fetch_video_rid($_GET['id']); ?> |
@@ -13,7 +13,7 @@ discard block |
||
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 $_video = $__video_h->fetch_video_rid($_GET['id']); ?> |
18 | 18 | <!DOCTYPE html> |
19 | 19 | <html dir="ltr"> |
@@ -177,7 +177,7 @@ discard block |
||
177 | 177 | <b>Category</b> <br> |
178 | 178 | <select style="margin-top:5px;" name="category" class="yt-uix-button yt-uix-button-default"> |
179 | 179 | <?php $categories = ["None", "Film & Animation", "Autos & Vehicles", "Music", "Pets & Animals", "Sports", "Travel & Events", "Gaming", "People & Blogs", "Comedy", "Entertainment", "News & Politics", "Howto & Style", "Education", "Science & Technology", "Nonprofits & Activism"]; ?> |
180 | - <?php foreach($categories as $categoryTag) { ?> |
|
180 | + <?php foreach ($categories as $categoryTag) { ?> |
|
181 | 181 | <option value="<?php echo $categoryTag; ?>"><?php echo $categoryTag; ?></option> |
182 | 182 | <?php } ?> |
183 | 183 | </select><br><br> |
@@ -4,46 +4,46 @@ discard block |
||
4 | 4 | <?php require_once($_SERVER['DOCUMENT_ROOT'] . "/s/classes/user_helper.php"); ?> |
5 | 5 | <?php require_once($_SERVER['DOCUMENT_ROOT'] . "/s/classes/video_helper.php"); ?> |
6 | 6 | <?php |
7 | - $request = (object) [ |
|
8 | - "search_term" => htmlspecialchars($_GET['search_query']), |
|
9 | - "like_search_term" => "%" . htmlspecialchars($_GET['search_query']) . "%", |
|
10 | - "search_amount" => 0 /* [fallback] */ |
|
11 | - ]; |
|
7 | + $request = (object) [ |
|
8 | + "search_term" => htmlspecialchars($_GET['search_query']), |
|
9 | + "like_search_term" => "%" . htmlspecialchars($_GET['search_query']) . "%", |
|
10 | + "search_amount" => 0 /* [fallback] */ |
|
11 | + ]; |
|
12 | 12 | |
13 | - $stmt = $__db->prepare("SELECT * FROM videos WHERE lower(title) LIKE lower(:search) "); |
|
14 | - $stmt->bindParam(":search", $request->like_search_term); |
|
15 | - $stmt->execute(); |
|
16 | - $request->search_amount = $stmt->rowCount(); |
|
13 | + $stmt = $__db->prepare("SELECT * FROM videos WHERE lower(title) LIKE lower(:search) "); |
|
14 | + $stmt->bindParam(":search", $request->like_search_term); |
|
15 | + $stmt->execute(); |
|
16 | + $request->search_amount = $stmt->rowCount(); |
|
17 | 17 | |
18 | - $results_per_page = 12; |
|
19 | - $number_of_result = $request->search_amount; |
|
20 | - $number_of_page = ceil ($number_of_result / $results_per_page); |
|
18 | + $results_per_page = 12; |
|
19 | + $number_of_result = $request->search_amount; |
|
20 | + $number_of_page = ceil ($number_of_result / $results_per_page); |
|
21 | 21 | |
22 | - if (!isset ($_GET['page']) ) { |
|
23 | - $page = 1; |
|
24 | - } else { |
|
25 | - $page = (int)$_GET['page']; |
|
26 | - } |
|
22 | + if (!isset ($_GET['page']) ) { |
|
23 | + $page = 1; |
|
24 | + } else { |
|
25 | + $page = (int)$_GET['page']; |
|
26 | + } |
|
27 | 27 | |
28 | - $page_first_result = ($page - 1) * $results_per_page; |
|
28 | + $page_first_result = ($page - 1) * $results_per_page; |
|
29 | 29 | |
30 | - $stmt6 = $__db->prepare("SELECT * FROM videos WHERE lower(title) LIKE lower(:search) ORDER BY id DESC LIMIT :pfirst, :pper"); |
|
31 | - $stmt6->bindParam(":search", $request->like_search_term); |
|
32 | - $stmt6->bindParam(":pfirst", $page_first_result); |
|
33 | - $stmt6->bindParam(":pper", $results_per_page); |
|
34 | - $stmt6->execute(); |
|
30 | + $stmt6 = $__db->prepare("SELECT * FROM videos WHERE lower(title) LIKE lower(:search) ORDER BY id DESC LIMIT :pfirst, :pper"); |
|
31 | + $stmt6->bindParam(":search", $request->like_search_term); |
|
32 | + $stmt6->bindParam(":pfirst", $page_first_result); |
|
33 | + $stmt6->bindParam(":pper", $results_per_page); |
|
34 | + $stmt6->execute(); |
|
35 | 35 | |
36 | - /* TODO :: Easy & Clean Pagination Class PLZ :((( ))) */ |
|
36 | + /* TODO :: Easy & Clean Pagination Class PLZ :((( ))) */ |
|
37 | 37 | ?> |
38 | 38 | <?php $__video_h = new video_helper($__db); ?> |
39 | 39 | <?php $__user_h = new user_helper($__db); ?> |
40 | 40 | <?php $__db_h = new db_helper(); ?> |
41 | 41 | <?php $__time_h = new time_helper(); ?> |
42 | 42 | <?php |
43 | - $__server->page_embeds->page_title = "SubRocks - Search"; |
|
44 | - $__server->page_embeds->page_description = "SubRocks is a site dedicated to bring back the 2012 layout of YouTube."; |
|
45 | - $__server->page_embeds->page_image = "/yt/imgbin/full-size-logo.png"; |
|
46 | - $__server->page_embeds->page_url = "https://subrock.rocks/"; |
|
43 | + $__server->page_embeds->page_title = "SubRocks - Search"; |
|
44 | + $__server->page_embeds->page_description = "SubRocks is a site dedicated to bring back the 2012 layout of YouTube."; |
|
45 | + $__server->page_embeds->page_image = "/yt/imgbin/full-size-logo.png"; |
|
46 | + $__server->page_embeds->page_url = "https://subrock.rocks/"; |
|
47 | 47 | ?> |
48 | 48 | <!DOCTYPE html> |
49 | 49 | <html> |
@@ -219,14 +219,14 @@ 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)) { |
|
223 | - $video['video_responses'] = $__video_h->get_video_responses($video['rid']); |
|
224 | - $video['age'] = $__time_h->time_elapsed_string($video['publish']); |
|
225 | - $video['duration'] = $__time_h->timestamp($video['duration']); |
|
226 | - $video['views'] = $__video_h->fetch_video_views($video['rid']); |
|
227 | - $video['author'] = htmlspecialchars($video['author']); |
|
228 | - $video['title'] = htmlspecialchars($video['title']); |
|
229 | - $video['description'] = $__video_h->shorten_description($video['description'], 50, true); |
|
222 | + while($video = $stmt6->fetch(PDO::FETCH_ASSOC)) { |
|
223 | + $video['video_responses'] = $__video_h->get_video_responses($video['rid']); |
|
224 | + $video['age'] = $__time_h->time_elapsed_string($video['publish']); |
|
225 | + $video['duration'] = $__time_h->timestamp($video['duration']); |
|
226 | + $video['views'] = $__video_h->fetch_video_views($video['rid']); |
|
227 | + $video['author'] = htmlspecialchars($video['author']); |
|
228 | + $video['title'] = htmlspecialchars($video['title']); |
|
229 | + $video['description'] = $__video_h->shorten_description($video['description'], 50, true); |
|
230 | 230 | ?> |
231 | 231 | <li class="yt-grid-box result-item-video *sr "> |
232 | 232 | <div id="" class="yt-uix-tile yt-lockup-list yt-tile-default yt-grid-box "> |
@@ -254,7 +254,7 @@ discard block |
||
254 | 254 | </li> |
255 | 255 | <?php } ?> |
256 | 256 | <?php if($request->search_amount == 0) |
257 | - echo "Your search query has brought no results.<br><br>"; |
|
257 | + echo "Your search query has brought no results.<br><br>"; |
|
258 | 258 | ?> |
259 | 259 | </ol> |
260 | 260 | </div> |
@@ -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> |
@@ -253,8 +253,9 @@ |
||
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 | 260 | </ol> |
260 | 261 | </div> |
@@ -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); |
@@ -14,11 +14,13 @@ |
||
14 | 14 | "action" => "l" /* fallback */ |
15 | 15 | ]; |
16 | 16 | |
17 | -if(!isset($_SESSION['siteusername']) || !isset($_GET['id'])) |
|
18 | - header('Location: ' . $_SERVER['HTTP_REFERER']); |
|
17 | +if(!isset($_SESSION['siteusername']) || !isset($_GET['id'])) { |
|
18 | + header('Location: ' . $_SERVER['HTTP_REFERER']); |
|
19 | +} |
|
19 | 20 | |
20 | -if(isset($_GET['a']) && $_GET['a'] == "-1") |
|
21 | +if(isset($_GET['a']) && $_GET['a'] == "-1") { |
|
21 | 22 | $request->action = "d"; |
23 | +} |
|
22 | 24 | |
23 | 25 | $stmt = $__db->prepare("SELECT * FROM comment_likes WHERE sender = :username AND reciever = :reciever AND type = 'l'"); |
24 | 26 | $stmt->bindParam(":username", $_SESSION['siteusername']); |