@@ -14,8 +14,8 @@ discard block |
||
14 | 14 | "status" => 201, |
15 | 15 | ]; |
16 | 16 | |
17 | -if(!isset($_GET['u'])) { $response->status = 400; die(json_encode($response)); } |
|
18 | -if(!$__user_h->user_exists($_GET['u'])) { $response->status = 400; die(json_encode($response)); } |
|
17 | +if (!isset($_GET['u'])) { $response->status = 400; die(json_encode($response)); } |
|
18 | +if (!$__user_h->user_exists($_GET['u'])) { $response->status = 400; die(json_encode($response)); } |
|
19 | 19 | |
20 | 20 | $_user = $__user_h->fetch_user_username($_GET['u']); |
21 | 21 | $response = (object) [ |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | $_user['featured_channels'] = explode($_user['featured_channels'], ","); |
41 | 41 | $_user['featured_channels_object'] = (object) []; |
42 | 42 | $i = 0; |
43 | -foreach($_user['featured_channels'] as $channel) { |
|
43 | +foreach ($_user['featured_channels'] as $channel) { |
|
44 | 44 | $_user['featured_channels_object']->$i = $channel; |
45 | 45 | } |
46 | 46 |
@@ -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> |
@@ -11,8 +11,8 @@ discard block |
||
11 | 11 | <?php $__db_h = new db_helper(); ?> |
12 | 12 | <?php $__time_h = new time_helper(); ?> |
13 | 13 | <?php |
14 | - if(!isset($_SESSION['siteusername'])) { die(); } |
|
15 | - if(!$__user_h->if_admin($_SESSION['siteusername'])) { die(); } |
|
14 | + if (!isset($_SESSION['siteusername'])) { die(); } |
|
15 | + if (!$__user_h->if_admin($_SESSION['siteusername'])) { die(); } |
|
16 | 16 | |
17 | 17 | $request = (object) [ |
18 | 18 | "action" => $_GET['action'], |
@@ -49,8 +49,8 @@ discard block |
||
49 | 49 | ); |
50 | 50 | $request->tables_increment = 0; |
51 | 51 | |
52 | - if($request->action == "ban_users") { |
|
53 | - foreach($request->users as $username) { |
|
52 | + if ($request->action == "ban_users") { |
|
53 | + foreach ($request->users as $username) { |
|
54 | 54 | $stmt = $__db->prepare("DELETE FROM users WHERE username=:username"); |
55 | 55 | $stmt->execute(array( |
56 | 56 | ':username' => $username, |
@@ -133,8 +133,8 @@ discard block |
||
133 | 133 | |
134 | 134 | header("Location: /admin/bans"); |
135 | 135 | } |
136 | - } else if($request->action == "delete_videos") { |
|
137 | - foreach($request->videos as $video) { |
|
136 | + } else if ($request->action == "delete_videos") { |
|
137 | + foreach ($request->videos as $video) { |
|
138 | 138 | $stmt = $__db->prepare("DELETE FROM videos WHERE rid=:video"); |
139 | 139 | $stmt->execute(array( |
140 | 140 | ':video' => $video, |
@@ -142,7 +142,7 @@ discard block |
||
142 | 142 | |
143 | 143 | header("Location: /admin/bans"); |
144 | 144 | } |
145 | - } else if($request->action == "actually_just_ban") { |
|
145 | + } else if ($request->action == "actually_just_ban") { |
|
146 | 146 | $stmt = $__db->prepare("INSERT INTO bans (username, reason, expire, moderator) VALUES (:username, :reason, now(), :moderator)"); |
147 | 147 | $stmt->execute(array( |
148 | 148 | ':username' => $_POST['users'], |
@@ -151,7 +151,7 @@ discard block |
||
151 | 151 | )); |
152 | 152 | |
153 | 153 | header("Location: /admin/bans"); |
154 | - } else if($request->action == "actually_just_ban_ip") { |
|
154 | + } else if ($request->action == "actually_just_ban_ip") { |
|
155 | 155 | $_user = $__user_h->fetch_user_username($_POST['users']); |
156 | 156 | |
157 | 157 | $stmt = $__db->prepare("INSERT INTO bans (username, reason, expire, moderator) VALUES (:username, :reason, now(), :moderator)"); |
@@ -50,14 +50,14 @@ |
||
50 | 50 | |
51 | 51 | /* NORMAL BANS */ |
52 | 52 | $stmt = $__db->prepare("SELECT * FROM bans WHERE username = :username ORDER BY id DESC"); |
53 | - $stmt->bindParam(":username", $_SESSION['siteusername']); |
|
54 | - $stmt->execute(); |
|
53 | + $stmt->bindParam(":username", $_SESSION['siteusername']); |
|
54 | + $stmt->execute(); |
|
55 | 55 | |
56 | - while($ban = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
56 | + while($ban = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
57 | 57 | $ban_info = $ban; |
58 | 58 | if($_SERVER['REQUEST_URI'] != "/ban") |
59 | - header("Location: /ban"); |
|
60 | - } |
|
59 | + header("Location: /ban"); |
|
60 | + } |
|
61 | 61 | |
62 | 62 | /* IP BANS */ |
63 | 63 | $stmt = $__db->prepare("SELECT * FROM bans WHERE username = :username ORDER BY id DESC"); |
@@ -23,15 +23,15 @@ discard block |
||
23 | 23 | "db_connected" => false, |
24 | 24 | ], |
25 | 25 | |
26 | - "video_properties" => (object) [ "status" => "unloaded" ], |
|
27 | - "user_properties" => (object) [ "status" => "unloaded" ], |
|
28 | - "group_properties" => (object) [ "status" => "unloaded" ], |
|
29 | - "forum_properties" => (object) [ "status" => "unloaded" ], |
|
26 | + "video_properties" => (object) ["status" => "unloaded"], |
|
27 | + "user_properties" => (object) ["status" => "unloaded"], |
|
28 | + "group_properties" => (object) ["status" => "unloaded"], |
|
29 | + "forum_properties" => (object) ["status" => "unloaded"], |
|
30 | 30 | ]; |
31 | 31 | |
32 | 32 | try |
33 | 33 | { |
34 | - $__db = new PDO("mysql:host=".$__server->db_properties->db_host.";dbname=".$__server->db_properties->db_database.";charset=utf8mb4", |
|
34 | + $__db = new PDO("mysql:host=" . $__server->db_properties->db_host . ";dbname=" . $__server->db_properties->db_database . ";charset=utf8mb4", |
|
35 | 35 | $__server->db_properties->db_user, |
36 | 36 | $__server->db_properties->db_password, |
37 | 37 | [ |
@@ -41,9 +41,9 @@ discard block |
||
41 | 41 | ); |
42 | 42 | $__server->db_properties->db_connected = true; |
43 | 43 | } |
44 | - catch(PDOException $e) |
|
44 | + catch (PDOException $e) |
|
45 | 45 | { |
46 | - die("An error occured connecting to the database: ".$e->getMessage()); |
|
46 | + die("An error occured connecting to the database: " . $e->getMessage()); |
|
47 | 47 | } |
48 | 48 | |
49 | 49 | session_start(); |
@@ -53,9 +53,9 @@ discard block |
||
53 | 53 | $stmt->bindParam(":username", $_SESSION['siteusername']); |
54 | 54 | $stmt->execute(); |
55 | 55 | |
56 | - while($ban = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
56 | + while ($ban = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
57 | 57 | $ban_info = $ban; |
58 | - if($_SERVER['REQUEST_URI'] != "/ban") |
|
58 | + if ($_SERVER['REQUEST_URI'] != "/ban") |
|
59 | 59 | header("Location: /ban"); |
60 | 60 | } |
61 | 61 | |
@@ -64,14 +64,14 @@ discard block |
||
64 | 64 | $stmt->bindParam(":username", $_SERVER["HTTP_CF_CONNECTING_IP"]); |
65 | 65 | $stmt->execute(); |
66 | 66 | |
67 | - while($ban = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
67 | + while ($ban = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
68 | 68 | $ban_info = $ban; |
69 | - if($_SERVER['REQUEST_URI'] != "/ip_ban") |
|
69 | + if ($_SERVER['REQUEST_URI'] != "/ip_ban") |
|
70 | 70 | header("Location: /ip_ban"); |
71 | 71 | } |
72 | 72 | |
73 | 73 | /* NOT RUNNING UNDER CF CHECK */ |
74 | - if(!isset($_SERVER["HTTP_CF_CONNECTING_IP"])) { |
|
74 | + if (!isset($_SERVER["HTTP_CF_CONNECTING_IP"])) { |
|
75 | 75 | $_SERVER["HTTP_CF_CONNECTING_IP"] = $_SERVER['REMOTE_ADDR']; |
76 | 76 | } |
77 | 77 | ?> |
78 | 78 | \ No newline at end of file |
@@ -40,8 +40,7 @@ discard block |
||
40 | 40 | ] |
41 | 41 | ); |
42 | 42 | $__server->db_properties->db_connected = true; |
43 | - } |
|
44 | - catch(PDOException $e) |
|
43 | + } catch(PDOException $e) |
|
45 | 44 | { |
46 | 45 | die("An error occured connecting to the database: ".$e->getMessage()); |
47 | 46 | } |
@@ -55,8 +54,9 @@ discard block |
||
55 | 54 | |
56 | 55 | while($ban = $stmt->fetch(PDO::FETCH_ASSOC)) { |
57 | 56 | $ban_info = $ban; |
58 | - if($_SERVER['REQUEST_URI'] != "/ban") |
|
59 | - header("Location: /ban"); |
|
57 | + if($_SERVER['REQUEST_URI'] != "/ban") { |
|
58 | + header("Location: /ban"); |
|
59 | + } |
|
60 | 60 | } |
61 | 61 | |
62 | 62 | /* IP BANS */ |
@@ -66,8 +66,9 @@ discard block |
||
66 | 66 | |
67 | 67 | while($ban = $stmt->fetch(PDO::FETCH_ASSOC)) { |
68 | 68 | $ban_info = $ban; |
69 | - if($_SERVER['REQUEST_URI'] != "/ip_ban") |
|
70 | - header("Location: /ip_ban"); |
|
69 | + if($_SERVER['REQUEST_URI'] != "/ip_ban") { |
|
70 | + header("Location: /ip_ban"); |
|
71 | + } |
|
71 | 72 | } |
72 | 73 | |
73 | 74 | /* NOT RUNNING UNDER CF CHECK */ |
@@ -10,10 +10,10 @@ |
||
10 | 10 | <?php $__db_h = new db_helper(); ?> |
11 | 11 | <?php $__time_h = new time_helper(); ?> |
12 | 12 | <?php |
13 | - $__server->page_embeds->page_title = "SubRocks - Community Guidelines"; |
|
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 - Community Guidelines"; |
|
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 dir="ltr"> |
@@ -10,10 +10,10 @@ |
||
10 | 10 | <?php $__db_h = new db_helper(); ?> |
11 | 11 | <?php $__time_h = new time_helper(); ?> |
12 | 12 | <?php |
13 | - $__server->page_embeds->page_title = "SubRocks - Copyright"; |
|
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 - Copyright"; |
|
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 dir="ltr"> |
@@ -10,10 +10,10 @@ |
||
10 | 10 | <?php $__db_h = new db_helper(); ?> |
11 | 11 | <?php $__time_h = new time_helper(); ?> |
12 | 12 | <?php |
13 | - $__server->page_embeds->page_title = "SubRocks - About"; |
|
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 - About"; |
|
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 dir="ltr"> |
@@ -10,10 +10,10 @@ |
||
10 | 10 | <?php $__db_h = new db_helper(); ?> |
11 | 11 | <?php $__time_h = new time_helper(); ?> |
12 | 12 | <?php |
13 | - $__server->page_embeds->page_title = "SubRocks - Terms & Conditions"; |
|
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 - Terms & Conditions"; |
|
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 dir="ltr"> |
@@ -34,8 +34,8 @@ |
||
34 | 34 | |
35 | 35 | <div id="browse-side-column" class="ytg-2col ytg-last"> |
36 | 36 | <ol class="navigation-menu"> |
37 | - <?php foreach($__tabs as $_tab) { |
|
38 | - if($_SERVER['REQUEST_URI'] != $_tab->url) |
|
37 | + <?php foreach ($__tabs as $_tab) { |
|
38 | + if ($_SERVER['REQUEST_URI'] != $_tab->url) |
|
39 | 39 | $_tab->selected = true; |
40 | 40 | ?> |
41 | 41 | <li class="menu-item"> |
@@ -40,8 +40,9 @@ |
||
40 | 40 | <div id="browse-side-column" class="ytg-2col ytg-last"> |
41 | 41 | <ol class="navigation-menu"> |
42 | 42 | <?php foreach($__tabs as $_tab) { |
43 | - if($_SERVER['REQUEST_URI'] != $_tab->url) |
|
44 | - $_tab->selected = true; |
|
43 | + if($_SERVER['REQUEST_URI'] != $_tab->url) { |
|
44 | + $_tab->selected = true; |
|
45 | + } |
|
45 | 46 | ?> |
46 | 47 | <li class="menu-item"> |
47 | 48 | <a class="<?php echo $_tab->selected ? true : "selected"; ?>" href="<?php echo $_tab->url; ?>"> |