@@ -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"> |
@@ -134,7 +134,7 @@ discard block |
||
| 134 | 134 | </div><br> |
| 135 | 135 | <?php } ?> |
| 136 | 136 | |
| 137 | - <?php if($__user_h->if_admin(@$_SESSION['siteusername'])) { ?> |
|
| 137 | + <?php if ($__user_h->if_admin(@$_SESSION['siteusername'])) { ?> |
|
| 138 | 138 | <div id="watch-owner-container"> |
| 139 | 139 | <div id="masthead-subnav" class="yt-nav yt-nav-dark "> |
| 140 | 140 | <ul class="yt-nav-aside"> |
@@ -169,7 +169,7 @@ discard block |
||
| 169 | 169 | title="" |
| 170 | 170 | id="subscribe-button" |
| 171 | 171 | type="button" |
| 172 | - class="<?php if($_video['subscribed']) { echo "subscribed "; } ?>yt-subscription-button yt-uix-button yt-uix-button-subscription yt-uix-tooltip" |
|
| 172 | + class="<?php if ($_video['subscribed']) { echo "subscribed "; } ?>yt-subscription-button yt-uix-button yt-uix-button-subscription yt-uix-tooltip" |
|
| 173 | 173 | role="button"> |
| 174 | 174 | <span class="yt-uix-button-icon-wrapper"> |
| 175 | 175 | <img class="yt-uix-button-icon yt-uix-button-icon-subscribe" src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" alt=""> |
@@ -227,7 +227,7 @@ discard block |
||
| 227 | 227 | <div id="watch-main-container"> |
| 228 | 228 | <div id="watch-main"> |
| 229 | 229 | <div id="watch-panel"> |
| 230 | - <?php if($_video['visibility'] == "u") { ?> |
|
| 230 | + <?php if ($_video['visibility'] == "u") { ?> |
|
| 231 | 231 | <div id="masthead_child_div"><div class="yt-alert yt-alert-default yt-alert-warn"> <div class="yt-alert-icon"> |
| 232 | 232 | <img src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" class="icon master-sprite" alt="Alert icon"> |
| 233 | 233 | </div> |
@@ -236,7 +236,7 @@ discard block |
||
| 236 | 236 | This video is unlisted. Only people who have the link can view this video. |
| 237 | 237 | </div> |
| 238 | 238 | </div></div></div> |
| 239 | - <?php } else if($_video['visibility'] == "v") { ?> |
|
| 239 | + <?php } else if ($_video['visibility'] == "v") { ?> |
|
| 240 | 240 | <div id="masthead_child_div"><div class="yt-alert yt-alert-default yt-alert-error"> <div class="yt-alert-icon"> |
| 241 | 241 | <img src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" class="icon master-sprite" alt="Alert icon"> |
| 242 | 242 | </div> |
@@ -270,7 +270,7 @@ discard block |
||
| 270 | 270 | <button onclick=";like_video();return false;" |
| 271 | 271 | title="I like this" |
| 272 | 272 | type="button" |
| 273 | - class="start <?php if($_video['liked']) { echo "liked "; } ?>yt-uix-tooltip-reverse yt-uix-button yt-uix-button-default yt-uix-tooltip" |
|
| 273 | + class="start <?php if ($_video['liked']) { echo "liked "; } ?>yt-uix-tooltip-reverse yt-uix-button yt-uix-button-default yt-uix-tooltip" |
|
| 274 | 274 | id="watch-like" |
| 275 | 275 | href="/get/like_video?v=<?php echo $_video['rid']; ?>" |
| 276 | 276 | role="button"><span class="yt-uix-button-icon-wrapper"> |
@@ -284,7 +284,7 @@ discard block |
||
| 284 | 284 | type="button" |
| 285 | 285 | style="margin-left: -2px;" |
| 286 | 286 | href="/get/dislike_video?v=<?php echo $_video['rid']; ?>" |
| 287 | - 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" |
|
| 287 | + 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" |
|
| 288 | 288 | id="watch-unlike" |
| 289 | 289 | role="button"> |
| 290 | 290 | <span class="yt-uix-button-icon-wrapper"> |
@@ -304,7 +304,7 @@ discard block |
||
| 304 | 304 | </div> |
| 305 | 305 | </div> |
| 306 | 306 | <div id="watch-actions-logged-out" class="watch-actions-panel hid"> |
| 307 | - <?php if(!isset($_SESSION['siteusername'])) { ?> |
|
| 307 | + <?php if (!isset($_SESSION['siteusername'])) { ?> |
|
| 308 | 308 | <div class="yt-alert yt-alert-naked yt-alert-warn "> |
| 309 | 309 | <div class="yt-alert-icon"> |
| 310 | 310 | <img src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" class="icon master-sprite" alt="Alert icon"> |
@@ -320,7 +320,7 @@ discard block |
||
| 320 | 320 | <?php } else { ?> |
| 321 | 321 | <h3>Be friends with the creator</h3> |
| 322 | 322 | |
| 323 | - <?php if($_SESSION['siteusername'] != $_video['author']) { ?> |
|
| 323 | + <?php if ($_SESSION['siteusername'] != $_video['author']) { ?> |
|
| 324 | 324 | <img style="width: 50px;height:50px;" src="/dynamic/pfp/<?php echo $__user_h->fetch_pfp($_video['author']); ?>"> |
| 325 | 325 | <span style="display: inline-block; vertical-align:top;width: 100px;font-size:11px;"> |
| 326 | 326 | <b><a href="/user/<?php echo htmlspecialchars($_video['author']); ?>"><?php echo htmlspecialchars($_video['author']); ?></a></b><br> |
@@ -334,8 +334,8 @@ discard block |
||
| 334 | 334 | </span><br><br> |
| 335 | 335 | <?php } ?> |
| 336 | 336 | |
| 337 | - <?php if($_SESSION['siteusername'] != $_video['author']) { ?> |
|
| 338 | - <?php if($_video['friended'] == false) { ?> |
|
| 337 | + <?php if ($_SESSION['siteusername'] != $_video['author']) { ?> |
|
| 338 | + <?php if ($_video['friended'] == false) { ?> |
|
| 339 | 339 | <a href="/friends">Send a friend request</a> |
| 340 | 340 | <?php } else { ?> |
| 341 | 341 | Your friend request is pending. |
@@ -345,7 +345,7 @@ discard block |
||
| 345 | 345 | <?php } ?> |
| 346 | 346 | <hr><br> |
| 347 | 347 | <h3>Add to Favorites</h3> |
| 348 | - <?php if($_video['favorited'] == false) { ?> |
|
| 348 | + <?php if ($_video['favorited'] == false) { ?> |
|
| 349 | 349 | <a href="/get/favorite?v=<?php echo $_video['rid']; ?>">Favorite Video</a> |
| 350 | 350 | <?php } else { ?> |
| 351 | 351 | <a href="/get/unfavorite?v=<?php echo $_video['rid']; ?>">Unfavorite Video</a> |
@@ -356,10 +356,10 @@ discard block |
||
| 356 | 356 | $stmt = $__db->prepare("SELECT * FROM playlists WHERE author = :username ORDER BY id DESC LIMIT 20"); |
| 357 | 357 | $stmt->bindParam(":username", $_SESSION['siteusername']); |
| 358 | 358 | $stmt->execute(); |
| 359 | - while($playlist = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
| 359 | + while ($playlist = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
| 360 | 360 | $buffer = json_decode($playlist['videos']); |
| 361 | 361 | @$rid = $buffer[0]; |
| 362 | - if(!empty($rid)) { |
|
| 362 | + if (!empty($rid)) { |
|
| 363 | 363 | @$video = $__video_h->fetch_video_rid($rid); |
| 364 | 364 | } else { |
| 365 | 365 | $video['thumbnail'] = ""; |
@@ -637,7 +637,7 @@ discard block |
||
| 637 | 637 | $stmt->execute(); |
| 638 | 638 | ?> |
| 639 | 639 | |
| 640 | - <?php if($stmt->rowCount() != 0) { ?> |
|
| 640 | + <?php if ($stmt->rowCount() != 0) { ?> |
|
| 641 | 641 | <div class="comments-section"> |
| 642 | 642 | <a class="comments-section-see-all" href="/video_response_view_all?v=<?php echo htmlspecialchars($_video['rid']); ?>"> |
| 643 | 643 | see all |
@@ -645,8 +645,8 @@ discard block |
||
| 645 | 645 | <h4>Video Responses</h4> |
| 646 | 646 | <ul class="video-list"> |
| 647 | 647 | <?php |
| 648 | - while($video = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
| 649 | - if($__video_h->video_exists($video['video'])) { |
|
| 648 | + while ($video = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
| 649 | + if ($__video_h->video_exists($video['video'])) { |
|
| 650 | 650 | $video = $__video_h->fetch_video_rid($video['video']); |
| 651 | 651 | $video['age'] = $__time_h->time_elapsed_string($video['publish']); |
| 652 | 652 | $video['duration'] = $__time_h->timestamp($video['duration']); |
@@ -677,18 +677,18 @@ discard block |
||
| 677 | 677 | </h4> |
| 678 | 678 | </div> |
| 679 | 679 | </div> |
| 680 | - <?php if(!isset($_SESSION['siteusername'])) { ?> |
|
| 680 | + <?php if (!isset($_SESSION['siteusername'])) { ?> |
|
| 681 | 681 | <div class="comments-post-container clearfix"> |
| 682 | 682 | <div class="comments-post-alert"> |
| 683 | 683 | <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> |
| 684 | 684 | </div> |
| 685 | 685 | </div> |
| 686 | - <?php } else if($_video['commenting'] == "d") { ?> |
|
| 686 | + <?php } else if ($_video['commenting'] == "d") { ?> |
|
| 687 | 687 | <div class="comments-disabled-message"> |
| 688 | 688 | <img src="http://s.ytimg.com/yt/img/icon_comments_disabled-vflxokpZC.png"> |
| 689 | 689 | <span>Adding comments has been disabled for this video.</span> |
| 690 | 690 | </div> |
| 691 | - <?php } else if($__user_h->if_blocked($_video['author'], $_SESSION['siteusername'])) { ?> |
|
| 691 | + <?php } else if ($__user_h->if_blocked($_video['author'], $_SESSION['siteusername'])) { ?> |
|
| 692 | 692 | <div class="comments-post-container clearfix"> |
| 693 | 693 | <div class="comments-post-alert"> |
| 694 | 694 | This user has blocked you! |
@@ -742,15 +742,15 @@ discard block |
||
| 742 | 742 | $stmt->execute(); |
| 743 | 743 | |
| 744 | 744 | $number_of_result = $stmt->rowCount(); |
| 745 | - $number_of_page = ceil ($number_of_result / $results_per_page); |
|
| 745 | + $number_of_page = ceil($number_of_result/$results_per_page); |
|
| 746 | 746 | |
| 747 | - if (!isset ($_GET['page']) ) { |
|
| 747 | + if (!isset ($_GET['page'])) { |
|
| 748 | 748 | $page = 1; |
| 749 | 749 | } else { |
| 750 | - $page = (int)$_GET['page']; |
|
| 750 | + $page = (int) $_GET['page']; |
|
| 751 | 751 | } |
| 752 | 752 | |
| 753 | - $page_first_result = ($page - 1) * $results_per_page; |
|
| 753 | + $page_first_result = ($page - 1)*$results_per_page; |
|
| 754 | 754 | |
| 755 | 755 | $stmt = $__db->prepare("SELECT * FROM comments WHERE toid = :rid ORDER BY id DESC LIMIT :pfirst, :pper"); |
| 756 | 756 | $stmt->bindParam(":rid", $_video['rid']); |
@@ -758,10 +758,10 @@ discard block |
||
| 758 | 758 | $stmt->bindParam(":pper", $results_per_page); |
| 759 | 759 | $stmt->execute(); |
| 760 | 760 | |
| 761 | - while($comment = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
| 762 | - if($__video_h->if_comment_liked($comment['id'], $_SESSION['siteusername'], true)) |
|
| 761 | + while ($comment = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
| 762 | + if ($__video_h->if_comment_liked($comment['id'], $_SESSION['siteusername'], true)) |
|
| 763 | 763 | $comment['liked'] = true; |
| 764 | - else if($__video_h->if_comment_liked($comment['id'], $_SESSION['siteusername'], false)) |
|
| 764 | + else if ($__video_h->if_comment_liked($comment['id'], $_SESSION['siteusername'], false)) |
|
| 765 | 765 | $comment['disliked'] = true; |
| 766 | 766 | |
| 767 | 767 | $comment['likes'] = $__video_h->get_comment_likes($comment['id'], true); |
@@ -783,7 +783,7 @@ discard block |
||
| 783 | 783 | <span dir="ltr"><?php echo $__time_h->time_elapsed_string($comment['date']); ?><span> |
| 784 | 784 | </span> |
| 785 | 785 | </span></span> |
| 786 | - <?php if($comment['likes'] != 0) { ?> |
|
| 786 | + <?php if ($comment['likes'] != 0) { ?> |
|
| 787 | 787 | <span dir="ltr" class="comments-rating-positive" title="9 up, 1 down"> |
| 788 | 788 | <?php echo $comment['likes']; ?> |
| 789 | 789 | <img class="comments-rating-thumbs-up" src="//s.ytimg.com/yts/img/pixel-vfl3z5WfW.gif"> |
@@ -811,7 +811,7 @@ discard block |
||
| 811 | 811 | </button> |
| 812 | 812 | </span> |
| 813 | 813 | </div> |
| 814 | - <?php if(isset($_SESSION['siteusername'])) { ?> |
|
| 814 | + <?php if (isset($_SESSION['siteusername'])) { ?> |
|
| 815 | 815 | <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']); ?>"> |
| 816 | 816 | |
| 817 | 817 | <div class="comment-body"> |
@@ -836,7 +836,7 @@ discard block |
||
| 836 | 836 | $stmt2->bindParam(":rid", $comment['id']); |
| 837 | 837 | $stmt2->execute(); |
| 838 | 838 | |
| 839 | - while($reply = $stmt2->fetch(PDO::FETCH_ASSOC)) { |
|
| 839 | + while ($reply = $stmt2->fetch(PDO::FETCH_ASSOC)) { |
|
| 840 | 840 | ?> |
| 841 | 841 | <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"> |
| 842 | 842 | <div class="comment-body"> |
@@ -919,11 +919,11 @@ discard block |
||
| 919 | 919 | <?php |
| 920 | 920 | $stmt = $__db->prepare("SELECT * FROM playlists ORDER BY rand() LIMIT 2"); |
| 921 | 921 | $stmt->execute(); |
| 922 | - while($_playlist = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
| 922 | + while ($_playlist = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
| 923 | 923 | $_playlist['videos'] = json_decode($_playlist['videos']); |
| 924 | 924 | $_playlist['count'] = 1; |
| 925 | 925 | |
| 926 | - if($__video_h->video_exists($_playlist['videos'][0])) { |
|
| 926 | + if ($__video_h->video_exists($_playlist['videos'][0])) { |
|
| 927 | 927 | $video = $__video_h->fetch_video_rid($_playlist['videos'][0]); |
| 928 | 928 | } else { |
| 929 | 929 | $video = []; |
@@ -978,7 +978,7 @@ discard block |
||
| 978 | 978 | <?php |
| 979 | 979 | $stmt = $__db->prepare("SELECT * FROM videos WHERE visibility = 'n' ORDER BY rand() LIMIT 20"); |
| 980 | 980 | $stmt->execute(); |
| 981 | - while($video = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
| 981 | + while ($video = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
| 982 | 982 | $video['age'] = $__time_h->time_elapsed_string($video['publish']); |
| 983 | 983 | $video['duration'] = $__time_h->timestamp($video['duration']); |
| 984 | 984 | $video['views'] = $__video_h->fetch_video_views($video['rid']); |
@@ -26,7 +26,7 @@ discard block |
||
| 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) $cpu[$x] = round($y/$total*100, 1); |
|
| 30 | 30 | |
| 31 | 31 | return $cpu; |
| 32 | 32 | } |
@@ -42,7 +42,7 @@ discard block |
||
| 42 | 42 | |
| 43 | 43 | foreach ($hexCode as & $color) { |
| 44 | 44 | $adjustableLimit = $adjustPercent < 0 ? $color : 255 - $color; |
| 45 | - $adjustAmount = ceil($adjustableLimit * $adjustPercent); |
|
| 45 | + $adjustAmount = ceil($adjustableLimit*$adjustPercent); |
|
| 46 | 46 | |
| 47 | 47 | $color = str_pad(dechex($color + $adjustAmount), 2, '0', STR_PAD_LEFT); |
| 48 | 48 | } |
@@ -52,7 +52,7 @@ discard block |
||
| 52 | 52 | |
| 53 | 53 | function get_server_memory_usage() { |
| 54 | 54 | $free = shell_exec('free'); |
| 55 | - $free = (string)trim($free); |
|
| 55 | + $free = (string) trim($free); |
|
| 56 | 56 | $free_arr = explode("\n", $free); |
| 57 | 57 | $mem = explode(" ", $free_arr[1]); |
| 58 | 58 | $mem = array_filter($mem); |
@@ -106,7 +106,7 @@ discard block |
||
| 106 | 106 | width:300px; |
| 107 | 107 | } |
| 108 | 108 | </style> |
| 109 | - <?php if($__user_h->if_admin(@$_SESSION['siteusername'])) { ?> |
|
| 109 | + <?php if ($__user_h->if_admin(@$_SESSION['siteusername'])) { ?> |
|
| 110 | 110 | <div class="box-gray" style="width: 95%;margin-bottom: 8px;"> |
| 111 | 111 | <h3>Statistics</h3> |
| 112 | 112 | <?php |
@@ -148,7 +148,7 @@ discard block |
||
| 148 | 148 | CPU Idle Usage: |
| 149 | 149 | <b style="float:right;color:<?php echo adjustBrightness("#FF0000", $server['idle']); ?>"> |
| 150 | 150 | <?php echo $server['idle']; ?>%</b><br> |
| 151 | - RAM Usage: <b style="float:right;"><?php echo round(get_server_memory_usage(), 3) ; ?> megabytes</b> |
|
| 151 | + RAM Usage: <b style="float:right;"><?php echo round(get_server_memory_usage(), 3); ?> megabytes</b> |
|
| 152 | 152 | </div> |
| 153 | 153 | <div style="width: 200px;display:inline-block;margin-right:20px;vertical-align: top;margin-left: 22px;"> |
| 154 | 154 | <?php $server = get_server_array_stats(); ?> |
@@ -162,7 +162,7 @@ discard block |
||
| 162 | 162 | <?php } ?> |
| 163 | 163 | <div class="guide-layout-container enable-fancy-subscribe-button"> |
| 164 | 164 | <div class="guide-container"> |
| 165 | - <?php if(!isset($_SESSION['siteusername'])) { ?> |
|
| 165 | + <?php if (!isset($_SESSION['siteusername'])) { ?> |
|
| 166 | 166 | <div id="guide-builder-promo"> |
| 167 | 167 | <h2> |
| 168 | 168 | Sign in to add channels to your homepage |
@@ -181,7 +181,7 @@ discard block |
||
| 181 | 181 | </div> |
| 182 | 182 | <div class="guide"> |
| 183 | 183 | <?php |
| 184 | - if(isset($_SESSION['siteusername'])) { |
|
| 184 | + if (isset($_SESSION['siteusername'])) { |
|
| 185 | 185 | ?> |
| 186 | 186 | <div style="/*! margin-top: 0px; *//*! margin-left: 10px; *//*! margin-bottom: 13px; */height: 99px;" class="guide-section feed-header channel first"><img alt="" src="/dynamic/pfp/<?php echo $__user_h->fetch_pfp($_SESSION['siteusername']); ?>" style="height: 88px;position: relative;top: 4px;left: 4px;" class="feed-header-thumb channel-thumb" width="88px"><div id="links" style="/*! margin-left: 5px; */position: relative;left: 13px;top: 7px;"><div style="font-size: 11px;margin-bottom: 6px;" class="metadata"> |
| 187 | 187 | <a href="/user/<?php echo htmlspecialchars($_SESSION['siteusername']); ?>" style="color: inherit;">My channel |
@@ -292,8 +292,8 @@ discard block |
||
| 292 | 292 | </span> |
| 293 | 293 | </a> |
| 294 | 294 | </li> |
| 295 | - <?php if(!isset($_SESSION['siteusername'])) { ?> |
|
| 296 | - <?php foreach($__server->featured_channels as $channel) { ?> |
|
| 295 | + <?php if (!isset($_SESSION['siteusername'])) { ?> |
|
| 296 | + <?php foreach ($__server->featured_channels as $channel) { ?> |
|
| 297 | 297 | <li class="guide-item-container "> |
| 298 | 298 | <a class="guide-item" data-external-id="<?php echo htmlspecialchars($channel); ?>" data-feed-name="<?php echo htmlspecialchars($channel); ?>" data-feed-type="user"> |
| 299 | 299 | <span class="thumb"> <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="Thumbnail" onerror="this.onerror=null;this.src='/dynamic/thumbs/default.jpg';" data-thumb="/dynamic/pfp/<?php echo $__user_h->fetch_pfp($channel); ?>" width="28"><span class="vertical-align"></span></span></span></span> |
@@ -308,7 +308,7 @@ discard block |
||
| 308 | 308 | $stmt = $__db->prepare("SELECT * FROM subscribers WHERE sender = :username ORDER BY id DESC LIMIT 20"); |
| 309 | 309 | $stmt->bindParam(":username", $_SESSION['siteusername']); |
| 310 | 310 | $stmt->execute(); |
| 311 | - while($channel = $stmt->fetch(PDO::FETCH_ASSOC)) { $channel = $channel['reciever']; ?> |
|
| 311 | + while ($channel = $stmt->fetch(PDO::FETCH_ASSOC)) { $channel = $channel['reciever']; ?> |
|
| 312 | 312 | <li class="guide-item-container "> |
| 313 | 313 | <a class="guide-item" data-external-id="<?php echo htmlspecialchars($channel); ?>" data-feed-name="<?php echo htmlspecialchars($channel); ?>" data-feed-type="user"> |
| 314 | 314 | <span class="thumb"> <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="Thumbnail" onerror="this.onerror=null;this.src='/dynamic/thumbs/default.jpg';" data-thumb="/dynamic/pfp/<?php echo $__user_h->fetch_pfp($channel); ?>" width="28"><span class="vertical-align"></span></span></span></span> |
@@ -347,7 +347,7 @@ discard block |
||
| 347 | 347 | <?php |
| 348 | 348 | $stmt = $__db->prepare("SELECT * FROM videos WHERE visibility = 'n' ORDER BY rand() LIMIT 4"); |
| 349 | 349 | $stmt->execute(); |
| 350 | - while($video = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
| 350 | + while ($video = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
| 351 | 351 | $video['age'] = $__time_h->time_elapsed_string($video['publish']); |
| 352 | 352 | $video['duration'] = $__time_h->timestamp($video['duration']); |
| 353 | 353 | $video['views'] = $__video_h->fetch_video_views($video['rid']); |
@@ -370,7 +370,7 @@ discard block |
||
| 370 | 370 | <?php |
| 371 | 371 | $stmt = $__db->prepare("SELECT * FROM videos WHERE featured = 'v' AND visibility = 'n' ORDER BY id DESC LIMIT 4"); |
| 372 | 372 | $stmt->execute(); |
| 373 | - while($video = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
| 373 | + while ($video = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
| 374 | 374 | $video['age'] = $__time_h->time_elapsed_string($video['publish']); |
| 375 | 375 | $video['duration'] = $__time_h->timestamp($video['duration']); |
| 376 | 376 | $video['views'] = $__video_h->fetch_video_views($video['rid']); |
@@ -403,7 +403,7 @@ discard block |
||
| 403 | 403 | <?php |
| 404 | 404 | $stmt = $__db->prepare("SELECT * FROM videos WHERE visibility = 'n' ORDER BY id DESC LIMIT 20"); |
| 405 | 405 | $stmt->execute(); |
| 406 | - while($video = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
| 406 | + while ($video = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
| 407 | 407 | $video['age'] = $__time_h->time_elapsed_string($video['publish']); |
| 408 | 408 | $video['duration'] = $__time_h->timestamp($video['duration']); |
| 409 | 409 | $video['views'] = $__video_h->fetch_video_views($video['rid']); |
@@ -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); |
@@ -261,7 +261,7 @@ discard block |
||
| 261 | 261 | CPU Idle Usage: |
| 262 | 262 | <b style="float:right;color:<?php echo adjustBrightness("#FF0000", $server['idle']); ?>"> |
| 263 | 263 | <?php echo $server['idle']; ?>%</b><br> |
| 264 | - RAM Usage: <b style="float:right;"><?php echo round(get_server_memory_usage(), 3) ; ?> megabytes</b> |
|
| 264 | + RAM Usage: <b style="float:right;"><?php echo round(get_server_memory_usage(), 3); ?> megabytes</b> |
|
| 265 | 265 | </div><br> |
| 266 | 266 | <button href="/admin/stats" type="button" class=" yt-uix-button yt-uix-button-default" onclick=";window.location.href=this.getAttribute('href');return false;" role="button"><span class="yt-uix-button-content">See more statistics </span></button> |
| 267 | 267 | </div> |
@@ -9,8 +9,8 @@ |
||
| 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 - Ban User"; |
| 16 | 16 | $__server->page_embeds->page_description = "SubRocks is a site dedicated to bring back the 2012 layout of YouTube."; |
@@ -14,7 +14,7 @@ discard block |
||
| 14 | 14 | <?php |
| 15 | 15 | $_playlist = $__video_h->fetch_playlist_rid($_GET['v']); |
| 16 | 16 | |
| 17 | - if(!$__user_h->user_exists($_playlist['author'])) |
|
| 17 | + if (!$__user_h->user_exists($_playlist['author'])) |
|
| 18 | 18 | header("Location: /?userdoesntexist"); |
| 19 | 19 | |
| 20 | 20 | $_user = $__user_h->fetch_user_username($_playlist['author']); |
@@ -66,28 +66,28 @@ discard block |
||
| 66 | 66 | $_user['genre'] = strtolower($_user['genre']); |
| 67 | 67 | $_user['subscribed'] = $__user_h->if_subscribed(@$_SESSION['siteusername'], $_user['username']); |
| 68 | 68 | |
| 69 | - if(!check_valid_colorhex($_user['primary_color']) && strlen($_user['primary_color']) != 6) { $_user['primary_color'] = ""; } |
|
| 70 | - if(!check_valid_colorhex($_user['secondary_color']) && strlen($_user['secondary_color']) != 6) { $_user['secondary_color'] = ""; } |
|
| 71 | - if(!check_valid_colorhex($_user['third_color']) && strlen($_user['third_color']) != 6) { $_user['third_color'] = ""; } |
|
| 72 | - if(!check_valid_colorhex($_user['text_color']) && strlen($_user['text_color']) != 6) { $_user['text_color'] = ""; } |
|
| 73 | - if(!check_valid_colorhex($_user['primary_color_text']) && strlen($_user['primary_color_text']) != 6) { $_user['primary_color_text'] = ""; } |
|
| 74 | - if(!check_valid_colorhex($_user['2009_bgcolor']) && strlen($_user['2009_bgcolor']) != 6) { $_user['2009_bgcolor'] = ""; } |
|
| 69 | + if (!check_valid_colorhex($_user['primary_color']) && strlen($_user['primary_color']) != 6) { $_user['primary_color'] = ""; } |
|
| 70 | + if (!check_valid_colorhex($_user['secondary_color']) && strlen($_user['secondary_color']) != 6) { $_user['secondary_color'] = ""; } |
|
| 71 | + if (!check_valid_colorhex($_user['third_color']) && strlen($_user['third_color']) != 6) { $_user['third_color'] = ""; } |
|
| 72 | + if (!check_valid_colorhex($_user['text_color']) && strlen($_user['text_color']) != 6) { $_user['text_color'] = ""; } |
|
| 73 | + if (!check_valid_colorhex($_user['primary_color_text']) && strlen($_user['primary_color_text']) != 6) { $_user['primary_color_text'] = ""; } |
|
| 74 | + if (!check_valid_colorhex($_user['2009_bgcolor']) && strlen($_user['2009_bgcolor']) != 6) { $_user['2009_bgcolor'] = ""; } |
|
| 75 | 75 | |
| 76 | - if(isset($_SESSION['siteusername'])) |
|
| 76 | + if (isset($_SESSION['siteusername'])) |
|
| 77 | 77 | $__user_i->check_view_channel($_user['username'], @$_SESSION['siteusername']); |
| 78 | 78 | |
| 79 | - if($_SERVER['REQUEST_METHOD'] == 'POST') { |
|
| 79 | + if ($_SERVER['REQUEST_METHOD'] == 'POST') { |
|
| 80 | 80 | $error = array(); |
| 81 | 81 | |
| 82 | - if(!isset($_SESSION['siteusername'])){ $error['message'] = "you are not logged in"; $error['status'] = true; } |
|
| 83 | - if(!$_POST['comment']){ $error['message'] = "your comment cannot be blank"; $error['status'] = true; } |
|
| 84 | - if(strlen($_POST['comment']) > 1000){ $error['message'] = "your comment must be shorter than 1000 characters"; $error['status'] = true; } |
|
| 82 | + if (!isset($_SESSION['siteusername'])) { $error['message'] = "you are not logged in"; $error['status'] = true; } |
|
| 83 | + if (!$_POST['comment']) { $error['message'] = "your comment cannot be blank"; $error['status'] = true; } |
|
| 84 | + if (strlen($_POST['comment']) > 1000) { $error['message'] = "your comment must be shorter than 1000 characters"; $error['status'] = true; } |
|
| 85 | 85 | //if(!isset($_POST['g-recaptcha-response'])){ $error['message'] = "captcha validation failed"; $error['status'] = true; } |
| 86 | 86 | //if(!$_user_insert_utils->validateCaptcha($config['recaptcha_secret'], $_POST['g-recaptcha-response'])) { $error['message'] = "captcha validation failed"; $error['status'] = true; } |
| 87 | - 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; } |
|
| 87 | + 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 | 88 | //if(ifBlocked(@$_SESSION['siteusername'], $user['username'], $__db)) { $error = "This user has blocked you!"; $error['status'] = true; } |
| 89 | 89 | |
| 90 | - if(!isset($error['message'])) { |
|
| 90 | + if (!isset($error['message'])) { |
|
| 91 | 91 | $text = $_POST['comment']; |
| 92 | 92 | $stmt = $__db->prepare("INSERT INTO profile_comments (toid, author, comment) VALUES (:id, :username, :comment)"); |
| 93 | 93 | $stmt->bindParam(":id", $_user['username']); |
@@ -97,7 +97,7 @@ discard block |
||
| 97 | 97 | |
| 98 | 98 | $_user_update_utils->update_comment_cooldown_time($_SESSION['siteusername']); |
| 99 | 99 | |
| 100 | - if(@$_SESSION['siteusername'] != $_user['username']) { |
|
| 100 | + if (@$_SESSION['siteusername'] != $_user['username']) { |
|
| 101 | 101 | $_user_insert_utils->send_message($_user['username'], "New comment", 'I commented "' . $_POST['comment'] . '" on your profile!', $_SESSION['siteusername']); |
| 102 | 102 | } |
| 103 | 103 | } |
@@ -131,11 +131,11 @@ discard block |
||
| 131 | 131 | <link rel="stylesheet" href="/yt/cssbin/www-extra.css"> |
| 132 | 132 | <style> |
| 133 | 133 | #content-container { |
| 134 | - background-color: <?php echo $_user['primary_color']; ?>; |
|
| 134 | + background-color: <?php echo $_user['primary_color']; ?>; |
|
| 135 | 135 | background-image: url(/dynamic/banners/<?php echo $_user['2012_bg']; ?>); |
| 136 | 136 | background-repeat: repeat; |
| 137 | 137 | <?php |
| 138 | - switch($_user['2012_bgoption']) { |
|
| 138 | + switch ($_user['2012_bgoption']) { |
|
| 139 | 139 | case "stretch": |
| 140 | 140 | echo "background-size: cover;"; |
| 141 | 141 | break; |
@@ -168,11 +168,11 @@ discard block |
||
| 168 | 168 | <div id="masthead-container"><?php require($_SERVER['DOCUMENT_ROOT'] . "/s/mod/header.php"); ?></div> |
| 169 | 169 | <div id="content-container"> |
| 170 | 170 | <!-- begin content --> |
| 171 | - <?php if(isset($_SESSION['siteusername']) && $_user['username'] == $_SESSION['siteusername']) { ?> |
|
| 171 | + <?php if (isset($_SESSION['siteusername']) && $_user['username'] == $_SESSION['siteusername']) { ?> |
|
| 172 | 172 | <div class="channel_customization"><?php require($_SERVER['DOCUMENT_ROOT'] . "/s/mod/channel_customization.php"); ?></div> |
| 173 | 173 | <?php } ?> |
| 174 | 174 | <?php |
| 175 | - if(empty(trim($_user['bio']))) |
|
| 175 | + if (empty(trim($_user['bio']))) |
|
| 176 | 176 | $_user['bio'] = "This user has no description."; |
| 177 | 177 | ?> |
| 178 | 178 | <div id="content"> |
@@ -232,7 +232,7 @@ discard block |
||
| 232 | 232 | </div> |
| 233 | 233 | </div> |
| 234 | 234 | <div class="upper-left-section enable-fancy-subscribe-button"> |
| 235 | - <?php if($_user['username'] != @$_SESSION['siteusername']) { ?> |
|
| 235 | + <?php if ($_user['username'] != @$_SESSION['siteusername']) { ?> |
|
| 236 | 236 | <div class="yt-subscription-button-hovercard yt-uix-hovercard"> |
| 237 | 237 | <button |
| 238 | 238 | href="#" |
@@ -240,7 +240,7 @@ discard block |
||
| 240 | 240 | title="" |
| 241 | 241 | id="subscribe-button" |
| 242 | 242 | type="button" |
| 243 | - class="yt-subscription-button <?php if($_user['subscribed']) { echo "subscribed "; } ?> yt-uix-button yt-uix-button-subscription yt-uix-tooltip" |
|
| 243 | + class="yt-subscription-button <?php if ($_user['subscribed']) { echo "subscribed "; } ?> yt-uix-button yt-uix-button-subscription yt-uix-tooltip" |
|
| 244 | 244 | role="button"><span class="yt-uix-button-icon-wrapper"><img class="yt-uix-button-icon yt-uix-button-icon-subscribe" |
| 245 | 245 | src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" alt=""></span><span class="yt-uix-button-content"> <span class="subscribe-label">Subscribe</span> |
| 246 | 246 | <span class="subscribed-label">Subscribed</span> |
@@ -274,7 +274,7 @@ discard block |
||
| 274 | 274 | </div> |
| 275 | 275 | </div> |
| 276 | 276 | </div> |
| 277 | - <?php if($_user['featured'] != "None") { $video = $__video_h->fetch_video_rid($_user['featured']); } else { $_user['featured'] = false; } ?> |
|
| 277 | + <?php if ($_user['featured'] != "None") { $video = $__video_h->fetch_video_rid($_user['featured']); } else { $_user['featured'] = false; } ?> |
|
| 278 | 278 | <div id="branded-page-body"> |
| 279 | 279 | <div class="channel-tab-content channel-layout-two-column selected blogger-template"> |
| 280 | 280 | <div class="tab-content-body"> |
@@ -308,8 +308,8 @@ discard block |
||
| 308 | 308 | <?php |
| 309 | 309 | $_playlist['videos'] = json_decode($_playlist['videos']); |
| 310 | 310 | $_playlist['count'] = 1; |
| 311 | - foreach($_playlist['videos'] as $video) { |
|
| 312 | - if($__video_h->video_exists($video)) { |
|
| 311 | + foreach ($_playlist['videos'] as $video) { |
|
| 312 | + if ($__video_h->video_exists($video)) { |
|
| 313 | 313 | $_video = $__video_h->fetch_video_rid($video); |
| 314 | 314 | $_video['video_responses'] = $__video_h->get_video_responses($_video['rid']); |
| 315 | 315 | $_video['age'] = $__time_h->time_elapsed_string($_video['publish']); |
@@ -357,7 +357,7 @@ discard block |
||
| 357 | 357 | </li> |
| 358 | 358 | <?php $_playlist['count']++; ?> |
| 359 | 359 | <?php } } ?> |
| 360 | - <?php if(count($_playlist['videos']) == 0) { ?> |
|
| 360 | + <?php if (count($_playlist['videos']) == 0) { ?> |
|
| 361 | 361 | <h4>This playlist has no videos yet.</h4> |
| 362 | 362 | <?php } ?> |
| 363 | 363 | </ol> |
@@ -411,7 +411,7 @@ discard block |
||
| 411 | 411 | </div> |
| 412 | 412 | <hr class="yt-horizontal-rule "> |
| 413 | 413 | </div> |
| 414 | - <?php if(!empty($_user['website'])) { ?> |
|
| 414 | + <?php if (!empty($_user['website'])) { ?> |
|
| 415 | 415 | <div class="user-profile-item"> |
| 416 | 416 | <div class="yt-c3-profile-custom-url field-container "> |
| 417 | 417 | <a href="<?php echo addhttp(htmlspecialchars($_user['website'])); ?>" rel="me nofollow" target="_blank" title="<?php echo htmlspecialchars($_user['website']); ?>" class="yt-uix-redirect-link"> |
@@ -460,7 +460,7 @@ discard block |
||
| 460 | 460 | <h5>Country</h5> |
| 461 | 461 | <span class="value"><?php echo htmlspecialchars($_user['country']); ?></span> |
| 462 | 462 | </div> |
| 463 | - <?php if($_user['genre'] != "none") { ?> |
|
| 463 | + <?php if ($_user['genre'] != "none") { ?> |
|
| 464 | 464 | <div class="user-profile-item "> |
| 465 | 465 | <h5>Channel Genre</h5> |
| 466 | 466 | <span class="value"><?php echo htmlspecialchars($_user['genre']); ?></span> |
@@ -472,13 +472,13 @@ discard block |
||
| 472 | 472 | </div> |
| 473 | 473 | <div class="channel-module other-channels yt-uix-c3-module-container other-channels-compact"> |
| 474 | 474 | <?php $_user['featured_channels'] = explode(",", $_user['featured_channels']); ?> |
| 475 | - <?php if(count($_user['featured_channels']) != 0) { ?> |
|
| 475 | + <?php if (count($_user['featured_channels']) != 0) { ?> |
|
| 476 | 476 | <div class="module-view other-channels-view"> |
| 477 | 477 | <h2>Featured Channels</h2> |
| 478 | 478 | <ul class="channel-summary-list "> |
| 479 | 479 | <?php |
| 480 | - foreach($_user['featured_channels'] as $user) { |
|
| 481 | - if($__user_h->user_exists($user)) { |
|
| 480 | + foreach ($_user['featured_channels'] as $user) { |
|
| 481 | + if ($__user_h->user_exists($user)) { |
|
| 482 | 482 | ?> |
| 483 | 483 | <li class="yt-tile-visible yt-uix-tile"> |
| 484 | 484 | <div class="channel-summary clearfix channel-summary-compact"> |
@@ -507,13 +507,13 @@ discard block |
||
| 507 | 507 | $stmt->bindParam(":search", $_user['username']); |
| 508 | 508 | $stmt->execute(); |
| 509 | 509 | |
| 510 | - if($stmt->rowCount() != 0) { |
|
| 510 | + if ($stmt->rowCount() != 0) { |
|
| 511 | 511 | ?> |
| 512 | 512 | <div class="playlists-narrow channel-module yt-uix-c3-module-container"> |
| 513 | 513 | <div class="module-view gh-featured"> |
| 514 | 514 | <h2>Featured Playlists</h2> |
| 515 | 515 | <?php |
| 516 | - while($playlist = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
| 516 | + while ($playlist = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
| 517 | 517 | $playlist['videos'] = json_decode($playlist['videos']); |
| 518 | 518 | ?> |
| 519 | 519 | <div class="playlist yt-tile-visible yt-uix-tile"> |
@@ -8,7 +8,7 @@ discard block |
||
| 8 | 8 | <?php $__user_h = new user_helper($__db); ?> |
| 9 | 9 | <?php $__db_h = new db_helper(); ?> |
| 10 | 10 | <?php $__time_h = new time_helper(); ?> |
| 11 | -<?php if(!isset($_SESSION['siteusername'])) { header("Location: /sign_in"); } ?> |
|
| 11 | +<?php if (!isset($_SESSION['siteusername'])) { header("Location: /sign_in"); } ?> |
|
| 12 | 12 | <?php |
| 13 | 13 | $__server->page_embeds->page_title = "SubRocks - Upload Video"; |
| 14 | 14 | $__server->page_embeds->page_description = "SubRocks is a site dedicated to bring back the 2012 layout of YouTube."; |
@@ -44,7 +44,7 @@ discard block |
||
| 44 | 44 | <div id="content-container"> |
| 45 | 45 | <!-- begin content --> |
| 46 | 46 | <div id="content"> |
| 47 | - <?php if($__user_h->if_upload_cooldown($_SESSION['siteusername'])) { ?> |
|
| 47 | + <?php if ($__user_h->if_upload_cooldown($_SESSION['siteusername'])) { ?> |
|
| 48 | 48 | <div id="masthead_child_div"><div class="yt-alert yt-alert-default yt-alert-error "> <div class="yt-alert-icon"> |
| 49 | 49 | <img src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" class="icon master-sprite" alt="Alert icon"> |
| 50 | 50 | </div> |
@@ -107,7 +107,7 @@ discard block |
||
| 107 | 107 | <b>Category</b> <br> |
| 108 | 108 | <select style="margin-top:5px;" name="category" class="yt-uix-button yt-uix-button-default"> |
| 109 | 109 | <?php $categories = ["None", "Film & Animation", "Autos & Vehicles", "Music", "Pets & Animals", "Sports", "Travel & Events", "Gaming", "People & Blogs", "Comedy", "Entertainment", "News & Politics", "Howto & Style", "Education", "Science & Technology", "Nonprofits & Activism"]; ?> |
| 110 | - <?php foreach($categories as $categoryTag) { ?> |
|
| 110 | + <?php foreach ($categories as $categoryTag) { ?> |
|
| 111 | 111 | <option value="<?php echo $categoryTag; ?>"><?php echo $categoryTag; ?></option> |
| 112 | 112 | <?php } ?> |
| 113 | 113 | </select><br><br> |
@@ -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']); |
@@ -68,28 +68,28 @@ discard block |
||
| 68 | 68 | $_user['genre'] = strtolower($_user['genre']); |
| 69 | 69 | $_user['subscribed'] = $__user_h->if_subscribed(@$_SESSION['siteusername'], $_user['username']); |
| 70 | 70 | |
| 71 | - if(!check_valid_colorhex($_user['primary_color']) && strlen($_user['primary_color']) != 6) { $_user['primary_color'] = ""; } |
|
| 72 | - if(!check_valid_colorhex($_user['secondary_color']) && strlen($_user['secondary_color']) != 6) { $_user['secondary_color'] = ""; } |
|
| 73 | - if(!check_valid_colorhex($_user['third_color']) && strlen($_user['third_color']) != 6) { $_user['third_color'] = ""; } |
|
| 74 | - if(!check_valid_colorhex($_user['text_color']) && strlen($_user['text_color']) != 6) { $_user['text_color'] = ""; } |
|
| 75 | - if(!check_valid_colorhex($_user['primary_color_text']) && strlen($_user['primary_color_text']) != 6) { $_user['primary_color_text'] = ""; } |
|
| 76 | - if(!check_valid_colorhex($_user['2009_bgcolor']) && strlen($_user['2009_bgcolor']) != 6) { $_user['2009_bgcolor'] = ""; } |
|
| 71 | + if (!check_valid_colorhex($_user['primary_color']) && strlen($_user['primary_color']) != 6) { $_user['primary_color'] = ""; } |
|
| 72 | + if (!check_valid_colorhex($_user['secondary_color']) && strlen($_user['secondary_color']) != 6) { $_user['secondary_color'] = ""; } |
|
| 73 | + if (!check_valid_colorhex($_user['third_color']) && strlen($_user['third_color']) != 6) { $_user['third_color'] = ""; } |
|
| 74 | + if (!check_valid_colorhex($_user['text_color']) && strlen($_user['text_color']) != 6) { $_user['text_color'] = ""; } |
|
| 75 | + if (!check_valid_colorhex($_user['primary_color_text']) && strlen($_user['primary_color_text']) != 6) { $_user['primary_color_text'] = ""; } |
|
| 76 | + if (!check_valid_colorhex($_user['2009_bgcolor']) && strlen($_user['2009_bgcolor']) != 6) { $_user['2009_bgcolor'] = ""; } |
|
| 77 | 77 | |
| 78 | - if(isset($_SESSION['siteusername'])) |
|
| 78 | + if (isset($_SESSION['siteusername'])) |
|
| 79 | 79 | $__user_i->check_view_channel($_user['username'], @$_SESSION['siteusername']); |
| 80 | 80 | |
| 81 | - if($_SERVER['REQUEST_METHOD'] == 'POST') { |
|
| 81 | + if ($_SERVER['REQUEST_METHOD'] == 'POST') { |
|
| 82 | 82 | $error = array(); |
| 83 | 83 | |
| 84 | - if(!isset($_SESSION['siteusername'])){ $error['message'] = "you are not logged in"; $error['status'] = true; } |
|
| 85 | - if(!$_POST['comment']){ $error['message'] = "your comment cannot be blank"; $error['status'] = true; } |
|
| 86 | - if(strlen($_POST['comment']) > 1000){ $error['message'] = "your comment must be shorter than 1000 characters"; $error['status'] = true; } |
|
| 84 | + if (!isset($_SESSION['siteusername'])) { $error['message'] = "you are not logged in"; $error['status'] = true; } |
|
| 85 | + if (!$_POST['comment']) { $error['message'] = "your comment cannot be blank"; $error['status'] = true; } |
|
| 86 | + if (strlen($_POST['comment']) > 1000) { $error['message'] = "your comment must be shorter than 1000 characters"; $error['status'] = true; } |
|
| 87 | 87 | //if(!isset($_POST['g-recaptcha-response'])){ $error['message'] = "captcha validation failed"; $error['status'] = true; } |
| 88 | 88 | //if(!$_user_insert_utils->validateCaptcha($config['recaptcha_secret'], $_POST['g-recaptcha-response'])) { $error['message'] = "captcha validation failed"; $error['status'] = true; } |
| 89 | - 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 | + 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; } |
|
| 90 | 90 | //if(ifBlocked(@$_SESSION['siteusername'], $user['username'], $__db)) { $error = "This user has blocked you!"; $error['status'] = true; } |
| 91 | 91 | |
| 92 | - if(!isset($error['message'])) { |
|
| 92 | + if (!isset($error['message'])) { |
|
| 93 | 93 | $text = $_POST['comment']; |
| 94 | 94 | $stmt = $__db->prepare("INSERT INTO profile_comments (toid, author, comment) VALUES (:id, :username, :comment)"); |
| 95 | 95 | $stmt->bindParam(":id", $_user['username']); |
@@ -99,7 +99,7 @@ discard block |
||
| 99 | 99 | |
| 100 | 100 | $_user_update_utils->update_comment_cooldown_time($_SESSION['siteusername']); |
| 101 | 101 | |
| 102 | - if(@$_SESSION['siteusername'] != $_user['username']) { |
|
| 102 | + if (@$_SESSION['siteusername'] != $_user['username']) { |
|
| 103 | 103 | $_user_insert_utils->send_message($_user['username'], "New comment", 'I commented "' . $_POST['comment'] . '" on your profile!', $_SESSION['siteusername']); |
| 104 | 104 | } |
| 105 | 105 | } |
@@ -133,11 +133,11 @@ discard block |
||
| 133 | 133 | <link rel="stylesheet" href="/yt/cssbin/www-extra.css"> |
| 134 | 134 | <style> |
| 135 | 135 | #content-container { |
| 136 | - background-color: <?php echo $_user['primary_color']; ?>; |
|
| 136 | + background-color: <?php echo $_user['primary_color']; ?>; |
|
| 137 | 137 | background-image: url(/dynamic/banners/<?php echo $_user['2012_bg']; ?>); |
| 138 | 138 | background-repeat: repeat; |
| 139 | 139 | <?php |
| 140 | - switch($_user['2012_bgoption']) { |
|
| 140 | + switch ($_user['2012_bgoption']) { |
|
| 141 | 141 | case "stretch": |
| 142 | 142 | echo "background-size: cover;"; |
| 143 | 143 | break; |
@@ -170,11 +170,11 @@ discard block |
||
| 170 | 170 | <div id="masthead-container"><?php require($_SERVER['DOCUMENT_ROOT'] . "/s/mod/header.php"); ?></div> |
| 171 | 171 | <div id="content-container"> |
| 172 | 172 | <!-- begin content --> |
| 173 | - <?php if(isset($_SESSION['siteusername']) && $_user['username'] == $_SESSION['siteusername']) { ?> |
|
| 173 | + <?php if (isset($_SESSION['siteusername']) && $_user['username'] == $_SESSION['siteusername']) { ?> |
|
| 174 | 174 | <div class="channel_customization"><?php require($_SERVER['DOCUMENT_ROOT'] . "/s/mod/channel_customization.php"); ?></div> |
| 175 | 175 | <?php } ?> |
| 176 | 176 | <?php |
| 177 | - if(empty(trim($_user['bio']))) |
|
| 177 | + if (empty(trim($_user['bio']))) |
|
| 178 | 178 | $_user['bio'] = "This user has no description."; |
| 179 | 179 | ?> |
| 180 | 180 | <div id="content"> |
@@ -229,7 +229,7 @@ discard block |
||
| 229 | 229 | <h1><?php echo htmlspecialchars($_user['username']); ?></h1> |
| 230 | 230 | </div> |
| 231 | 231 | <div class="upper-left-section enable-fancy-subscribe-button"> |
| 232 | - <?php if($_user['username'] != @$_SESSION['siteusername']) { ?> |
|
| 232 | + <?php if ($_user['username'] != @$_SESSION['siteusername']) { ?> |
|
| 233 | 233 | <div class="yt-subscription-button-hovercard yt-uix-hovercard"> |
| 234 | 234 | <button |
| 235 | 235 | href="#" |
@@ -237,7 +237,7 @@ discard block |
||
| 237 | 237 | title="" |
| 238 | 238 | id="subscribe-button" |
| 239 | 239 | type="button" |
| 240 | - class="yt-subscription-button <?php if($_user['subscribed']) { echo "subscribed "; } ?> yt-uix-button yt-uix-button-subscription yt-uix-tooltip" |
|
| 240 | + class="yt-subscription-button <?php if ($_user['subscribed']) { echo "subscribed "; } ?> yt-uix-button yt-uix-button-subscription yt-uix-tooltip" |
|
| 241 | 241 | role="button"><span class="yt-uix-button-icon-wrapper"><img class="yt-uix-button-icon yt-uix-button-icon-subscribe" |
| 242 | 242 | src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" alt=""></span><span class="yt-uix-button-content"> <span class="subscribe-label">Subscribe</span> |
| 243 | 243 | <span class="subscribed-label">Subscribed</span> |
@@ -303,7 +303,7 @@ discard block |
||
| 303 | 303 | </div> |
| 304 | 304 | </div> |
| 305 | 305 | </div> |
| 306 | - <?php if($_user['featured'] != "None") { $video = $__video_h->fetch_video_rid($_user['featured']); } else { $_user['featured'] = false; } ?> |
|
| 306 | + <?php if ($_user['featured'] != "None") { $video = $__video_h->fetch_video_rid($_user['featured']); } else { $_user['featured'] = false; } ?> |
|
| 307 | 307 | <div id="branded-page-body"> |
| 308 | 308 | <div class="channel-tab-content channel-layout-two-column selected blogger-template"><?php require($_SERVER['DOCUMENT_ROOT'] . "/s/mod/channel_feed.php"); ?></div> |
| 309 | 309 | </div> |
@@ -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>'; |
@@ -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']); |
@@ -68,28 +68,28 @@ discard block |
||
| 68 | 68 | $_user['genre'] = strtolower($_user['genre']); |
| 69 | 69 | $_user['subscribed'] = $__user_h->if_subscribed(@$_SESSION['siteusername'], $_user['username']); |
| 70 | 70 | |
| 71 | - if(!check_valid_colorhex($_user['primary_color']) && strlen($_user['primary_color']) != 6) { $_user['primary_color'] = ""; } |
|
| 72 | - if(!check_valid_colorhex($_user['secondary_color']) && strlen($_user['secondary_color']) != 6) { $_user['secondary_color'] = ""; } |
|
| 73 | - if(!check_valid_colorhex($_user['third_color']) && strlen($_user['third_color']) != 6) { $_user['third_color'] = ""; } |
|
| 74 | - if(!check_valid_colorhex($_user['text_color']) && strlen($_user['text_color']) != 6) { $_user['text_color'] = ""; } |
|
| 75 | - if(!check_valid_colorhex($_user['primary_color_text']) && strlen($_user['primary_color_text']) != 6) { $_user['primary_color_text'] = ""; } |
|
| 76 | - if(!check_valid_colorhex($_user['2009_bgcolor']) && strlen($_user['2009_bgcolor']) != 6) { $_user['2009_bgcolor'] = ""; } |
|
| 71 | + if (!check_valid_colorhex($_user['primary_color']) && strlen($_user['primary_color']) != 6) { $_user['primary_color'] = ""; } |
|
| 72 | + if (!check_valid_colorhex($_user['secondary_color']) && strlen($_user['secondary_color']) != 6) { $_user['secondary_color'] = ""; } |
|
| 73 | + if (!check_valid_colorhex($_user['third_color']) && strlen($_user['third_color']) != 6) { $_user['third_color'] = ""; } |
|
| 74 | + if (!check_valid_colorhex($_user['text_color']) && strlen($_user['text_color']) != 6) { $_user['text_color'] = ""; } |
|
| 75 | + if (!check_valid_colorhex($_user['primary_color_text']) && strlen($_user['primary_color_text']) != 6) { $_user['primary_color_text'] = ""; } |
|
| 76 | + if (!check_valid_colorhex($_user['2009_bgcolor']) && strlen($_user['2009_bgcolor']) != 6) { $_user['2009_bgcolor'] = ""; } |
|
| 77 | 77 | |
| 78 | - if(isset($_SESSION['siteusername'])) |
|
| 78 | + if (isset($_SESSION['siteusername'])) |
|
| 79 | 79 | $__user_i->check_view_channel($_user['username'], @$_SESSION['siteusername']); |
| 80 | 80 | |
| 81 | - if($_SERVER['REQUEST_METHOD'] == 'POST') { |
|
| 81 | + if ($_SERVER['REQUEST_METHOD'] == 'POST') { |
|
| 82 | 82 | $error = array(); |
| 83 | 83 | |
| 84 | - if(!isset($_SESSION['siteusername'])){ $error['message'] = "you are not logged in"; $error['status'] = true; } |
|
| 85 | - if(!$_POST['comment']){ $error['message'] = "your comment cannot be blank"; $error['status'] = true; } |
|
| 86 | - if(strlen($_POST['comment']) > 1000){ $error['message'] = "your comment must be shorter than 1000 characters"; $error['status'] = true; } |
|
| 84 | + if (!isset($_SESSION['siteusername'])) { $error['message'] = "you are not logged in"; $error['status'] = true; } |
|
| 85 | + if (!$_POST['comment']) { $error['message'] = "your comment cannot be blank"; $error['status'] = true; } |
|
| 86 | + if (strlen($_POST['comment']) > 1000) { $error['message'] = "your comment must be shorter than 1000 characters"; $error['status'] = true; } |
|
| 87 | 87 | //if(!isset($_POST['g-recaptcha-response'])){ $error['message'] = "captcha validation failed"; $error['status'] = true; } |
| 88 | 88 | //if(!$_user_insert_utils->validateCaptcha($config['recaptcha_secret'], $_POST['g-recaptcha-response'])) { $error['message'] = "captcha validation failed"; $error['status'] = true; } |
| 89 | - 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 | + 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; } |
|
| 90 | 90 | //if(ifBlocked(@$_SESSION['siteusername'], $user['username'], $__db)) { $error = "This user has blocked you!"; $error['status'] = true; } |
| 91 | 91 | |
| 92 | - if(!isset($error['message'])) { |
|
| 92 | + if (!isset($error['message'])) { |
|
| 93 | 93 | $text = $_POST['comment']; |
| 94 | 94 | $stmt = $__db->prepare("INSERT INTO profile_comments (toid, author, comment) VALUES (:id, :username, :comment)"); |
| 95 | 95 | $stmt->bindParam(":id", $_user['username']); |
@@ -99,7 +99,7 @@ discard block |
||
| 99 | 99 | |
| 100 | 100 | $_user_update_utils->update_comment_cooldown_time($_SESSION['siteusername']); |
| 101 | 101 | |
| 102 | - if(@$_SESSION['siteusername'] != $_user['username']) { |
|
| 102 | + if (@$_SESSION['siteusername'] != $_user['username']) { |
|
| 103 | 103 | $_user_insert_utils->send_message($_user['username'], "New comment", 'I commented "' . $_POST['comment'] . '" on your profile!', $_SESSION['siteusername']); |
| 104 | 104 | } |
| 105 | 105 | } |
@@ -133,11 +133,11 @@ discard block |
||
| 133 | 133 | <link rel="stylesheet" href="/yt/cssbin/www-extra.css"> |
| 134 | 134 | <style> |
| 135 | 135 | #content-container { |
| 136 | - background-color: <?php echo $_user['primary_color']; ?>; |
|
| 136 | + background-color: <?php echo $_user['primary_color']; ?>; |
|
| 137 | 137 | background-image: url(/dynamic/banners/<?php echo $_user['2012_bg']; ?>); |
| 138 | 138 | background-repeat: repeat; |
| 139 | 139 | <?php |
| 140 | - switch($_user['2012_bgoption']) { |
|
| 140 | + switch ($_user['2012_bgoption']) { |
|
| 141 | 141 | case "stretch": |
| 142 | 142 | echo "background-size: cover;"; |
| 143 | 143 | break; |
@@ -170,7 +170,7 @@ discard block |
||
| 170 | 170 | <div id="masthead-container"><?php require($_SERVER['DOCUMENT_ROOT'] . "/s/mod/header.php"); ?></div> |
| 171 | 171 | <div id="content-container"> |
| 172 | 172 | <!-- begin content --> |
| 173 | - <?php if(isset($_SESSION['siteusername']) && $_user['username'] == $_SESSION['siteusername']) { ?> |
|
| 173 | + <?php if (isset($_SESSION['siteusername']) && $_user['username'] == $_SESSION['siteusername']) { ?> |
|
| 174 | 174 | <div class="channel_customization"><?php require($_SERVER['DOCUMENT_ROOT'] . "/s/mod/channel_customization.php"); ?></div> |
| 175 | 175 | <?php } ?> |
| 176 | 176 | <div id="content"> |
@@ -225,7 +225,7 @@ discard block |
||
| 225 | 225 | <h1><?php echo htmlspecialchars($_user['username']); ?></h1> |
| 226 | 226 | </div> |
| 227 | 227 | <div class="upper-left-section enable-fancy-subscribe-button"> |
| 228 | - <?php if($_user['username'] != @$_SESSION['siteusername']) { ?> |
|
| 228 | + <?php if ($_user['username'] != @$_SESSION['siteusername']) { ?> |
|
| 229 | 229 | <div class="yt-subscription-button-hovercard yt-uix-hovercard"> |
| 230 | 230 | <button |
| 231 | 231 | href="#" |
@@ -233,7 +233,7 @@ discard block |
||
| 233 | 233 | title="" |
| 234 | 234 | id="subscribe-button" |
| 235 | 235 | type="button" |
| 236 | - class="yt-subscription-button <?php if($_user['subscribed']) { echo "subscribed "; } ?> yt-uix-button yt-uix-button-subscription yt-uix-tooltip" |
|
| 236 | + class="yt-subscription-button <?php if ($_user['subscribed']) { echo "subscribed "; } ?> yt-uix-button yt-uix-button-subscription yt-uix-tooltip" |
|
| 237 | 237 | role="button"><span class="yt-uix-button-icon-wrapper"><img class="yt-uix-button-icon yt-uix-button-icon-subscribe" |
| 238 | 238 | src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" alt=""></span><span class="yt-uix-button-content"> <span class="subscribe-label">Subscribe</span> |
| 239 | 239 | <span class="subscribed-label">Subscribed</span> |
@@ -299,7 +299,7 @@ discard block |
||
| 299 | 299 | </div> |
| 300 | 300 | </div> |
| 301 | 301 | </div> |
| 302 | - <?php if($_user['featured'] != "None") { $video = $__video_h->fetch_video_rid($_user['featured']); } else { $_user['featured'] = false; } ?> |
|
| 302 | + <?php if ($_user['featured'] != "None") { $video = $__video_h->fetch_video_rid($_user['featured']); } else { $_user['featured'] = false; } ?> |
|
| 303 | 303 | <div id="branded-page-body"> |
| 304 | 304 | <div class="channel-tab-content channel-layout-full-width"> |
| 305 | 305 | <div class="tab-content-body"> |
@@ -333,7 +333,7 @@ discard block |
||
| 333 | 333 | $stmt = $__db->prepare("SELECT * FROM videos WHERE author = :username ORDER BY id DESC"); |
| 334 | 334 | $stmt->bindParam(":username", $_user['username']); |
| 335 | 335 | $stmt->execute(); |
| 336 | - while($video = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
| 336 | + while ($video = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
| 337 | 337 | $video['age'] = $__time_h->time_elapsed_string($video['publish']); |
| 338 | 338 | $video['duration'] = $__time_h->timestamp($video['duration']); |
| 339 | 339 | $video['views'] = $__video_h->fetch_video_views($video['rid']); |