@@ -14,15 +14,15 @@ discard block |
||
| 14 | 14 | <?php |
| 15 | 15 | $_video = $__video_h->fetch_video_rid($_SESSION['current_video']); |
| 16 | 16 | |
| 17 | -if($_SERVER['REQUEST_METHOD'] == 'POST') { |
|
| 17 | +if ($_SERVER['REQUEST_METHOD'] == 'POST') { |
|
| 18 | 18 | $error = array(); |
| 19 | 19 | |
| 20 | - if(!isset($_SESSION['siteusername'])){ $error['message'] = "you are not logged in"; $error['status'] = true; } |
|
| 21 | - if(!$_POST['comment']){ $error['message'] = "your comment cannot be blank"; $error['status'] = true; } |
|
| 22 | - if(strlen($_POST['comment']) > 1000){ $error['message'] = "your comment must be shorter than 1000 characters"; $error['status'] = true; } |
|
| 23 | - if($__user_h->if_cooldown($_SESSION['siteusername'])) { $error['message'] = "You are on a cooldown! Wait for a minute before posting another comment."; $error['status'] = true; } |
|
| 20 | + if (!isset($_SESSION['siteusername'])) { $error['message'] = "you are not logged in"; $error['status'] = true; } |
|
| 21 | + if (!$_POST['comment']) { $error['message'] = "your comment cannot be blank"; $error['status'] = true; } |
|
| 22 | + if (strlen($_POST['comment']) > 1000) { $error['message'] = "your comment must be shorter than 1000 characters"; $error['status'] = true; } |
|
| 23 | + if ($__user_h->if_cooldown($_SESSION['siteusername'])) { $error['message'] = "You are on a cooldown! Wait for a minute before posting another comment."; $error['status'] = true; } |
|
| 24 | 24 | |
| 25 | - if(!isset($error['message'])) { |
|
| 25 | + if (!isset($error['message'])) { |
|
| 26 | 26 | $text = $_POST['comment']; |
| 27 | 27 | $stmt = $__db->prepare("INSERT INTO comments (toid, author, comment) VALUES (:v, :username, :comment)"); |
| 28 | 28 | $stmt->bindParam(":v", $_SESSION['current_video']); |
@@ -31,14 +31,14 @@ discard block |
||
| 31 | 31 | $stmt->execute(); |
| 32 | 32 | |
| 33 | 33 | $__user_u->update_cooldown_time($_SESSION['siteusername'], "cooldown_comment"); |
| 34 | - if(@$_SESSION['siteusername'] != $_video['author']) |
|
| 34 | + if (@$_SESSION['siteusername'] != $_video['author']) |
|
| 35 | 35 | $__user_i->send_message($_SESSION['siteusername'], "New comment", $_video['author'], "I commented \"" . $_POST['comment'] . "\" on your video!", $_video['rid'], "nt"); |
| 36 | 36 | } |
| 37 | 37 | } |
| 38 | 38 | |
| 39 | 39 | header("Content-type: text/xml"); |
| 40 | 40 | // ugly solution |
| 41 | -if(!isset($error['status'])) { |
|
| 41 | +if (!isset($error['status'])) { |
|
| 42 | 42 | $xml = '<?xml version="1.0" encoding="utf-8"?><root><str_code><![CDATA[OK]]></str_code><html_content><![CDATA[<li class="comment yt-tile-default " data-author-viewing="" data-author-id="-uD01K8FQTeOSS5sniRFzQ" data-id="420" data-score="0"><div class="comment-body"><div class="content-container"><div class="content"><div class="comment-text" dir="ltr"><p>' . $__video_h->shorten_description($_POST['comment'], 2048, true) . '</p></div><p class="metadata"><span class="author "><a href="/user/' . htmlspecialchars($_SESSION['siteusername']) . '" class="yt-uix-sessionlink yt-user-name " data-sessionlink="' . htmlspecialchars($_SESSION['siteusername']) . '" dir="ltr">' . htmlspecialchars($_SESSION['siteusername']) . '</a></span><span class="time" dir="ltr"><span dir="ltr">just now<span></span></span></span></p></div><div class="comment-actions"><span class="yt-uix-button-group"><button type="button" class="start comment-action-vote-up comment-action yt-uix-button yt-uix-button-default yt-uix-tooltip yt-uix-button-empty" onclick=";return false;" title="Vote Up" data-action="vote-up" data-tooltip-show-delay="300" role="button"><span class="yt-uix-button-icon-wrapper"><img class="yt-uix-button-icon yt-uix-button-icon-watch-comment-vote-up" src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" alt="Vote Up"><span class="yt-valign-trick"></span></span></button><button type="button" class="end comment-action-vote-down comment-action yt-uix-button yt-uix-button-default yt-uix-tooltip yt-uix-button-empty" onclick=";return false;" title="Vote Down" data-action="vote-down" data-tooltip-show-delay="300" role="button"><span class="yt-uix-button-icon-wrapper"><img class="yt-uix-button-icon yt-uix-button-icon-watch-comment-vote-down" src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" alt="Vote Down"><span class="yt-valign-trick"></span></span></button></span><span class="yt-uix-button-group"><!--<button type="button" class="start comment-action yt-uix-button yt-uix-button-default" onclick=";return false;" data-action="reply" role="button"><span class="yt-uix-button-content">Reply </span></button>--><button type="button" class="end flip yt-uix-button yt-uix-button-default yt-uix-button-empty" onclick=";return false;" data-button-has-sibling-menu="true" role="button" aria-pressed="false" aria-expanded="false" aria-haspopup="true" aria-activedescendant=""><img class="yt-uix-button-arrow" src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" alt=""><div class=" yt-uix-button-menu yt-uix-button-menu-default" style="display: none;"><ul><li class="comment-action" data-action="share"><span class="yt-uix-button-menu-item">Share</span></li><li class="comment-action-remove comment-action" data-action="remove"><span class="yt-uix-button-menu-item">Remove</span></li><li class="comment-action" data-action="flag"><span class="yt-uix-button-menu-item">Flag for spam</span></li><li class="comment-action-block comment-action" data-action="block"><span class="yt-uix-button-menu-item">Block User</span></li><li class="comment-action-unblock comment-action" data-action="unblock"><span class="yt-uix-button-menu-item">Unblock User</span></li></ul></div></button></span></div></div></div></li>]]></html_content><return_code><![CDATA[0]]></return_code></root>'; |
| 43 | 43 | } else { |
| 44 | 44 | $xml = '<?xml version="1.0" encoding="utf-8"?><root><str_code><![CDATA[OK]]></str_code><html_content><![CDATA[<div class="yt-alert yt-alert-default yt-alert-error "> <div class="yt-alert-icon"><img src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" class="icon master-sprite" alt="Alert icon"></div><div class="yt-alert-buttons"></div><div class="yt-alert-content" role="alert"><span class="yt-alert-vertical-trick"></span><div class="yt-alert-message">You are under a cooldown!</div></div></div>]]></html_content><return_code><![CDATA[0]]></return_code></root>'; |
@@ -31,8 +31,9 @@ |
||
| 31 | 31 | $stmt->execute(); |
| 32 | 32 | |
| 33 | 33 | $__user_u->update_cooldown_time($_SESSION['siteusername'], "cooldown_comment"); |
| 34 | - if(@$_SESSION['siteusername'] != $_video['author']) |
|
| 35 | - $__user_i->send_message($_SESSION['siteusername'], "New comment", $_video['author'], "I commented \"" . $_POST['comment'] . "\" on your video!", $_video['rid'], "nt"); |
|
| 34 | + if(@$_SESSION['siteusername'] != $_video['author']) { |
|
| 35 | + $__user_i->send_message($_SESSION['siteusername'], "New comment", $_video['author'], "I commented \"" . $_POST['comment'] . "\" on your video!", $_video['rid'], "nt"); |
|
| 36 | + } |
|
| 36 | 37 | } |
| 37 | 38 | } |
| 38 | 39 | |
@@ -21,12 +21,12 @@ |
||
| 21 | 21 | ] |
| 22 | 22 | ]; |
| 23 | 23 | |
| 24 | -if(empty(trim($request->comment))) { header("Location: /watch?v=" . $_GET['v']); } |
|
| 25 | -if(empty(trim($request->to_id ))) { header("Location: /"); } |
|
| 26 | -if(isset($_SESSION['siteusername'])) { |
|
| 24 | +if (empty(trim($request->comment))) { header("Location: /watch?v=" . $_GET['v']); } |
|
| 25 | +if (empty(trim($request->to_id))) { header("Location: /"); } |
|
| 26 | +if (isset($_SESSION['siteusername'])) { |
|
| 27 | 27 | $stmt = $__db->prepare("INSERT INTO comment_reply (toid, author, comment) VALUES (:to_id, :author, :comment)"); |
| 28 | - $stmt->bindParam(":to_id", $request->to_id); |
|
| 29 | - $stmt->bindParam(":author", $request->sender); |
|
| 28 | + $stmt->bindParam(":to_id", $request->to_id); |
|
| 29 | + $stmt->bindParam(":author", $request->sender); |
|
| 30 | 30 | $stmt->bindParam(":comment", $request->comment); |
| 31 | 31 | $stmt->execute(); |
| 32 | 32 | |
@@ -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 | "username" => $_GET['v'], |
@@ -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; ?>"> |
@@ -15,29 +15,29 @@ discard block |
||
| 15 | 15 | <?php $_video = $__video_h->fetch_video_rid($_GET['v']); ?> |
| 16 | 16 | <?php $_video['comments'] = $__video_h->get_comments_from_video($_video['rid']); ?> |
| 17 | 17 | <?php |
| 18 | - if($_video['visibility'] == "v" && @$_SESSION['siteusername'] != $_video['author']) |
|
| 19 | - header("Location: /"); |
|
| 18 | + if($_video['visibility'] == "v" && @$_SESSION['siteusername'] != $_video['author']) |
|
| 19 | + header("Location: /"); |
|
| 20 | 20 | |
| 21 | - if(isset($_SESSION['siteusername'])) |
|
| 22 | - $__video_h->check_view($_GET['v'], @$_SESSION['siteusername']); |
|
| 21 | + if(isset($_SESSION['siteusername'])) |
|
| 22 | + $__video_h->check_view($_GET['v'], @$_SESSION['siteusername']); |
|
| 23 | 23 | |
| 24 | - $_SESSION['current_video'] = $_video['rid']; |
|
| 24 | + $_SESSION['current_video'] = $_video['rid']; |
|
| 25 | 25 | |
| 26 | - /* |
|
| 26 | + /* |
|
| 27 | 27 | PREPARE EMBEDS CLASS -- function(string $page_title, string $page_description...) |
| 28 | 28 | Returns a list of arrays for compatibility purposes & but downside is ugly for loop codes |
| 29 | 29 | Work on this tomorrow or some shit idk lol |
| 30 | 30 | */ |
| 31 | 31 | |
| 32 | - /* |
|
| 32 | + /* |
|
| 33 | 33 | USE THE GOD DAMN __CONFIG MORE -- idiot |
| 34 | 34 | Work on this tomorrow or some shit |
| 35 | 35 | */ |
| 36 | 36 | |
| 37 | - $__server->page_embeds->page_title = htmlspecialchars($_video['title']); |
|
| 38 | - $__server->page_embeds->page_description = htmlspecialchars($_video['description']); |
|
| 39 | - $__server->page_embeds->page_image = "/dynamic/thumbs/" . $_video['thumbnail']; |
|
| 40 | - $__server->page_embeds->page_url = "https://subrock.rocks/watch?v=" . htmlspecialchars($_video['rid']); |
|
| 37 | + $__server->page_embeds->page_title = htmlspecialchars($_video['title']); |
|
| 38 | + $__server->page_embeds->page_description = htmlspecialchars($_video['description']); |
|
| 39 | + $__server->page_embeds->page_image = "/dynamic/thumbs/" . $_video['thumbnail']; |
|
| 40 | + $__server->page_embeds->page_url = "https://subrock.rocks/watch?v=" . htmlspecialchars($_video['rid']); |
|
| 41 | 41 | ?> |
| 42 | 42 | <!DOCTYPE html> |
| 43 | 43 | <html> |
@@ -67,29 +67,29 @@ discard block |
||
| 67 | 67 | if (window.yt.timing) {yt.timing.tick("ct");} |
| 68 | 68 | </script> |
| 69 | 69 | <?php |
| 70 | - $_video['dislikes'] = $__video_h->get_video_stars_level($_video['rid'], 1); |
|
| 71 | - $_video['dislikes'] += $__video_h->get_video_stars_level($_video['rid'], 2); |
|
| 70 | + $_video['dislikes'] = $__video_h->get_video_stars_level($_video['rid'], 1); |
|
| 71 | + $_video['dislikes'] += $__video_h->get_video_stars_level($_video['rid'], 2); |
|
| 72 | 72 | |
| 73 | - $_video['likes'] = $__video_h->get_video_stars_level($_video['rid'], 4); |
|
| 74 | - $_video['likes'] += $__video_h->get_video_stars_level($_video['rid'], 5); |
|
| 73 | + $_video['likes'] = $__video_h->get_video_stars_level($_video['rid'], 4); |
|
| 74 | + $_video['likes'] += $__video_h->get_video_stars_level($_video['rid'], 5); |
|
| 75 | 75 | |
| 76 | - $_video['dislikes'] += $__video_h->get_video_likes($_video['rid'], false); |
|
| 77 | - $_video['likes'] += $__video_h->get_video_likes($_video['rid'], true); |
|
| 76 | + $_video['dislikes'] += $__video_h->get_video_likes($_video['rid'], false); |
|
| 77 | + $_video['likes'] += $__video_h->get_video_likes($_video['rid'], true); |
|
| 78 | 78 | |
| 79 | - if($_video['likes'] == 0 && $_video['dislikes'] == 0) { |
|
| 80 | - $_video['likeswidth'] = 0; |
|
| 81 | - $_video['dislikeswidth'] = 0; |
|
| 82 | - } else { |
|
| 83 | - $_video['likeswidth'] = $_video['likes'] / ($_video['likes'] + $_video['dislikes']) * 100; |
|
| 84 | - $_video['dislikeswidth'] = 100 - $_video['likeswidth']; |
|
| 85 | - } |
|
| 79 | + if($_video['likes'] == 0 && $_video['dislikes'] == 0) { |
|
| 80 | + $_video['likeswidth'] = 0; |
|
| 81 | + $_video['dislikeswidth'] = 0; |
|
| 82 | + } else { |
|
| 83 | + $_video['likeswidth'] = $_video['likes'] / ($_video['likes'] + $_video['dislikes']) * 100; |
|
| 84 | + $_video['dislikeswidth'] = 100 - $_video['likeswidth']; |
|
| 85 | + } |
|
| 86 | 86 | |
| 87 | - $_video['liked'] = $__video_h->if_liked(@$_SESSION['siteusername'], $_video['rid'], true); |
|
| 88 | - $_video['disliked'] = $__video_h->if_liked(@$_SESSION['siteusername'], $_video['rid'], false); |
|
| 89 | - $_video['author_videos'] = $__video_h->fetch_user_videos($_video['author']); |
|
| 90 | - $_video['subscribed'] = $__user_h->if_subscribed(@$_SESSION['siteusername'], $_video['author']); |
|
| 91 | - $_video['favorited'] = $__video_h->if_favorited(@$_SESSION['siteusername'], $_video['rid']); |
|
| 92 | - ?> |
|
| 87 | + $_video['liked'] = $__video_h->if_liked(@$_SESSION['siteusername'], $_video['rid'], true); |
|
| 88 | + $_video['disliked'] = $__video_h->if_liked(@$_SESSION['siteusername'], $_video['rid'], false); |
|
| 89 | + $_video['author_videos'] = $__video_h->fetch_user_videos($_video['author']); |
|
| 90 | + $_video['subscribed'] = $__user_h->if_subscribed(@$_SESSION['siteusername'], $_video['author']); |
|
| 91 | + $_video['favorited'] = $__video_h->if_favorited(@$_SESSION['siteusername'], $_video['rid']); |
|
| 92 | + ?> |
|
| 93 | 93 | </head> |
| 94 | 94 | <body id="" class="date-20120927 en_US ltr ytg-old-clearfix guide-feed-v2 gecko gecko-15" dir="ltr"> |
| 95 | 95 | <form name="logoutForm" method="POST" action="/logout"> |
@@ -154,21 +154,21 @@ discard block |
||
| 154 | 154 | |
| 155 | 155 | <?php $_user = $__user_h->fetch_user_username($_video['author']); ?> |
| 156 | 156 | <?php |
| 157 | - $stmt = $__db->prepare("SELECT ip, username FROM users WHERE ip = :ip"); |
|
| 158 | - $stmt->bindParam(":ip", $_user['ip']); |
|
| 159 | - $stmt->execute(); |
|
| 160 | - $alts = $stmt->rowCount(); |
|
| 157 | + $stmt = $__db->prepare("SELECT ip, username FROM users WHERE ip = :ip"); |
|
| 158 | + $stmt->bindParam(":ip", $_user['ip']); |
|
| 159 | + $stmt->execute(); |
|
| 160 | + $alts = $stmt->rowCount(); |
|
| 161 | 161 | |
| 162 | - if($alts != 0) { echo "<span style='font-size:11px;color:grey;'>Alts will pop up below here...</span><br>"; } |
|
| 162 | + if($alts != 0) { echo "<span style='font-size:11px;color:grey;'>Alts will pop up below here...</span><br>"; } |
|
| 163 | 163 | |
| 164 | - while($username = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
| 165 | - if($username['username'] != $_video['author'] && $username['ip'] != "0.0.0.0") |
|
| 166 | - echo " |
|
| 164 | + while($username = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
| 165 | + if($username['username'] != $_video['author'] && $username['ip'] != "0.0.0.0") |
|
| 166 | + echo " |
|
| 167 | 167 | <a style='font-size:10px;' href='/user/" . htmlspecialchars($username['username']) . "'>" . |
| 168 | - htmlspecialchars($username['username']) |
|
| 169 | - . "</a><br>"; |
|
| 170 | - } |
|
| 171 | - ?> |
|
| 168 | + htmlspecialchars($username['username']) |
|
| 169 | + . "</a><br>"; |
|
| 170 | + } |
|
| 171 | + ?> |
|
| 172 | 172 | <hr> |
| 173 | 173 | <?php } ?> |
| 174 | 174 | <h1 id="watch-headline-title"> |
@@ -371,21 +371,21 @@ discard block |
||
| 371 | 371 | <hr><br> |
| 372 | 372 | <h3>Add to a Playlist</h3> |
| 373 | 373 | <?php |
| 374 | - $stmt = $__db->prepare("SELECT * FROM playlists WHERE author = :username ORDER BY id DESC LIMIT 20"); |
|
| 375 | - $stmt->bindParam(":username", $_SESSION['siteusername']); |
|
| 376 | - $stmt->execute(); |
|
| 377 | - while($playlist = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
| 378 | - $buffer = json_decode($playlist['videos']); |
|
| 379 | - @$rid = $buffer[0]; |
|
| 380 | - if(!empty($rid)) { |
|
| 381 | - @$video = $__video_h->fetch_video_rid($rid); |
|
| 382 | - } else { |
|
| 383 | - $video['thumbnail'] = ""; |
|
| 384 | - $video['duration'] = 0; |
|
| 385 | - } |
|
| 374 | + $stmt = $__db->prepare("SELECT * FROM playlists WHERE author = :username ORDER BY id DESC LIMIT 20"); |
|
| 375 | + $stmt->bindParam(":username", $_SESSION['siteusername']); |
|
| 376 | + $stmt->execute(); |
|
| 377 | + while($playlist = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
| 378 | + $buffer = json_decode($playlist['videos']); |
|
| 379 | + @$rid = $buffer[0]; |
|
| 380 | + if(!empty($rid)) { |
|
| 381 | + @$video = $__video_h->fetch_video_rid($rid); |
|
| 382 | + } else { |
|
| 383 | + $video['thumbnail'] = ""; |
|
| 384 | + $video['duration'] = 0; |
|
| 385 | + } |
|
| 386 | 386 | |
| 387 | - $videos = count($buffer); |
|
| 388 | - ?> |
|
| 387 | + $videos = count($buffer); |
|
| 388 | + ?> |
|
| 389 | 389 | <a href="/get/add_to_playlist?id=<?php echo $_video['rid']; ?>&playlist=<?php echo $playlist['rid']; ?>">Add to <?php echo htmlspecialchars($playlist['title']); ?></a><br> |
| 390 | 390 | <?php } ?> |
| 391 | 391 | <?php } ?> |
@@ -650,10 +650,10 @@ discard block |
||
| 650 | 650 | </div> |
| 651 | 651 | </div> |
| 652 | 652 | <?php |
| 653 | - $stmt = $__db->prepare("SELECT * FROM video_response WHERE toid = :v ORDER BY id DESC LIMIT 4"); |
|
| 654 | - $stmt->bindParam(":v", $_GET['v']); |
|
| 655 | - $stmt->execute(); |
|
| 656 | - ?> |
|
| 653 | + $stmt = $__db->prepare("SELECT * FROM video_response WHERE toid = :v ORDER BY id DESC LIMIT 4"); |
|
| 654 | + $stmt->bindParam(":v", $_GET['v']); |
|
| 655 | + $stmt->execute(); |
|
| 656 | + ?> |
|
| 657 | 657 | |
| 658 | 658 | <?php if($stmt->rowCount() != 0) { ?> |
| 659 | 659 | <div class="comments-section"> |
@@ -663,16 +663,16 @@ discard block |
||
| 663 | 663 | <h4>Video Responses</h4> |
| 664 | 664 | <ul class="video-list"> |
| 665 | 665 | <?php |
| 666 | - while($video = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
| 667 | - if($__video_h->video_exists($video['video'])) { |
|
| 668 | - $video = $__video_h->fetch_video_rid($video['video']); |
|
| 669 | - $video['age'] = $__time_h->time_elapsed_string($video['publish']); |
|
| 670 | - $video['duration'] = $__time_h->timestamp($video['duration']); |
|
| 671 | - $video['views'] = $__video_h->fetch_video_views($video['rid']); |
|
| 672 | - $video['author'] = htmlspecialchars($video['author']); |
|
| 673 | - $video['title'] = htmlspecialchars($video['title']); |
|
| 674 | - $video['description'] = $__video_h->shorten_description($video['description'], 50); |
|
| 675 | - ?> |
|
| 666 | + while($video = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
| 667 | + if($__video_h->video_exists($video['video'])) { |
|
| 668 | + $video = $__video_h->fetch_video_rid($video['video']); |
|
| 669 | + $video['age'] = $__time_h->time_elapsed_string($video['publish']); |
|
| 670 | + $video['duration'] = $__time_h->timestamp($video['duration']); |
|
| 671 | + $video['views'] = $__video_h->fetch_video_views($video['rid']); |
|
| 672 | + $video['author'] = htmlspecialchars($video['author']); |
|
| 673 | + $video['title'] = htmlspecialchars($video['title']); |
|
| 674 | + $video['description'] = $__video_h->shorten_description($video['description'], 50); |
|
| 675 | + ?> |
|
| 676 | 676 | <li class="video-list-item yt-tile-default"> |
| 677 | 677 | <a href="/watch?v=<?php echo $video['rid']; ?>" class="related-video yt-uix-contextlink yt-uix-sessionlink" data-sessionlink="<?php echo htmlspecialchars($_video['author']); ?>&feature=watch_response"><span class="ux-thumb-wrap contains-addto "><span class="video-thumb ux-thumb yt-thumb-default-120 "><span class="yt-thumb-clip"><span class="yt-thumb-clip-inner"><img src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" alt="<?php echo $video['title']; ?>" data-thumb="/dynamic/thumbs/<?php echo $video['thumbnail']; ?>" width="120"><span class="vertical-align"></span></span></span></span><span class="video-time"><?php echo $video['duration']; ?></span> |
| 678 | 678 | <button onclick=";return false;" title="Watch Later" type="button" class="addto-button video-actions addto-watch-later-button-sign-in yt-uix-button yt-uix-button-default yt-uix-button-short yt-uix-tooltip" data-button-menu-id="shared-addto-watch-later-login" data-video-ids="cjls0QsHOBE" role="button"><span class="yt-uix-button-content"> <img src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" alt="Watch Later"> |
@@ -753,38 +753,38 @@ discard block |
||
| 753 | 753 | </div> |
| 754 | 754 | <ul class="comment-list" id="live_comments"> |
| 755 | 755 | <?php |
| 756 | - $results_per_page = 20; |
|
| 756 | + $results_per_page = 20; |
|
| 757 | 757 | |
| 758 | - $stmt = $__db->prepare("SELECT * FROM comments WHERE toid = :rid ORDER BY id DESC"); |
|
| 759 | - $stmt->bindParam(":rid", $_video['rid']); |
|
| 760 | - $stmt->execute(); |
|
| 758 | + $stmt = $__db->prepare("SELECT * FROM comments WHERE toid = :rid ORDER BY id DESC"); |
|
| 759 | + $stmt->bindParam(":rid", $_video['rid']); |
|
| 760 | + $stmt->execute(); |
|
| 761 | 761 | |
| 762 | - $number_of_result = $stmt->rowCount(); |
|
| 763 | - $number_of_page = ceil ($number_of_result / $results_per_page); |
|
| 762 | + $number_of_result = $stmt->rowCount(); |
|
| 763 | + $number_of_page = ceil ($number_of_result / $results_per_page); |
|
| 764 | 764 | |
| 765 | - if (!isset ($_GET['page']) ) { |
|
| 766 | - $page = 1; |
|
| 767 | - } else { |
|
| 768 | - $page = (int)$_GET['page']; |
|
| 769 | - } |
|
| 765 | + if (!isset ($_GET['page']) ) { |
|
| 766 | + $page = 1; |
|
| 767 | + } else { |
|
| 768 | + $page = (int)$_GET['page']; |
|
| 769 | + } |
|
| 770 | 770 | |
| 771 | - $page_first_result = ($page - 1) * $results_per_page; |
|
| 771 | + $page_first_result = ($page - 1) * $results_per_page; |
|
| 772 | 772 | |
| 773 | - $stmt = $__db->prepare("SELECT * FROM comments WHERE toid = :rid ORDER BY id DESC LIMIT :pfirst, :pper"); |
|
| 774 | - $stmt->bindParam(":rid", $_video['rid']); |
|
| 775 | - $stmt->bindParam(":pfirst", $page_first_result); |
|
| 776 | - $stmt->bindParam(":pper", $results_per_page); |
|
| 777 | - $stmt->execute(); |
|
| 773 | + $stmt = $__db->prepare("SELECT * FROM comments WHERE toid = :rid ORDER BY id DESC LIMIT :pfirst, :pper"); |
|
| 774 | + $stmt->bindParam(":rid", $_video['rid']); |
|
| 775 | + $stmt->bindParam(":pfirst", $page_first_result); |
|
| 776 | + $stmt->bindParam(":pper", $results_per_page); |
|
| 777 | + $stmt->execute(); |
|
| 778 | 778 | |
| 779 | - while($comment = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
| 780 | - if($__video_h->if_comment_liked($comment['id'], $_SESSION['siteusername'], true)) |
|
| 781 | - $comment['liked'] = true; |
|
| 782 | - else if($__video_h->if_comment_liked($comment['id'], $_SESSION['siteusername'], false)) |
|
| 783 | - $comment['disliked'] = true; |
|
| 779 | + while($comment = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
| 780 | + if($__video_h->if_comment_liked($comment['id'], $_SESSION['siteusername'], true)) |
|
| 781 | + $comment['liked'] = true; |
|
| 782 | + else if($__video_h->if_comment_liked($comment['id'], $_SESSION['siteusername'], false)) |
|
| 783 | + $comment['disliked'] = true; |
|
| 784 | 784 | |
| 785 | - $comment['likes'] = $__video_h->get_comment_likes($comment['id'], true); |
|
| 786 | - $comment['likes'] -= $__video_h->get_comment_likes($comment['id'], false); |
|
| 787 | - ?> |
|
| 785 | + $comment['likes'] = $__video_h->get_comment_likes($comment['id'], true); |
|
| 786 | + $comment['likes'] -= $__video_h->get_comment_likes($comment['id'], false); |
|
| 787 | + ?> |
|
| 788 | 788 | |
| 789 | 789 | <li class="comment yt-tile-default " data-author-viewing="" data-author-id="-uD01K8FQTeOSS5sniRFzQ" data-id="<?php echo $comment['id']; ?>" data-score="0"> |
| 790 | 790 | <div class="comment-body"> |
@@ -850,12 +850,12 @@ discard block |
||
| 850 | 850 | </div> |
| 851 | 851 | </li> |
| 852 | 852 | <?php |
| 853 | - $stmt2 = $__db->prepare("SELECT * FROM comment_reply WHERE toid = :rid ORDER BY id DESC"); |
|
| 854 | - $stmt2->bindParam(":rid", $comment['id']); |
|
| 855 | - $stmt2->execute(); |
|
| 853 | + $stmt2 = $__db->prepare("SELECT * FROM comment_reply WHERE toid = :rid ORDER BY id DESC"); |
|
| 854 | + $stmt2->bindParam(":rid", $comment['id']); |
|
| 855 | + $stmt2->execute(); |
|
| 856 | 856 | |
| 857 | - while($reply = $stmt2->fetch(PDO::FETCH_ASSOC)) { |
|
| 858 | - ?> |
|
| 857 | + while($reply = $stmt2->fetch(PDO::FETCH_ASSOC)) { |
|
| 858 | + ?> |
|
| 859 | 859 | <li class="comment yt-tile-default " style="margin-left: 30px;" data-author-viewing="" data-author-id="-uD01K8FQTeOSS5sniRFzQ" data-id="<?php echo $reply['id']; ?>" data-score="0"> |
| 860 | 860 | <div class="comment-body"> |
| 861 | 861 | <div class="content-container"> |
@@ -935,19 +935,19 @@ discard block |
||
| 935 | 935 | <div id="watch-related-container" class="watch-sidebar-body"> |
| 936 | 936 | <ul id="watch-related" class="video-list"> |
| 937 | 937 | <?php |
| 938 | - $stmt = $__db->prepare("SELECT * FROM playlists ORDER BY rand() LIMIT 2"); |
|
| 939 | - $stmt->execute(); |
|
| 940 | - while($_playlist = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
| 941 | - $_playlist['videos'] = json_decode($_playlist['videos']); |
|
| 942 | - $_playlist['count'] = 1; |
|
| 938 | + $stmt = $__db->prepare("SELECT * FROM playlists ORDER BY rand() LIMIT 2"); |
|
| 939 | + $stmt->execute(); |
|
| 940 | + while($_playlist = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
| 941 | + $_playlist['videos'] = json_decode($_playlist['videos']); |
|
| 942 | + $_playlist['count'] = 1; |
|
| 943 | 943 | |
| 944 | - if($__video_h->video_exists($_playlist['videos'][0])) { |
|
| 945 | - $video = $__video_h->fetch_video_rid($_playlist['videos'][0]); |
|
| 946 | - } else { |
|
| 947 | - $video = []; |
|
| 948 | - $video['thumbnail'] = "default.jpg"; |
|
| 949 | - } |
|
| 950 | - ?> |
|
| 944 | + if($__video_h->video_exists($_playlist['videos'][0])) { |
|
| 945 | + $video = $__video_h->fetch_video_rid($_playlist['videos'][0]); |
|
| 946 | + } else { |
|
| 947 | + $video = []; |
|
| 948 | + $video['thumbnail'] = "default.jpg"; |
|
| 949 | + } |
|
| 950 | + ?> |
|
| 951 | 951 | <li class="video-list-item"> |
| 952 | 952 | <a href="/view_playlist?v=<?php echo $_playlist['rid']; ?>" class="related-playlist yt-uix-contextlink yt-uix-sessionlink" data-sessionlink="ved=CAMQzhooAA%3D%3D&ei=CKf4md_r7rMCFYMfRAodLGlRiA%3D%3D&feature=list_other"> |
| 953 | 953 | <span class="ux-thumb-wrap"> |
@@ -994,16 +994,16 @@ discard block |
||
| 994 | 994 | <?php } ?> |
| 995 | 995 | <div id="ppv-container" class="hid"></div> |
| 996 | 996 | <?php |
| 997 | - $stmt = $__db->prepare("SELECT * FROM videos WHERE visibility = 'n' ORDER BY rand() LIMIT 20"); |
|
| 998 | - $stmt->execute(); |
|
| 999 | - while($video = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
| 1000 | - $video['age'] = $__time_h->time_elapsed_string($video['publish']); |
|
| 1001 | - $video['duration'] = $__time_h->timestamp($video['duration']); |
|
| 1002 | - $video['views'] = $__video_h->fetch_video_views($video['rid']); |
|
| 1003 | - $video['author'] = htmlspecialchars($video['author']); |
|
| 1004 | - $video['title'] = htmlspecialchars($video['title']); |
|
| 1005 | - $video['description'] = $__video_h->shorten_description($video['description'], 50); |
|
| 1006 | - ?> |
|
| 997 | + $stmt = $__db->prepare("SELECT * FROM videos WHERE visibility = 'n' ORDER BY rand() LIMIT 20"); |
|
| 998 | + $stmt->execute(); |
|
| 999 | + while($video = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
| 1000 | + $video['age'] = $__time_h->time_elapsed_string($video['publish']); |
|
| 1001 | + $video['duration'] = $__time_h->timestamp($video['duration']); |
|
| 1002 | + $video['views'] = $__video_h->fetch_video_views($video['rid']); |
|
| 1003 | + $video['author'] = htmlspecialchars($video['author']); |
|
| 1004 | + $video['title'] = htmlspecialchars($video['title']); |
|
| 1005 | + $video['description'] = $__video_h->shorten_description($video['description'], 50); |
|
| 1006 | + ?> |
|
| 1007 | 1007 | <li class="video-list-item"><a href="/watch?v=<?php echo $video['rid']; ?>" class="related-video yt-uix-contextlink yt-uix-sessionlink" data-sessionlink="ved=CAIQzRooAA%3D%3D&<?php echo htmlspecialchars($_video['author']); ?>&feature=relmfu"><span class="ux-thumb-wrap contains-addto "><span class="video-thumb ux-thumb yt-thumb-default-120 "><span class="yt-thumb-clip"><span class="yt-thumb-clip-inner"><img src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" alt="<?php echo $video['title']; ?>" onerror=";this.src='/dynamic/thumbs/default.jpg';" data-thumb="/dynamic/thumbs/<?php echo $video['thumbnail']; ?>" width="120"><span class="vertical-align"></span></span></span></span><span class="video-time"><?php echo $video['duration']; ?></span> |
| 1008 | 1008 | <button onclick=";return false;" title="Watch Later" type="button" class="addto-button video-actions addto-watch-later-button-sign-in yt-uix-button yt-uix-button-default yt-uix-button-short yt-uix-tooltip" data-button-menu-id="shared-addto-watch-later-login" data-video-ids="gyAaIKF6tSQ" role="button"><span class="yt-uix-button-content"> <img src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" alt="Watch Later"> |
| 1009 | 1009 | </span><img class="yt-uix-button-arrow" src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" alt=""></button> |
@@ -15,11 +15,13 @@ discard block |
||
| 15 | 15 | <?php $_video = $__video_h->fetch_video_rid($_GET['v']); ?> |
| 16 | 16 | <?php $_video['comments'] = $__video_h->get_comments_from_video($_video['rid']); ?> |
| 17 | 17 | <?php |
| 18 | - if($_video['visibility'] == "v" && @$_SESSION['siteusername'] != $_video['author']) |
|
| 19 | - header("Location: /"); |
|
| 18 | + if($_video['visibility'] == "v" && @$_SESSION['siteusername'] != $_video['author']) { |
|
| 19 | + header("Location: /"); |
|
| 20 | + } |
|
| 20 | 21 | |
| 21 | - if(isset($_SESSION['siteusername'])) |
|
| 22 | - $__video_h->check_view($_GET['v'], @$_SESSION['siteusername']); |
|
| 22 | + if(isset($_SESSION['siteusername'])) { |
|
| 23 | + $__video_h->check_view($_GET['v'], @$_SESSION['siteusername']); |
|
| 24 | + } |
|
| 23 | 25 | |
| 24 | 26 | $_SESSION['current_video'] = $_video['rid']; |
| 25 | 27 | |
@@ -162,11 +164,12 @@ discard block |
||
| 162 | 164 | if($alts != 0) { echo "<span style='font-size:11px;color:grey;'>Alts will pop up below here...</span><br>"; } |
| 163 | 165 | |
| 164 | 166 | while($username = $stmt->fetch(PDO::FETCH_ASSOC)) { |
| 165 | - if($username['username'] != $_video['author'] && $username['ip'] != "0.0.0.0") |
|
| 166 | - echo " |
|
| 167 | + if($username['username'] != $_video['author'] && $username['ip'] != "0.0.0.0") { |
|
| 168 | + echo " |
|
| 167 | 169 | <a style='font-size:10px;' href='/user/" . htmlspecialchars($username['username']) . "'>" . |
| 168 | 170 | htmlspecialchars($username['username']) |
| 169 | 171 | . "</a><br>"; |
| 172 | + } |
|
| 170 | 173 | } |
| 171 | 174 | ?> |
| 172 | 175 | <hr> |
@@ -777,10 +780,11 @@ discard block |
||
| 777 | 780 | $stmt->execute(); |
| 778 | 781 | |
| 779 | 782 | while($comment = $stmt->fetch(PDO::FETCH_ASSOC)) { |
| 780 | - if($__video_h->if_comment_liked($comment['id'], $_SESSION['siteusername'], true)) |
|
| 781 | - $comment['liked'] = true; |
|
| 782 | - else if($__video_h->if_comment_liked($comment['id'], $_SESSION['siteusername'], false)) |
|
| 783 | - $comment['disliked'] = true; |
|
| 783 | + if($__video_h->if_comment_liked($comment['id'], $_SESSION['siteusername'], true)) { |
|
| 784 | + $comment['liked'] = true; |
|
| 785 | + } else if($__video_h->if_comment_liked($comment['id'], $_SESSION['siteusername'], false)) { |
|
| 786 | + $comment['disliked'] = true; |
|
| 787 | + } |
|
| 784 | 788 | |
| 785 | 789 | $comment['likes'] = $__video_h->get_comment_likes($comment['id'], true); |
| 786 | 790 | $comment['likes'] -= $__video_h->get_comment_likes($comment['id'], false); |
@@ -11,14 +11,14 @@ discard block |
||
| 11 | 11 | <?php $__user_u = new user_update($__db); ?> |
| 12 | 12 | <?php $__db_h = new db_helper(); ?> |
| 13 | 13 | <?php $__time_h = new time_helper(); ?> |
| 14 | -<?php if(!$__video_h->video_exists($_GET['v'])) { header("Location: /?error=This video doesn't exist!"); } ?> |
|
| 14 | +<?php if (!$__video_h->video_exists($_GET['v'])) { header("Location: /?error=This video doesn't exist!"); } ?> |
|
| 15 | 15 | <?php $_video = $__video_h->fetch_video_rid($_GET['v']); ?> |
| 16 | 16 | <?php $_video['comments'] = $__video_h->get_comments_from_video($_video['rid']); ?> |
| 17 | 17 | <?php |
| 18 | - if($_video['visibility'] == "v" && @$_SESSION['siteusername'] != $_video['author']) |
|
| 18 | + if ($_video['visibility'] == "v" && @$_SESSION['siteusername'] != $_video['author']) |
|
| 19 | 19 | header("Location: /"); |
| 20 | 20 | |
| 21 | - if(isset($_SESSION['siteusername'])) |
|
| 21 | + if (isset($_SESSION['siteusername'])) |
|
| 22 | 22 | $__video_h->check_view($_GET['v'], @$_SESSION['siteusername']); |
| 23 | 23 | |
| 24 | 24 | $_SESSION['current_video'] = $_video['rid']; |
@@ -67,20 +67,20 @@ discard block |
||
| 67 | 67 | if (window.yt.timing) {yt.timing.tick("ct");} |
| 68 | 68 | </script> |
| 69 | 69 | <?php |
| 70 | - $_video['dislikes'] = $__video_h->get_video_stars_level($_video['rid'], 1); |
|
| 70 | + $_video['dislikes'] = $__video_h->get_video_stars_level($_video['rid'], 1); |
|
| 71 | 71 | $_video['dislikes'] += $__video_h->get_video_stars_level($_video['rid'], 2); |
| 72 | 72 | |
| 73 | - $_video['likes'] = $__video_h->get_video_stars_level($_video['rid'], 4); |
|
| 74 | - $_video['likes'] += $__video_h->get_video_stars_level($_video['rid'], 5); |
|
| 73 | + $_video['likes'] = $__video_h->get_video_stars_level($_video['rid'], 4); |
|
| 74 | + $_video['likes'] += $__video_h->get_video_stars_level($_video['rid'], 5); |
|
| 75 | 75 | |
| 76 | 76 | $_video['dislikes'] += $__video_h->get_video_likes($_video['rid'], false); |
| 77 | 77 | $_video['likes'] += $__video_h->get_video_likes($_video['rid'], true); |
| 78 | 78 | |
| 79 | - if($_video['likes'] == 0 && $_video['dislikes'] == 0) { |
|
| 79 | + if ($_video['likes'] == 0 && $_video['dislikes'] == 0) { |
|
| 80 | 80 | $_video['likeswidth'] = 0; |
| 81 | 81 | $_video['dislikeswidth'] = 0; |
| 82 | 82 | } else { |
| 83 | - $_video['likeswidth'] = $_video['likes'] / ($_video['likes'] + $_video['dislikes']) * 100; |
|
| 83 | + $_video['likeswidth'] = $_video['likes']/($_video['likes'] + $_video['dislikes'])*100; |
|
| 84 | 84 | $_video['dislikeswidth'] = 100 - $_video['likeswidth']; |
| 85 | 85 | } |
| 86 | 86 | |
@@ -114,7 +114,7 @@ discard block |
||
| 114 | 114 | </div> |
| 115 | 115 | <div id="instream_google_companion_ad_div"></div> |
| 116 | 116 | </div> |
| 117 | - <?php if(@$_SESSION['siteusername'] == $_video['author']) { ?> |
|
| 117 | + <?php if (@$_SESSION['siteusername'] == $_video['author']) { ?> |
|
| 118 | 118 | <div id="watch-owner-container"> |
| 119 | 119 | <div id="masthead-subnav" class="yt-nav yt-nav-dark "> |
| 120 | 120 | <ul class="yt-nav-aside"> |
@@ -133,7 +133,7 @@ discard block |
||
| 133 | 133 | </div> |
| 134 | 134 | </div><br> |
| 135 | 135 | <?php } ?> |
| 136 | - <?php if($__user_h->if_admin(@$_SESSION['siteusername']) && @$_SESSION['siteusername'] != $_video['author']) { ?> |
|
| 136 | + <?php if ($__user_h->if_admin(@$_SESSION['siteusername']) && @$_SESSION['siteusername'] != $_video['author']) { ?> |
|
| 137 | 137 | <div id="watch-owner-container"> |
| 138 | 138 | <div id="masthead-subnav" class="yt-nav yt-nav-dark "> |
| 139 | 139 | <ul class="yt-nav-aside"> |
@@ -162,10 +162,10 @@ discard block |
||
| 162 | 162 | $stmt->execute(); |
| 163 | 163 | $alts = $stmt->rowCount(); |
| 164 | 164 | |
| 165 | - if($alts != 0) { echo "<span style='font-size:11px;color:grey;'>Alts will pop up below here...</span><br>"; } |
|
| 165 | + if ($alts != 0) { echo "<span style='font-size:11px;color:grey;'>Alts will pop up below here...</span><br>"; } |
|
| 166 | 166 | |
| 167 | - while($username = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
| 168 | - if($username['username'] != $_video['author'] && $username['ip'] != "0.0.0.0") |
|
| 167 | + while ($username = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
| 168 | + if ($username['username'] != $_video['author'] && $username['ip'] != "0.0.0.0") |
|
| 169 | 169 | echo " |
| 170 | 170 | <a style='font-size:10px;' href='/user/" . htmlspecialchars($username['username']) . "'>" . |
| 171 | 171 | htmlspecialchars($username['username']) |
@@ -190,7 +190,7 @@ discard block |
||
| 190 | 190 | title="" |
| 191 | 191 | id="subscribe-button" |
| 192 | 192 | type="button" |
| 193 | - class="<?php if($_video['subscribed']) { echo "subscribed "; } ?>yt-subscription-button yt-uix-button yt-uix-button-subscription yt-uix-tooltip" |
|
| 193 | + class="<?php if ($_video['subscribed']) { echo "subscribed "; } ?>yt-subscription-button yt-uix-button yt-uix-button-subscription yt-uix-tooltip" |
|
| 194 | 194 | role="button"> |
| 195 | 195 | <span class="yt-uix-button-icon-wrapper"> |
| 196 | 196 | <img class="yt-uix-button-icon yt-uix-button-icon-subscribe" src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" alt=""> |
@@ -248,7 +248,7 @@ discard block |
||
| 248 | 248 | <div id="watch-main-container"> |
| 249 | 249 | <div id="watch-main"> |
| 250 | 250 | <div id="watch-panel"> |
| 251 | - <?php if($_video['featured'] == "v") { ?> |
|
| 251 | + <?php if ($_video['featured'] == "v") { ?> |
|
| 252 | 252 | <div id="masthead_child_div"><div class="yt-alert yt-alert-default yt-alert-warn"> <div class="yt-alert-icon"> |
| 253 | 253 | <img src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" class="icon master-sprite" alt="Alert icon"> |
| 254 | 254 | </div> |
@@ -259,7 +259,7 @@ discard block |
||
| 259 | 259 | </div></div></div> |
| 260 | 260 | <?php } ?> |
| 261 | 261 | |
| 262 | - <?php if($_video['visibility'] == "u") { ?> |
|
| 262 | + <?php if ($_video['visibility'] == "u") { ?> |
|
| 263 | 263 | <div id="masthead_child_div"><div class="yt-alert yt-alert-default yt-alert-warn"> <div class="yt-alert-icon"> |
| 264 | 264 | <img src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" class="icon master-sprite" alt="Alert icon"> |
| 265 | 265 | </div> |
@@ -268,7 +268,7 @@ discard block |
||
| 268 | 268 | This video is unlisted. Only people who have the link can view this video. |
| 269 | 269 | </div> |
| 270 | 270 | </div></div></div> |
| 271 | - <?php } else if($_video['visibility'] == "v") { ?> |
|
| 271 | + <?php } else if ($_video['visibility'] == "v") { ?> |
|
| 272 | 272 | <div id="masthead_child_div"><div class="yt-alert yt-alert-default yt-alert-error"> <div class="yt-alert-icon"> |
| 273 | 273 | <img src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" class="icon master-sprite" alt="Alert icon"> |
| 274 | 274 | </div> |
@@ -302,7 +302,7 @@ discard block |
||
| 302 | 302 | <button onclick=";window.location.href=this.getAttribute('href');return false;" href="/get/like_video?v=<?php echo $_video['rid']; ?>" |
| 303 | 303 | title="I like this" |
| 304 | 304 | type="button" |
| 305 | - class="start <?php if($_video['liked']) { echo "liked "; } ?>yt-uix-tooltip-reverse yt-uix-button yt-uix-button-default yt-uix-tooltip" |
|
| 305 | + class="start <?php if ($_video['liked']) { echo "liked "; } ?>yt-uix-tooltip-reverse yt-uix-button yt-uix-button-default yt-uix-tooltip" |
|
| 306 | 306 | id="watch-like" |
| 307 | 307 | href="/get/like_video?v=<?php echo $_video['rid']; ?>" |
| 308 | 308 | role="button"><span class="yt-uix-button-icon-wrapper"> |
@@ -316,7 +316,7 @@ discard block |
||
| 316 | 316 | type="button" |
| 317 | 317 | style="margin-left: -2px;" |
| 318 | 318 | href="/get/dislike_video?v=<?php echo $_video['rid']; ?>" |
| 319 | - class="end yt-uix-tooltip-reverse <?php if($_video['disliked']) { echo "unliked "; } ?> yt-uix-button yt-uix-button-default yt-uix-tooltip yt-uix-button-empty" |
|
| 319 | + class="end yt-uix-tooltip-reverse <?php if ($_video['disliked']) { echo "unliked "; } ?> yt-uix-button yt-uix-button-default yt-uix-tooltip yt-uix-button-empty" |
|
| 320 | 320 | id="watch-unlike" |
| 321 | 321 | role="button"> |
| 322 | 322 | <span class="yt-uix-button-icon-wrapper"> |
@@ -336,7 +336,7 @@ discard block |
||
| 336 | 336 | </div> |
| 337 | 337 | </div> |
| 338 | 338 | <div id="watch-actions-logged-out" class="watch-actions-panel hid"> |
| 339 | - <?php if(!isset($_SESSION['siteusername'])) { ?> |
|
| 339 | + <?php if (!isset($_SESSION['siteusername'])) { ?> |
|
| 340 | 340 | <div class="yt-alert yt-alert-naked yt-alert-warn "> |
| 341 | 341 | <div class="yt-alert-icon"> |
| 342 | 342 | <img src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" class="icon master-sprite" alt="Alert icon"> |
@@ -352,7 +352,7 @@ discard block |
||
| 352 | 352 | <?php } else { ?> |
| 353 | 353 | <h3>Be friends with the creator</h3> |
| 354 | 354 | |
| 355 | - <?php if($_SESSION['siteusername'] != $_video['author']) { ?> |
|
| 355 | + <?php if ($_SESSION['siteusername'] != $_video['author']) { ?> |
|
| 356 | 356 | <img style="width: 50px;height:50px;" src="/dynamic/pfp/<?php echo $__user_h->fetch_pfp($_video['author']); ?>"> |
| 357 | 357 | <span style="display: inline-block; vertical-align:top;width: 100px;font-size:11px;"> |
| 358 | 358 | <b><a href="/user/<?php echo htmlspecialchars($_video['author']); ?>"><?php echo htmlspecialchars($_video['author']); ?></a></b><br> |
@@ -366,8 +366,8 @@ discard block |
||
| 366 | 366 | </span><br><br> |
| 367 | 367 | <?php } ?> |
| 368 | 368 | |
| 369 | - <?php if($_SESSION['siteusername'] != $_video['author']) { ?> |
|
| 370 | - <?php if($_video['friended'] == false) { ?> |
|
| 369 | + <?php if ($_SESSION['siteusername'] != $_video['author']) { ?> |
|
| 370 | + <?php if ($_video['friended'] == false) { ?> |
|
| 371 | 371 | <a href="/friends">Send a friend request</a> |
| 372 | 372 | <?php } else { ?> |
| 373 | 373 | Your friend request is pending. |
@@ -377,7 +377,7 @@ discard block |
||
| 377 | 377 | <?php } ?> |
| 378 | 378 | <hr><br> |
| 379 | 379 | <h3>Add to Favorites</h3> |
| 380 | - <?php if($_video['favorited'] == false) { ?> |
|
| 380 | + <?php if ($_video['favorited'] == false) { ?> |
|
| 381 | 381 | <a href="/get/favorite?v=<?php echo $_video['rid']; ?>">Favorite Video</a> |
| 382 | 382 | <?php } else { ?> |
| 383 | 383 | <a href="/get/unfavorite?v=<?php echo $_video['rid']; ?>">Unfavorite Video</a> |
@@ -388,10 +388,10 @@ discard block |
||
| 388 | 388 | $stmt = $__db->prepare("SELECT * FROM playlists WHERE author = :username ORDER BY id DESC LIMIT 20"); |
| 389 | 389 | $stmt->bindParam(":username", $_SESSION['siteusername']); |
| 390 | 390 | $stmt->execute(); |
| 391 | - while($playlist = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
| 391 | + while ($playlist = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
| 392 | 392 | $buffer = json_decode($playlist['videos']); |
| 393 | 393 | @$rid = $buffer[0]; |
| 394 | - if(!empty($rid)) { |
|
| 394 | + if (!empty($rid)) { |
|
| 395 | 395 | @$video = $__video_h->fetch_video_rid($rid); |
| 396 | 396 | } else { |
| 397 | 397 | $video['thumbnail'] = ""; |
@@ -669,7 +669,7 @@ discard block |
||
| 669 | 669 | $stmt->execute(); |
| 670 | 670 | ?> |
| 671 | 671 | |
| 672 | - <?php if($stmt->rowCount() != 0) { ?> |
|
| 672 | + <?php if ($stmt->rowCount() != 0) { ?> |
|
| 673 | 673 | <div class="comments-section"> |
| 674 | 674 | <a class="comments-section-see-all" href="/video_response_view_all?v=<?php echo htmlspecialchars($_video['rid']); ?>"> |
| 675 | 675 | see all |
@@ -677,8 +677,8 @@ discard block |
||
| 677 | 677 | <h4>Video Responses</h4> |
| 678 | 678 | <ul class="video-list"> |
| 679 | 679 | <?php |
| 680 | - while($video = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
| 681 | - if($__video_h->video_exists($video['video'])) { |
|
| 680 | + while ($video = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
| 681 | + if ($__video_h->video_exists($video['video'])) { |
|
| 682 | 682 | $video = $__video_h->fetch_video_rid($video['video']); |
| 683 | 683 | $video['age'] = $__time_h->time_elapsed_string($video['publish']); |
| 684 | 684 | $video['duration'] = $__time_h->timestamp($video['duration']); |
@@ -709,18 +709,18 @@ discard block |
||
| 709 | 709 | </h4> |
| 710 | 710 | </div> |
| 711 | 711 | </div> |
| 712 | - <?php if(!isset($_SESSION['siteusername'])) { ?> |
|
| 712 | + <?php if (!isset($_SESSION['siteusername'])) { ?> |
|
| 713 | 713 | <div class="comments-post-container clearfix"> |
| 714 | 714 | <div class="comments-post-alert"> |
| 715 | 715 | <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> |
| 716 | 716 | </div> |
| 717 | 717 | </div> |
| 718 | - <?php } else if($_video['commenting'] == "d") { ?> |
|
| 718 | + <?php } else if ($_video['commenting'] == "d") { ?> |
|
| 719 | 719 | <div class="comments-disabled-message"> |
| 720 | 720 | <img src="http://s.ytimg.com/yt/img/icon_comments_disabled-vflxokpZC.png"> |
| 721 | 721 | <span>Adding comments has been disabled for this video.</span> |
| 722 | 722 | </div> |
| 723 | - <?php } else if($__user_h->if_blocked($_video['author'], $_SESSION['siteusername'])) { ?> |
|
| 723 | + <?php } else if ($__user_h->if_blocked($_video['author'], $_SESSION['siteusername'])) { ?> |
|
| 724 | 724 | <div class="comments-post-container clearfix"> |
| 725 | 725 | <div class="comments-post-alert"> |
| 726 | 726 | This user has blocked you! |
@@ -774,15 +774,15 @@ discard block |
||
| 774 | 774 | $stmt->execute(); |
| 775 | 775 | |
| 776 | 776 | $number_of_result = $stmt->rowCount(); |
| 777 | - $number_of_page = ceil ($number_of_result / $results_per_page); |
|
| 777 | + $number_of_page = ceil($number_of_result/$results_per_page); |
|
| 778 | 778 | |
| 779 | - if (!isset ($_GET['page']) ) { |
|
| 779 | + if (!isset ($_GET['page'])) { |
|
| 780 | 780 | $page = 1; |
| 781 | 781 | } else { |
| 782 | - $page = (int)$_GET['page']; |
|
| 782 | + $page = (int) $_GET['page']; |
|
| 783 | 783 | } |
| 784 | 784 | |
| 785 | - $page_first_result = ($page - 1) * $results_per_page; |
|
| 785 | + $page_first_result = ($page - 1)*$results_per_page; |
|
| 786 | 786 | |
| 787 | 787 | $stmt = $__db->prepare("SELECT * FROM comments WHERE toid = :rid ORDER BY id DESC LIMIT :pfirst, :pper"); |
| 788 | 788 | $stmt->bindParam(":rid", $_video['rid']); |
@@ -790,10 +790,10 @@ discard block |
||
| 790 | 790 | $stmt->bindParam(":pper", $results_per_page); |
| 791 | 791 | $stmt->execute(); |
| 792 | 792 | |
| 793 | - while($comment = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
| 794 | - if($__video_h->if_comment_liked($comment['id'], $_SESSION['siteusername'], true)) |
|
| 793 | + while ($comment = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
| 794 | + if ($__video_h->if_comment_liked($comment['id'], $_SESSION['siteusername'], true)) |
|
| 795 | 795 | $comment['liked'] = true; |
| 796 | - else if($__video_h->if_comment_liked($comment['id'], $_SESSION['siteusername'], false)) |
|
| 796 | + else if ($__video_h->if_comment_liked($comment['id'], $_SESSION['siteusername'], false)) |
|
| 797 | 797 | $comment['disliked'] = true; |
| 798 | 798 | |
| 799 | 799 | $comment['likes'] = $__video_h->get_comment_likes($comment['id'], true); |
@@ -815,7 +815,7 @@ discard block |
||
| 815 | 815 | <span dir="ltr"><?php echo $__time_h->time_elapsed_string($comment['date']); ?><span> |
| 816 | 816 | </span> |
| 817 | 817 | </span></span> |
| 818 | - <?php if($comment['likes'] != 0) { ?> |
|
| 818 | + <?php if ($comment['likes'] != 0) { ?> |
|
| 819 | 819 | <span dir="ltr" class="comments-rating-positive" title="9 up, 1 down"> |
| 820 | 820 | <?php echo $comment['likes']; ?> |
| 821 | 821 | <img class="comments-rating-thumbs-up" src="//s.ytimg.com/yts/img/pixel-vfl3z5WfW.gif"> |
@@ -843,7 +843,7 @@ discard block |
||
| 843 | 843 | </button> |
| 844 | 844 | </span> |
| 845 | 845 | </div> |
| 846 | - <?php if(isset($_SESSION['siteusername'])) { ?> |
|
| 846 | + <?php if (isset($_SESSION['siteusername'])) { ?> |
|
| 847 | 847 | <li id="reply_to_<?php echo $comment['id']; ?>" style="display: none;" class="comment yt-tile-default child" data-tag="O" data-author-viewing="" data-id="iRV7EkT9us81mDLFDSB6FAsB156Fdn13HUmTm26C3PE" data-score="34" data-author="<?php echo htmlspecialchars($row['author']); ?>"> |
| 848 | 848 | |
| 849 | 849 | <div class="comment-body"> |
@@ -868,7 +868,7 @@ discard block |
||
| 868 | 868 | $stmt2->bindParam(":rid", $comment['id']); |
| 869 | 869 | $stmt2->execute(); |
| 870 | 870 | |
| 871 | - while($reply = $stmt2->fetch(PDO::FETCH_ASSOC)) { |
|
| 871 | + while ($reply = $stmt2->fetch(PDO::FETCH_ASSOC)) { |
|
| 872 | 872 | ?> |
| 873 | 873 | <li class="comment yt-tile-default " style="margin-left: 30px;" data-author-viewing="" data-author-id="-uD01K8FQTeOSS5sniRFzQ" data-id="<?php echo $reply['id']; ?>" data-score="0"> |
| 874 | 874 | <div class="comment-body"> |
@@ -951,11 +951,11 @@ discard block |
||
| 951 | 951 | <?php |
| 952 | 952 | $stmt = $__db->prepare("SELECT * FROM playlists ORDER BY rand() LIMIT 2"); |
| 953 | 953 | $stmt->execute(); |
| 954 | - while($_playlist = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
| 954 | + while ($_playlist = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
| 955 | 955 | $_playlist['videos'] = json_decode($_playlist['videos']); |
| 956 | 956 | $_playlist['count'] = 1; |
| 957 | 957 | |
| 958 | - if($__video_h->video_exists($_playlist['videos'][0])) { |
|
| 958 | + if ($__video_h->video_exists($_playlist['videos'][0])) { |
|
| 959 | 959 | $video = $__video_h->fetch_video_rid($_playlist['videos'][0]); |
| 960 | 960 | } else { |
| 961 | 961 | $video = []; |
@@ -1010,7 +1010,7 @@ discard block |
||
| 1010 | 1010 | <?php |
| 1011 | 1011 | $stmt = $__db->prepare("SELECT * FROM videos WHERE visibility = 'n' ORDER BY rand() LIMIT 20"); |
| 1012 | 1012 | $stmt->execute(); |
| 1013 | - while($video = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
| 1013 | + while ($video = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
| 1014 | 1014 | $video['age'] = $__time_h->time_elapsed_string($video['publish']); |
| 1015 | 1015 | $video['duration'] = $__time_h->timestamp($video['duration']); |
| 1016 | 1016 | $video['views'] = $__video_h->fetch_video_views($video['rid']); |
@@ -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> |