@@ -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"> |
@@ -353,21 +353,21 @@ discard block |
||
| 353 | 353 | <hr><br> |
| 354 | 354 | <h3>Add to a Playlist</h3> |
| 355 | 355 | <?php |
| 356 | - $stmt = $__db->prepare("SELECT * FROM playlists WHERE author = :username ORDER BY id DESC LIMIT 20"); |
|
| 357 | - $stmt->bindParam(":username", $_SESSION['siteusername']); |
|
| 358 | - $stmt->execute(); |
|
| 359 | - while($playlist = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
| 360 | - $buffer = json_decode($playlist['videos']); |
|
| 361 | - @$rid = $buffer[0]; |
|
| 362 | - if(!empty($rid)) { |
|
| 363 | - @$video = $__video_h->fetch_video_rid($rid); |
|
| 364 | - } else { |
|
| 365 | - $video['thumbnail'] = ""; |
|
| 366 | - $video['duration'] = 0; |
|
| 367 | - } |
|
| 356 | + $stmt = $__db->prepare("SELECT * FROM playlists WHERE author = :username ORDER BY id DESC LIMIT 20"); |
|
| 357 | + $stmt->bindParam(":username", $_SESSION['siteusername']); |
|
| 358 | + $stmt->execute(); |
|
| 359 | + while($playlist = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
| 360 | + $buffer = json_decode($playlist['videos']); |
|
| 361 | + @$rid = $buffer[0]; |
|
| 362 | + if(!empty($rid)) { |
|
| 363 | + @$video = $__video_h->fetch_video_rid($rid); |
|
| 364 | + } else { |
|
| 365 | + $video['thumbnail'] = ""; |
|
| 366 | + $video['duration'] = 0; |
|
| 367 | + } |
|
| 368 | 368 | |
| 369 | - $videos = count($buffer); |
|
| 370 | - ?> |
|
| 369 | + $videos = count($buffer); |
|
| 370 | + ?> |
|
| 371 | 371 | <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> |
| 372 | 372 | <?php } ?> |
| 373 | 373 | <?php } ?> |
@@ -632,10 +632,10 @@ discard block |
||
| 632 | 632 | </div> |
| 633 | 633 | </div> |
| 634 | 634 | <?php |
| 635 | - $stmt = $__db->prepare("SELECT * FROM video_response WHERE toid = :v ORDER BY id DESC LIMIT 4"); |
|
| 636 | - $stmt->bindParam(":v", $_GET['v']); |
|
| 637 | - $stmt->execute(); |
|
| 638 | - ?> |
|
| 635 | + $stmt = $__db->prepare("SELECT * FROM video_response WHERE toid = :v ORDER BY id DESC LIMIT 4"); |
|
| 636 | + $stmt->bindParam(":v", $_GET['v']); |
|
| 637 | + $stmt->execute(); |
|
| 638 | + ?> |
|
| 639 | 639 | |
| 640 | 640 | <?php if($stmt->rowCount() != 0) { ?> |
| 641 | 641 | <div class="comments-section"> |
@@ -645,16 +645,16 @@ 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'])) { |
|
| 650 | - $video = $__video_h->fetch_video_rid($video['video']); |
|
| 651 | - $video['age'] = $__time_h->time_elapsed_string($video['publish']); |
|
| 652 | - $video['duration'] = $__time_h->timestamp($video['duration']); |
|
| 653 | - $video['views'] = $__video_h->fetch_video_views($video['rid']); |
|
| 654 | - $video['author'] = htmlspecialchars($video['author']); |
|
| 655 | - $video['title'] = htmlspecialchars($video['title']); |
|
| 656 | - $video['description'] = $__video_h->shorten_description($video['description'], 50); |
|
| 657 | - ?> |
|
| 648 | + while($video = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
| 649 | + if($__video_h->video_exists($video['video'])) { |
|
| 650 | + $video = $__video_h->fetch_video_rid($video['video']); |
|
| 651 | + $video['age'] = $__time_h->time_elapsed_string($video['publish']); |
|
| 652 | + $video['duration'] = $__time_h->timestamp($video['duration']); |
|
| 653 | + $video['views'] = $__video_h->fetch_video_views($video['rid']); |
|
| 654 | + $video['author'] = htmlspecialchars($video['author']); |
|
| 655 | + $video['title'] = htmlspecialchars($video['title']); |
|
| 656 | + $video['description'] = $__video_h->shorten_description($video['description'], 50); |
|
| 657 | + ?> |
|
| 658 | 658 | <li class="video-list-item yt-tile-default"> |
| 659 | 659 | <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> |
| 660 | 660 | <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"> |
@@ -735,38 +735,38 @@ discard block |
||
| 735 | 735 | </div> |
| 736 | 736 | <ul class="comment-list" id="live_comments"> |
| 737 | 737 | <?php |
| 738 | - $results_per_page = 20; |
|
| 738 | + $results_per_page = 20; |
|
| 739 | 739 | |
| 740 | - $stmt = $__db->prepare("SELECT * FROM comments WHERE toid = :rid ORDER BY id DESC"); |
|
| 741 | - $stmt->bindParam(":rid", $_video['rid']); |
|
| 742 | - $stmt->execute(); |
|
| 740 | + $stmt = $__db->prepare("SELECT * FROM comments WHERE toid = :rid ORDER BY id DESC"); |
|
| 741 | + $stmt->bindParam(":rid", $_video['rid']); |
|
| 742 | + $stmt->execute(); |
|
| 743 | 743 | |
| 744 | - $number_of_result = $stmt->rowCount(); |
|
| 745 | - $number_of_page = ceil ($number_of_result / $results_per_page); |
|
| 744 | + $number_of_result = $stmt->rowCount(); |
|
| 745 | + $number_of_page = ceil ($number_of_result / $results_per_page); |
|
| 746 | 746 | |
| 747 | - if (!isset ($_GET['page']) ) { |
|
| 748 | - $page = 1; |
|
| 749 | - } else { |
|
| 750 | - $page = (int)$_GET['page']; |
|
| 751 | - } |
|
| 747 | + if (!isset ($_GET['page']) ) { |
|
| 748 | + $page = 1; |
|
| 749 | + } else { |
|
| 750 | + $page = (int)$_GET['page']; |
|
| 751 | + } |
|
| 752 | 752 | |
| 753 | - $page_first_result = ($page - 1) * $results_per_page; |
|
| 753 | + $page_first_result = ($page - 1) * $results_per_page; |
|
| 754 | 754 | |
| 755 | - $stmt = $__db->prepare("SELECT * FROM comments WHERE toid = :rid ORDER BY id DESC LIMIT :pfirst, :pper"); |
|
| 756 | - $stmt->bindParam(":rid", $_video['rid']); |
|
| 757 | - $stmt->bindParam(":pfirst", $page_first_result); |
|
| 758 | - $stmt->bindParam(":pper", $results_per_page); |
|
| 759 | - $stmt->execute(); |
|
| 755 | + $stmt = $__db->prepare("SELECT * FROM comments WHERE toid = :rid ORDER BY id DESC LIMIT :pfirst, :pper"); |
|
| 756 | + $stmt->bindParam(":rid", $_video['rid']); |
|
| 757 | + $stmt->bindParam(":pfirst", $page_first_result); |
|
| 758 | + $stmt->bindParam(":pper", $results_per_page); |
|
| 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)) |
|
| 763 | - $comment['liked'] = true; |
|
| 764 | - else if($__video_h->if_comment_liked($comment['id'], $_SESSION['siteusername'], false)) |
|
| 765 | - $comment['disliked'] = true; |
|
| 761 | + while($comment = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
| 762 | + if($__video_h->if_comment_liked($comment['id'], $_SESSION['siteusername'], true)) |
|
| 763 | + $comment['liked'] = true; |
|
| 764 | + else if($__video_h->if_comment_liked($comment['id'], $_SESSION['siteusername'], false)) |
|
| 765 | + $comment['disliked'] = true; |
|
| 766 | 766 | |
| 767 | - $comment['likes'] = $__video_h->get_comment_likes($comment['id'], true); |
|
| 768 | - $comment['likes'] -= $__video_h->get_comment_likes($comment['id'], false); |
|
| 769 | - ?> |
|
| 767 | + $comment['likes'] = $__video_h->get_comment_likes($comment['id'], true); |
|
| 768 | + $comment['likes'] -= $__video_h->get_comment_likes($comment['id'], false); |
|
| 769 | + ?> |
|
| 770 | 770 | |
| 771 | 771 | <li class="comment yt-tile-default " data-author-viewing="" data-author-id="-uD01K8FQTeOSS5sniRFzQ" data-id="<?php echo $comment['id']; ?>" data-score="0"> |
| 772 | 772 | <div class="comment-body"> |
@@ -832,12 +832,12 @@ discard block |
||
| 832 | 832 | </div> |
| 833 | 833 | </li> |
| 834 | 834 | <?php |
| 835 | - $stmt2 = $__db->prepare("SELECT * FROM comment_reply WHERE toid = :rid ORDER BY id"); |
|
| 836 | - $stmt2->bindParam(":rid", $comment['id']); |
|
| 837 | - $stmt2->execute(); |
|
| 835 | + $stmt2 = $__db->prepare("SELECT * FROM comment_reply WHERE toid = :rid ORDER BY id"); |
|
| 836 | + $stmt2->bindParam(":rid", $comment['id']); |
|
| 837 | + $stmt2->execute(); |
|
| 838 | 838 | |
| 839 | - while($reply = $stmt2->fetch(PDO::FETCH_ASSOC)) { |
|
| 840 | - ?> |
|
| 839 | + while($reply = $stmt2->fetch(PDO::FETCH_ASSOC)) { |
|
| 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"> |
| 843 | 843 | <div class="content-container"> |
@@ -917,19 +917,19 @@ discard block |
||
| 917 | 917 | <div id="watch-related-container" class="watch-sidebar-body"> |
| 918 | 918 | <ul id="watch-related" class="video-list"> |
| 919 | 919 | <?php |
| 920 | - $stmt = $__db->prepare("SELECT * FROM playlists ORDER BY rand() LIMIT 2"); |
|
| 921 | - $stmt->execute(); |
|
| 922 | - while($_playlist = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
| 923 | - $_playlist['videos'] = json_decode($_playlist['videos']); |
|
| 924 | - $_playlist['count'] = 1; |
|
| 920 | + $stmt = $__db->prepare("SELECT * FROM playlists ORDER BY rand() LIMIT 2"); |
|
| 921 | + $stmt->execute(); |
|
| 922 | + while($_playlist = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
| 923 | + $_playlist['videos'] = json_decode($_playlist['videos']); |
|
| 924 | + $_playlist['count'] = 1; |
|
| 925 | 925 | |
| 926 | - if($__video_h->video_exists($_playlist['videos'][0])) { |
|
| 927 | - $video = $__video_h->fetch_video_rid($_playlist['videos'][0]); |
|
| 928 | - } else { |
|
| 929 | - $video = []; |
|
| 930 | - $video['thumbnail'] = "default.jpg"; |
|
| 931 | - } |
|
| 932 | - ?> |
|
| 926 | + if($__video_h->video_exists($_playlist['videos'][0])) { |
|
| 927 | + $video = $__video_h->fetch_video_rid($_playlist['videos'][0]); |
|
| 928 | + } else { |
|
| 929 | + $video = []; |
|
| 930 | + $video['thumbnail'] = "default.jpg"; |
|
| 931 | + } |
|
| 932 | + ?> |
|
| 933 | 933 | <li class="video-list-item"> |
| 934 | 934 | <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"> |
| 935 | 935 | <span class="ux-thumb-wrap"> |
@@ -976,16 +976,16 @@ discard block |
||
| 976 | 976 | <?php } ?> |
| 977 | 977 | <div id="ppv-container" class="hid"></div> |
| 978 | 978 | <?php |
| 979 | - $stmt = $__db->prepare("SELECT * FROM videos WHERE visibility = 'n' ORDER BY rand() LIMIT 20"); |
|
| 980 | - $stmt->execute(); |
|
| 981 | - while($video = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
| 982 | - $video['age'] = $__time_h->time_elapsed_string($video['publish']); |
|
| 983 | - $video['duration'] = $__time_h->timestamp($video['duration']); |
|
| 984 | - $video['views'] = $__video_h->fetch_video_views($video['rid']); |
|
| 985 | - $video['author'] = htmlspecialchars($video['author']); |
|
| 986 | - $video['title'] = htmlspecialchars($video['title']); |
|
| 987 | - $video['description'] = $__video_h->shorten_description($video['description'], 50); |
|
| 988 | - ?> |
|
| 979 | + $stmt = $__db->prepare("SELECT * FROM videos WHERE visibility = 'n' ORDER BY rand() LIMIT 20"); |
|
| 980 | + $stmt->execute(); |
|
| 981 | + while($video = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
| 982 | + $video['age'] = $__time_h->time_elapsed_string($video['publish']); |
|
| 983 | + $video['duration'] = $__time_h->timestamp($video['duration']); |
|
| 984 | + $video['views'] = $__video_h->fetch_video_views($video['rid']); |
|
| 985 | + $video['author'] = htmlspecialchars($video['author']); |
|
| 986 | + $video['title'] = htmlspecialchars($video['title']); |
|
| 987 | + $video['description'] = $__video_h->shorten_description($video['description'], 50); |
|
| 988 | + ?> |
|
| 989 | 989 | <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> |
| 990 | 990 | <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"> |
| 991 | 991 | </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"> |
@@ -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']); |
@@ -8,64 +8,64 @@ discard block |
||
| 8 | 8 | <?php $__db_h = new db_helper(); ?> |
| 9 | 9 | <?php $__time_h = new time_helper(); ?> |
| 10 | 10 | <?php |
| 11 | - $__server->page_embeds->page_title = "SubRocks - Homepage"; |
|
| 12 | - $__server->page_embeds->page_description = "SubRocks is a site dedicated to bring back the 2012 layout of YouTube."; |
|
| 13 | - $__server->page_embeds->page_image = "/yt/imgbin/full-size-logo.png"; |
|
| 14 | - $__server->page_embeds->page_url = "https://subrock.rocks/"; |
|
| 11 | + $__server->page_embeds->page_title = "SubRocks - Homepage"; |
|
| 12 | + $__server->page_embeds->page_description = "SubRocks is a site dedicated to bring back the 2012 layout of YouTube."; |
|
| 13 | + $__server->page_embeds->page_image = "/yt/imgbin/full-size-logo.png"; |
|
| 14 | + $__server->page_embeds->page_url = "https://subrock.rocks/"; |
|
| 15 | 15 | |
| 16 | - function get_server_array_stats() { |
|
| 17 | - $stat1 = file('/proc/stat'); |
|
| 18 | - sleep(1); |
|
| 19 | - $stat2 = file('/proc/stat'); |
|
| 20 | - $info1 = explode(" ", preg_replace("!cpu +!", "", $stat1[0])); |
|
| 21 | - $info2 = explode(" ", preg_replace("!cpu +!", "", $stat2[0])); |
|
| 22 | - $dif = array(); |
|
| 23 | - $dif['user'] = $info2[0] - $info1[0]; |
|
| 24 | - $dif['nice'] = $info2[1] - $info1[1]; |
|
| 25 | - $dif['sys'] = $info2[2] - $info1[2]; |
|
| 26 | - $dif['idle'] = $info2[3] - $info1[3]; |
|
| 27 | - $total = array_sum($dif); |
|
| 28 | - $cpu = array(); |
|
| 29 | - foreach($dif as $x=>$y) $cpu[$x] = round($y / $total * 100, 1); |
|
| 16 | + function get_server_array_stats() { |
|
| 17 | + $stat1 = file('/proc/stat'); |
|
| 18 | + sleep(1); |
|
| 19 | + $stat2 = file('/proc/stat'); |
|
| 20 | + $info1 = explode(" ", preg_replace("!cpu +!", "", $stat1[0])); |
|
| 21 | + $info2 = explode(" ", preg_replace("!cpu +!", "", $stat2[0])); |
|
| 22 | + $dif = array(); |
|
| 23 | + $dif['user'] = $info2[0] - $info1[0]; |
|
| 24 | + $dif['nice'] = $info2[1] - $info1[1]; |
|
| 25 | + $dif['sys'] = $info2[2] - $info1[2]; |
|
| 26 | + $dif['idle'] = $info2[3] - $info1[3]; |
|
| 27 | + $total = array_sum($dif); |
|
| 28 | + $cpu = array(); |
|
| 29 | + foreach($dif as $x=>$y) $cpu[$x] = round($y / $total * 100, 1); |
|
| 30 | 30 | |
| 31 | - return $cpu; |
|
| 32 | - } |
|
| 31 | + return $cpu; |
|
| 32 | + } |
|
| 33 | 33 | |
| 34 | - function adjustBrightness($hexCode, $adjustPercent) { |
|
| 35 | - $hexCode = ltrim($hexCode, '#'); |
|
| 34 | + function adjustBrightness($hexCode, $adjustPercent) { |
|
| 35 | + $hexCode = ltrim($hexCode, '#'); |
|
| 36 | 36 | |
| 37 | - if (strlen($hexCode) == 3) { |
|
| 38 | - $hexCode = $hexCode[0] . $hexCode[0] . $hexCode[1] . $hexCode[1] . $hexCode[2] . $hexCode[2]; |
|
| 39 | - } |
|
| 37 | + if (strlen($hexCode) == 3) { |
|
| 38 | + $hexCode = $hexCode[0] . $hexCode[0] . $hexCode[1] . $hexCode[1] . $hexCode[2] . $hexCode[2]; |
|
| 39 | + } |
|
| 40 | 40 | |
| 41 | - $hexCode = array_map('hexdec', str_split($hexCode, 2)); |
|
| 41 | + $hexCode = array_map('hexdec', str_split($hexCode, 2)); |
|
| 42 | 42 | |
| 43 | - foreach ($hexCode as & $color) { |
|
| 44 | - $adjustableLimit = $adjustPercent < 0 ? $color : 255 - $color; |
|
| 45 | - $adjustAmount = ceil($adjustableLimit * $adjustPercent); |
|
| 43 | + foreach ($hexCode as & $color) { |
|
| 44 | + $adjustableLimit = $adjustPercent < 0 ? $color : 255 - $color; |
|
| 45 | + $adjustAmount = ceil($adjustableLimit * $adjustPercent); |
|
| 46 | 46 | |
| 47 | - $color = str_pad(dechex($color + $adjustAmount), 2, '0', STR_PAD_LEFT); |
|
| 48 | - } |
|
| 47 | + $color = str_pad(dechex($color + $adjustAmount), 2, '0', STR_PAD_LEFT); |
|
| 48 | + } |
|
| 49 | 49 | |
| 50 | - return '#' . implode($hexCode); |
|
| 51 | - } |
|
| 50 | + return '#' . implode($hexCode); |
|
| 51 | + } |
|
| 52 | 52 | |
| 53 | - function get_server_memory_usage() { |
|
| 54 | - $free = shell_exec('free'); |
|
| 55 | - $free = (string)trim($free); |
|
| 56 | - $free_arr = explode("\n", $free); |
|
| 57 | - $mem = explode(" ", $free_arr[1]); |
|
| 58 | - $mem = array_filter($mem); |
|
| 59 | - $mem = array_merge($mem); |
|
| 60 | - $memory_usage = $mem[2]/$mem[1]*100; |
|
| 53 | + function get_server_memory_usage() { |
|
| 54 | + $free = shell_exec('free'); |
|
| 55 | + $free = (string)trim($free); |
|
| 56 | + $free_arr = explode("\n", $free); |
|
| 57 | + $mem = explode(" ", $free_arr[1]); |
|
| 58 | + $mem = array_filter($mem); |
|
| 59 | + $mem = array_merge($mem); |
|
| 60 | + $memory_usage = $mem[2]/$mem[1]*100; |
|
| 61 | 61 | |
| 62 | - return $memory_usage; |
|
| 63 | - } |
|
| 62 | + return $memory_usage; |
|
| 63 | + } |
|
| 64 | 64 | |
| 65 | - function get_server_cpu_usage() { |
|
| 66 | - $load = sys_getloadavg(); |
|
| 67 | - return $load[0]; |
|
| 68 | - } |
|
| 65 | + function get_server_cpu_usage() { |
|
| 66 | + $load = sys_getloadavg(); |
|
| 67 | + return $load[0]; |
|
| 68 | + } |
|
| 69 | 69 | ?> |
| 70 | 70 | <!DOCTYPE html> |
| 71 | 71 | <html> |
@@ -110,30 +110,30 @@ discard block |
||
| 110 | 110 | <div class="box-gray" style="width: 95%;margin-bottom: 8px;"> |
| 111 | 111 | <h3>Statistics</h3> |
| 112 | 112 | <?php |
| 113 | - $stmt = $__db->prepare("SELECT id FROM videos"); |
|
| 114 | - $stmt->execute(); |
|
| 115 | - $videos = $stmt->rowCount(); |
|
| 113 | + $stmt = $__db->prepare("SELECT id FROM videos"); |
|
| 114 | + $stmt->execute(); |
|
| 115 | + $videos = $stmt->rowCount(); |
|
| 116 | 116 | |
| 117 | - $stmt = $__db->prepare("SELECT id FROM users"); |
|
| 118 | - $stmt->execute(); |
|
| 119 | - $users = $stmt->rowCount(); |
|
| 117 | + $stmt = $__db->prepare("SELECT id FROM users"); |
|
| 118 | + $stmt->execute(); |
|
| 119 | + $users = $stmt->rowCount(); |
|
| 120 | 120 | |
| 121 | - $stmt = $__db->prepare("SELECT id FROM comments"); |
|
| 122 | - $stmt->execute(); |
|
| 123 | - $comments = $stmt->rowCount(); |
|
| 121 | + $stmt = $__db->prepare("SELECT id FROM comments"); |
|
| 122 | + $stmt->execute(); |
|
| 123 | + $comments = $stmt->rowCount(); |
|
| 124 | 124 | |
| 125 | - $stmt = $__db->prepare("SELECT id FROM views"); |
|
| 126 | - $stmt->execute(); |
|
| 127 | - $views = $stmt->rowCount(); |
|
| 125 | + $stmt = $__db->prepare("SELECT id FROM views"); |
|
| 126 | + $stmt->execute(); |
|
| 127 | + $views = $stmt->rowCount(); |
|
| 128 | 128 | |
| 129 | - $stmt = $__db->prepare("SELECT id FROM pms"); |
|
| 130 | - $stmt->execute(); |
|
| 131 | - $pms = $stmt->rowCount(); |
|
| 129 | + $stmt = $__db->prepare("SELECT id FROM pms"); |
|
| 130 | + $stmt->execute(); |
|
| 131 | + $pms = $stmt->rowCount(); |
|
| 132 | 132 | |
| 133 | - $stmt = $__db->prepare("SELECT id FROM playlists"); |
|
| 134 | - $stmt->execute(); |
|
| 135 | - $playlists = $stmt->rowCount(); |
|
| 136 | - ?> |
|
| 133 | + $stmt = $__db->prepare("SELECT id FROM playlists"); |
|
| 134 | + $stmt->execute(); |
|
| 135 | + $playlists = $stmt->rowCount(); |
|
| 136 | + ?> |
|
| 137 | 137 | <div style="width: 200px;display:inline-block;"> |
| 138 | 138 | <?php $server = get_server_array_stats(); ?> |
| 139 | 139 | Videos uploaded: <b style="float:right;"><?php echo $videos; ?></b><br> |
@@ -181,8 +181,8 @@ discard block |
||
| 181 | 181 | </div> |
| 182 | 182 | <div class="guide"> |
| 183 | 183 | <?php |
| 184 | - if(isset($_SESSION['siteusername'])) { |
|
| 185 | - ?> |
|
| 184 | + if(isset($_SESSION['siteusername'])) { |
|
| 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 |
| 188 | 188 | <img src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" class="see-more-arrow" alt=""></a> |
@@ -345,16 +345,16 @@ discard block |
||
| 345 | 345 | </p> |
| 346 | 346 | <ul> |
| 347 | 347 | <?php |
| 348 | - $stmt = $__db->prepare("SELECT * FROM videos WHERE visibility = 'n' ORDER BY rand() LIMIT 4"); |
|
| 349 | - $stmt->execute(); |
|
| 350 | - while($video = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
| 351 | - $video['age'] = $__time_h->time_elapsed_string($video['publish']); |
|
| 352 | - $video['duration'] = $__time_h->timestamp($video['duration']); |
|
| 353 | - $video['views'] = $__video_h->fetch_video_views($video['rid']); |
|
| 354 | - $video['author'] = htmlspecialchars($video['author']); |
|
| 355 | - $video['title'] = htmlspecialchars($video['title']); |
|
| 356 | - $video['description'] = $__video_h->shorten_description($video['description'], 50); |
|
| 357 | - ?> |
|
| 348 | + $stmt = $__db->prepare("SELECT * FROM videos WHERE visibility = 'n' ORDER BY rand() LIMIT 4"); |
|
| 349 | + $stmt->execute(); |
|
| 350 | + while($video = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
| 351 | + $video['age'] = $__time_h->time_elapsed_string($video['publish']); |
|
| 352 | + $video['duration'] = $__time_h->timestamp($video['duration']); |
|
| 353 | + $video['views'] = $__video_h->fetch_video_views($video['rid']); |
|
| 354 | + $video['author'] = htmlspecialchars($video['author']); |
|
| 355 | + $video['title'] = htmlspecialchars($video['title']); |
|
| 356 | + $video['description'] = $__video_h->shorten_description($video['description'], 50); |
|
| 357 | + ?> |
|
| 358 | 358 | <li class="video-list-item "><a href="/watch?v=<?php echo $video['rid']; ?>" class="video-list-item-link yt-uix-sessionlink" data-sessionlink="ei=CNLr3rbS3rICFSwSIQodSW397Q%3D%3D&feature=g-sptl%26cid%3Dinp-hs-ytg"><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="http://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> |
| 359 | 359 | <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="yuTBQ86r8o0" role="button"><span class="yt-uix-button-content"> <img src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" alt="Watch Later"> |
| 360 | 360 | </span><img class="yt-uix-button-arrow" src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" alt=""></button> |
@@ -368,16 +368,16 @@ discard block |
||
| 368 | 368 | </h3> |
| 369 | 369 | <ul> |
| 370 | 370 | <?php |
| 371 | - $stmt = $__db->prepare("SELECT * FROM videos WHERE featured = 'v' AND visibility = 'n' ORDER BY id DESC LIMIT 4"); |
|
| 372 | - $stmt->execute(); |
|
| 373 | - while($video = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
| 374 | - $video['age'] = $__time_h->time_elapsed_string($video['publish']); |
|
| 375 | - $video['duration'] = $__time_h->timestamp($video['duration']); |
|
| 376 | - $video['views'] = $__video_h->fetch_video_views($video['rid']); |
|
| 377 | - $video['author'] = htmlspecialchars($video['author']); |
|
| 378 | - $video['title'] = htmlspecialchars($video['title']); |
|
| 379 | - $video['description'] = $__video_h->shorten_description($video['description'], 50); |
|
| 380 | - ?> |
|
| 371 | + $stmt = $__db->prepare("SELECT * FROM videos WHERE featured = 'v' AND visibility = 'n' ORDER BY id DESC LIMIT 4"); |
|
| 372 | + $stmt->execute(); |
|
| 373 | + while($video = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
| 374 | + $video['age'] = $__time_h->time_elapsed_string($video['publish']); |
|
| 375 | + $video['duration'] = $__time_h->timestamp($video['duration']); |
|
| 376 | + $video['views'] = $__video_h->fetch_video_views($video['rid']); |
|
| 377 | + $video['author'] = htmlspecialchars($video['author']); |
|
| 378 | + $video['title'] = htmlspecialchars($video['title']); |
|
| 379 | + $video['description'] = $__video_h->shorten_description($video['description'], 50); |
|
| 380 | + ?> |
|
| 381 | 381 | <li class="video-list-item "><a href="/watch?v=<?php echo $video['rid']; ?>" class="video-list-item-link yt-uix-sessionlink" data-sessionlink="ei=CNLr3rbS3rICFSwSIQodSW397Q%3D%3D&feature=g-sptl%26cid%3Dinp-hs-ytg"><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="http://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> |
| 382 | 382 | <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="yuTBQ86r8o0" role="button"><span class="yt-uix-button-content"> <img src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" alt="Watch Later"> |
| 383 | 383 | </span><img class="yt-uix-button-arrow" src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" alt=""></button> |
@@ -401,16 +401,16 @@ discard block |
||
| 401 | 401 | <div class="feed-page"> |
| 402 | 402 | <ul> |
| 403 | 403 | <?php |
| 404 | - $stmt = $__db->prepare("SELECT * FROM videos WHERE visibility = 'n' ORDER BY id DESC LIMIT 20"); |
|
| 405 | - $stmt->execute(); |
|
| 406 | - while($video = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
| 407 | - $video['age'] = $__time_h->time_elapsed_string($video['publish']); |
|
| 408 | - $video['duration'] = $__time_h->timestamp($video['duration']); |
|
| 409 | - $video['views'] = $__video_h->fetch_video_views($video['rid']); |
|
| 410 | - $video['author'] = htmlspecialchars($video['author']); |
|
| 411 | - $video['title'] = htmlspecialchars($video['title']); |
|
| 412 | - $video['description'] = $__video_h->shorten_description($video['description'], 50); |
|
| 413 | - ?> |
|
| 404 | + $stmt = $__db->prepare("SELECT * FROM videos WHERE visibility = 'n' ORDER BY id DESC LIMIT 20"); |
|
| 405 | + $stmt->execute(); |
|
| 406 | + while($video = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
| 407 | + $video['age'] = $__time_h->time_elapsed_string($video['publish']); |
|
| 408 | + $video['duration'] = $__time_h->timestamp($video['duration']); |
|
| 409 | + $video['views'] = $__video_h->fetch_video_views($video['rid']); |
|
| 410 | + $video['author'] = htmlspecialchars($video['author']); |
|
| 411 | + $video['title'] = htmlspecialchars($video['title']); |
|
| 412 | + $video['description'] = $__video_h->shorten_description($video['description'], 50); |
|
| 413 | + ?> |
|
| 414 | 414 | <li> |
| 415 | 415 | <div class="feed-item-container first " data-channel-key="UCR2A9ZNliJfgC66IvIpe-Zw"> |
| 416 | 416 | <div class="feed-author-bubble-container"> |
@@ -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']); |
@@ -26,7 +26,9 @@ |
||
| 26 | 26 | $dif['idle'] = $info2[3] - $info1[3]; |
| 27 | 27 | $total = array_sum($dif); |
| 28 | 28 | $cpu = array(); |
| 29 | - foreach($dif as $x=>$y) $cpu[$x] = round($y / $total * 100, 1); |
|
| 29 | + foreach($dif as $x=>$y) { |
|
| 30 | + $cpu[$x] = round($y / $total * 100, 1); |
|
| 31 | + } |
|
| 30 | 32 | |
| 31 | 33 | return $cpu; |
| 32 | 34 | } |
@@ -12,64 +12,64 @@ discard block |
||
| 12 | 12 | <?php if(!isset($_SESSION['siteusername'])) { header("Location: /sign_in"); } ?> |
| 13 | 13 | <?php if(!$__user_h->if_admin($_SESSION['siteusername'])) { header("Location: /"); } ?> |
| 14 | 14 | <?php |
| 15 | - $__server->page_embeds->page_title = "SubRocks - Admin Panel"; |
|
| 16 | - $__server->page_embeds->page_description = "SubRocks is a site dedicated to bring back the 2012 layout of YouTube."; |
|
| 17 | - $__server->page_embeds->page_image = "/yt/imgbin/full-size-logo.png"; |
|
| 18 | - $__server->page_embeds->page_url = "https://subrock.rocks/"; |
|
| 15 | + $__server->page_embeds->page_title = "SubRocks - Admin Panel"; |
|
| 16 | + $__server->page_embeds->page_description = "SubRocks is a site dedicated to bring back the 2012 layout of YouTube."; |
|
| 17 | + $__server->page_embeds->page_image = "/yt/imgbin/full-size-logo.png"; |
|
| 18 | + $__server->page_embeds->page_url = "https://subrock.rocks/"; |
|
| 19 | 19 | |
| 20 | - function get_server_array_stats() { |
|
| 21 | - $stat1 = file('/proc/stat'); |
|
| 22 | - sleep(1); |
|
| 23 | - $stat2 = file('/proc/stat'); |
|
| 24 | - $info1 = explode(" ", preg_replace("!cpu +!", "", $stat1[0])); |
|
| 25 | - $info2 = explode(" ", preg_replace("!cpu +!", "", $stat2[0])); |
|
| 26 | - $dif = array(); |
|
| 27 | - $dif['user'] = $info2[0] - $info1[0]; |
|
| 28 | - $dif['nice'] = $info2[1] - $info1[1]; |
|
| 29 | - $dif['sys'] = $info2[2] - $info1[2]; |
|
| 30 | - $dif['idle'] = $info2[3] - $info1[3]; |
|
| 31 | - $total = array_sum($dif); |
|
| 32 | - $cpu = array(); |
|
| 33 | - foreach($dif as $x=>$y) $cpu[$x] = round($y / $total * 100, 1); |
|
| 20 | + function get_server_array_stats() { |
|
| 21 | + $stat1 = file('/proc/stat'); |
|
| 22 | + sleep(1); |
|
| 23 | + $stat2 = file('/proc/stat'); |
|
| 24 | + $info1 = explode(" ", preg_replace("!cpu +!", "", $stat1[0])); |
|
| 25 | + $info2 = explode(" ", preg_replace("!cpu +!", "", $stat2[0])); |
|
| 26 | + $dif = array(); |
|
| 27 | + $dif['user'] = $info2[0] - $info1[0]; |
|
| 28 | + $dif['nice'] = $info2[1] - $info1[1]; |
|
| 29 | + $dif['sys'] = $info2[2] - $info1[2]; |
|
| 30 | + $dif['idle'] = $info2[3] - $info1[3]; |
|
| 31 | + $total = array_sum($dif); |
|
| 32 | + $cpu = array(); |
|
| 33 | + foreach($dif as $x=>$y) $cpu[$x] = round($y / $total * 100, 1); |
|
| 34 | 34 | |
| 35 | - return $cpu; |
|
| 36 | - } |
|
| 35 | + return $cpu; |
|
| 36 | + } |
|
| 37 | 37 | |
| 38 | - function adjustBrightness($hexCode, $adjustPercent) { |
|
| 39 | - $hexCode = ltrim($hexCode, '#'); |
|
| 38 | + function adjustBrightness($hexCode, $adjustPercent) { |
|
| 39 | + $hexCode = ltrim($hexCode, '#'); |
|
| 40 | 40 | |
| 41 | - if (strlen($hexCode) == 3) { |
|
| 42 | - $hexCode = $hexCode[0] . $hexCode[0] . $hexCode[1] . $hexCode[1] . $hexCode[2] . $hexCode[2]; |
|
| 43 | - } |
|
| 41 | + if (strlen($hexCode) == 3) { |
|
| 42 | + $hexCode = $hexCode[0] . $hexCode[0] . $hexCode[1] . $hexCode[1] . $hexCode[2] . $hexCode[2]; |
|
| 43 | + } |
|
| 44 | 44 | |
| 45 | - $hexCode = array_map('hexdec', str_split($hexCode, 2)); |
|
| 45 | + $hexCode = array_map('hexdec', str_split($hexCode, 2)); |
|
| 46 | 46 | |
| 47 | - foreach ($hexCode as & $color) { |
|
| 48 | - $adjustableLimit = $adjustPercent < 0 ? $color : 255 - $color; |
|
| 49 | - $adjustAmount = ceil($adjustableLimit * $adjustPercent); |
|
| 47 | + foreach ($hexCode as & $color) { |
|
| 48 | + $adjustableLimit = $adjustPercent < 0 ? $color : 255 - $color; |
|
| 49 | + $adjustAmount = ceil($adjustableLimit * $adjustPercent); |
|
| 50 | 50 | |
| 51 | - $color = str_pad(dechex($color + $adjustAmount), 2, '0', STR_PAD_LEFT); |
|
| 52 | - } |
|
| 51 | + $color = str_pad(dechex($color + $adjustAmount), 2, '0', STR_PAD_LEFT); |
|
| 52 | + } |
|
| 53 | 53 | |
| 54 | - return '#' . implode($hexCode); |
|
| 55 | - } |
|
| 54 | + return '#' . implode($hexCode); |
|
| 55 | + } |
|
| 56 | 56 | |
| 57 | - function get_server_memory_usage() { |
|
| 58 | - $free = shell_exec('free'); |
|
| 59 | - $free = (string)trim($free); |
|
| 60 | - $free_arr = explode("\n", $free); |
|
| 61 | - $mem = explode(" ", $free_arr[1]); |
|
| 62 | - $mem = array_filter($mem); |
|
| 63 | - $mem = array_merge($mem); |
|
| 64 | - $memory_usage = $mem[2]/$mem[1]*100; |
|
| 57 | + function get_server_memory_usage() { |
|
| 58 | + $free = shell_exec('free'); |
|
| 59 | + $free = (string)trim($free); |
|
| 60 | + $free_arr = explode("\n", $free); |
|
| 61 | + $mem = explode(" ", $free_arr[1]); |
|
| 62 | + $mem = array_filter($mem); |
|
| 63 | + $mem = array_merge($mem); |
|
| 64 | + $memory_usage = $mem[2]/$mem[1]*100; |
|
| 65 | 65 | |
| 66 | - return $memory_usage; |
|
| 67 | - } |
|
| 66 | + return $memory_usage; |
|
| 67 | + } |
|
| 68 | 68 | |
| 69 | - function get_server_cpu_usage() { |
|
| 70 | - $load = sys_getloadavg(); |
|
| 71 | - return $load[0]; |
|
| 72 | - } |
|
| 69 | + function get_server_cpu_usage() { |
|
| 70 | + $load = sys_getloadavg(); |
|
| 71 | + return $load[0]; |
|
| 72 | + } |
|
| 73 | 73 | ?> |
| 74 | 74 | <!DOCTYPE html> |
| 75 | 75 | <html dir="ltr"> |
@@ -237,14 +237,14 @@ discard block |
||
| 237 | 237 | <h3>Statistics</h3> |
| 238 | 238 | <ul class="disc"> |
| 239 | 239 | <?php |
| 240 | - $stmt = $__db->prepare("SELECT id FROM videos"); |
|
| 241 | - $stmt->execute(); |
|
| 242 | - $videos = $stmt->rowCount(); |
|
| 240 | + $stmt = $__db->prepare("SELECT id FROM videos"); |
|
| 241 | + $stmt->execute(); |
|
| 242 | + $videos = $stmt->rowCount(); |
|
| 243 | 243 | |
| 244 | - $stmt = $__db->prepare("SELECT id FROM users"); |
|
| 245 | - $stmt->execute(); |
|
| 246 | - $users = $stmt->rowCount(); |
|
| 247 | - ?> |
|
| 244 | + $stmt = $__db->prepare("SELECT id FROM users"); |
|
| 245 | + $stmt->execute(); |
|
| 246 | + $users = $stmt->rowCount(); |
|
| 247 | + ?> |
|
| 248 | 248 | <li>Videos uploaded: <b><?php echo $videos; ?></b></li> |
| 249 | 249 | <li> |
| 250 | 250 | Users registered: <b><?php echo $users; ?></b> |
@@ -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> |
@@ -30,7 +30,9 @@ |
||
| 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) { |
|
| 34 | + $cpu[$x] = round($y / $total * 100, 1); |
|
| 35 | + } |
|
| 34 | 36 | |
| 35 | 37 | return $cpu; |
| 36 | 38 | } |
@@ -12,10 +12,10 @@ |
||
| 12 | 12 | <?php if(!isset($_SESSION['siteusername'])) { header("Location: /sign_in"); } ?> |
| 13 | 13 | <?php if(!$__user_h->if_admin($_SESSION['siteusername'])) { header("Location: /"); } ?> |
| 14 | 14 | <?php |
| 15 | - $__server->page_embeds->page_title = "SubRocks - Ban User"; |
|
| 16 | - $__server->page_embeds->page_description = "SubRocks is a site dedicated to bring back the 2012 layout of YouTube."; |
|
| 17 | - $__server->page_embeds->page_image = "/yt/imgbin/full-size-logo.png"; |
|
| 18 | - $__server->page_embeds->page_url = "https://subrock.rocks/"; |
|
| 15 | + $__server->page_embeds->page_title = "SubRocks - Ban User"; |
|
| 16 | + $__server->page_embeds->page_description = "SubRocks is a site dedicated to bring back the 2012 layout of YouTube."; |
|
| 17 | + $__server->page_embeds->page_image = "/yt/imgbin/full-size-logo.png"; |
|
| 18 | + $__server->page_embeds->page_url = "https://subrock.rocks/"; |
|
| 19 | 19 | ?> |
| 20 | 20 | <!DOCTYPE html> |
| 21 | 21 | <html dir="ltr"> |
@@ -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."; |
@@ -25,21 +25,21 @@ discard block |
||
| 25 | 25 | return preg_replace('/[^A-Za-z0-9\-]/', '', $string); // Removes special chars. |
| 26 | 26 | } |
| 27 | 27 | |
| 28 | - function addhttp($url) { |
|
| 29 | - if (!preg_match("~^(?:f|ht)tps?://~i", $url)) { |
|
| 30 | - $url = "http://" . $url; |
|
| 31 | - } |
|
| 32 | - return $url; |
|
| 33 | - } |
|
| 28 | + function addhttp($url) { |
|
| 29 | + if (!preg_match("~^(?:f|ht)tps?://~i", $url)) { |
|
| 30 | + $url = "http://" . $url; |
|
| 31 | + } |
|
| 32 | + return $url; |
|
| 33 | + } |
|
| 34 | 34 | |
| 35 | 35 | function check_valid_colorhex($colorCode) { |
| 36 | 36 | // If user accidentally passed along the # sign, strip it off |
| 37 | 37 | $colorCode = ltrim($colorCode, '#'); |
| 38 | 38 | |
| 39 | 39 | if ( |
| 40 | - ctype_xdigit($colorCode) && |
|
| 40 | + ctype_xdigit($colorCode) && |
|
| 41 | 41 | (strlen($colorCode) == 6 || strlen($colorCode) == 3)) |
| 42 | - return true; |
|
| 42 | + return true; |
|
| 43 | 43 | |
| 44 | 44 | else return false; |
| 45 | 45 | } |
@@ -64,7 +64,7 @@ discard block |
||
| 64 | 64 | $_user['2009_bgcolor'] = substr($_user['2009_bgcolor'], 0, 7); |
| 65 | 65 | |
| 66 | 66 | $_user['genre'] = strtolower($_user['genre']); |
| 67 | - $_user['subscribed'] = $__user_h->if_subscribed(@$_SESSION['siteusername'], $_user['username']); |
|
| 67 | + $_user['subscribed'] = $__user_h->if_subscribed(@$_SESSION['siteusername'], $_user['username']); |
|
| 68 | 68 | |
| 69 | 69 | if(!check_valid_colorhex($_user['primary_color']) && strlen($_user['primary_color']) != 6) { $_user['primary_color'] = ""; } |
| 70 | 70 | if(!check_valid_colorhex($_user['secondary_color']) && strlen($_user['secondary_color']) != 6) { $_user['secondary_color'] = ""; } |
@@ -73,8 +73,8 @@ discard block |
||
| 73 | 73 | if(!check_valid_colorhex($_user['primary_color_text']) && strlen($_user['primary_color_text']) != 6) { $_user['primary_color_text'] = ""; } |
| 74 | 74 | if(!check_valid_colorhex($_user['2009_bgcolor']) && strlen($_user['2009_bgcolor']) != 6) { $_user['2009_bgcolor'] = ""; } |
| 75 | 75 | |
| 76 | - if(isset($_SESSION['siteusername'])) |
|
| 77 | - $__user_i->check_view_channel($_user['username'], @$_SESSION['siteusername']); |
|
| 76 | + if(isset($_SESSION['siteusername'])) |
|
| 77 | + $__user_i->check_view_channel($_user['username'], @$_SESSION['siteusername']); |
|
| 78 | 78 | |
| 79 | 79 | if($_SERVER['REQUEST_METHOD'] == 'POST') { |
| 80 | 80 | $error = array(); |
@@ -88,11 +88,11 @@ discard block |
||
| 88 | 88 | //if(ifBlocked(@$_SESSION['siteusername'], $user['username'], $__db)) { $error = "This user has blocked you!"; $error['status'] = true; } |
| 89 | 89 | |
| 90 | 90 | if(!isset($error['message'])) { |
| 91 | - $text = $_POST['comment']; |
|
| 91 | + $text = $_POST['comment']; |
|
| 92 | 92 | $stmt = $__db->prepare("INSERT INTO profile_comments (toid, author, comment) VALUES (:id, :username, :comment)"); |
| 93 | - $stmt->bindParam(":id", $_user['username']); |
|
| 94 | - $stmt->bindParam(":username", $_SESSION['siteusername']); |
|
| 95 | - $stmt->bindParam(":comment", $text); |
|
| 93 | + $stmt->bindParam(":id", $_user['username']); |
|
| 94 | + $stmt->bindParam(":username", $_SESSION['siteusername']); |
|
| 95 | + $stmt->bindParam(":comment", $text); |
|
| 96 | 96 | $stmt->execute(); |
| 97 | 97 | |
| 98 | 98 | $_user_update_utils->update_comment_cooldown_time($_SESSION['siteusername']); |
@@ -104,10 +104,10 @@ discard block |
||
| 104 | 104 | } |
| 105 | 105 | ?> |
| 106 | 106 | <?php |
| 107 | - $__server->page_embeds->page_title = "SubRocks - " . htmlspecialchars($_playlist['title']); |
|
| 108 | - $__server->page_embeds->page_description = htmlspecialchars($_playlist['description']); |
|
| 109 | - $__server->page_embeds->page_image = "/yt/imgbin/full-size-logo.png"; |
|
| 110 | - $__server->page_embeds->page_url = "https://subrock.rocks/"; |
|
| 107 | + $__server->page_embeds->page_title = "SubRocks - " . htmlspecialchars($_playlist['title']); |
|
| 108 | + $__server->page_embeds->page_description = htmlspecialchars($_playlist['description']); |
|
| 109 | + $__server->page_embeds->page_image = "/yt/imgbin/full-size-logo.png"; |
|
| 110 | + $__server->page_embeds->page_url = "https://subrock.rocks/"; |
|
| 111 | 111 | ?> |
| 112 | 112 | <!DOCTYPE html> |
| 113 | 113 | <html dir="ltr" xmlns:og="http://opengraphprotocol.org/schema/" lang="en"> |
@@ -135,27 +135,27 @@ discard block |
||
| 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']) { |
|
| 139 | - case "stretch": |
|
| 140 | - echo "background-size: cover;"; |
|
| 141 | - break; |
|
| 142 | - case "solid": |
|
| 143 | - echo ""; |
|
| 144 | - break; |
|
| 145 | - case "norepeat": |
|
| 146 | - echo "background-repeat: no-repeat !important;"; |
|
| 147 | - break; |
|
| 148 | - case "repeatxy": |
|
| 149 | - echo "background-repeat: repeat;"; |
|
| 150 | - break; |
|
| 151 | - case "repeaty": |
|
| 152 | - echo "background-repeat: repeat-y;"; |
|
| 153 | - break; |
|
| 154 | - case "repeatx": |
|
| 155 | - echo "background-repeat: repeat-x;"; |
|
| 156 | - break; |
|
| 157 | - } |
|
| 158 | - ?> |
|
| 138 | + switch($_user['2012_bgoption']) { |
|
| 139 | + case "stretch": |
|
| 140 | + echo "background-size: cover;"; |
|
| 141 | + break; |
|
| 142 | + case "solid": |
|
| 143 | + echo ""; |
|
| 144 | + break; |
|
| 145 | + case "norepeat": |
|
| 146 | + echo "background-repeat: no-repeat !important;"; |
|
| 147 | + break; |
|
| 148 | + case "repeatxy": |
|
| 149 | + echo "background-repeat: repeat;"; |
|
| 150 | + break; |
|
| 151 | + case "repeaty": |
|
| 152 | + echo "background-repeat: repeat-y;"; |
|
| 153 | + break; |
|
| 154 | + case "repeatx": |
|
| 155 | + echo "background-repeat: repeat-x;"; |
|
| 156 | + break; |
|
| 157 | + } |
|
| 158 | + ?> |
|
| 159 | 159 | } |
| 160 | 160 | </style> |
| 161 | 161 | </head> |
@@ -172,9 +172,9 @@ discard block |
||
| 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']))) |
|
| 176 | - $_user['bio'] = "This user has no description."; |
|
| 177 | - ?> |
|
| 175 | + if(empty(trim($_user['bio']))) |
|
| 176 | + $_user['bio'] = "This user has no description."; |
|
| 177 | + ?> |
|
| 178 | 178 | <div id="content"> |
| 179 | 179 | <div class="subscription-menu-expandable subscription-menu-expandable-channels3 yt-rounded ytg-wide hid"> |
| 180 | 180 | <div class="content" id="recommended-channels-list"></div> |
@@ -306,20 +306,20 @@ discard block |
||
| 306 | 306 | </div> |
| 307 | 307 | <ol> |
| 308 | 308 | <?php |
| 309 | - $_playlist['videos'] = json_decode($_playlist['videos']); |
|
| 310 | - $_playlist['count'] = 1; |
|
| 311 | - foreach($_playlist['videos'] as $video) { |
|
| 312 | - if($__video_h->video_exists($video)) { |
|
| 313 | - $_video = $__video_h->fetch_video_rid($video); |
|
| 314 | - $_video['video_responses'] = $__video_h->get_video_responses($_video['rid']); |
|
| 315 | - $_video['age'] = $__time_h->time_elapsed_string($_video['publish']); |
|
| 316 | - $_video['duration'] = $__time_h->timestamp($_video['duration']); |
|
| 317 | - $_video['views'] = $__video_h->fetch_video_views($_video['rid']); |
|
| 318 | - $_video['author'] = htmlspecialchars($_video['author']); |
|
| 319 | - $_video['title'] = htmlspecialchars($_video['title']); |
|
| 320 | - $_video['description'] = $__video_h->shorten_description($_video['description'], 50); |
|
| 321 | - $_playlist['title'] = htmlspecialchars($_playlist['title']); |
|
| 322 | - ?> |
|
| 309 | + $_playlist['videos'] = json_decode($_playlist['videos']); |
|
| 310 | + $_playlist['count'] = 1; |
|
| 311 | + foreach($_playlist['videos'] as $video) { |
|
| 312 | + if($__video_h->video_exists($video)) { |
|
| 313 | + $_video = $__video_h->fetch_video_rid($video); |
|
| 314 | + $_video['video_responses'] = $__video_h->get_video_responses($_video['rid']); |
|
| 315 | + $_video['age'] = $__time_h->time_elapsed_string($_video['publish']); |
|
| 316 | + $_video['duration'] = $__time_h->timestamp($_video['duration']); |
|
| 317 | + $_video['views'] = $__video_h->fetch_video_views($_video['rid']); |
|
| 318 | + $_video['author'] = htmlspecialchars($_video['author']); |
|
| 319 | + $_video['title'] = htmlspecialchars($_video['title']); |
|
| 320 | + $_video['description'] = $__video_h->shorten_description($_video['description'], 50); |
|
| 321 | + $_playlist['title'] = htmlspecialchars($_playlist['title']); |
|
| 322 | + ?> |
|
| 323 | 323 | <li class="playlist-video-item |
| 324 | 324 | odd |
| 325 | 325 | "> |
@@ -477,9 +477,9 @@ discard block |
||
| 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)) { |
|
| 482 | - ?> |
|
| 480 | + foreach($_user['featured_channels'] as $user) { |
|
| 481 | + if($__user_h->user_exists($user)) { |
|
| 482 | + ?> |
|
| 483 | 483 | <li class="yt-tile-visible yt-uix-tile"> |
| 484 | 484 | <div class="channel-summary clearfix channel-summary-compact"> |
| 485 | 485 | <div class="channel-summary-thumb"> |
@@ -503,19 +503,19 @@ discard block |
||
| 503 | 503 | </div> |
| 504 | 504 | |
| 505 | 505 | <?php |
| 506 | - $stmt = $__db->prepare("SELECT * FROM playlists WHERE author = :search ORDER BY id DESC LIMIT 10"); |
|
| 507 | - $stmt->bindParam(":search", $_user['username']); |
|
| 508 | - $stmt->execute(); |
|
| 506 | + $stmt = $__db->prepare("SELECT * FROM playlists WHERE author = :search ORDER BY id DESC LIMIT 10"); |
|
| 507 | + $stmt->bindParam(":search", $_user['username']); |
|
| 508 | + $stmt->execute(); |
|
| 509 | 509 | |
| 510 | - if($stmt->rowCount() != 0) { |
|
| 511 | - ?> |
|
| 510 | + if($stmt->rowCount() != 0) { |
|
| 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)) { |
|
| 517 | - $playlist['videos'] = json_decode($playlist['videos']); |
|
| 518 | - ?> |
|
| 516 | + while($playlist = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
| 517 | + $playlist['videos'] = json_decode($playlist['videos']); |
|
| 518 | + ?> |
|
| 519 | 519 | <div class="playlist yt-tile-visible yt-uix-tile"> |
| 520 | 520 | <a href="/view_playlist?v=<?php echo $playlist['rid']; ?>"> |
| 521 | 521 | <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"> |
@@ -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,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 | } |
@@ -75,8 +75,8 @@ discard block |
||
| 75 | 75 | if(!check_valid_colorhex($_user['primary_color_text']) && strlen($_user['primary_color_text']) != 6) { $_user['primary_color_text'] = ""; } |
| 76 | 76 | if(!check_valid_colorhex($_user['2009_bgcolor']) && strlen($_user['2009_bgcolor']) != 6) { $_user['2009_bgcolor'] = ""; } |
| 77 | 77 | |
| 78 | - if(isset($_SESSION['siteusername'])) |
|
| 79 | - $__user_i->check_view_channel($_user['username'], @$_SESSION['siteusername']); |
|
| 78 | + if(isset($_SESSION['siteusername'])) |
|
| 79 | + $__user_i->check_view_channel($_user['username'], @$_SESSION['siteusername']); |
|
| 80 | 80 | |
| 81 | 81 | if($_SERVER['REQUEST_METHOD'] == 'POST') { |
| 82 | 82 | $error = array(); |
@@ -90,11 +90,11 @@ discard block |
||
| 90 | 90 | //if(ifBlocked(@$_SESSION['siteusername'], $user['username'], $__db)) { $error = "This user has blocked you!"; $error['status'] = true; } |
| 91 | 91 | |
| 92 | 92 | if(!isset($error['message'])) { |
| 93 | - $text = $_POST['comment']; |
|
| 93 | + $text = $_POST['comment']; |
|
| 94 | 94 | $stmt = $__db->prepare("INSERT INTO profile_comments (toid, author, comment) VALUES (:id, :username, :comment)"); |
| 95 | - $stmt->bindParam(":id", $_user['username']); |
|
| 96 | - $stmt->bindParam(":username", $_SESSION['siteusername']); |
|
| 97 | - $stmt->bindParam(":comment", $text); |
|
| 95 | + $stmt->bindParam(":id", $_user['username']); |
|
| 96 | + $stmt->bindParam(":username", $_SESSION['siteusername']); |
|
| 97 | + $stmt->bindParam(":comment", $text); |
|
| 98 | 98 | $stmt->execute(); |
| 99 | 99 | |
| 100 | 100 | $_user_update_utils->update_comment_cooldown_time($_SESSION['siteusername']); |
@@ -106,10 +106,10 @@ discard block |
||
| 106 | 106 | } |
| 107 | 107 | ?> |
| 108 | 108 | <?php |
| 109 | - $__server->page_embeds->page_title = "SubRocks - " . htmlspecialchars($_user['username']); |
|
| 110 | - $__server->page_embeds->page_description = htmlspecialchars($_user['bio']); |
|
| 111 | - $__server->page_embeds->page_image = "/dynamic/pfp/" . htmlspecialchars($_user['pfp']); |
|
| 112 | - $__server->page_embeds->page_url = "https://subrock.rocks/"; |
|
| 109 | + $__server->page_embeds->page_title = "SubRocks - " . htmlspecialchars($_user['username']); |
|
| 110 | + $__server->page_embeds->page_description = htmlspecialchars($_user['bio']); |
|
| 111 | + $__server->page_embeds->page_image = "/dynamic/pfp/" . htmlspecialchars($_user['pfp']); |
|
| 112 | + $__server->page_embeds->page_url = "https://subrock.rocks/"; |
|
| 113 | 113 | ?> |
| 114 | 114 | <!DOCTYPE html> |
| 115 | 115 | <html dir="ltr" xmlns:og="http://opengraphprotocol.org/schema/" lang="en"> |
@@ -137,27 +137,27 @@ discard block |
||
| 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']) { |
|
| 141 | - case "stretch": |
|
| 142 | - echo "background-size: cover;"; |
|
| 143 | - break; |
|
| 144 | - case "solid": |
|
| 145 | - echo ""; |
|
| 146 | - break; |
|
| 147 | - case "norepeat": |
|
| 148 | - echo "background-repeat: no-repeat !important;"; |
|
| 149 | - break; |
|
| 150 | - case "repeatxy": |
|
| 151 | - echo "background-repeat: repeat;"; |
|
| 152 | - break; |
|
| 153 | - case "repeaty": |
|
| 154 | - echo "background-repeat: repeat-y;"; |
|
| 155 | - break; |
|
| 156 | - case "repeatx": |
|
| 157 | - echo "background-repeat: repeat-x;"; |
|
| 158 | - break; |
|
| 159 | - } |
|
| 160 | - ?> |
|
| 140 | + switch($_user['2012_bgoption']) { |
|
| 141 | + case "stretch": |
|
| 142 | + echo "background-size: cover;"; |
|
| 143 | + break; |
|
| 144 | + case "solid": |
|
| 145 | + echo ""; |
|
| 146 | + break; |
|
| 147 | + case "norepeat": |
|
| 148 | + echo "background-repeat: no-repeat !important;"; |
|
| 149 | + break; |
|
| 150 | + case "repeatxy": |
|
| 151 | + echo "background-repeat: repeat;"; |
|
| 152 | + break; |
|
| 153 | + case "repeaty": |
|
| 154 | + echo "background-repeat: repeat-y;"; |
|
| 155 | + break; |
|
| 156 | + case "repeatx": |
|
| 157 | + echo "background-repeat: repeat-x;"; |
|
| 158 | + break; |
|
| 159 | + } |
|
| 160 | + ?> |
|
| 161 | 161 | } |
| 162 | 162 | </style> |
| 163 | 163 | </head> |
@@ -174,9 +174,9 @@ discard block |
||
| 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']))) |
|
| 178 | - $_user['bio'] = "This user has no description."; |
|
| 179 | - ?> |
|
| 177 | + if(empty(trim($_user['bio']))) |
|
| 178 | + $_user['bio'] = "This user has no description."; |
|
| 179 | + ?> |
|
| 180 | 180 | <div id="content"> |
| 181 | 181 | <div class="subscription-menu-expandable subscription-menu-expandable-channels3 yt-rounded ytg-wide hid"> |
| 182 | 182 | <div class="content" id="recommended-channels-list"></div> |
@@ -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>'; |
@@ -31,8 +31,9 @@ |
||
| 31 | 31 | $stmt->execute(); |
| 32 | 32 | |
| 33 | 33 | $__user_u->update_cooldown_time($_SESSION['siteusername'], "cooldown_comment"); |
| 34 | - if(@$_SESSION['siteusername'] != $_video['author']) |
|
| 35 | - $__user_i->send_message($_SESSION['siteusername'], "New comment", $_video['author'], "I commented \"" . $_POST['comment'] . "\" on your video!", $_video['rid'], "nt"); |
|
| 34 | + if(@$_SESSION['siteusername'] != $_video['author']) { |
|
| 35 | + $__user_i->send_message($_SESSION['siteusername'], "New comment", $_video['author'], "I commented \"" . $_POST['comment'] . "\" on your video!", $_video['rid'], "nt"); |
|
| 36 | + } |
|
| 36 | 37 | } |
| 37 | 38 | } |
| 38 | 39 | |
@@ -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 | } |
@@ -75,8 +75,8 @@ discard block |
||
| 75 | 75 | if(!check_valid_colorhex($_user['primary_color_text']) && strlen($_user['primary_color_text']) != 6) { $_user['primary_color_text'] = ""; } |
| 76 | 76 | if(!check_valid_colorhex($_user['2009_bgcolor']) && strlen($_user['2009_bgcolor']) != 6) { $_user['2009_bgcolor'] = ""; } |
| 77 | 77 | |
| 78 | - if(isset($_SESSION['siteusername'])) |
|
| 79 | - $__user_i->check_view_channel($_user['username'], @$_SESSION['siteusername']); |
|
| 78 | + if(isset($_SESSION['siteusername'])) |
|
| 79 | + $__user_i->check_view_channel($_user['username'], @$_SESSION['siteusername']); |
|
| 80 | 80 | |
| 81 | 81 | if($_SERVER['REQUEST_METHOD'] == 'POST') { |
| 82 | 82 | $error = array(); |
@@ -90,11 +90,11 @@ discard block |
||
| 90 | 90 | //if(ifBlocked(@$_SESSION['siteusername'], $user['username'], $__db)) { $error = "This user has blocked you!"; $error['status'] = true; } |
| 91 | 91 | |
| 92 | 92 | if(!isset($error['message'])) { |
| 93 | - $text = $_POST['comment']; |
|
| 93 | + $text = $_POST['comment']; |
|
| 94 | 94 | $stmt = $__db->prepare("INSERT INTO profile_comments (toid, author, comment) VALUES (:id, :username, :comment)"); |
| 95 | - $stmt->bindParam(":id", $_user['username']); |
|
| 96 | - $stmt->bindParam(":username", $_SESSION['siteusername']); |
|
| 97 | - $stmt->bindParam(":comment", $text); |
|
| 95 | + $stmt->bindParam(":id", $_user['username']); |
|
| 96 | + $stmt->bindParam(":username", $_SESSION['siteusername']); |
|
| 97 | + $stmt->bindParam(":comment", $text); |
|
| 98 | 98 | $stmt->execute(); |
| 99 | 99 | |
| 100 | 100 | $_user_update_utils->update_comment_cooldown_time($_SESSION['siteusername']); |
@@ -106,10 +106,10 @@ discard block |
||
| 106 | 106 | } |
| 107 | 107 | ?> |
| 108 | 108 | <?php |
| 109 | - $__server->page_embeds->page_title = "SubRocks - " . htmlspecialchars($_user['username']); |
|
| 110 | - $__server->page_embeds->page_description = htmlspecialchars($_user['bio']); |
|
| 111 | - $__server->page_embeds->page_image = "/dynamic/pfp/" . htmlspecialchars($_user['pfp']); |
|
| 112 | - $__server->page_embeds->page_url = "https://subrock.rocks/"; |
|
| 109 | + $__server->page_embeds->page_title = "SubRocks - " . htmlspecialchars($_user['username']); |
|
| 110 | + $__server->page_embeds->page_description = htmlspecialchars($_user['bio']); |
|
| 111 | + $__server->page_embeds->page_image = "/dynamic/pfp/" . htmlspecialchars($_user['pfp']); |
|
| 112 | + $__server->page_embeds->page_url = "https://subrock.rocks/"; |
|
| 113 | 113 | ?> |
| 114 | 114 | <!DOCTYPE html> |
| 115 | 115 | <html dir="ltr" xmlns:og="http://opengraphprotocol.org/schema/" lang="en"> |
@@ -137,27 +137,27 @@ discard block |
||
| 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']) { |
|
| 141 | - case "stretch": |
|
| 142 | - echo "background-size: cover;"; |
|
| 143 | - break; |
|
| 144 | - case "solid": |
|
| 145 | - echo ""; |
|
| 146 | - break; |
|
| 147 | - case "norepeat": |
|
| 148 | - echo "background-repeat: no-repeat !important;"; |
|
| 149 | - break; |
|
| 150 | - case "repeatxy": |
|
| 151 | - echo "background-repeat: repeat;"; |
|
| 152 | - break; |
|
| 153 | - case "repeaty": |
|
| 154 | - echo "background-repeat: repeat-y;"; |
|
| 155 | - break; |
|
| 156 | - case "repeatx": |
|
| 157 | - echo "background-repeat: repeat-x;"; |
|
| 158 | - break; |
|
| 159 | - } |
|
| 160 | - ?> |
|
| 140 | + switch($_user['2012_bgoption']) { |
|
| 141 | + case "stretch": |
|
| 142 | + echo "background-size: cover;"; |
|
| 143 | + break; |
|
| 144 | + case "solid": |
|
| 145 | + echo ""; |
|
| 146 | + break; |
|
| 147 | + case "norepeat": |
|
| 148 | + echo "background-repeat: no-repeat !important;"; |
|
| 149 | + break; |
|
| 150 | + case "repeatxy": |
|
| 151 | + echo "background-repeat: repeat;"; |
|
| 152 | + break; |
|
| 153 | + case "repeaty": |
|
| 154 | + echo "background-repeat: repeat-y;"; |
|
| 155 | + break; |
|
| 156 | + case "repeatx": |
|
| 157 | + echo "background-repeat: repeat-x;"; |
|
| 158 | + break; |
|
| 159 | + } |
|
| 160 | + ?> |
|
| 161 | 161 | } |
| 162 | 162 | </style> |
| 163 | 163 | </head> |
@@ -330,17 +330,17 @@ discard block |
||
| 330 | 330 | <div class="channel-filtered-content"> |
| 331 | 331 | <ol class="channel-videos-list"> |
| 332 | 332 | <?php |
| 333 | - $stmt = $__db->prepare("SELECT * FROM videos WHERE author = :username ORDER BY id DESC"); |
|
| 334 | - $stmt->bindParam(":username", $_user['username']); |
|
| 335 | - $stmt->execute(); |
|
| 336 | - while($video = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
| 337 | - $video['age'] = $__time_h->time_elapsed_string($video['publish']); |
|
| 338 | - $video['duration'] = $__time_h->timestamp($video['duration']); |
|
| 339 | - $video['views'] = $__video_h->fetch_video_views($video['rid']); |
|
| 340 | - $video['author'] = htmlspecialchars($video['author']); |
|
| 341 | - $video['title'] = htmlspecialchars($video['title']); |
|
| 342 | - $video['description'] = $__video_h->shorten_description($video['description'], 50); |
|
| 343 | - ?> |
|
| 333 | + $stmt = $__db->prepare("SELECT * FROM videos WHERE author = :username ORDER BY id DESC"); |
|
| 334 | + $stmt->bindParam(":username", $_user['username']); |
|
| 335 | + $stmt->execute(); |
|
| 336 | + while($video = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
| 337 | + $video['age'] = $__time_h->time_elapsed_string($video['publish']); |
|
| 338 | + $video['duration'] = $__time_h->timestamp($video['duration']); |
|
| 339 | + $video['views'] = $__video_h->fetch_video_views($video['rid']); |
|
| 340 | + $video['author'] = htmlspecialchars($video['author']); |
|
| 341 | + $video['title'] = htmlspecialchars($video['title']); |
|
| 342 | + $video['description'] = $__video_h->shorten_description($video['description'], 50); |
|
| 343 | + ?> |
|
| 344 | 344 | <li class="yt-c3-grid-item"> |
| 345 | 345 | <a href="/watch?v=<?php echo htmlspecialchars($video['rid']); ?>" class="ux-thumb-wrap yt-uix-sessionlink yt-uix-contextlink contains-addto " data-sessionlink="feature=plcp&context=C4e80d7cVDvjVQa1PpcFPHxNkhfeSQg8_nJHnhVurQf82C2OenNiw%3D"><span class="video-thumb ux-thumb yt-thumb-default-234 "><span class="yt-thumb-clip"><span class="yt-thumb-clip-inner"><img src="/dynamic/thumbs/<?php echo $video['thumbnail']; ?>" alt="Thumbnail" onerror="this.onerror=null;this.src='/dynamic/thumbs/default.jpg';" width="234"><span class="vertical-align"></span></span></span></span><span class="video-time"><?php echo $video['duration']; ?></span> |
| 346 | 346 | <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="yBlvNSfqAj0" role="button"><span class="yt-uix-button-content"> <img src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" alt="Watch Later"> |
@@ -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']); |