@@ -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(); error_reporting(E_ERROR | E_PARSE); ?> |
10 | -<?php if(!isset($_SESSION['siteusername'])) { header("Location: /sign_in"); } ?> |
|
10 | +<?php if (!isset($_SESSION['siteusername'])) { header("Location: /sign_in"); } ?> |
|
11 | 11 | <!DOCTYPE html> |
12 | 12 | <html dir="ltr"> |
13 | 13 | <head> |
@@ -160,15 +160,15 @@ discard block |
||
160 | 160 | $stmt->execute(); |
161 | 161 | |
162 | 162 | $number_of_result = $stmt->rowCount(); |
163 | - $number_of_page = ceil ($number_of_result / $results_per_page); |
|
163 | + $number_of_page = ceil($number_of_result/$results_per_page); |
|
164 | 164 | |
165 | - if (!isset ($_GET['page']) ) { |
|
165 | + if (!isset ($_GET['page'])) { |
|
166 | 166 | $page = 1; |
167 | 167 | } else { |
168 | - $page = (int)$_GET['page']; |
|
168 | + $page = (int) $_GET['page']; |
|
169 | 169 | } |
170 | 170 | |
171 | - $page_first_result = ($page - 1) * $results_per_page; |
|
171 | + $page_first_result = ($page - 1)*$results_per_page; |
|
172 | 172 | ?> |
173 | 173 | <?php |
174 | 174 | $stmt6 = $__db->prepare("SELECT * FROM favorite_video WHERE sender = :search ORDER BY id DESC LIMIT :pfirst, :pper"); |
@@ -188,8 +188,8 @@ discard block |
||
188 | 188 | </tr> |
189 | 189 | |
190 | 190 | <?php |
191 | - while($video = $stmt6->fetch(PDO::FETCH_ASSOC)) { |
|
192 | - if($__video_h->video_exists($video['reciever'])) { |
|
191 | + while ($video = $stmt6->fetch(PDO::FETCH_ASSOC)) { |
|
192 | + if ($__video_h->video_exists($video['reciever'])) { |
|
193 | 193 | $_video = $__video_h->fetch_video_rid($video['reciever']); |
194 | 194 | $_video['video_responses'] = $__video_h->get_video_responses($_video['rid']); |
195 | 195 | $_video['age'] = $__time_h->time_elapsed_string($_video['publish']); |
@@ -199,19 +199,19 @@ discard block |
||
199 | 199 | $_video['title'] = htmlspecialchars($_video['title']); |
200 | 200 | $_video['description'] = $__video_h->shorten_description($_video['description'], 50); |
201 | 201 | |
202 | - if($_video['thumbnail'] == ".png" && $_video['filename'] == ".mp4") { |
|
202 | + if ($_video['thumbnail'] == ".png" && $_video['filename'] == ".mp4") { |
|
203 | 203 | $status = "Corrupted"; |
204 | - } else if($_video['visibility'] == "v") { |
|
204 | + } else if ($_video['visibility'] == "v") { |
|
205 | 205 | $status = "Approved"; |
206 | - } else if($_video['visibility'] == "n") { |
|
206 | + } else if ($_video['visibility'] == "n") { |
|
207 | 207 | $status = "Approved"; |
208 | - } else if($_video['visibility'] == "o") { |
|
208 | + } else if ($_video['visibility'] == "o") { |
|
209 | 209 | $status = "Disapproved"; |
210 | 210 | } else { |
211 | 211 | $status = "Unknown"; |
212 | 212 | } |
213 | 213 | |
214 | - if($_video['commenting'] == "a") |
|
214 | + if ($_video['commenting'] == "a") |
|
215 | 215 | $_video['commentstatus'] = "Commenting allowed"; |
216 | 216 | else |
217 | 217 | $_video['commentstatus'] = "Commenting disallowed"; |
@@ -257,7 +257,7 @@ discard block |
||
257 | 257 | </div> |
258 | 258 | </center> |
259 | 259 | |
260 | - <?php for($page = 1; $page<= $number_of_page; $page++) { ?> |
|
260 | + <?php for ($page = 1; $page <= $number_of_page; $page++) { ?> |
|
261 | 261 | <button class="yt-uix-button yt-uix-button-default" onclick="ajax_fetch_videomanager(<?php echo $page; ?>)"><?php echo $page; ?></button> |
262 | 262 | <?php } ?> |
263 | 263 | |
@@ -303,7 +303,7 @@ discard block |
||
303 | 303 | </script> |
304 | 304 | |
305 | 305 | <?php |
306 | - if($stmt6->rowCount() == 0) { echo " |
|
306 | + if ($stmt6->rowCount() == 0) { echo " |
|
307 | 307 | <br>Welcome to your favorite videos page.<br> |
308 | 308 | You can add videos that you like and the video will be added here! |
309 | 309 | "; |
@@ -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(); |