@@ -8,10 +8,10 @@ |
||
| 8 | 8 | <?php $__db_h = new db_helper(); ?> |
| 9 | 9 | <?php $__time_h = new time_helper(); ?> |
| 10 | 10 | <?php |
| 11 | - $__server->page_embeds->page_title = "SubRocks - Edit Video"; |
|
| 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 - Edit Video"; |
|
| 12 | + $__server->page_embeds->page_description = "SubRocks is a site dedicated to bring back the 2012 layout of YouTube."; |
|
| 13 | + $__server->page_embeds->page_image = "/yt/imgbin/full-size-logo.png"; |
|
| 14 | + $__server->page_embeds->page_url = "https://subrock.rocks/"; |
|
| 15 | 15 | ?> |
| 16 | 16 | <?php if(!isset($_SESSION['siteusername'])) { header("Location: /sign_in"); } ?> |
| 17 | 17 | <?php $_playlist = $__video_h->fetch_playlist_rid($_GET['id']); ?> |
@@ -13,7 +13,7 @@ |
||
| 13 | 13 | $__server->page_embeds->page_image = "/yt/imgbin/full-size-logo.png"; |
| 14 | 14 | $__server->page_embeds->page_url = "https://subrock.rocks/"; |
| 15 | 15 | ?> |
| 16 | -<?php if(!isset($_SESSION['siteusername'])) { header("Location: /sign_in"); } ?> |
|
| 16 | +<?php if (!isset($_SESSION['siteusername'])) { header("Location: /sign_in"); } ?> |
|
| 17 | 17 | <?php $_playlist = $__video_h->fetch_playlist_rid($_GET['id']); ?> |
| 18 | 18 | <!DOCTYPE html> |
| 19 | 19 | <html dir="ltr"> |
@@ -15,10 +15,10 @@ 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(isset($_SESSION['siteusername'])) |
|
| 19 | - $__video_h->check_view($_GET['v'], @$_SESSION['siteusername']); |
|
| 18 | + if(isset($_SESSION['siteusername'])) |
|
| 19 | + $__video_h->check_view($_GET['v'], @$_SESSION['siteusername']); |
|
| 20 | 20 | |
| 21 | - $_SESSION['current_video'] = $_video['rid']; |
|
| 21 | + $_SESSION['current_video'] = $_video['rid']; |
|
| 22 | 22 | if($_SERVER['REQUEST_METHOD'] == 'POST') { |
| 23 | 23 | $error = array(); |
| 24 | 24 | |
@@ -28,33 +28,33 @@ discard block |
||
| 28 | 28 | 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; } |
| 29 | 29 | |
| 30 | 30 | if(!isset($error['message'])) { |
| 31 | - $text = $_POST['comment']; |
|
| 31 | + $text = $_POST['comment']; |
|
| 32 | 32 | $stmt = $__db->prepare("INSERT INTO comments (toid, author, comment) VALUES (:v, :username, :comment)"); |
| 33 | 33 | $stmt->bindParam(":v", $_GET['v']); |
| 34 | - $stmt->bindParam(":username", $_SESSION['siteusername']); |
|
| 35 | - $stmt->bindParam(":comment", $text); |
|
| 34 | + $stmt->bindParam(":username", $_SESSION['siteusername']); |
|
| 35 | + $stmt->bindParam(":comment", $text); |
|
| 36 | 36 | $stmt->execute(); |
| 37 | 37 | |
| 38 | - $__user_u->update_cooldown_time($_SESSION['siteusername'], "cooldown_comment"); |
|
| 39 | - $__user_i->send_message($_SESSION['siteusername'], "New comment", $_video['author'], "I commented \"" . $_POST['comment'] . "\" on your video!", $_video['rid'], "nt"); |
|
| 38 | + $__user_u->update_cooldown_time($_SESSION['siteusername'], "cooldown_comment"); |
|
| 39 | + $__user_i->send_message($_SESSION['siteusername'], "New comment", $_video['author'], "I commented \"" . $_POST['comment'] . "\" on your video!", $_video['rid'], "nt"); |
|
| 40 | 40 | } |
| 41 | 41 | } |
| 42 | 42 | |
| 43 | - /* |
|
| 43 | + /* |
|
| 44 | 44 | PREPARE EMBEDS CLASS -- function(string $page_title, string $page_description...) |
| 45 | 45 | Returns a list of arrays for compatibility purposes & but downside is ugly for loop codes |
| 46 | 46 | Work on this tomorrow or some shit idk lol |
| 47 | 47 | */ |
| 48 | 48 | |
| 49 | - /* |
|
| 49 | + /* |
|
| 50 | 50 | USE THE GOD DAMN __CONFIG MORE -- idiot |
| 51 | 51 | Work on this tomorrow or some shit |
| 52 | 52 | */ |
| 53 | 53 | |
| 54 | - $__server->page_embeds->page_title = htmlspecialchars($_video['title']); |
|
| 55 | - $__server->page_embeds->page_description = htmlspecialchars($_video['description']); |
|
| 56 | - $__server->page_embeds->page_image = "/dynamic/thumbs/" . $_video['thumbnail']; |
|
| 57 | - $__server->page_embeds->page_url = "https://subrock.rocks/watch?v=" . htmlspecialchars($_video['rid']); |
|
| 54 | + $__server->page_embeds->page_title = htmlspecialchars($_video['title']); |
|
| 55 | + $__server->page_embeds->page_description = htmlspecialchars($_video['description']); |
|
| 56 | + $__server->page_embeds->page_image = "/dynamic/thumbs/" . $_video['thumbnail']; |
|
| 57 | + $__server->page_embeds->page_url = "https://subrock.rocks/watch?v=" . htmlspecialchars($_video['rid']); |
|
| 58 | 58 | ?> |
| 59 | 59 | <!DOCTYPE html> |
| 60 | 60 | <html> |
@@ -84,29 +84,29 @@ discard block |
||
| 84 | 84 | if (window.yt.timing) {yt.timing.tick("ct");} |
| 85 | 85 | </script> |
| 86 | 86 | <?php |
| 87 | - $_video['dislikes'] = $__video_h->get_video_stars_level($_video['rid'], 1); |
|
| 88 | - $_video['dislikes'] += $__video_h->get_video_stars_level($_video['rid'], 2); |
|
| 87 | + $_video['dislikes'] = $__video_h->get_video_stars_level($_video['rid'], 1); |
|
| 88 | + $_video['dislikes'] += $__video_h->get_video_stars_level($_video['rid'], 2); |
|
| 89 | 89 | |
| 90 | - $_video['likes'] = $__video_h->get_video_stars_level($_video['rid'], 4); |
|
| 91 | - $_video['likes'] += $__video_h->get_video_stars_level($_video['rid'], 5); |
|
| 90 | + $_video['likes'] = $__video_h->get_video_stars_level($_video['rid'], 4); |
|
| 91 | + $_video['likes'] += $__video_h->get_video_stars_level($_video['rid'], 5); |
|
| 92 | 92 | |
| 93 | - $_video['dislikes'] += $__video_h->get_video_likes($_video['rid'], false); |
|
| 94 | - $_video['likes'] += $__video_h->get_video_likes($_video['rid'], true); |
|
| 93 | + $_video['dislikes'] += $__video_h->get_video_likes($_video['rid'], false); |
|
| 94 | + $_video['likes'] += $__video_h->get_video_likes($_video['rid'], true); |
|
| 95 | 95 | |
| 96 | - if($_video['likes'] == 0 && $_video['dislikes'] == 0) { |
|
| 97 | - $_video['likeswidth'] = 0; |
|
| 98 | - $_video['dislikeswidth'] = 0; |
|
| 99 | - } else { |
|
| 100 | - $_video['likeswidth'] = $_video['likes'] / ($_video['likes'] + $_video['dislikes']) * 100; |
|
| 101 | - $_video['dislikeswidth'] = 100 - $_video['likeswidth']; |
|
| 102 | - } |
|
| 96 | + if($_video['likes'] == 0 && $_video['dislikes'] == 0) { |
|
| 97 | + $_video['likeswidth'] = 0; |
|
| 98 | + $_video['dislikeswidth'] = 0; |
|
| 99 | + } else { |
|
| 100 | + $_video['likeswidth'] = $_video['likes'] / ($_video['likes'] + $_video['dislikes']) * 100; |
|
| 101 | + $_video['dislikeswidth'] = 100 - $_video['likeswidth']; |
|
| 102 | + } |
|
| 103 | 103 | |
| 104 | - $_video['liked'] = $__video_h->if_liked(@$_SESSION['siteusername'], $_video['rid'], true); |
|
| 105 | - $_video['disliked'] = $__video_h->if_liked(@$_SESSION['siteusername'], $_video['rid'], false); |
|
| 106 | - $_video['author_videos'] = $__video_h->fetch_user_videos($_video['author']); |
|
| 107 | - $_video['subscribed'] = $__user_h->if_subscribed(@$_SESSION['siteusername'], $_video['author']); |
|
| 108 | - $_video['favorited'] = $__video_h->if_favorited(@$_SESSION['siteusername'], $_video['rid']); |
|
| 109 | - ?> |
|
| 104 | + $_video['liked'] = $__video_h->if_liked(@$_SESSION['siteusername'], $_video['rid'], true); |
|
| 105 | + $_video['disliked'] = $__video_h->if_liked(@$_SESSION['siteusername'], $_video['rid'], false); |
|
| 106 | + $_video['author_videos'] = $__video_h->fetch_user_videos($_video['author']); |
|
| 107 | + $_video['subscribed'] = $__user_h->if_subscribed(@$_SESSION['siteusername'], $_video['author']); |
|
| 108 | + $_video['favorited'] = $__video_h->if_favorited(@$_SESSION['siteusername'], $_video['rid']); |
|
| 109 | + ?> |
|
| 110 | 110 | </head> |
| 111 | 111 | <body id="" class="date-20120927 en_US ltr ytg-old-clearfix guide-feed-v2 gecko gecko-15" dir="ltr"> |
| 112 | 112 | <form name="logoutForm" method="POST" action="/logout"> |
@@ -328,21 +328,21 @@ discard block |
||
| 328 | 328 | <hr><br> |
| 329 | 329 | <h3>Add to a Playlist</h3> |
| 330 | 330 | <?php |
| 331 | - $stmt = $__db->prepare("SELECT * FROM playlists WHERE author = :username ORDER BY id DESC LIMIT 20"); |
|
| 332 | - $stmt->bindParam(":username", $_SESSION['siteusername']); |
|
| 333 | - $stmt->execute(); |
|
| 334 | - while($playlist = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
| 335 | - $buffer = json_decode($playlist['videos']); |
|
| 336 | - @$rid = $buffer[0]; |
|
| 337 | - if(!empty($rid)) { |
|
| 338 | - @$video = $__video_h->fetch_video_rid($rid); |
|
| 339 | - } else { |
|
| 340 | - $video['thumbnail'] = ""; |
|
| 341 | - $video['duration'] = 0; |
|
| 342 | - } |
|
| 331 | + $stmt = $__db->prepare("SELECT * FROM playlists WHERE author = :username ORDER BY id DESC LIMIT 20"); |
|
| 332 | + $stmt->bindParam(":username", $_SESSION['siteusername']); |
|
| 333 | + $stmt->execute(); |
|
| 334 | + while($playlist = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
| 335 | + $buffer = json_decode($playlist['videos']); |
|
| 336 | + @$rid = $buffer[0]; |
|
| 337 | + if(!empty($rid)) { |
|
| 338 | + @$video = $__video_h->fetch_video_rid($rid); |
|
| 339 | + } else { |
|
| 340 | + $video['thumbnail'] = ""; |
|
| 341 | + $video['duration'] = 0; |
|
| 342 | + } |
|
| 343 | 343 | |
| 344 | - $videos = count($buffer); |
|
| 345 | - ?> |
|
| 344 | + $videos = count($buffer); |
|
| 345 | + ?> |
|
| 346 | 346 | <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> |
| 347 | 347 | <?php } ?> |
| 348 | 348 | <?php } ?> |
@@ -607,10 +607,10 @@ discard block |
||
| 607 | 607 | </div> |
| 608 | 608 | </div> |
| 609 | 609 | <?php |
| 610 | - $stmt = $__db->prepare("SELECT * FROM video_response WHERE toid = :v ORDER BY id DESC LIMIT 4"); |
|
| 611 | - $stmt->bindParam(":v", $_GET['v']); |
|
| 612 | - $stmt->execute(); |
|
| 613 | - ?> |
|
| 610 | + $stmt = $__db->prepare("SELECT * FROM video_response WHERE toid = :v ORDER BY id DESC LIMIT 4"); |
|
| 611 | + $stmt->bindParam(":v", $_GET['v']); |
|
| 612 | + $stmt->execute(); |
|
| 613 | + ?> |
|
| 614 | 614 | |
| 615 | 615 | <?php if($stmt->rowCount() != 0) { ?> |
| 616 | 616 | <div class="comments-section"> |
@@ -620,16 +620,16 @@ discard block |
||
| 620 | 620 | <h4>Video Responses</h4> |
| 621 | 621 | <ul class="video-list"> |
| 622 | 622 | <?php |
| 623 | - while($video = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
| 624 | - if($__video_h->video_exists($video['video'])) { |
|
| 625 | - $video = $__video_h->fetch_video_rid($video['video']); |
|
| 626 | - $video['age'] = $__time_h->time_elapsed_string($video['publish']); |
|
| 627 | - $video['duration'] = $__time_h->timestamp($video['duration']); |
|
| 628 | - $video['views'] = $__video_h->fetch_video_views($video['rid']); |
|
| 629 | - $video['author'] = htmlspecialchars($video['author']); |
|
| 630 | - $video['title'] = htmlspecialchars($video['title']); |
|
| 631 | - $video['description'] = $__video_h->shorten_description($video['description'], 50); |
|
| 632 | - ?> |
|
| 623 | + while($video = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
| 624 | + if($__video_h->video_exists($video['video'])) { |
|
| 625 | + $video = $__video_h->fetch_video_rid($video['video']); |
|
| 626 | + $video['age'] = $__time_h->time_elapsed_string($video['publish']); |
|
| 627 | + $video['duration'] = $__time_h->timestamp($video['duration']); |
|
| 628 | + $video['views'] = $__video_h->fetch_video_views($video['rid']); |
|
| 629 | + $video['author'] = htmlspecialchars($video['author']); |
|
| 630 | + $video['title'] = htmlspecialchars($video['title']); |
|
| 631 | + $video['description'] = $__video_h->shorten_description($video['description'], 50); |
|
| 632 | + ?> |
|
| 633 | 633 | <li class="video-list-item yt-tile-default"> |
| 634 | 634 | <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> |
| 635 | 635 | <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"> |
@@ -711,38 +711,38 @@ discard block |
||
| 711 | 711 | </div> |
| 712 | 712 | <ul class="comment-list" id="live_comments"> |
| 713 | 713 | <?php |
| 714 | - $results_per_page = 20; |
|
| 714 | + $results_per_page = 20; |
|
| 715 | 715 | |
| 716 | - $stmt = $__db->prepare("SELECT * FROM comments WHERE toid = :rid ORDER BY id DESC"); |
|
| 717 | - $stmt->bindParam(":rid", $_video['rid']); |
|
| 718 | - $stmt->execute(); |
|
| 716 | + $stmt = $__db->prepare("SELECT * FROM comments WHERE toid = :rid ORDER BY id DESC"); |
|
| 717 | + $stmt->bindParam(":rid", $_video['rid']); |
|
| 718 | + $stmt->execute(); |
|
| 719 | 719 | |
| 720 | - $number_of_result = $stmt->rowCount(); |
|
| 721 | - $number_of_page = ceil ($number_of_result / $results_per_page); |
|
| 720 | + $number_of_result = $stmt->rowCount(); |
|
| 721 | + $number_of_page = ceil ($number_of_result / $results_per_page); |
|
| 722 | 722 | |
| 723 | - if (!isset ($_GET['page']) ) { |
|
| 724 | - $page = 1; |
|
| 725 | - } else { |
|
| 726 | - $page = (int)$_GET['page']; |
|
| 727 | - } |
|
| 723 | + if (!isset ($_GET['page']) ) { |
|
| 724 | + $page = 1; |
|
| 725 | + } else { |
|
| 726 | + $page = (int)$_GET['page']; |
|
| 727 | + } |
|
| 728 | 728 | |
| 729 | - $page_first_result = ($page - 1) * $results_per_page; |
|
| 729 | + $page_first_result = ($page - 1) * $results_per_page; |
|
| 730 | 730 | |
| 731 | - $stmt = $__db->prepare("SELECT * FROM comments WHERE toid = :rid ORDER BY id DESC LIMIT :pfirst, :pper"); |
|
| 732 | - $stmt->bindParam(":rid", $_video['rid']); |
|
| 733 | - $stmt->bindParam(":pfirst", $page_first_result); |
|
| 734 | - $stmt->bindParam(":pper", $results_per_page); |
|
| 735 | - $stmt->execute(); |
|
| 731 | + $stmt = $__db->prepare("SELECT * FROM comments WHERE toid = :rid ORDER BY id DESC LIMIT :pfirst, :pper"); |
|
| 732 | + $stmt->bindParam(":rid", $_video['rid']); |
|
| 733 | + $stmt->bindParam(":pfirst", $page_first_result); |
|
| 734 | + $stmt->bindParam(":pper", $results_per_page); |
|
| 735 | + $stmt->execute(); |
|
| 736 | 736 | |
| 737 | - while($comment = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
| 738 | - if($__video_h->if_comment_liked($comment['id'], $_SESSION['siteusername'], true)) |
|
| 739 | - $comment['liked'] = true; |
|
| 740 | - else if($__video_h->if_comment_liked($comment['id'], $_SESSION['siteusername'], false)) |
|
| 741 | - $comment['disliked'] = true; |
|
| 737 | + while($comment = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
| 738 | + if($__video_h->if_comment_liked($comment['id'], $_SESSION['siteusername'], true)) |
|
| 739 | + $comment['liked'] = true; |
|
| 740 | + else if($__video_h->if_comment_liked($comment['id'], $_SESSION['siteusername'], false)) |
|
| 741 | + $comment['disliked'] = true; |
|
| 742 | 742 | |
| 743 | - $comment['likes'] = $__video_h->get_comment_likes($comment['id'], true); |
|
| 744 | - $comment['likes'] -= $__video_h->get_comment_likes($comment['id'], false); |
|
| 745 | - ?> |
|
| 743 | + $comment['likes'] = $__video_h->get_comment_likes($comment['id'], true); |
|
| 744 | + $comment['likes'] -= $__video_h->get_comment_likes($comment['id'], false); |
|
| 745 | + ?> |
|
| 746 | 746 | |
| 747 | 747 | <li class="comment yt-tile-default " data-author-viewing="" data-author-id="-uD01K8FQTeOSS5sniRFzQ" data-id="<?php echo $comment['id']; ?>" data-score="0"> |
| 748 | 748 | <div class="comment-body"> |
@@ -827,16 +827,16 @@ discard block |
||
| 827 | 827 | <ul id="watch-related" class="video-list"> |
| 828 | 828 | <div id="ppv-container" class="hid"></div> |
| 829 | 829 | <?php |
| 830 | - $stmt = $__db->prepare("SELECT * FROM videos ORDER BY rand() LIMIT 20"); |
|
| 831 | - $stmt->execute(); |
|
| 832 | - while($video = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
| 833 | - $video['age'] = $__time_h->time_elapsed_string($video['publish']); |
|
| 834 | - $video['duration'] = $__time_h->timestamp($video['duration']); |
|
| 835 | - $video['views'] = $__video_h->fetch_video_views($video['rid']); |
|
| 836 | - $video['author'] = htmlspecialchars($video['author']); |
|
| 837 | - $video['title'] = htmlspecialchars($video['title']); |
|
| 838 | - $video['description'] = $__video_h->shorten_description($video['description'], 50); |
|
| 839 | - ?> |
|
| 830 | + $stmt = $__db->prepare("SELECT * FROM videos ORDER BY rand() LIMIT 20"); |
|
| 831 | + $stmt->execute(); |
|
| 832 | + while($video = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
| 833 | + $video['age'] = $__time_h->time_elapsed_string($video['publish']); |
|
| 834 | + $video['duration'] = $__time_h->timestamp($video['duration']); |
|
| 835 | + $video['views'] = $__video_h->fetch_video_views($video['rid']); |
|
| 836 | + $video['author'] = htmlspecialchars($video['author']); |
|
| 837 | + $video['title'] = htmlspecialchars($video['title']); |
|
| 838 | + $video['description'] = $__video_h->shorten_description($video['description'], 50); |
|
| 839 | + ?> |
|
| 840 | 840 | <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> |
| 841 | 841 | <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"> |
| 842 | 842 | </span><img class="yt-uix-button-arrow" src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" alt=""></button> |
@@ -13,8 +13,8 @@ |
||
| 13 | 13 | <?php |
| 14 | 14 | $video = $__video_h->fetch_video_rid($_GET['id']); |
| 15 | 15 | |
| 16 | -if($video['author'] == $_SESSION['siteusername']) { |
|
| 17 | - if($video['commenting'] == "a") { |
|
| 16 | +if ($video['author'] == $_SESSION['siteusername']) { |
|
| 17 | + if ($video['commenting'] == "a") { |
|
| 18 | 18 | $__video_u->update_row($_GET['id'], "commenting", "d"); |
| 19 | 19 | } else { |
| 20 | 20 | $__video_u->update_row($_GET['id'], "commenting", "a"); |
@@ -12,11 +12,11 @@ |
||
| 12 | 12 | <?php |
| 13 | 13 | |
| 14 | 14 | if($video['author'] == $_SESSION['siteusername']) { |
| 15 | - $stmt = $__db->prepare("DELETE FROM videos WHERE rid=:rid AND author=:author"); |
|
| 16 | - $stmt->execute(array( |
|
| 15 | + $stmt = $__db->prepare("DELETE FROM videos WHERE rid=:rid AND author=:author"); |
|
| 16 | + $stmt->execute(array( |
|
| 17 | 17 | ':author' => $video['author'], |
| 18 | 18 | ':rid' => $video['rid'], |
| 19 | - )); |
|
| 19 | + )); |
|
| 20 | 20 | } |
| 21 | 21 | |
| 22 | 22 | header('Location: /my_videos'); |
@@ -11,7 +11,7 @@ |
||
| 11 | 11 | <?php $video = $__video_h->fetch_video_rid($_GET['id']); ?> |
| 12 | 12 | <?php |
| 13 | 13 | |
| 14 | -if($video['author'] == $_SESSION['siteusername']) { |
|
| 14 | +if ($video['author'] == $_SESSION['siteusername']) { |
|
| 15 | 15 | $stmt = $__db->prepare("DELETE FROM videos WHERE rid=:rid AND author=:author"); |
| 16 | 16 | $stmt->execute(array( |
| 17 | 17 | ':author' => $video['author'], |
@@ -12,7 +12,7 @@ |
||
| 12 | 12 | <?php $__time_h = new time_helper(); ?> |
| 13 | 13 | <?php |
| 14 | 14 | $_playlist = $__video_h->fetch_playlist_rid($_GET['v']); |
| 15 | - if($_playlist['author'] != @$_SESSION['siteusername']) { |
|
| 15 | + if ($_playlist['author'] != @$_SESSION['siteusername']) { |
|
| 16 | 16 | die(); |
| 17 | 17 | } |
| 18 | 18 | |
@@ -12,7 +12,7 @@ discard block |
||
| 12 | 12 | <?php $__time_h = new time_helper(); ?> |
| 13 | 13 | <?php |
| 14 | 14 | $_video = $__video_h->fetch_video_rid($_GET['v']); |
| 15 | - if($_video['author'] != @$_SESSION['siteusername']) { |
|
| 15 | + if ($_video['author'] != @$_SESSION['siteusername']) { |
|
| 16 | 16 | die(); |
| 17 | 17 | } |
| 18 | 18 | |
@@ -37,8 +37,8 @@ discard block |
||
| 37 | 37 | // $__video_u->update_row($_GET['v'], "thumbnail", $request->thumbnail); |
| 38 | 38 | $__video_u->update_row($_GET['v'], "category", $request->category); |
| 39 | 39 | |
| 40 | - if($_SERVER['REQUEST_METHOD'] == 'POST' && @$_FILES['thumbnail']) { |
|
| 41 | - if(!empty($_FILES["thumbnail"]["name"])) { |
|
| 40 | + if ($_SERVER['REQUEST_METHOD'] == 'POST' && @$_FILES['thumbnail']) { |
|
| 41 | + if (!empty($_FILES["thumbnail"]["name"])) { |
|
| 42 | 42 | $target_dir = "dynamic/thumbs/"; |
| 43 | 43 | $imageFileType = strtolower(pathinfo($_FILES["thumbnail"]["name"], PATHINFO_EXTENSION)); |
| 44 | 44 | $target_name = md5_file($_FILES["thumbnail"]["tmp_name"]) . "." . $imageFileType; |
@@ -48,8 +48,8 @@ discard block |
||
| 48 | 48 | $uploadOk = true; |
| 49 | 49 | $movedFile = false; |
| 50 | 50 | |
| 51 | - if($imageFileType != "jpg" && $imageFileType != "png" && $imageFileType != "jpeg" |
|
| 52 | - && $imageFileType != "gif" ) { |
|
| 51 | + if ($imageFileType != "jpg" && $imageFileType != "png" && $imageFileType != "jpeg" |
|
| 52 | + && $imageFileType != "gif") { |
|
| 53 | 53 | $fileerror = 'unsupported file type. must be jpg, png, jpeg, or gif'; |
| 54 | 54 | $uploadOk = false; |
| 55 | 55 | goto skip; |
@@ -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,7 +131,7 @@ 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['2009_bg']; ?>); |
| 136 | 136 | background-repeat: repeat; |
| 137 | 137 | background-position: center top; |
@@ -147,11 +147,11 @@ discard block |
||
| 147 | 147 | <div id="masthead-container"><?php require($_SERVER['DOCUMENT_ROOT'] . "/s/mod/header.php"); ?></div> |
| 148 | 148 | <div id="content-container"> |
| 149 | 149 | <!-- begin content --> |
| 150 | - <?php if(isset($_SESSION['siteusername']) && $_user['username'] == $_SESSION['siteusername']) { ?> |
|
| 150 | + <?php if (isset($_SESSION['siteusername']) && $_user['username'] == $_SESSION['siteusername']) { ?> |
|
| 151 | 151 | <div class="channel_customization"><?php require($_SERVER['DOCUMENT_ROOT'] . "/s/mod/channel_customization.php"); ?></div> |
| 152 | 152 | <?php } ?> |
| 153 | 153 | <?php |
| 154 | - if(empty(trim($_user['bio']))) |
|
| 154 | + if (empty(trim($_user['bio']))) |
|
| 155 | 155 | $_user['bio'] = "This user has no description."; |
| 156 | 156 | ?> |
| 157 | 157 | <div id="content"> |
@@ -211,7 +211,7 @@ discard block |
||
| 211 | 211 | </div> |
| 212 | 212 | </div> |
| 213 | 213 | <div class="upper-left-section enable-fancy-subscribe-button"> |
| 214 | - <?php if($_user['username'] != @$_SESSION['siteusername']) { ?> |
|
| 214 | + <?php if ($_user['username'] != @$_SESSION['siteusername']) { ?> |
|
| 215 | 215 | <div class="yt-subscription-button-hovercard yt-uix-hovercard"> |
| 216 | 216 | <button |
| 217 | 217 | href="#" |
@@ -219,7 +219,7 @@ discard block |
||
| 219 | 219 | title="" |
| 220 | 220 | id="subscribe-button" |
| 221 | 221 | type="button" |
| 222 | - class="yt-subscription-button <?php if($_user['subscribed']) { echo "subscribed "; } ?> yt-uix-button yt-uix-button-subscription yt-uix-tooltip" |
|
| 222 | + class="yt-subscription-button <?php if ($_user['subscribed']) { echo "subscribed "; } ?> yt-uix-button yt-uix-button-subscription yt-uix-tooltip" |
|
| 223 | 223 | role="button"><span class="yt-uix-button-icon-wrapper"><img class="yt-uix-button-icon yt-uix-button-icon-subscribe" |
| 224 | 224 | src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" alt=""></span><span class="yt-uix-button-content"> <span class="subscribe-label">Subscribe</span> |
| 225 | 225 | <span class="subscribed-label">Subscribed</span> |
@@ -253,7 +253,7 @@ discard block |
||
| 253 | 253 | </div> |
| 254 | 254 | </div> |
| 255 | 255 | </div> |
| 256 | - <?php if($_user['featured'] != "None") { $video = $__video_h->fetch_video_rid($_user['featured']); } else { $_user['featured'] = false; } ?> |
|
| 256 | + <?php if ($_user['featured'] != "None") { $video = $__video_h->fetch_video_rid($_user['featured']); } else { $_user['featured'] = false; } ?> |
|
| 257 | 257 | <div id="branded-page-body"> |
| 258 | 258 | <div class="channel-tab-content channel-layout-two-column selected blogger-template"> |
| 259 | 259 | <div class="tab-content-body"> |
@@ -287,8 +287,8 @@ discard block |
||
| 287 | 287 | <?php |
| 288 | 288 | $_playlist['videos'] = json_decode($_playlist['videos']); |
| 289 | 289 | $_playlist['count'] = 1; |
| 290 | - foreach($_playlist['videos'] as $video) { |
|
| 291 | - if($__video_h->video_exists($video)) { |
|
| 290 | + foreach ($_playlist['videos'] as $video) { |
|
| 291 | + if ($__video_h->video_exists($video)) { |
|
| 292 | 292 | $_video = $__video_h->fetch_video_rid($video); |
| 293 | 293 | $_video['video_responses'] = $__video_h->get_video_responses($_video['rid']); |
| 294 | 294 | $_video['age'] = $__time_h->time_elapsed_string($_video['publish']); |
@@ -336,7 +336,7 @@ discard block |
||
| 336 | 336 | </li> |
| 337 | 337 | <?php $_playlist['count']++; ?> |
| 338 | 338 | <?php } } ?> |
| 339 | - <?php if(count($_playlist['videos']) == 0) { ?> |
|
| 339 | + <?php if (count($_playlist['videos']) == 0) { ?> |
|
| 340 | 340 | <h4>This playlist has no videos yet.</h4> |
| 341 | 341 | <?php } ?> |
| 342 | 342 | </ol> |
@@ -390,7 +390,7 @@ discard block |
||
| 390 | 390 | </div> |
| 391 | 391 | <hr class="yt-horizontal-rule "> |
| 392 | 392 | </div> |
| 393 | - <?php if(!empty($_user['website'])) { ?> |
|
| 393 | + <?php if (!empty($_user['website'])) { ?> |
|
| 394 | 394 | <div class="user-profile-item"> |
| 395 | 395 | <div class="yt-c3-profile-custom-url field-container "> |
| 396 | 396 | <a href="<?php echo addhttp(htmlspecialchars($_user['website'])); ?>" rel="me nofollow" target="_blank" title="<?php echo htmlspecialchars($_user['website']); ?>" class="yt-uix-redirect-link"> |
@@ -439,7 +439,7 @@ discard block |
||
| 439 | 439 | <h5>Country</h5> |
| 440 | 440 | <span class="value"><?php echo htmlspecialchars($_user['country']); ?></span> |
| 441 | 441 | </div> |
| 442 | - <?php if($_user['genre'] != "none") { ?> |
|
| 442 | + <?php if ($_user['genre'] != "none") { ?> |
|
| 443 | 443 | <div class="user-profile-item "> |
| 444 | 444 | <h5>Channel Genre</h5> |
| 445 | 445 | <span class="value"><?php echo htmlspecialchars($_user['genre']); ?></span> |
@@ -451,13 +451,13 @@ discard block |
||
| 451 | 451 | </div> |
| 452 | 452 | <div class="channel-module other-channels yt-uix-c3-module-container other-channels-compact"> |
| 453 | 453 | <?php $_user['featured_channels'] = explode(",", $_user['featured_channels']); ?> |
| 454 | - <?php if(count($_user['featured_channels']) != 0) { ?> |
|
| 454 | + <?php if (count($_user['featured_channels']) != 0) { ?> |
|
| 455 | 455 | <div class="module-view other-channels-view"> |
| 456 | 456 | <h2>Featured Channels</h2> |
| 457 | 457 | <ul class="channel-summary-list "> |
| 458 | 458 | <?php |
| 459 | - foreach($_user['featured_channels'] as $user) { |
|
| 460 | - if($__user_h->user_exists($user)) { |
|
| 459 | + foreach ($_user['featured_channels'] as $user) { |
|
| 460 | + if ($__user_h->user_exists($user)) { |
|
| 461 | 461 | ?> |
| 462 | 462 | <li class="yt-tile-visible yt-uix-tile"> |
| 463 | 463 | <div class="channel-summary clearfix channel-summary-compact"> |
@@ -486,13 +486,13 @@ discard block |
||
| 486 | 486 | $stmt->bindParam(":search", $_user['username']); |
| 487 | 487 | $stmt->execute(); |
| 488 | 488 | |
| 489 | - if($stmt->rowCount() != 0) { |
|
| 489 | + if ($stmt->rowCount() != 0) { |
|
| 490 | 490 | ?> |
| 491 | 491 | <div class="playlists-narrow channel-module yt-uix-c3-module-container"> |
| 492 | 492 | <div class="module-view gh-featured"> |
| 493 | 493 | <h2>Featured Playlists</h2> |
| 494 | 494 | <?php |
| 495 | - while($playlist = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
| 495 | + while ($playlist = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
| 496 | 496 | $playlist['videos'] = json_decode($playlist['videos']); |
| 497 | 497 | ?> |
| 498 | 498 | <div class="playlist yt-tile-visible yt-uix-tile"> |
@@ -39,8 +39,8 @@ |
||
| 39 | 39 | ?> |
| 40 | 40 | <div id="browse-side-column" class="ytg-2col ytg-last"> |
| 41 | 41 | <ol class="navigation-menu"> |
| 42 | - <?php foreach($__tabs as $_tab) { |
|
| 43 | - if(parse_url($_SERVER["REQUEST_URI"], PHP_URL_PATH) != $_tab->url) |
|
| 42 | + <?php foreach ($__tabs as $_tab) { |
|
| 43 | + if (parse_url($_SERVER["REQUEST_URI"], PHP_URL_PATH) != $_tab->url) |
|
| 44 | 44 | $_tab->selected = true; |
| 45 | 45 | ?> |
| 46 | 46 | <li class="menu-item"> |
@@ -10,12 +10,12 @@ discard block |
||
| 10 | 10 | class video_updater { |
| 11 | 11 | public $__db; |
| 12 | 12 | |
| 13 | - public function __construct($conn){ |
|
| 13 | + public function __construct($conn) { |
|
| 14 | 14 | $this->__db = $conn; |
| 15 | 15 | } |
| 16 | 16 | |
| 17 | 17 | function update_row($video, $rowName, $new) { |
| 18 | - $stmt = $this->__db->prepare("UPDATE videos SET ".$rowName." = :new WHERE rid = :rid"); |
|
| 18 | + $stmt = $this->__db->prepare("UPDATE videos SET " . $rowName . " = :new WHERE rid = :rid"); |
|
| 19 | 19 | $stmt->bindParam(":new", $new); |
| 20 | 20 | $stmt->bindParam(":rid", $video); |
| 21 | 21 | $stmt->execute(); |
@@ -24,7 +24,7 @@ discard block |
||
| 24 | 24 | } |
| 25 | 25 | |
| 26 | 26 | function playlist_update_row($video, $rowName, $new) { |
| 27 | - $stmt = $this->__db->prepare("UPDATE playlists SET ".$rowName." = :new WHERE rid = :rid"); |
|
| 27 | + $stmt = $this->__db->prepare("UPDATE playlists SET " . $rowName . " = :new WHERE rid = :rid"); |
|
| 28 | 28 | $stmt->bindParam(":new", $new); |
| 29 | 29 | $stmt->bindParam(":rid", $video); |
| 30 | 30 | $stmt->execute(); |