@@ -39,7 +39,7 @@ discard block |
||
| 39 | 39 | // $_FILES['video_file']['tmp_name'] = substr_replace($_FILES['video_file']['tmp_name'], '/', 8, 0); |
| 40 | 40 | /* -- /tmp/phpfAN4Xu -- Why in the fuck does this happen? I love PHP */ |
| 41 | 41 | |
| 42 | - if(move_uploaded_file( |
|
| 42 | + if (move_uploaded_file( |
|
| 43 | 43 | $_FILES['video_file']['tmp_name'], |
| 44 | 44 | "../dynamic/temp/" . $video_properties->video_rid . $video_validation->video_file_type |
| 45 | 45 | )) { |
@@ -49,7 +49,7 @@ discard block |
||
| 49 | 49 | $video_validation->upload_ok = 0; |
| 50 | 50 | } |
| 51 | 51 | |
| 52 | - if( $video_validation->video_file_type == ".png" || |
|
| 52 | + if ($video_validation->video_file_type == ".png" || |
|
| 53 | 53 | $video_validation->video_file_type == ".jpg" || |
| 54 | 54 | $video_validation->video_file_type == ".jpeg" || |
| 55 | 55 | $video_validation->video_file_type == ".gif" |
@@ -12,8 +12,8 @@ discard block |
||
| 12 | 12 | <?php $__db_h = new db_helper(); ?> |
| 13 | 13 | <?php $__time_h = new time_helper(); ?> |
| 14 | 14 | <?php |
| 15 | - if(isset($_SESSION['siteusername'])) |
|
| 16 | - $_user_hp = $__user_h->fetch_user_username($_SESSION['siteusername']); |
|
| 15 | + if(isset($_SESSION['siteusername'])) |
|
| 16 | + $_user_hp = $__user_h->fetch_user_username($_SESSION['siteusername']); |
|
| 17 | 17 | |
| 18 | 18 | if(!$__user_h->user_exists($_GET['n'])) |
| 19 | 19 | header("Location: /?userdoesntexist"); |
@@ -26,21 +26,21 @@ discard block |
||
| 26 | 26 | return preg_replace('/[^A-Za-z0-9\-]/', '', $string); // Removes special chars. |
| 27 | 27 | } |
| 28 | 28 | |
| 29 | - function addhttp($url) { |
|
| 30 | - if (!preg_match("~^(?:f|ht)tps?://~i", $url)) { |
|
| 31 | - $url = "http://" . $url; |
|
| 32 | - } |
|
| 33 | - return $url; |
|
| 34 | - } |
|
| 29 | + function addhttp($url) { |
|
| 30 | + if (!preg_match("~^(?:f|ht)tps?://~i", $url)) { |
|
| 31 | + $url = "http://" . $url; |
|
| 32 | + } |
|
| 33 | + return $url; |
|
| 34 | + } |
|
| 35 | 35 | |
| 36 | 36 | function check_valid_colorhex($colorCode) { |
| 37 | 37 | // If user accidentally passed along the # sign, strip it off |
| 38 | 38 | $colorCode = ltrim($colorCode, '#'); |
| 39 | 39 | |
| 40 | 40 | if ( |
| 41 | - ctype_xdigit($colorCode) && |
|
| 41 | + ctype_xdigit($colorCode) && |
|
| 42 | 42 | (strlen($colorCode) == 6 || strlen($colorCode) == 3)) |
| 43 | - return true; |
|
| 43 | + return true; |
|
| 44 | 44 | |
| 45 | 45 | else return false; |
| 46 | 46 | } |
@@ -65,7 +65,7 @@ discard block |
||
| 65 | 65 | $_user['2012_bgcolor'] = substr($_user['2012_bgcolor'], 0, 7); |
| 66 | 66 | |
| 67 | 67 | $_user['genre'] = strtolower($_user['genre']); |
| 68 | - $_user['subscribed'] = $__user_h->if_subscribed(@$_SESSION['siteusername'], $_user['username']); |
|
| 68 | + $_user['subscribed'] = $__user_h->if_subscribed(@$_SESSION['siteusername'], $_user['username']); |
|
| 69 | 69 | |
| 70 | 70 | if(!check_valid_colorhex($_user['primary_color']) && strlen($_user['primary_color']) != 6) { $_user['primary_color'] = ""; } |
| 71 | 71 | if(!check_valid_colorhex($_user['secondary_color']) && strlen($_user['secondary_color']) != 6) { $_user['secondary_color'] = ""; } |
@@ -74,8 +74,8 @@ discard block |
||
| 74 | 74 | if(!check_valid_colorhex($_user['primary_color_text']) && strlen($_user['primary_color_text']) != 6) { $_user['primary_color_text'] = ""; } |
| 75 | 75 | if(!check_valid_colorhex($_user['2012_bgcolor']) && strlen($_user['2012_bgcolor']) != 6) { $_user['2012_bgcolor'] = ""; } |
| 76 | 76 | |
| 77 | - if(isset($_SESSION['siteusername'])) |
|
| 78 | - $__user_i->check_view_channel($_user['username'], @$_SESSION['siteusername']); |
|
| 77 | + if(isset($_SESSION['siteusername'])) |
|
| 78 | + $__user_i->check_view_channel($_user['username'], @$_SESSION['siteusername']); |
|
| 79 | 79 | |
| 80 | 80 | if($_SERVER['REQUEST_METHOD'] == 'POST') { |
| 81 | 81 | $error = array(); |
@@ -89,11 +89,11 @@ discard block |
||
| 89 | 89 | //if(ifBlocked(@$_SESSION['siteusername'], $user['username'], $__db)) { $error = "This user has blocked you!"; $error['status'] = true; } |
| 90 | 90 | |
| 91 | 91 | if(!isset($error['message'])) { |
| 92 | - $text = $_POST['comment']; |
|
| 92 | + $text = $_POST['comment']; |
|
| 93 | 93 | $stmt = $__db->prepare("INSERT INTO profile_comments (toid, author, comment) VALUES (:id, :username, :comment)"); |
| 94 | - $stmt->bindParam(":id", $_user['username']); |
|
| 95 | - $stmt->bindParam(":username", $_SESSION['siteusername']); |
|
| 96 | - $stmt->bindParam(":comment", $text); |
|
| 94 | + $stmt->bindParam(":id", $_user['username']); |
|
| 95 | + $stmt->bindParam(":username", $_SESSION['siteusername']); |
|
| 96 | + $stmt->bindParam(":comment", $text); |
|
| 97 | 97 | $stmt->execute(); |
| 98 | 98 | |
| 99 | 99 | $_user_update_utils->update_comment_cooldown_time($_SESSION['siteusername']); |
@@ -105,10 +105,10 @@ discard block |
||
| 105 | 105 | } |
| 106 | 106 | ?> |
| 107 | 107 | <?php |
| 108 | - $__server->page_embeds->page_title = "SubRocks - " . htmlspecialchars($_user['username']); |
|
| 109 | - $__server->page_embeds->page_description = htmlspecialchars($_user['bio']); |
|
| 110 | - $__server->page_embeds->page_image = "/dynamic/pfp/" . htmlspecialchars($_user['pfp']); |
|
| 111 | - $__server->page_embeds->page_url = "https://subrock.rocks/"; |
|
| 108 | + $__server->page_embeds->page_title = "SubRocks - " . htmlspecialchars($_user['username']); |
|
| 109 | + $__server->page_embeds->page_description = htmlspecialchars($_user['bio']); |
|
| 110 | + $__server->page_embeds->page_image = "/dynamic/pfp/" . htmlspecialchars($_user['pfp']); |
|
| 111 | + $__server->page_embeds->page_url = "https://subrock.rocks/"; |
|
| 112 | 112 | ?> |
| 113 | 113 | <!DOCTYPE html> |
| 114 | 114 | <html dir="ltr" xmlns:og="http://opengraphprotocol.org/schema/" lang="en"> |
@@ -140,27 +140,27 @@ discard block |
||
| 140 | 140 | background-image: url(/dynamic/banners/<?php echo $_user['2012_bg']; ?>); |
| 141 | 141 | background-repeat: repeat; |
| 142 | 142 | <?php |
| 143 | - switch($_user['2012_bgoption']) { |
|
| 144 | - case "stretch": |
|
| 145 | - echo "background-size: cover;"; |
|
| 146 | - break; |
|
| 147 | - case "solid": |
|
| 148 | - echo ""; |
|
| 149 | - break; |
|
| 150 | - case "norepeat": |
|
| 151 | - echo "background-repeat: no-repeat !important;"; |
|
| 152 | - break; |
|
| 153 | - case "repeatxy": |
|
| 154 | - echo "background-repeat: repeat;"; |
|
| 155 | - break; |
|
| 156 | - case "repeaty": |
|
| 157 | - echo "background-repeat: repeat-y;"; |
|
| 158 | - break; |
|
| 159 | - case "repeatx": |
|
| 160 | - echo "background-repeat: repeat-x;"; |
|
| 161 | - break; |
|
| 162 | - } |
|
| 163 | - ?> |
|
| 143 | + switch($_user['2012_bgoption']) { |
|
| 144 | + case "stretch": |
|
| 145 | + echo "background-size: cover;"; |
|
| 146 | + break; |
|
| 147 | + case "solid": |
|
| 148 | + echo ""; |
|
| 149 | + break; |
|
| 150 | + case "norepeat": |
|
| 151 | + echo "background-repeat: no-repeat !important;"; |
|
| 152 | + break; |
|
| 153 | + case "repeatxy": |
|
| 154 | + echo "background-repeat: repeat;"; |
|
| 155 | + break; |
|
| 156 | + case "repeaty": |
|
| 157 | + echo "background-repeat: repeat-y;"; |
|
| 158 | + break; |
|
| 159 | + case "repeatx": |
|
| 160 | + echo "background-repeat: repeat-x;"; |
|
| 161 | + break; |
|
| 162 | + } |
|
| 163 | + ?> |
|
| 164 | 164 | } |
| 165 | 165 | </style> |
| 166 | 166 | <script> |
@@ -188,9 +188,9 @@ discard block |
||
| 188 | 188 | <div class="channel_customization"><?php require($_SERVER['DOCUMENT_ROOT'] . "/s/mod/channel_customization.php"); ?></div> |
| 189 | 189 | <?php } ?> |
| 190 | 190 | <?php |
| 191 | - if(empty(trim($_user['bio']))) |
|
| 192 | - $_user['bio'] = "This user has no description."; |
|
| 193 | - ?> |
|
| 191 | + if(empty(trim($_user['bio']))) |
|
| 192 | + $_user['bio'] = "This user has no description."; |
|
| 193 | + ?> |
|
| 194 | 194 | <div id="content"> |
| 195 | 195 | <div class="subscription-menu-expandable subscription-menu-expandable-channels3 yt-rounded ytg-wide hid"> |
| 196 | 196 | <div class="content" id="recommended-channels-list"></div> |
@@ -535,13 +535,13 @@ discard block |
||
| 535 | 535 | <div class="module-view other-channels-view"> |
| 536 | 536 | <h2 <?php if(@$_SESSION['siteusername'] == $_user['username']) { ?>style="display: inline-block;position: relative;bottom: 10px;"<?php } ?>>Featured Channels</h2> |
| 537 | 537 | <?php if(@$_SESSION['siteusername'] == $_user['username']) { |
| 538 | - echo "<a href='#' style='float:right;font-size:11px;color:black;' onclick=';open_featured_channels();return false;'>edit</a>"; |
|
| 539 | - } ?> |
|
| 538 | + echo "<a href='#' style='float:right;font-size:11px;color:black;' onclick=';open_featured_channels();return false;'>edit</a>"; |
|
| 539 | + } ?> |
|
| 540 | 540 | <ul class="channel-summary-list "> |
| 541 | 541 | <?php |
| 542 | - foreach($_user['featured_channels'] as $user) { |
|
| 543 | - if($__user_h->user_exists($user)) { |
|
| 544 | - ?> |
|
| 542 | + foreach($_user['featured_channels'] as $user) { |
|
| 543 | + if($__user_h->user_exists($user)) { |
|
| 544 | + ?> |
|
| 545 | 545 | <li class="yt-tile-visible yt-uix-tile"> |
| 546 | 546 | <div class="channel-summary clearfix channel-summary-compact"> |
| 547 | 547 | <div class="channel-summary-thumb"> |
@@ -565,19 +565,19 @@ discard block |
||
| 565 | 565 | </div> |
| 566 | 566 | |
| 567 | 567 | <?php |
| 568 | - $stmt = $__db->prepare("SELECT * FROM playlists WHERE author = :search ORDER BY id DESC LIMIT 10"); |
|
| 569 | - $stmt->bindParam(":search", $_user['username']); |
|
| 570 | - $stmt->execute(); |
|
| 568 | + $stmt = $__db->prepare("SELECT * FROM playlists WHERE author = :search ORDER BY id DESC LIMIT 10"); |
|
| 569 | + $stmt->bindParam(":search", $_user['username']); |
|
| 570 | + $stmt->execute(); |
|
| 571 | 571 | |
| 572 | - if($stmt->rowCount() != 0) { |
|
| 573 | - ?> |
|
| 572 | + if($stmt->rowCount() != 0) { |
|
| 573 | + ?> |
|
| 574 | 574 | <div class="playlists-narrow channel-module yt-uix-c3-module-container"> |
| 575 | 575 | <div class="module-view gh-featured"> |
| 576 | 576 | <h2>Featured Playlists</h2> |
| 577 | 577 | <?php |
| 578 | - while($playlist = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
| 579 | - $playlist['videos'] = json_decode($playlist['videos']); |
|
| 580 | - ?> |
|
| 578 | + while($playlist = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
| 579 | + $playlist['videos'] = json_decode($playlist['videos']); |
|
| 580 | + ?> |
|
| 581 | 581 | <div class="playlist yt-tile-visible yt-uix-tile"> |
| 582 | 582 | <a href="/view_playlist?v=<?php echo $playlist['rid']; ?>"> |
| 583 | 583 | <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"> |
@@ -12,10 +12,10 @@ discard block |
||
| 12 | 12 | <?php $__db_h = new db_helper(); ?> |
| 13 | 13 | <?php $__time_h = new time_helper(); ?> |
| 14 | 14 | <?php |
| 15 | - if(isset($_SESSION['siteusername'])) |
|
| 15 | + if (isset($_SESSION['siteusername'])) |
|
| 16 | 16 | $_user_hp = $__user_h->fetch_user_username($_SESSION['siteusername']); |
| 17 | 17 | |
| 18 | - if(!$__user_h->user_exists($_GET['n'])) |
|
| 18 | + if (!$__user_h->user_exists($_GET['n'])) |
|
| 19 | 19 | header("Location: /?userdoesntexist"); |
| 20 | 20 | |
| 21 | 21 | $_user = $__user_h->fetch_user_username($_GET['n']); |
@@ -67,28 +67,28 @@ discard block |
||
| 67 | 67 | $_user['genre'] = strtolower($_user['genre']); |
| 68 | 68 | $_user['subscribed'] = $__user_h->if_subscribed(@$_SESSION['siteusername'], $_user['username']); |
| 69 | 69 | |
| 70 | - if(!check_valid_colorhex($_user['primary_color']) && strlen($_user['primary_color']) != 6) { $_user['primary_color'] = ""; } |
|
| 71 | - if(!check_valid_colorhex($_user['secondary_color']) && strlen($_user['secondary_color']) != 6) { $_user['secondary_color'] = ""; } |
|
| 72 | - if(!check_valid_colorhex($_user['third_color']) && strlen($_user['third_color']) != 6) { $_user['third_color'] = ""; } |
|
| 73 | - if(!check_valid_colorhex($_user['text_color']) && strlen($_user['text_color']) != 6) { $_user['text_color'] = ""; } |
|
| 74 | - if(!check_valid_colorhex($_user['primary_color_text']) && strlen($_user['primary_color_text']) != 6) { $_user['primary_color_text'] = ""; } |
|
| 75 | - if(!check_valid_colorhex($_user['2012_bgcolor']) && strlen($_user['2012_bgcolor']) != 6) { $_user['2012_bgcolor'] = ""; } |
|
| 70 | + if (!check_valid_colorhex($_user['primary_color']) && strlen($_user['primary_color']) != 6) { $_user['primary_color'] = ""; } |
|
| 71 | + if (!check_valid_colorhex($_user['secondary_color']) && strlen($_user['secondary_color']) != 6) { $_user['secondary_color'] = ""; } |
|
| 72 | + if (!check_valid_colorhex($_user['third_color']) && strlen($_user['third_color']) != 6) { $_user['third_color'] = ""; } |
|
| 73 | + if (!check_valid_colorhex($_user['text_color']) && strlen($_user['text_color']) != 6) { $_user['text_color'] = ""; } |
|
| 74 | + if (!check_valid_colorhex($_user['primary_color_text']) && strlen($_user['primary_color_text']) != 6) { $_user['primary_color_text'] = ""; } |
|
| 75 | + if (!check_valid_colorhex($_user['2012_bgcolor']) && strlen($_user['2012_bgcolor']) != 6) { $_user['2012_bgcolor'] = ""; } |
|
| 76 | 76 | |
| 77 | - if(isset($_SESSION['siteusername'])) |
|
| 77 | + if (isset($_SESSION['siteusername'])) |
|
| 78 | 78 | $__user_i->check_view_channel($_user['username'], @$_SESSION['siteusername']); |
| 79 | 79 | |
| 80 | - if($_SERVER['REQUEST_METHOD'] == 'POST') { |
|
| 80 | + if ($_SERVER['REQUEST_METHOD'] == 'POST') { |
|
| 81 | 81 | $error = array(); |
| 82 | 82 | |
| 83 | - if(!isset($_SESSION['siteusername'])){ $error['message'] = "you are not logged in"; $error['status'] = true; } |
|
| 84 | - if(!$_POST['comment']){ $error['message'] = "your comment cannot be blank"; $error['status'] = true; } |
|
| 85 | - if(strlen($_POST['comment']) > 1000){ $error['message'] = "your comment must be shorter than 1000 characters"; $error['status'] = true; } |
|
| 83 | + if (!isset($_SESSION['siteusername'])) { $error['message'] = "you are not logged in"; $error['status'] = true; } |
|
| 84 | + if (!$_POST['comment']) { $error['message'] = "your comment cannot be blank"; $error['status'] = true; } |
|
| 85 | + if (strlen($_POST['comment']) > 1000) { $error['message'] = "your comment must be shorter than 1000 characters"; $error['status'] = true; } |
|
| 86 | 86 | //if(!isset($_POST['g-recaptcha-response'])){ $error['message'] = "captcha validation failed"; $error['status'] = true; } |
| 87 | 87 | //if(!$_user_insert_utils->validateCaptcha($config['recaptcha_secret'], $_POST['g-recaptcha-response'])) { $error['message'] = "captcha validation failed"; $error['status'] = true; } |
| 88 | - 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; } |
|
| 88 | + 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; } |
|
| 89 | 89 | //if(ifBlocked(@$_SESSION['siteusername'], $user['username'], $__db)) { $error = "This user has blocked you!"; $error['status'] = true; } |
| 90 | 90 | |
| 91 | - if(!isset($error['message'])) { |
|
| 91 | + if (!isset($error['message'])) { |
|
| 92 | 92 | $text = $_POST['comment']; |
| 93 | 93 | $stmt = $__db->prepare("INSERT INTO profile_comments (toid, author, comment) VALUES (:id, :username, :comment)"); |
| 94 | 94 | $stmt->bindParam(":id", $_user['username']); |
@@ -98,7 +98,7 @@ discard block |
||
| 98 | 98 | |
| 99 | 99 | $_user_update_utils->update_comment_cooldown_time($_SESSION['siteusername']); |
| 100 | 100 | |
| 101 | - if(@$_SESSION['siteusername'] != $_user['username']) { |
|
| 101 | + if (@$_SESSION['siteusername'] != $_user['username']) { |
|
| 102 | 102 | $_user_insert_utils->send_message($_user['username'], "New comment", 'I commented "' . $_POST['comment'] . '" on your profile!', $_SESSION['siteusername']); |
| 103 | 103 | } |
| 104 | 104 | } |
@@ -136,11 +136,11 @@ discard block |
||
| 136 | 136 | <link rel="stylesheet" href="/yt/cssbin/www-extra.css"> |
| 137 | 137 | <style> |
| 138 | 138 | #content-container { |
| 139 | - background-color: <?php echo $_user['primary_color']; ?>; |
|
| 139 | + background-color: <?php echo $_user['primary_color']; ?>; |
|
| 140 | 140 | background-image: url(/dynamic/banners/<?php echo $_user['2012_bg']; ?>); |
| 141 | 141 | background-repeat: repeat; |
| 142 | 142 | <?php |
| 143 | - switch($_user['2012_bgoption']) { |
|
| 143 | + switch ($_user['2012_bgoption']) { |
|
| 144 | 144 | case "stretch": |
| 145 | 145 | echo "background-size: cover;"; |
| 146 | 146 | break; |
@@ -184,11 +184,11 @@ discard block |
||
| 184 | 184 | <div id="masthead-container"><?php require($_SERVER['DOCUMENT_ROOT'] . "/s/mod/header.php"); ?></div> |
| 185 | 185 | <div id="content-container"> |
| 186 | 186 | <!-- begin content --> |
| 187 | - <?php if(isset($_SESSION['siteusername']) && $_user['username'] == $_SESSION['siteusername']) { ?> |
|
| 187 | + <?php if (isset($_SESSION['siteusername']) && $_user['username'] == $_SESSION['siteusername']) { ?> |
|
| 188 | 188 | <div class="channel_customization"><?php require($_SERVER['DOCUMENT_ROOT'] . "/s/mod/channel_customization.php"); ?></div> |
| 189 | 189 | <?php } ?> |
| 190 | 190 | <?php |
| 191 | - if(empty(trim($_user['bio']))) |
|
| 191 | + if (empty(trim($_user['bio']))) |
|
| 192 | 192 | $_user['bio'] = "This user has no description."; |
| 193 | 193 | ?> |
| 194 | 194 | <div id="content"> |
@@ -243,7 +243,7 @@ discard block |
||
| 243 | 243 | <h1><?php echo htmlspecialchars($_user['username']); ?></h1> |
| 244 | 244 | </div> |
| 245 | 245 | <div class="upper-left-section enable-fancy-subscribe-button"> |
| 246 | - <?php if($_user['username'] != @$_SESSION['siteusername']) { ?> |
|
| 246 | + <?php if ($_user['username'] != @$_SESSION['siteusername']) { ?> |
|
| 247 | 247 | <div class="yt-subscription-button-hovercard yt-uix-hovercard"> |
| 248 | 248 | <button |
| 249 | 249 | href="#" |
@@ -251,7 +251,7 @@ discard block |
||
| 251 | 251 | title="" |
| 252 | 252 | id="subscribe-button" |
| 253 | 253 | type="button" |
| 254 | - class="yt-subscription-button <?php if($_user['subscribed']) { echo "subscribed "; } ?> yt-uix-button yt-uix-button-subscription yt-uix-tooltip" |
|
| 254 | + class="yt-subscription-button <?php if ($_user['subscribed']) { echo "subscribed "; } ?> yt-uix-button yt-uix-button-subscription yt-uix-tooltip" |
|
| 255 | 255 | role="button"><span class="yt-uix-button-icon-wrapper"><img class="yt-uix-button-icon yt-uix-button-icon-subscribe" |
| 256 | 256 | src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" alt=""></span><span class="yt-uix-button-content"> <span class="subscribe-label">Subscribe</span> |
| 257 | 257 | <span class="subscribed-label">Subscribed</span> |
@@ -272,7 +272,7 @@ discard block |
||
| 272 | 272 | <div class="header-stats"> |
| 273 | 273 | <div class="stat-entry"> |
| 274 | 274 | <span class="stat-value"><?php echo $_user['subscribers']; ?></span> |
| 275 | - <span class="stat-name"><?php if($_user['subscribers'] == 1){ ?>subscriber<?php }else{ ?>subscribers<?php } ?></span> |
|
| 275 | + <span class="stat-name"><?php if ($_user['subscribers'] == 1) { ?>subscriber<?php } else { ?>subscribers<?php } ?></span> |
|
| 276 | 276 | </div> |
| 277 | 277 | <div class="stat-entry"> |
| 278 | 278 | <span class="stat-value"><?php echo $_user['views']; ?></span> |
@@ -317,12 +317,12 @@ discard block |
||
| 317 | 317 | </div> |
| 318 | 318 | </div> |
| 319 | 319 | </div> |
| 320 | - <?php if($_user['featured'] != "None") { $video = $__video_h->fetch_video_rid($_user['featured']); } else { $_user['featured'] = false; } ?> |
|
| 320 | + <?php if ($_user['featured'] != "None") { $video = $__video_h->fetch_video_rid($_user['featured']); } else { $_user['featured'] = false; } ?> |
|
| 321 | 321 | <div id="branded-page-body"> |
| 322 | 322 | <div class="channel-tab-content channel-layout-two-column selected blogger-template"> |
| 323 | 323 | <div class="tab-content-body"> |
| 324 | 324 | <div class="primary-pane"> |
| 325 | - <?php if($_user['featured'] != false && $__video_h->video_exists($_user['featured'])) { ?> |
|
| 325 | + <?php if ($_user['featured'] != false && $__video_h->video_exists($_user['featured'])) { ?> |
|
| 326 | 326 | <div class="channels-featured-video channel-module yt-uix-c3-module-container has-visible-edge"> |
| 327 | 327 | <div class="module-view featured-video-view-module"> |
| 328 | 328 | <div id="watch-video" > |
@@ -379,7 +379,7 @@ discard block |
||
| 379 | 379 | <div class="playlist-info"> |
| 380 | 380 | <h2>Uploaded videos</h2> |
| 381 | 381 | <div class="yt-horizontal-rule "><span class="first"></span><span class="second"></span><span class="third"></span></div> |
| 382 | - <?php if($_user['videos'] == 0) { ?> |
|
| 382 | + <?php if ($_user['videos'] == 0) { ?> |
|
| 383 | 383 | <h4>This user has not uploaded a video yet.</h4> |
| 384 | 384 | <?php } ?> |
| 385 | 385 | </div> |
@@ -388,7 +388,7 @@ discard block |
||
| 388 | 388 | $stmt = $__db->prepare("SELECT * FROM videos WHERE author = :username ORDER BY id DESC LIMIT 20"); |
| 389 | 389 | $stmt->bindParam(":username", $_user['username']); |
| 390 | 390 | $stmt->execute(); |
| 391 | - while($video = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
| 391 | + while ($video = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
| 392 | 392 | ?> |
| 393 | 393 | <li class="blogger-video"> |
| 394 | 394 | <div class="video yt-tile-visible"> |
@@ -470,7 +470,7 @@ discard block |
||
| 470 | 470 | </div> |
| 471 | 471 | <hr class="yt-horizontal-rule "> |
| 472 | 472 | </div> |
| 473 | - <?php if(!empty($_user['website'])) { ?> |
|
| 473 | + <?php if (!empty($_user['website'])) { ?> |
|
| 474 | 474 | <div class="user-profile-item"> |
| 475 | 475 | <div class="yt-c3-profile-custom-url field-container "> |
| 476 | 476 | <a href="<?php echo addhttp(htmlspecialchars($_user['website'])); ?>" rel="me nofollow" target="_blank" title="<?php echo htmlspecialchars($_user['website']); ?>" class="yt-uix-redirect-link"> |
@@ -519,7 +519,7 @@ discard block |
||
| 519 | 519 | <h5>Country</h5> |
| 520 | 520 | <span class="value"><?php echo htmlspecialchars($_user['country']); ?></span> |
| 521 | 521 | </div> |
| 522 | - <?php if($_user['genre'] != "none") { ?> |
|
| 522 | + <?php if ($_user['genre'] != "none") { ?> |
|
| 523 | 523 | <div class="user-profile-item "> |
| 524 | 524 | <h5>Channel Genre</h5> |
| 525 | 525 | <span class="value"><?php echo htmlspecialchars(ucfirst($_user['genre'])); ?></span> |
@@ -531,16 +531,16 @@ discard block |
||
| 531 | 531 | </div> |
| 532 | 532 | <div class="channel-module other-channels yt-uix-c3-module-container other-channels-compact"> |
| 533 | 533 | <?php $_user['featured_channels'] = explode(",", $_user['featured_channels']); ?> |
| 534 | - <?php if(count($_user['featured_channels']) != 0) { ?> |
|
| 534 | + <?php if (count($_user['featured_channels']) != 0) { ?> |
|
| 535 | 535 | <div class="module-view other-channels-view"> |
| 536 | - <h2 <?php if(@$_SESSION['siteusername'] == $_user['username']) { ?>style="display: inline-block;position: relative;bottom: 10px;"<?php } ?>>Featured Channels</h2> |
|
| 537 | - <?php if(@$_SESSION['siteusername'] == $_user['username']) { |
|
| 536 | + <h2 <?php if (@$_SESSION['siteusername'] == $_user['username']) { ?>style="display: inline-block;position: relative;bottom: 10px;"<?php } ?>>Featured Channels</h2> |
|
| 537 | + <?php if (@$_SESSION['siteusername'] == $_user['username']) { |
|
| 538 | 538 | echo "<a href='#' style='float:right;font-size:11px;color:black;' onclick=';open_featured_channels();return false;'>edit</a>"; |
| 539 | 539 | } ?> |
| 540 | 540 | <ul class="channel-summary-list "> |
| 541 | 541 | <?php |
| 542 | - foreach($_user['featured_channels'] as $user) { |
|
| 543 | - if($__user_h->user_exists($user)) { |
|
| 542 | + foreach ($_user['featured_channels'] as $user) { |
|
| 543 | + if ($__user_h->user_exists($user)) { |
|
| 544 | 544 | ?> |
| 545 | 545 | <li class="yt-tile-visible yt-uix-tile"> |
| 546 | 546 | <div class="channel-summary clearfix channel-summary-compact"> |
@@ -569,13 +569,13 @@ discard block |
||
| 569 | 569 | $stmt->bindParam(":search", $_user['username']); |
| 570 | 570 | $stmt->execute(); |
| 571 | 571 | |
| 572 | - if($stmt->rowCount() != 0) { |
|
| 572 | + if ($stmt->rowCount() != 0) { |
|
| 573 | 573 | ?> |
| 574 | 574 | <div class="playlists-narrow channel-module yt-uix-c3-module-container"> |
| 575 | 575 | <div class="module-view gh-featured"> |
| 576 | 576 | <h2>Featured Playlists</h2> |
| 577 | 577 | <?php |
| 578 | - while($playlist = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
| 578 | + while ($playlist = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
| 579 | 579 | $playlist['videos'] = json_decode($playlist['videos']); |
| 580 | 580 | ?> |
| 581 | 581 | <div class="playlist yt-tile-visible yt-uix-tile"> |
@@ -11,7 +11,7 @@ discard block |
||
| 11 | 11 | class user_helper { |
| 12 | 12 | public $__db; |
| 13 | 13 | |
| 14 | - public function __construct($conn){ |
|
| 14 | + public function __construct($conn) { |
|
| 15 | 15 | $this->__db = $conn; |
| 16 | 16 | } |
| 17 | 17 | |
@@ -19,7 +19,7 @@ discard block |
||
| 19 | 19 | $stmt = $this->__db->prepare("SELECT pfp FROM users WHERE username = :username"); |
| 20 | 20 | $stmt->bindParam(":username", $username); |
| 21 | 21 | $stmt->execute(); |
| 22 | - while($row = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
| 22 | + while ($row = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
| 23 | 23 | $pfp = $row['pfp']; |
| 24 | 24 | } // why the while statement? just remove it (i cant be bothered to) |
| 25 | 25 | |
@@ -46,7 +46,7 @@ discard block |
||
| 46 | 46 | |
| 47 | 47 | function if_admin($user) { |
| 48 | 48 | $stmt = $this->__db->prepare("SELECT status FROM users WHERE username = :user AND status = 'admin'"); |
| 49 | - $stmt->bindParam(":user", $user);; |
|
| 49 | + $stmt->bindParam(":user", $user); ; |
|
| 50 | 50 | $stmt->execute(); |
| 51 | 51 | |
| 52 | 52 | return $stmt->rowCount() === 1; |
@@ -39,8 +39,8 @@ |
||
| 39 | 39 | ?> |
| 40 | 40 | <div id="browse-side-column" class="ytg-2col ytg-last"> |
| 41 | 41 | <ol class="navigation-menu"> |
| 42 | - <?php foreach($__tabs as $_tab) { |
|
| 43 | - if($_SERVER['REQUEST_URI'] != $_tab->url) |
|
| 42 | + <?php foreach ($__tabs as $_tab) { |
|
| 43 | + if ($_SERVER['REQUEST_URI'] != $_tab->url) |
|
| 44 | 44 | $_tab->selected = true; |
| 45 | 45 | ?> |
| 46 | 46 | <li class="menu-item"> |
@@ -40,8 +40,9 @@ |
||
| 40 | 40 | <div id="browse-side-column" class="ytg-2col ytg-last"> |
| 41 | 41 | <ol class="navigation-menu"> |
| 42 | 42 | <?php foreach($__tabs as $_tab) { |
| 43 | - if($_SERVER['REQUEST_URI'] != $_tab->url) |
|
| 44 | - $_tab->selected = true; |
|
| 43 | + if($_SERVER['REQUEST_URI'] != $_tab->url) { |
|
| 44 | + $_tab->selected = true; |
|
| 45 | + } |
|
| 45 | 46 | ?> |
| 46 | 47 | <li class="menu-item"> |
| 47 | 48 | <a class="<?php echo $_tab->selected ? true : "selected"; ?>" href="<?php echo $_tab->url; ?>"> |
@@ -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"> |
@@ -333,21 +333,21 @@ discard block |
||
| 333 | 333 | <hr><br> |
| 334 | 334 | <h3>Add to a Playlist</h3> |
| 335 | 335 | <?php |
| 336 | - $stmt = $__db->prepare("SELECT * FROM playlists WHERE author = :username ORDER BY id DESC LIMIT 20"); |
|
| 337 | - $stmt->bindParam(":username", $_SESSION['siteusername']); |
|
| 338 | - $stmt->execute(); |
|
| 339 | - while($playlist = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
| 340 | - $buffer = json_decode($playlist['videos']); |
|
| 341 | - @$rid = $buffer[0]; |
|
| 342 | - if(!empty($rid)) { |
|
| 343 | - @$video = $__video_h->fetch_video_rid($rid); |
|
| 344 | - } else { |
|
| 345 | - $video['thumbnail'] = ""; |
|
| 346 | - $video['duration'] = 0; |
|
| 347 | - } |
|
| 336 | + $stmt = $__db->prepare("SELECT * FROM playlists WHERE author = :username ORDER BY id DESC LIMIT 20"); |
|
| 337 | + $stmt->bindParam(":username", $_SESSION['siteusername']); |
|
| 338 | + $stmt->execute(); |
|
| 339 | + while($playlist = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
| 340 | + $buffer = json_decode($playlist['videos']); |
|
| 341 | + @$rid = $buffer[0]; |
|
| 342 | + if(!empty($rid)) { |
|
| 343 | + @$video = $__video_h->fetch_video_rid($rid); |
|
| 344 | + } else { |
|
| 345 | + $video['thumbnail'] = ""; |
|
| 346 | + $video['duration'] = 0; |
|
| 347 | + } |
|
| 348 | 348 | |
| 349 | - $videos = count($buffer); |
|
| 350 | - ?> |
|
| 349 | + $videos = count($buffer); |
|
| 350 | + ?> |
|
| 351 | 351 | <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> |
| 352 | 352 | <?php } ?> |
| 353 | 353 | <?php } ?> |
@@ -612,10 +612,10 @@ discard block |
||
| 612 | 612 | </div> |
| 613 | 613 | </div> |
| 614 | 614 | <?php |
| 615 | - $stmt = $__db->prepare("SELECT * FROM video_response WHERE toid = :v ORDER BY id DESC LIMIT 4"); |
|
| 616 | - $stmt->bindParam(":v", $_GET['v']); |
|
| 617 | - $stmt->execute(); |
|
| 618 | - ?> |
|
| 615 | + $stmt = $__db->prepare("SELECT * FROM video_response WHERE toid = :v ORDER BY id DESC LIMIT 4"); |
|
| 616 | + $stmt->bindParam(":v", $_GET['v']); |
|
| 617 | + $stmt->execute(); |
|
| 618 | + ?> |
|
| 619 | 619 | |
| 620 | 620 | <?php if($stmt->rowCount() != 0) { ?> |
| 621 | 621 | <div class="comments-section"> |
@@ -625,16 +625,16 @@ discard block |
||
| 625 | 625 | <h4>Video Responses</h4> |
| 626 | 626 | <ul class="video-list"> |
| 627 | 627 | <?php |
| 628 | - while($video = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
| 629 | - if($__video_h->video_exists($video['video'])) { |
|
| 630 | - $video = $__video_h->fetch_video_rid($video['video']); |
|
| 631 | - $video['age'] = $__time_h->time_elapsed_string($video['publish']); |
|
| 632 | - $video['duration'] = $__time_h->timestamp($video['duration']); |
|
| 633 | - $video['views'] = $__video_h->fetch_video_views($video['rid']); |
|
| 634 | - $video['author'] = htmlspecialchars($video['author']); |
|
| 635 | - $video['title'] = htmlspecialchars($video['title']); |
|
| 636 | - $video['description'] = $__video_h->shorten_description($video['description'], 50); |
|
| 637 | - ?> |
|
| 628 | + while($video = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
| 629 | + if($__video_h->video_exists($video['video'])) { |
|
| 630 | + $video = $__video_h->fetch_video_rid($video['video']); |
|
| 631 | + $video['age'] = $__time_h->time_elapsed_string($video['publish']); |
|
| 632 | + $video['duration'] = $__time_h->timestamp($video['duration']); |
|
| 633 | + $video['views'] = $__video_h->fetch_video_views($video['rid']); |
|
| 634 | + $video['author'] = htmlspecialchars($video['author']); |
|
| 635 | + $video['title'] = htmlspecialchars($video['title']); |
|
| 636 | + $video['description'] = $__video_h->shorten_description($video['description'], 50); |
|
| 637 | + ?> |
|
| 638 | 638 | <li class="video-list-item yt-tile-default"> |
| 639 | 639 | <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> |
| 640 | 640 | <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"> |
@@ -715,38 +715,38 @@ discard block |
||
| 715 | 715 | </div> |
| 716 | 716 | <ul class="comment-list" id="live_comments"> |
| 717 | 717 | <?php |
| 718 | - $results_per_page = 20; |
|
| 718 | + $results_per_page = 20; |
|
| 719 | 719 | |
| 720 | - $stmt = $__db->prepare("SELECT * FROM comments WHERE toid = :rid ORDER BY id DESC"); |
|
| 721 | - $stmt->bindParam(":rid", $_video['rid']); |
|
| 722 | - $stmt->execute(); |
|
| 720 | + $stmt = $__db->prepare("SELECT * FROM comments WHERE toid = :rid ORDER BY id DESC"); |
|
| 721 | + $stmt->bindParam(":rid", $_video['rid']); |
|
| 722 | + $stmt->execute(); |
|
| 723 | 723 | |
| 724 | - $number_of_result = $stmt->rowCount(); |
|
| 725 | - $number_of_page = ceil ($number_of_result / $results_per_page); |
|
| 724 | + $number_of_result = $stmt->rowCount(); |
|
| 725 | + $number_of_page = ceil ($number_of_result / $results_per_page); |
|
| 726 | 726 | |
| 727 | - if (!isset ($_GET['page']) ) { |
|
| 728 | - $page = 1; |
|
| 729 | - } else { |
|
| 730 | - $page = (int)$_GET['page']; |
|
| 731 | - } |
|
| 727 | + if (!isset ($_GET['page']) ) { |
|
| 728 | + $page = 1; |
|
| 729 | + } else { |
|
| 730 | + $page = (int)$_GET['page']; |
|
| 731 | + } |
|
| 732 | 732 | |
| 733 | - $page_first_result = ($page - 1) * $results_per_page; |
|
| 733 | + $page_first_result = ($page - 1) * $results_per_page; |
|
| 734 | 734 | |
| 735 | - $stmt = $__db->prepare("SELECT * FROM comments WHERE toid = :rid ORDER BY id DESC LIMIT :pfirst, :pper"); |
|
| 736 | - $stmt->bindParam(":rid", $_video['rid']); |
|
| 737 | - $stmt->bindParam(":pfirst", $page_first_result); |
|
| 738 | - $stmt->bindParam(":pper", $results_per_page); |
|
| 739 | - $stmt->execute(); |
|
| 735 | + $stmt = $__db->prepare("SELECT * FROM comments WHERE toid = :rid ORDER BY id DESC LIMIT :pfirst, :pper"); |
|
| 736 | + $stmt->bindParam(":rid", $_video['rid']); |
|
| 737 | + $stmt->bindParam(":pfirst", $page_first_result); |
|
| 738 | + $stmt->bindParam(":pper", $results_per_page); |
|
| 739 | + $stmt->execute(); |
|
| 740 | 740 | |
| 741 | - while($comment = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
| 742 | - if($__video_h->if_comment_liked($comment['id'], $_SESSION['siteusername'], true)) |
|
| 743 | - $comment['liked'] = true; |
|
| 744 | - else if($__video_h->if_comment_liked($comment['id'], $_SESSION['siteusername'], false)) |
|
| 745 | - $comment['disliked'] = true; |
|
| 741 | + while($comment = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
| 742 | + if($__video_h->if_comment_liked($comment['id'], $_SESSION['siteusername'], true)) |
|
| 743 | + $comment['liked'] = true; |
|
| 744 | + else if($__video_h->if_comment_liked($comment['id'], $_SESSION['siteusername'], false)) |
|
| 745 | + $comment['disliked'] = true; |
|
| 746 | 746 | |
| 747 | - $comment['likes'] = $__video_h->get_comment_likes($comment['id'], true); |
|
| 748 | - $comment['likes'] -= $__video_h->get_comment_likes($comment['id'], false); |
|
| 749 | - ?> |
|
| 747 | + $comment['likes'] = $__video_h->get_comment_likes($comment['id'], true); |
|
| 748 | + $comment['likes'] -= $__video_h->get_comment_likes($comment['id'], false); |
|
| 749 | + ?> |
|
| 750 | 750 | |
| 751 | 751 | <li class="comment yt-tile-default " data-author-viewing="" data-author-id="-uD01K8FQTeOSS5sniRFzQ" data-id="<?php echo $comment['id']; ?>" data-score="0"> |
| 752 | 752 | <div class="comment-body"> |
@@ -812,12 +812,12 @@ discard block |
||
| 812 | 812 | </div> |
| 813 | 813 | </li> |
| 814 | 814 | <?php |
| 815 | - $stmt2 = $__db->prepare("SELECT * FROM comment_reply WHERE toid = :rid ORDER BY id DESC"); |
|
| 816 | - $stmt2->bindParam(":rid", $comment['id']); |
|
| 817 | - $stmt2->execute(); |
|
| 815 | + $stmt2 = $__db->prepare("SELECT * FROM comment_reply WHERE toid = :rid ORDER BY id DESC"); |
|
| 816 | + $stmt2->bindParam(":rid", $comment['id']); |
|
| 817 | + $stmt2->execute(); |
|
| 818 | 818 | |
| 819 | - while($reply = $stmt2->fetch(PDO::FETCH_ASSOC)) { |
|
| 820 | - ?> |
|
| 819 | + while($reply = $stmt2->fetch(PDO::FETCH_ASSOC)) { |
|
| 820 | + ?> |
|
| 821 | 821 | <li class="comment yt-tile-default " style="padding-left: 30px;" data-author-viewing="" data-author-id="-uD01K8FQTeOSS5sniRFzQ" data-id="<?php echo $reply['id']; ?>" data-score="0"> |
| 822 | 822 | <div class="comment-body"> |
| 823 | 823 | <div class="content-container"> |
@@ -897,19 +897,19 @@ discard block |
||
| 897 | 897 | <div id="watch-related-container" class="watch-sidebar-body"> |
| 898 | 898 | <ul id="watch-related" class="video-list"> |
| 899 | 899 | <?php |
| 900 | - $stmt = $__db->prepare("SELECT * FROM playlists ORDER BY rand() LIMIT 2"); |
|
| 901 | - $stmt->execute(); |
|
| 902 | - while($_playlist = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
| 903 | - $_playlist['videos'] = json_decode($_playlist['videos']); |
|
| 904 | - $_playlist['count'] = 1; |
|
| 900 | + $stmt = $__db->prepare("SELECT * FROM playlists ORDER BY rand() LIMIT 2"); |
|
| 901 | + $stmt->execute(); |
|
| 902 | + while($_playlist = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
| 903 | + $_playlist['videos'] = json_decode($_playlist['videos']); |
|
| 904 | + $_playlist['count'] = 1; |
|
| 905 | 905 | |
| 906 | - if($__video_h->video_exists($_playlist['videos'][0])) { |
|
| 907 | - $video = $__video_h->fetch_video_rid($_playlist['videos'][0]); |
|
| 908 | - } else { |
|
| 909 | - $video = []; |
|
| 910 | - $video['thumbnail'] = "default.jpg"; |
|
| 911 | - } |
|
| 912 | - ?> |
|
| 906 | + if($__video_h->video_exists($_playlist['videos'][0])) { |
|
| 907 | + $video = $__video_h->fetch_video_rid($_playlist['videos'][0]); |
|
| 908 | + } else { |
|
| 909 | + $video = []; |
|
| 910 | + $video['thumbnail'] = "default.jpg"; |
|
| 911 | + } |
|
| 912 | + ?> |
|
| 913 | 913 | <li class="video-list-item"> |
| 914 | 914 | <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"> |
| 915 | 915 | <span class="ux-thumb-wrap"> |
@@ -956,16 +956,16 @@ discard block |
||
| 956 | 956 | <?php } ?> |
| 957 | 957 | <div id="ppv-container" class="hid"></div> |
| 958 | 958 | <?php |
| 959 | - $stmt = $__db->prepare("SELECT * FROM videos WHERE visibility = 'n' ORDER BY rand() LIMIT 20"); |
|
| 960 | - $stmt->execute(); |
|
| 961 | - while($video = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
| 962 | - $video['age'] = $__time_h->time_elapsed_string($video['publish']); |
|
| 963 | - $video['duration'] = $__time_h->timestamp($video['duration']); |
|
| 964 | - $video['views'] = $__video_h->fetch_video_views($video['rid']); |
|
| 965 | - $video['author'] = htmlspecialchars($video['author']); |
|
| 966 | - $video['title'] = htmlspecialchars($video['title']); |
|
| 967 | - $video['description'] = $__video_h->shorten_description($video['description'], 50); |
|
| 968 | - ?> |
|
| 959 | + $stmt = $__db->prepare("SELECT * FROM videos WHERE visibility = 'n' ORDER BY rand() LIMIT 20"); |
|
| 960 | + $stmt->execute(); |
|
| 961 | + while($video = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
| 962 | + $video['age'] = $__time_h->time_elapsed_string($video['publish']); |
|
| 963 | + $video['duration'] = $__time_h->timestamp($video['duration']); |
|
| 964 | + $video['views'] = $__video_h->fetch_video_views($video['rid']); |
|
| 965 | + $video['author'] = htmlspecialchars($video['author']); |
|
| 966 | + $video['title'] = htmlspecialchars($video['title']); |
|
| 967 | + $video['description'] = $__video_h->shorten_description($video['description'], 50); |
|
| 968 | + ?> |
|
| 969 | 969 | <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> |
| 970 | 970 | <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"> |
| 971 | 971 | </span><img class="yt-uix-button-arrow" src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" alt=""></button> |
@@ -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"> |
@@ -149,7 +149,7 @@ discard block |
||
| 149 | 149 | title="" |
| 150 | 150 | id="subscribe-button" |
| 151 | 151 | type="button" |
| 152 | - class="<?php if($_video['subscribed']) { echo "subscribed "; } ?>yt-subscription-button yt-uix-button yt-uix-button-subscription yt-uix-tooltip" |
|
| 152 | + class="<?php if ($_video['subscribed']) { echo "subscribed "; } ?>yt-subscription-button yt-uix-button yt-uix-button-subscription yt-uix-tooltip" |
|
| 153 | 153 | role="button"> |
| 154 | 154 | <span class="yt-uix-button-icon-wrapper"> |
| 155 | 155 | <img class="yt-uix-button-icon yt-uix-button-icon-subscribe" src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" alt=""> |
@@ -207,7 +207,7 @@ discard block |
||
| 207 | 207 | <div id="watch-main-container"> |
| 208 | 208 | <div id="watch-main"> |
| 209 | 209 | <div id="watch-panel"> |
| 210 | - <?php if($_video['visibility'] == "u") { ?> |
|
| 210 | + <?php if ($_video['visibility'] == "u") { ?> |
|
| 211 | 211 | <div id="masthead_child_div"><div class="yt-alert yt-alert-default yt-alert-warn"> <div class="yt-alert-icon"> |
| 212 | 212 | <img src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" class="icon master-sprite" alt="Alert icon"> |
| 213 | 213 | </div> |
@@ -216,7 +216,7 @@ discard block |
||
| 216 | 216 | This video is unlisted. Only people who have the link can view this video. |
| 217 | 217 | </div> |
| 218 | 218 | </div></div></div> |
| 219 | - <?php } else if($_video['visibility'] == "v") { ?> |
|
| 219 | + <?php } else if ($_video['visibility'] == "v") { ?> |
|
| 220 | 220 | <div id="masthead_child_div"><div class="yt-alert yt-alert-default yt-alert-error"> <div class="yt-alert-icon"> |
| 221 | 221 | <img src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" class="icon master-sprite" alt="Alert icon"> |
| 222 | 222 | </div> |
@@ -250,7 +250,7 @@ discard block |
||
| 250 | 250 | <button onclick=";like_video();return false;" |
| 251 | 251 | title="I like this" |
| 252 | 252 | type="button" |
| 253 | - class="start <?php if($_video['liked']) { echo "liked "; } ?>yt-uix-tooltip-reverse yt-uix-button yt-uix-button-default yt-uix-tooltip" |
|
| 253 | + class="start <?php if ($_video['liked']) { echo "liked "; } ?>yt-uix-tooltip-reverse yt-uix-button yt-uix-button-default yt-uix-tooltip" |
|
| 254 | 254 | id="watch-like" |
| 255 | 255 | href="/get/like_video?v=<?php echo $_video['rid']; ?>" |
| 256 | 256 | role="button"><span class="yt-uix-button-icon-wrapper"> |
@@ -264,7 +264,7 @@ discard block |
||
| 264 | 264 | type="button" |
| 265 | 265 | style="margin-left: -2px;" |
| 266 | 266 | href="/get/dislike_video?v=<?php echo $_video['rid']; ?>" |
| 267 | - 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" |
|
| 267 | + 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" |
|
| 268 | 268 | id="watch-unlike" |
| 269 | 269 | role="button"> |
| 270 | 270 | <span class="yt-uix-button-icon-wrapper"> |
@@ -284,7 +284,7 @@ discard block |
||
| 284 | 284 | </div> |
| 285 | 285 | </div> |
| 286 | 286 | <div id="watch-actions-logged-out" class="watch-actions-panel hid"> |
| 287 | - <?php if(!isset($_SESSION['siteusername'])) { ?> |
|
| 287 | + <?php if (!isset($_SESSION['siteusername'])) { ?> |
|
| 288 | 288 | <div class="yt-alert yt-alert-naked yt-alert-warn "> |
| 289 | 289 | <div class="yt-alert-icon"> |
| 290 | 290 | <img src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" class="icon master-sprite" alt="Alert icon"> |
@@ -300,7 +300,7 @@ discard block |
||
| 300 | 300 | <?php } else { ?> |
| 301 | 301 | <h3>Be friends with the creator</h3> |
| 302 | 302 | |
| 303 | - <?php if($_SESSION['siteusername'] != $_video['author']) { ?> |
|
| 303 | + <?php if ($_SESSION['siteusername'] != $_video['author']) { ?> |
|
| 304 | 304 | <img style="width: 50px;height:50px;" src="/dynamic/pfp/<?php echo $__user_h->fetch_pfp($_video['author']); ?>"> |
| 305 | 305 | <span style="display: inline-block; vertical-align:top;width: 100px;font-size:11px;"> |
| 306 | 306 | <b><a href="/user/<?php echo htmlspecialchars($_video['author']); ?>"><?php echo htmlspecialchars($_video['author']); ?></a></b><br> |
@@ -314,8 +314,8 @@ discard block |
||
| 314 | 314 | </span><br><br> |
| 315 | 315 | <?php } ?> |
| 316 | 316 | |
| 317 | - <?php if($_SESSION['siteusername'] != $_video['author']) { ?> |
|
| 318 | - <?php if($_video['friended'] == false) { ?> |
|
| 317 | + <?php if ($_SESSION['siteusername'] != $_video['author']) { ?> |
|
| 318 | + <?php if ($_video['friended'] == false) { ?> |
|
| 319 | 319 | <a href="/friends">Send a friend request</a> |
| 320 | 320 | <?php } else { ?> |
| 321 | 321 | Your friend request is pending. |
@@ -325,7 +325,7 @@ discard block |
||
| 325 | 325 | <?php } ?> |
| 326 | 326 | <hr><br> |
| 327 | 327 | <h3>Add to Favorites</h3> |
| 328 | - <?php if($_video['favorited'] == false) { ?> |
|
| 328 | + <?php if ($_video['favorited'] == false) { ?> |
|
| 329 | 329 | <a href="/get/favorite?v=<?php echo $_video['rid']; ?>">Favorite Video</a> |
| 330 | 330 | <?php } else { ?> |
| 331 | 331 | <a href="/get/unfavorite?v=<?php echo $_video['rid']; ?>">Unfavorite Video</a> |
@@ -336,10 +336,10 @@ discard block |
||
| 336 | 336 | $stmt = $__db->prepare("SELECT * FROM playlists WHERE author = :username ORDER BY id DESC LIMIT 20"); |
| 337 | 337 | $stmt->bindParam(":username", $_SESSION['siteusername']); |
| 338 | 338 | $stmt->execute(); |
| 339 | - while($playlist = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
| 339 | + while ($playlist = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
| 340 | 340 | $buffer = json_decode($playlist['videos']); |
| 341 | 341 | @$rid = $buffer[0]; |
| 342 | - if(!empty($rid)) { |
|
| 342 | + if (!empty($rid)) { |
|
| 343 | 343 | @$video = $__video_h->fetch_video_rid($rid); |
| 344 | 344 | } else { |
| 345 | 345 | $video['thumbnail'] = ""; |
@@ -617,7 +617,7 @@ discard block |
||
| 617 | 617 | $stmt->execute(); |
| 618 | 618 | ?> |
| 619 | 619 | |
| 620 | - <?php if($stmt->rowCount() != 0) { ?> |
|
| 620 | + <?php if ($stmt->rowCount() != 0) { ?> |
|
| 621 | 621 | <div class="comments-section"> |
| 622 | 622 | <a class="comments-section-see-all" href="/video_response_view_all?v=<?php echo htmlspecialchars($_video['rid']); ?>"> |
| 623 | 623 | see all |
@@ -625,8 +625,8 @@ discard block |
||
| 625 | 625 | <h4>Video Responses</h4> |
| 626 | 626 | <ul class="video-list"> |
| 627 | 627 | <?php |
| 628 | - while($video = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
| 629 | - if($__video_h->video_exists($video['video'])) { |
|
| 628 | + while ($video = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
| 629 | + if ($__video_h->video_exists($video['video'])) { |
|
| 630 | 630 | $video = $__video_h->fetch_video_rid($video['video']); |
| 631 | 631 | $video['age'] = $__time_h->time_elapsed_string($video['publish']); |
| 632 | 632 | $video['duration'] = $__time_h->timestamp($video['duration']); |
@@ -657,18 +657,18 @@ discard block |
||
| 657 | 657 | </h4> |
| 658 | 658 | </div> |
| 659 | 659 | </div> |
| 660 | - <?php if(!isset($_SESSION['siteusername'])) { ?> |
|
| 660 | + <?php if (!isset($_SESSION['siteusername'])) { ?> |
|
| 661 | 661 | <div class="comments-post-container clearfix"> |
| 662 | 662 | <div class="comments-post-alert"> |
| 663 | 663 | <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> |
| 664 | 664 | </div> |
| 665 | 665 | </div> |
| 666 | - <?php } else if($_video['commenting'] == "d") { ?> |
|
| 666 | + <?php } else if ($_video['commenting'] == "d") { ?> |
|
| 667 | 667 | <div class="comments-disabled-message"> |
| 668 | 668 | <img src="http://s.ytimg.com/yt/img/icon_comments_disabled-vflxokpZC.png"> |
| 669 | 669 | <span>Adding comments has been disabled for this video.</span> |
| 670 | 670 | </div> |
| 671 | - <?php } else if($__user_h->if_blocked($_video['author'], $_SESSION['siteusername'])) { ?> |
|
| 671 | + <?php } else if ($__user_h->if_blocked($_video['author'], $_SESSION['siteusername'])) { ?> |
|
| 672 | 672 | <div class="comments-post-container clearfix"> |
| 673 | 673 | <div class="comments-post-alert"> |
| 674 | 674 | This user has blocked you! |
@@ -722,15 +722,15 @@ discard block |
||
| 722 | 722 | $stmt->execute(); |
| 723 | 723 | |
| 724 | 724 | $number_of_result = $stmt->rowCount(); |
| 725 | - $number_of_page = ceil ($number_of_result / $results_per_page); |
|
| 725 | + $number_of_page = ceil($number_of_result/$results_per_page); |
|
| 726 | 726 | |
| 727 | - if (!isset ($_GET['page']) ) { |
|
| 727 | + if (!isset ($_GET['page'])) { |
|
| 728 | 728 | $page = 1; |
| 729 | 729 | } else { |
| 730 | - $page = (int)$_GET['page']; |
|
| 730 | + $page = (int) $_GET['page']; |
|
| 731 | 731 | } |
| 732 | 732 | |
| 733 | - $page_first_result = ($page - 1) * $results_per_page; |
|
| 733 | + $page_first_result = ($page - 1)*$results_per_page; |
|
| 734 | 734 | |
| 735 | 735 | $stmt = $__db->prepare("SELECT * FROM comments WHERE toid = :rid ORDER BY id DESC LIMIT :pfirst, :pper"); |
| 736 | 736 | $stmt->bindParam(":rid", $_video['rid']); |
@@ -738,10 +738,10 @@ discard block |
||
| 738 | 738 | $stmt->bindParam(":pper", $results_per_page); |
| 739 | 739 | $stmt->execute(); |
| 740 | 740 | |
| 741 | - while($comment = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
| 742 | - if($__video_h->if_comment_liked($comment['id'], $_SESSION['siteusername'], true)) |
|
| 741 | + while ($comment = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
| 742 | + if ($__video_h->if_comment_liked($comment['id'], $_SESSION['siteusername'], true)) |
|
| 743 | 743 | $comment['liked'] = true; |
| 744 | - else if($__video_h->if_comment_liked($comment['id'], $_SESSION['siteusername'], false)) |
|
| 744 | + else if ($__video_h->if_comment_liked($comment['id'], $_SESSION['siteusername'], false)) |
|
| 745 | 745 | $comment['disliked'] = true; |
| 746 | 746 | |
| 747 | 747 | $comment['likes'] = $__video_h->get_comment_likes($comment['id'], true); |
@@ -763,7 +763,7 @@ discard block |
||
| 763 | 763 | <span dir="ltr"><?php echo $__time_h->time_elapsed_string($comment['date']); ?><span> |
| 764 | 764 | </span> |
| 765 | 765 | </span></span> |
| 766 | - <?php if($comment['likes'] != 0) { ?> |
|
| 766 | + <?php if ($comment['likes'] != 0) { ?> |
|
| 767 | 767 | <span dir="ltr" class="comments-rating-positive" title="9 up, 1 down"> |
| 768 | 768 | <?php echo $comment['likes']; ?> |
| 769 | 769 | <img class="comments-rating-thumbs-up" src="//s.ytimg.com/yts/img/pixel-vfl3z5WfW.gif"> |
@@ -791,7 +791,7 @@ discard block |
||
| 791 | 791 | </button> |
| 792 | 792 | </span> |
| 793 | 793 | </div> |
| 794 | - <?php if(isset($_SESSION['siteusername'])) { ?> |
|
| 794 | + <?php if (isset($_SESSION['siteusername'])) { ?> |
|
| 795 | 795 | <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']); ?>"> |
| 796 | 796 | |
| 797 | 797 | <div class="comment-body"> |
@@ -816,7 +816,7 @@ discard block |
||
| 816 | 816 | $stmt2->bindParam(":rid", $comment['id']); |
| 817 | 817 | $stmt2->execute(); |
| 818 | 818 | |
| 819 | - while($reply = $stmt2->fetch(PDO::FETCH_ASSOC)) { |
|
| 819 | + while ($reply = $stmt2->fetch(PDO::FETCH_ASSOC)) { |
|
| 820 | 820 | ?> |
| 821 | 821 | <li class="comment yt-tile-default " style="padding-left: 30px;" data-author-viewing="" data-author-id="-uD01K8FQTeOSS5sniRFzQ" data-id="<?php echo $reply['id']; ?>" data-score="0"> |
| 822 | 822 | <div class="comment-body"> |
@@ -899,11 +899,11 @@ discard block |
||
| 899 | 899 | <?php |
| 900 | 900 | $stmt = $__db->prepare("SELECT * FROM playlists ORDER BY rand() LIMIT 2"); |
| 901 | 901 | $stmt->execute(); |
| 902 | - while($_playlist = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
| 902 | + while ($_playlist = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
| 903 | 903 | $_playlist['videos'] = json_decode($_playlist['videos']); |
| 904 | 904 | $_playlist['count'] = 1; |
| 905 | 905 | |
| 906 | - if($__video_h->video_exists($_playlist['videos'][0])) { |
|
| 906 | + if ($__video_h->video_exists($_playlist['videos'][0])) { |
|
| 907 | 907 | $video = $__video_h->fetch_video_rid($_playlist['videos'][0]); |
| 908 | 908 | } else { |
| 909 | 909 | $video = []; |
@@ -958,7 +958,7 @@ discard block |
||
| 958 | 958 | <?php |
| 959 | 959 | $stmt = $__db->prepare("SELECT * FROM videos WHERE visibility = 'n' ORDER BY rand() LIMIT 20"); |
| 960 | 960 | $stmt->execute(); |
| 961 | - while($video = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
| 961 | + while ($video = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
| 962 | 962 | $video['age'] = $__time_h->time_elapsed_string($video['publish']); |
| 963 | 963 | $video['duration'] = $__time_h->timestamp($video['duration']); |
| 964 | 964 | $video['views'] = $__video_h->fetch_video_views($video['rid']); |
@@ -11,10 +11,10 @@ |
||
| 11 | 11 | <?php $__time_h = new time_helper(); ?> |
| 12 | 12 | <?php if(!isset($_SESSION['siteusername'])) { header("Location: /sign_in"); } ?> |
| 13 | 13 | <?php |
| 14 | - $__server->page_embeds->page_title = "SubRocks - Inbox"; |
|
| 15 | - $__server->page_embeds->page_description = "SubRocks is a site dedicated to bring back the 2012 layout of YouTube."; |
|
| 16 | - $__server->page_embeds->page_image = "/yt/imgbin/full-size-logo.png"; |
|
| 17 | - $__server->page_embeds->page_url = "https://subrock.rocks/"; |
|
| 14 | + $__server->page_embeds->page_title = "SubRocks - Inbox"; |
|
| 15 | + $__server->page_embeds->page_description = "SubRocks is a site dedicated to bring back the 2012 layout of YouTube."; |
|
| 16 | + $__server->page_embeds->page_image = "/yt/imgbin/full-size-logo.png"; |
|
| 17 | + $__server->page_embeds->page_url = "https://subrock.rocks/"; |
|
| 18 | 18 | ?> |
| 19 | 19 | <!DOCTYPE html> |
| 20 | 20 | <html dir="ltr"> |
@@ -9,7 +9,7 @@ |
||
| 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"); } ?> |
|
| 12 | +<?php if (!isset($_SESSION['siteusername'])) { header("Location: /sign_in"); } ?> |
|
| 13 | 13 | <?php |
| 14 | 14 | $__server->page_embeds->page_title = "SubRocks - Inbox"; |
| 15 | 15 | $__server->page_embeds->page_description = "SubRocks is a site dedicated to bring back the 2012 layout of YouTube."; |