@@ -11,8 +11,8 @@ |
||
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 | "video" => $_GET['v'], |
@@ -26,7 +26,9 @@ |
||
26 | 26 | $dif['idle'] = $info2[3] - $info1[3]; |
27 | 27 | $total = array_sum($dif); |
28 | 28 | $cpu = array(); |
29 | - foreach($dif as $x=>$y) $cpu[$x] = round($y / $total * 100, 1); |
|
29 | + foreach($dif as $x=>$y) { |
|
30 | + $cpu[$x] = round($y / $total * 100, 1); |
|
31 | + } |
|
30 | 32 | |
31 | 33 | return $cpu; |
32 | 34 | } |
@@ -12,64 +12,64 @@ discard block |
||
12 | 12 | <?php if(!isset($_SESSION['siteusername'])) { header("Location: /sign_in"); } ?> |
13 | 13 | <?php if(!$__user_h->if_admin($_SESSION['siteusername'])) { header("Location: /"); } ?> |
14 | 14 | <?php |
15 | - $__server->page_embeds->page_title = "SubRocks - Admin Panel"; |
|
16 | - $__server->page_embeds->page_description = "SubRocks is a site dedicated to bring back the 2012 layout of YouTube."; |
|
17 | - $__server->page_embeds->page_image = "/yt/imgbin/full-size-logo.png"; |
|
18 | - $__server->page_embeds->page_url = "https://subrock.rocks/"; |
|
15 | + $__server->page_embeds->page_title = "SubRocks - Admin Panel"; |
|
16 | + $__server->page_embeds->page_description = "SubRocks is a site dedicated to bring back the 2012 layout of YouTube."; |
|
17 | + $__server->page_embeds->page_image = "/yt/imgbin/full-size-logo.png"; |
|
18 | + $__server->page_embeds->page_url = "https://subrock.rocks/"; |
|
19 | 19 | |
20 | - function get_server_array_stats() { |
|
21 | - $stat1 = file('/proc/stat'); |
|
22 | - sleep(1); |
|
23 | - $stat2 = file('/proc/stat'); |
|
24 | - $info1 = explode(" ", preg_replace("!cpu +!", "", $stat1[0])); |
|
25 | - $info2 = explode(" ", preg_replace("!cpu +!", "", $stat2[0])); |
|
26 | - $dif = array(); |
|
27 | - $dif['user'] = $info2[0] - $info1[0]; |
|
28 | - $dif['nice'] = $info2[1] - $info1[1]; |
|
29 | - $dif['sys'] = $info2[2] - $info1[2]; |
|
30 | - $dif['idle'] = $info2[3] - $info1[3]; |
|
31 | - $total = array_sum($dif); |
|
32 | - $cpu = array(); |
|
33 | - foreach($dif as $x=>$y) $cpu[$x] = round($y / $total * 100, 1); |
|
20 | + function get_server_array_stats() { |
|
21 | + $stat1 = file('/proc/stat'); |
|
22 | + sleep(1); |
|
23 | + $stat2 = file('/proc/stat'); |
|
24 | + $info1 = explode(" ", preg_replace("!cpu +!", "", $stat1[0])); |
|
25 | + $info2 = explode(" ", preg_replace("!cpu +!", "", $stat2[0])); |
|
26 | + $dif = array(); |
|
27 | + $dif['user'] = $info2[0] - $info1[0]; |
|
28 | + $dif['nice'] = $info2[1] - $info1[1]; |
|
29 | + $dif['sys'] = $info2[2] - $info1[2]; |
|
30 | + $dif['idle'] = $info2[3] - $info1[3]; |
|
31 | + $total = array_sum($dif); |
|
32 | + $cpu = array(); |
|
33 | + foreach($dif as $x=>$y) $cpu[$x] = round($y / $total * 100, 1); |
|
34 | 34 | |
35 | - return $cpu; |
|
36 | - } |
|
35 | + return $cpu; |
|
36 | + } |
|
37 | 37 | |
38 | - function adjustBrightness($hexCode, $adjustPercent) { |
|
39 | - $hexCode = ltrim($hexCode, '#'); |
|
38 | + function adjustBrightness($hexCode, $adjustPercent) { |
|
39 | + $hexCode = ltrim($hexCode, '#'); |
|
40 | 40 | |
41 | - if (strlen($hexCode) == 3) { |
|
42 | - $hexCode = $hexCode[0] . $hexCode[0] . $hexCode[1] . $hexCode[1] . $hexCode[2] . $hexCode[2]; |
|
43 | - } |
|
41 | + if (strlen($hexCode) == 3) { |
|
42 | + $hexCode = $hexCode[0] . $hexCode[0] . $hexCode[1] . $hexCode[1] . $hexCode[2] . $hexCode[2]; |
|
43 | + } |
|
44 | 44 | |
45 | - $hexCode = array_map('hexdec', str_split($hexCode, 2)); |
|
45 | + $hexCode = array_map('hexdec', str_split($hexCode, 2)); |
|
46 | 46 | |
47 | - foreach ($hexCode as & $color) { |
|
48 | - $adjustableLimit = $adjustPercent < 0 ? $color : 255 - $color; |
|
49 | - $adjustAmount = ceil($adjustableLimit * $adjustPercent); |
|
47 | + foreach ($hexCode as & $color) { |
|
48 | + $adjustableLimit = $adjustPercent < 0 ? $color : 255 - $color; |
|
49 | + $adjustAmount = ceil($adjustableLimit * $adjustPercent); |
|
50 | 50 | |
51 | - $color = str_pad(dechex($color + $adjustAmount), 2, '0', STR_PAD_LEFT); |
|
52 | - } |
|
51 | + $color = str_pad(dechex($color + $adjustAmount), 2, '0', STR_PAD_LEFT); |
|
52 | + } |
|
53 | 53 | |
54 | - return '#' . implode($hexCode); |
|
55 | - } |
|
54 | + return '#' . implode($hexCode); |
|
55 | + } |
|
56 | 56 | |
57 | - function get_server_memory_usage() { |
|
58 | - $free = shell_exec('free'); |
|
59 | - $free = (string)trim($free); |
|
60 | - $free_arr = explode("\n", $free); |
|
61 | - $mem = explode(" ", $free_arr[1]); |
|
62 | - $mem = array_filter($mem); |
|
63 | - $mem = array_merge($mem); |
|
64 | - $memory_usage = $mem[2]/$mem[1]*100; |
|
57 | + function get_server_memory_usage() { |
|
58 | + $free = shell_exec('free'); |
|
59 | + $free = (string)trim($free); |
|
60 | + $free_arr = explode("\n", $free); |
|
61 | + $mem = explode(" ", $free_arr[1]); |
|
62 | + $mem = array_filter($mem); |
|
63 | + $mem = array_merge($mem); |
|
64 | + $memory_usage = $mem[2]/$mem[1]*100; |
|
65 | 65 | |
66 | - return $memory_usage; |
|
67 | - } |
|
66 | + return $memory_usage; |
|
67 | + } |
|
68 | 68 | |
69 | - function get_server_cpu_usage() { |
|
70 | - $load = sys_getloadavg(); |
|
71 | - return $load[0]; |
|
72 | - } |
|
69 | + function get_server_cpu_usage() { |
|
70 | + $load = sys_getloadavg(); |
|
71 | + return $load[0]; |
|
72 | + } |
|
73 | 73 | ?> |
74 | 74 | <!DOCTYPE html> |
75 | 75 | <html dir="ltr"> |
@@ -236,30 +236,30 @@ discard block |
||
236 | 236 | <div class="box-gray" style="width: 95%;margin-bottom: 8px;"> |
237 | 237 | <h3>Statistics</h3> |
238 | 238 | <?php |
239 | - $stmt = $__db->prepare("SELECT id FROM videos"); |
|
240 | - $stmt->execute(); |
|
241 | - $videos = $stmt->rowCount(); |
|
239 | + $stmt = $__db->prepare("SELECT id FROM videos"); |
|
240 | + $stmt->execute(); |
|
241 | + $videos = $stmt->rowCount(); |
|
242 | 242 | |
243 | - $stmt = $__db->prepare("SELECT id FROM users"); |
|
244 | - $stmt->execute(); |
|
245 | - $users = $stmt->rowCount(); |
|
243 | + $stmt = $__db->prepare("SELECT id FROM users"); |
|
244 | + $stmt->execute(); |
|
245 | + $users = $stmt->rowCount(); |
|
246 | 246 | |
247 | - $stmt = $__db->prepare("SELECT id FROM comments"); |
|
248 | - $stmt->execute(); |
|
249 | - $comments = $stmt->rowCount(); |
|
247 | + $stmt = $__db->prepare("SELECT id FROM comments"); |
|
248 | + $stmt->execute(); |
|
249 | + $comments = $stmt->rowCount(); |
|
250 | 250 | |
251 | - $stmt = $__db->prepare("SELECT id FROM views"); |
|
252 | - $stmt->execute(); |
|
253 | - $views = $stmt->rowCount(); |
|
251 | + $stmt = $__db->prepare("SELECT id FROM views"); |
|
252 | + $stmt->execute(); |
|
253 | + $views = $stmt->rowCount(); |
|
254 | 254 | |
255 | - $stmt = $__db->prepare("SELECT id FROM pms"); |
|
256 | - $stmt->execute(); |
|
257 | - $pms = $stmt->rowCount(); |
|
255 | + $stmt = $__db->prepare("SELECT id FROM pms"); |
|
256 | + $stmt->execute(); |
|
257 | + $pms = $stmt->rowCount(); |
|
258 | 258 | |
259 | - $stmt = $__db->prepare("SELECT id FROM playlists"); |
|
260 | - $stmt->execute(); |
|
261 | - $playlists = $stmt->rowCount(); |
|
262 | - ?> |
|
259 | + $stmt = $__db->prepare("SELECT id FROM playlists"); |
|
260 | + $stmt->execute(); |
|
261 | + $playlists = $stmt->rowCount(); |
|
262 | + ?> |
|
263 | 263 | <div style="width: 200px;display:inline-block;"> |
264 | 264 | <?php $server = get_server_array_stats(); ?> |
265 | 265 | Videos uploaded: <b style="float:right;"><?php echo $videos; ?></b><br> |
@@ -9,8 +9,8 @@ discard block |
||
9 | 9 | <?php $__user_u = new user_update($__db); ?> |
10 | 10 | <?php $__db_h = new db_helper(); ?> |
11 | 11 | <?php $__time_h = new time_helper(); ?> |
12 | -<?php if(!isset($_SESSION['siteusername'])) { header("Location: /sign_in"); } ?> |
|
13 | -<?php if(!$__user_h->if_admin($_SESSION['siteusername'])) { header("Location: /"); } ?> |
|
12 | +<?php if (!isset($_SESSION['siteusername'])) { header("Location: /sign_in"); } ?> |
|
13 | +<?php if (!$__user_h->if_admin($_SESSION['siteusername'])) { header("Location: /"); } ?> |
|
14 | 14 | <?php |
15 | 15 | $__server->page_embeds->page_title = "SubRocks - Admin Panel"; |
16 | 16 | $__server->page_embeds->page_description = "SubRocks is a site dedicated to bring back the 2012 layout of YouTube."; |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | $dif['idle'] = $info2[3] - $info1[3]; |
31 | 31 | $total = array_sum($dif); |
32 | 32 | $cpu = array(); |
33 | - foreach($dif as $x=>$y) $cpu[$x] = round($y / $total * 100, 1); |
|
33 | + foreach ($dif as $x=>$y) $cpu[$x] = round($y/$total*100, 1); |
|
34 | 34 | |
35 | 35 | return $cpu; |
36 | 36 | } |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | |
47 | 47 | foreach ($hexCode as & $color) { |
48 | 48 | $adjustableLimit = $adjustPercent < 0 ? $color : 255 - $color; |
49 | - $adjustAmount = ceil($adjustableLimit * $adjustPercent); |
|
49 | + $adjustAmount = ceil($adjustableLimit*$adjustPercent); |
|
50 | 50 | |
51 | 51 | $color = str_pad(dechex($color + $adjustAmount), 2, '0', STR_PAD_LEFT); |
52 | 52 | } |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | |
57 | 57 | function get_server_memory_usage() { |
58 | 58 | $free = shell_exec('free'); |
59 | - $free = (string)trim($free); |
|
59 | + $free = (string) trim($free); |
|
60 | 60 | $free_arr = explode("\n", $free); |
61 | 61 | $mem = explode(" ", $free_arr[1]); |
62 | 62 | $mem = array_filter($mem); |
@@ -274,7 +274,7 @@ discard block |
||
274 | 274 | CPU Idle Usage: |
275 | 275 | <b style="float:right;color:<?php echo adjustBrightness("#FF0000", $server['idle']); ?>"> |
276 | 276 | <?php echo $server['idle']; ?>%</b><br> |
277 | - RAM Usage: <b style="float:right;"><?php echo round(get_server_memory_usage(), 3) ; ?> megabytes</b> |
|
277 | + RAM Usage: <b style="float:right;"><?php echo round(get_server_memory_usage(), 3); ?> megabytes</b> |
|
278 | 278 | </div> |
279 | 279 | <div style="width: 200px;display:inline-block;margin-right:20px;vertical-align: top;margin-left: 22px;"> |
280 | 280 | <?php $server = get_server_array_stats(); ?> |
@@ -35,8 +35,8 @@ |
||
35 | 35 | </a> |
36 | 36 | </div> |
37 | 37 | <ol class="navigation-menu"> |
38 | - <?php foreach($__tabs as $_tab) { |
|
39 | - if($_SERVER['REQUEST_URI'] != $_tab->url) |
|
38 | + <?php foreach ($__tabs as $_tab) { |
|
39 | + if ($_SERVER['REQUEST_URI'] != $_tab->url) |
|
40 | 40 | $_tab->selected = true; |
41 | 41 | ?> |
42 | 42 | <li class="menu-item"> |
@@ -36,8 +36,9 @@ |
||
36 | 36 | </div> |
37 | 37 | <ol class="navigation-menu"> |
38 | 38 | <?php foreach($__tabs as $_tab) { |
39 | - if($_SERVER['REQUEST_URI'] != $_tab->url) |
|
40 | - $_tab->selected = true; |
|
39 | + if($_SERVER['REQUEST_URI'] != $_tab->url) { |
|
40 | + $_tab->selected = true; |
|
41 | + } |
|
41 | 42 | ?> |
42 | 43 | <li class="menu-item"> |
43 | 44 | <a class="<?php echo $_tab->selected ? true : "selected"; ?>" href="<?php echo $_tab->url; ?>"> |
@@ -47,9 +47,9 @@ discard block |
||
47 | 47 | $stmt->bindParam(":comment_username", $_user['username']); |
48 | 48 | $stmt->bindParam(":videos_username", $_user['username']); |
49 | 49 | $stmt->execute(); |
50 | - if($stmt->rowCount() == 0) { echo "<br><span style='color:grey;font-size:11px;'>This user has not done anything yet.</span>"; } |
|
51 | - while($content = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
52 | - if((int)$content['id']) { |
|
50 | + if ($stmt->rowCount() == 0) { echo "<br><span style='color:grey;font-size:11px;'>This user has not done anything yet.</span>"; } |
|
51 | + while ($content = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
52 | + if ((int) $content['id']) { |
|
53 | 53 | $content = $__video_h->fetch_comment_id($content['id']); |
54 | 54 | $content['video'] = $__video_h->fetch_video_rid($content['toid']); |
55 | 55 | $content['type'] = "comment"; |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | $content['type'] = "video"; |
59 | 59 | } |
60 | 60 | |
61 | - if($content['type'] == "video") { |
|
61 | + if ($content['type'] == "video") { |
|
62 | 62 | ?> |
63 | 63 | <div class="feed-item-container" data-channel-key="UCc6W7efUSkd9YYoxOnctlFg"> |
64 | 64 | <a href="/user/<?php echo htmlspecialchars($content['author']); ?>?feature=plcp" class="feed-author-bubble " title="<?php echo htmlspecialchars($content['author']); ?>"> <span class="feed-item-author"> |
@@ -130,7 +130,7 @@ discard block |
||
130 | 130 | </div> |
131 | 131 | </div> |
132 | 132 | <?php } else { |
133 | - if($__video_h->video_exists($content['video']['rid'])) { ?> |
|
133 | + if ($__video_h->video_exists($content['video']['rid'])) { ?> |
|
134 | 134 | <div class="feed-item-container" data-channel-key="UCXf1X2u5gsmuqcuTQlpOGhw"> |
135 | 135 | <a href="/user/<?php echo htmlspecialchars($content['author']); ?>?feature=plcp" class="feed-author-bubble " title="<?php echo htmlspecialchars($content['author']); ?>"> <span class="feed-item-author"> |
136 | 136 | <span class="video-thumb ux-thumb yt-thumb-square-28 "><span class="yt-thumb-clip"><span class="yt-thumb-clip-inner"><img src="http://s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" alt="<?php echo htmlspecialchars($content['author']); ?>" data-thumb="/dynamic/pfp/<?php echo $__user_h->fetch_pfp($content['author']); ?>" width="28"><span class="vertical-align"></span></span></span></span> |
@@ -236,7 +236,7 @@ discard block |
||
236 | 236 | </div> |
237 | 237 | <hr class="yt-horizontal-rule "> |
238 | 238 | </div> |
239 | - <?php if(!empty($_user['website'])) { ?> |
|
239 | + <?php if (!empty($_user['website'])) { ?> |
|
240 | 240 | <div class="user-profile-item"> |
241 | 241 | <div class="yt-c3-profile-custom-url field-container "> |
242 | 242 | <a href="<?php echo addhttp(htmlspecialchars($_user['website'])); ?>" rel="me nofollow" target="_blank" title="<?php echo htmlspecialchars($_user['website']); ?>" class="yt-uix-redirect-link"> |
@@ -285,7 +285,7 @@ discard block |
||
285 | 285 | <h5>Country</h5> |
286 | 286 | <span class="value"><?php echo htmlspecialchars($_user['country']); ?></span> |
287 | 287 | </div> |
288 | - <?php if($_user['genre'] != "none") { ?> |
|
288 | + <?php if ($_user['genre'] != "none") { ?> |
|
289 | 289 | <div class="user-profile-item "> |
290 | 290 | <h5>Channel Genre</h5> |
291 | 291 | <span class="value"><?php echo htmlspecialchars(ucfirst($_user['genre'])); ?></span> |
@@ -297,16 +297,16 @@ discard block |
||
297 | 297 | </div> |
298 | 298 | <div class="channel-module other-channels yt-uix-c3-module-container other-channels-compact"> |
299 | 299 | <?php $_user['featured_channels'] = explode(",", $_user['featured_channels']); ?> |
300 | - <?php if(count($_user['featured_channels']) != 0) { ?> |
|
300 | + <?php if (count($_user['featured_channels']) != 0) { ?> |
|
301 | 301 | <div class="module-view other-channels-view"> |
302 | - <h2 <?php if(@$_SESSION['siteusername'] == $_user['username']) { ?>style="display: inline-block;position: relative;bottom: 10px;"<?php } ?>>Featured Channels</h2> |
|
303 | - <?php if(@$_SESSION['siteusername'] == $_user['username']) { |
|
302 | + <h2 <?php if (@$_SESSION['siteusername'] == $_user['username']) { ?>style="display: inline-block;position: relative;bottom: 10px;"<?php } ?>>Featured Channels</h2> |
|
303 | + <?php if (@$_SESSION['siteusername'] == $_user['username']) { |
|
304 | 304 | echo "<a href='#' style='float:right;font-size:11px;color:black;' onclick=';open_featured_channels();return false;'>edit</a>"; |
305 | 305 | } ?> |
306 | 306 | <ul class="channel-summary-list "> |
307 | 307 | <?php |
308 | - foreach($_user['featured_channels'] as $user) { |
|
309 | - if($__user_h->user_exists($user)) { |
|
308 | + foreach ($_user['featured_channels'] as $user) { |
|
309 | + if ($__user_h->user_exists($user)) { |
|
310 | 310 | ?> |
311 | 311 | <li class="yt-tile-visible yt-uix-tile"> |
312 | 312 | <div class="channel-summary clearfix channel-summary-compact"> |
@@ -335,13 +335,13 @@ discard block |
||
335 | 335 | $stmt->bindParam(":search", $_user['username']); |
336 | 336 | $stmt->execute(); |
337 | 337 | |
338 | - if($stmt->rowCount() != 0) { |
|
338 | + if ($stmt->rowCount() != 0) { |
|
339 | 339 | ?> |
340 | 340 | <div class="playlists-narrow channel-module yt-uix-c3-module-container"> |
341 | 341 | <div class="module-view gh-featured"> |
342 | 342 | <h2>Featured Playlists</h2> |
343 | 343 | <?php |
344 | - while($playlist = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
344 | + while ($playlist = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
345 | 345 | $playlist['videos'] = json_decode($playlist['videos']); |
346 | 346 | ?> |
347 | 347 | <div class="playlist yt-tile-visible yt-uix-tile"> |
@@ -45,20 +45,20 @@ discard block |
||
45 | 45 | ORDER BY |
46 | 46 | `date` DESC LIMIT 10;"); |
47 | 47 | $stmt->bindParam(":comment_username", $_user['username']); |
48 | - $stmt->bindParam(":videos_username", $_user['username']); |
|
48 | + $stmt->bindParam(":videos_username", $_user['username']); |
|
49 | 49 | $stmt->execute(); |
50 | - if($stmt->rowCount() == 0) { echo "<br><span style='color:grey;font-size:11px;'>This user has not done anything yet.</span>"; } |
|
50 | + if($stmt->rowCount() == 0) { echo "<br><span style='color:grey;font-size:11px;'>This user has not done anything yet.</span>"; } |
|
51 | 51 | while($content = $stmt->fetch(PDO::FETCH_ASSOC)) { |
52 | - if((int)$content['id']) { |
|
53 | - $content = $__video_h->fetch_comment_id($content['id']); |
|
54 | - $content['video'] = $__video_h->fetch_video_rid($content['toid']); |
|
55 | - $content['type'] = "comment"; |
|
56 | - } else { |
|
57 | - $content = $__video_h->fetch_video_rid($content['id']); |
|
58 | - $content['type'] = "video"; |
|
59 | - } |
|
52 | + if((int)$content['id']) { |
|
53 | + $content = $__video_h->fetch_comment_id($content['id']); |
|
54 | + $content['video'] = $__video_h->fetch_video_rid($content['toid']); |
|
55 | + $content['type'] = "comment"; |
|
56 | + } else { |
|
57 | + $content = $__video_h->fetch_video_rid($content['id']); |
|
58 | + $content['type'] = "video"; |
|
59 | + } |
|
60 | 60 | |
61 | - if($content['type'] == "video") { |
|
61 | + if($content['type'] == "video") { |
|
62 | 62 | ?> |
63 | 63 | <div class="feed-item-container" data-channel-key="UCc6W7efUSkd9YYoxOnctlFg"> |
64 | 64 | <a href="/user/<?php echo htmlspecialchars($content['author']); ?>?feature=plcp" class="feed-author-bubble " title="<?php echo htmlspecialchars($content['author']); ?>"> <span class="feed-item-author"> |
@@ -130,7 +130,7 @@ discard block |
||
130 | 130 | </div> |
131 | 131 | </div> |
132 | 132 | <?php } else { |
133 | - if($__video_h->video_exists($content['video']['rid'])) { ?> |
|
133 | + if($__video_h->video_exists($content['video']['rid'])) { ?> |
|
134 | 134 | <div class="feed-item-container" data-channel-key="UCXf1X2u5gsmuqcuTQlpOGhw"> |
135 | 135 | <a href="/user/<?php echo htmlspecialchars($content['author']); ?>?feature=plcp" class="feed-author-bubble " title="<?php echo htmlspecialchars($content['author']); ?>"> <span class="feed-item-author"> |
136 | 136 | <span class="video-thumb ux-thumb yt-thumb-square-28 "><span class="yt-thumb-clip"><span class="yt-thumb-clip-inner"><img src="http://s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" alt="<?php echo htmlspecialchars($content['author']); ?>" data-thumb="/dynamic/pfp/<?php echo $__user_h->fetch_pfp($content['author']); ?>" width="28"><span class="vertical-align"></span></span></span></span> |
@@ -301,13 +301,13 @@ discard block |
||
301 | 301 | <div class="module-view other-channels-view"> |
302 | 302 | <h2 <?php if(@$_SESSION['siteusername'] == $_user['username']) { ?>style="display: inline-block;position: relative;bottom: 10px;"<?php } ?>>Featured Channels</h2> |
303 | 303 | <?php if(@$_SESSION['siteusername'] == $_user['username']) { |
304 | - echo "<a href='#' style='float:right;font-size:11px;color:black;' onclick=';open_featured_channels();return false;'>edit</a>"; |
|
305 | - } ?> |
|
304 | + echo "<a href='#' style='float:right;font-size:11px;color:black;' onclick=';open_featured_channels();return false;'>edit</a>"; |
|
305 | + } ?> |
|
306 | 306 | <ul class="channel-summary-list "> |
307 | 307 | <?php |
308 | - foreach($_user['featured_channels'] as $user) { |
|
309 | - if($__user_h->user_exists($user)) { |
|
310 | - ?> |
|
308 | + foreach($_user['featured_channels'] as $user) { |
|
309 | + if($__user_h->user_exists($user)) { |
|
310 | + ?> |
|
311 | 311 | <li class="yt-tile-visible yt-uix-tile"> |
312 | 312 | <div class="channel-summary clearfix channel-summary-compact"> |
313 | 313 | <div class="channel-summary-thumb"> |
@@ -331,19 +331,19 @@ discard block |
||
331 | 331 | </div> |
332 | 332 | |
333 | 333 | <?php |
334 | - $stmt = $__db->prepare("SELECT * FROM playlists WHERE author = :search ORDER BY id DESC LIMIT 10"); |
|
335 | - $stmt->bindParam(":search", $_user['username']); |
|
336 | - $stmt->execute(); |
|
334 | + $stmt = $__db->prepare("SELECT * FROM playlists WHERE author = :search ORDER BY id DESC LIMIT 10"); |
|
335 | + $stmt->bindParam(":search", $_user['username']); |
|
336 | + $stmt->execute(); |
|
337 | 337 | |
338 | - if($stmt->rowCount() != 0) { |
|
339 | - ?> |
|
338 | + if($stmt->rowCount() != 0) { |
|
339 | + ?> |
|
340 | 340 | <div class="playlists-narrow channel-module yt-uix-c3-module-container"> |
341 | 341 | <div class="module-view gh-featured"> |
342 | 342 | <h2>Featured Playlists</h2> |
343 | 343 | <?php |
344 | - while($playlist = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
345 | - $playlist['videos'] = json_decode($playlist['videos']); |
|
346 | - ?> |
|
344 | + while($playlist = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
345 | + $playlist['videos'] = json_decode($playlist['videos']); |
|
346 | + ?> |
|
347 | 347 | <div class="playlist yt-tile-visible yt-uix-tile"> |
348 | 348 | <a href="/view_playlist?v=<?php echo $playlist['rid']; ?>"> |
349 | 349 | <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> |
@@ -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 */ |