@@ -15,26 +15,26 @@ 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 | |
| 23 | - /* |
|
| 23 | + /* |
|
| 24 | 24 | PREPARE EMBEDS CLASS -- function(string $page_title, string $page_description...) |
| 25 | 25 | Returns a list of arrays for compatibility purposes & but downside is ugly for loop codes |
| 26 | 26 | Work on this tomorrow or some shit idk lol |
| 27 | 27 | */ |
| 28 | 28 | |
| 29 | - /* |
|
| 29 | + /* |
|
| 30 | 30 | USE THE GOD DAMN __CONFIG MORE -- idiot |
| 31 | 31 | Work on this tomorrow or some shit |
| 32 | 32 | */ |
| 33 | 33 | |
| 34 | - $__server->page_embeds->page_title = htmlspecialchars($_video['title']); |
|
| 35 | - $__server->page_embeds->page_description = htmlspecialchars($_video['description']); |
|
| 36 | - $__server->page_embeds->page_image = "/dynamic/thumbs/" . $_video['thumbnail']; |
|
| 37 | - $__server->page_embeds->page_url = "https://subrock.rocks/watch?v=" . htmlspecialchars($_video['rid']); |
|
| 34 | + $__server->page_embeds->page_title = htmlspecialchars($_video['title']); |
|
| 35 | + $__server->page_embeds->page_description = htmlspecialchars($_video['description']); |
|
| 36 | + $__server->page_embeds->page_image = "/dynamic/thumbs/" . $_video['thumbnail']; |
|
| 37 | + $__server->page_embeds->page_url = "https://subrock.rocks/watch?v=" . htmlspecialchars($_video['rid']); |
|
| 38 | 38 | ?> |
| 39 | 39 | <!DOCTYPE html> |
| 40 | 40 | <html> |
@@ -64,29 +64,29 @@ discard block |
||
| 64 | 64 | if (window.yt.timing) {yt.timing.tick("ct");} |
| 65 | 65 | </script> |
| 66 | 66 | <?php |
| 67 | - $_video['dislikes'] = $__video_h->get_video_stars_level($_video['rid'], 1); |
|
| 68 | - $_video['dislikes'] += $__video_h->get_video_stars_level($_video['rid'], 2); |
|
| 67 | + $_video['dislikes'] = $__video_h->get_video_stars_level($_video['rid'], 1); |
|
| 68 | + $_video['dislikes'] += $__video_h->get_video_stars_level($_video['rid'], 2); |
|
| 69 | 69 | |
| 70 | - $_video['likes'] = $__video_h->get_video_stars_level($_video['rid'], 4); |
|
| 71 | - $_video['likes'] += $__video_h->get_video_stars_level($_video['rid'], 5); |
|
| 70 | + $_video['likes'] = $__video_h->get_video_stars_level($_video['rid'], 4); |
|
| 71 | + $_video['likes'] += $__video_h->get_video_stars_level($_video['rid'], 5); |
|
| 72 | 72 | |
| 73 | - $_video['dislikes'] += $__video_h->get_video_likes($_video['rid'], false); |
|
| 74 | - $_video['likes'] += $__video_h->get_video_likes($_video['rid'], true); |
|
| 73 | + $_video['dislikes'] += $__video_h->get_video_likes($_video['rid'], false); |
|
| 74 | + $_video['likes'] += $__video_h->get_video_likes($_video['rid'], true); |
|
| 75 | 75 | |
| 76 | - if($_video['likes'] == 0 && $_video['dislikes'] == 0) { |
|
| 77 | - $_video['likeswidth'] = 0; |
|
| 78 | - $_video['dislikeswidth'] = 0; |
|
| 79 | - } else { |
|
| 80 | - $_video['likeswidth'] = $_video['likes'] / ($_video['likes'] + $_video['dislikes']) * 100; |
|
| 81 | - $_video['dislikeswidth'] = 100 - $_video['likeswidth']; |
|
| 82 | - } |
|
| 76 | + if($_video['likes'] == 0 && $_video['dislikes'] == 0) { |
|
| 77 | + $_video['likeswidth'] = 0; |
|
| 78 | + $_video['dislikeswidth'] = 0; |
|
| 79 | + } else { |
|
| 80 | + $_video['likeswidth'] = $_video['likes'] / ($_video['likes'] + $_video['dislikes']) * 100; |
|
| 81 | + $_video['dislikeswidth'] = 100 - $_video['likeswidth']; |
|
| 82 | + } |
|
| 83 | 83 | |
| 84 | - $_video['liked'] = $__video_h->if_liked(@$_SESSION['siteusername'], $_video['rid'], true); |
|
| 85 | - $_video['disliked'] = $__video_h->if_liked(@$_SESSION['siteusername'], $_video['rid'], false); |
|
| 86 | - $_video['author_videos'] = $__video_h->fetch_user_videos($_video['author']); |
|
| 87 | - $_video['subscribed'] = $__user_h->if_subscribed(@$_SESSION['siteusername'], $_video['author']); |
|
| 88 | - $_video['favorited'] = $__video_h->if_favorited(@$_SESSION['siteusername'], $_video['rid']); |
|
| 89 | - ?> |
|
| 84 | + $_video['liked'] = $__video_h->if_liked(@$_SESSION['siteusername'], $_video['rid'], true); |
|
| 85 | + $_video['disliked'] = $__video_h->if_liked(@$_SESSION['siteusername'], $_video['rid'], false); |
|
| 86 | + $_video['author_videos'] = $__video_h->fetch_user_videos($_video['author']); |
|
| 87 | + $_video['subscribed'] = $__user_h->if_subscribed(@$_SESSION['siteusername'], $_video['author']); |
|
| 88 | + $_video['favorited'] = $__video_h->if_favorited(@$_SESSION['siteusername'], $_video['rid']); |
|
| 89 | + ?> |
|
| 90 | 90 | </head> |
| 91 | 91 | <body id="" class="date-20120927 en_US ltr ytg-old-clearfix guide-feed-v2 gecko gecko-15" dir="ltr"> |
| 92 | 92 | <form name="logoutForm" method="POST" action="/logout"> |
@@ -310,21 +310,21 @@ discard block |
||
| 310 | 310 | <hr><br> |
| 311 | 311 | <h3>Add to a Playlist</h3> |
| 312 | 312 | <?php |
| 313 | - $stmt = $__db->prepare("SELECT * FROM playlists WHERE author = :username ORDER BY id DESC LIMIT 20"); |
|
| 314 | - $stmt->bindParam(":username", $_SESSION['siteusername']); |
|
| 315 | - $stmt->execute(); |
|
| 316 | - while($playlist = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
| 317 | - $buffer = json_decode($playlist['videos']); |
|
| 318 | - @$rid = $buffer[0]; |
|
| 319 | - if(!empty($rid)) { |
|
| 320 | - @$video = $__video_h->fetch_video_rid($rid); |
|
| 321 | - } else { |
|
| 322 | - $video['thumbnail'] = ""; |
|
| 323 | - $video['duration'] = 0; |
|
| 324 | - } |
|
| 313 | + $stmt = $__db->prepare("SELECT * FROM playlists WHERE author = :username ORDER BY id DESC LIMIT 20"); |
|
| 314 | + $stmt->bindParam(":username", $_SESSION['siteusername']); |
|
| 315 | + $stmt->execute(); |
|
| 316 | + while($playlist = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
| 317 | + $buffer = json_decode($playlist['videos']); |
|
| 318 | + @$rid = $buffer[0]; |
|
| 319 | + if(!empty($rid)) { |
|
| 320 | + @$video = $__video_h->fetch_video_rid($rid); |
|
| 321 | + } else { |
|
| 322 | + $video['thumbnail'] = ""; |
|
| 323 | + $video['duration'] = 0; |
|
| 324 | + } |
|
| 325 | 325 | |
| 326 | - $videos = count($buffer); |
|
| 327 | - ?> |
|
| 326 | + $videos = count($buffer); |
|
| 327 | + ?> |
|
| 328 | 328 | <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> |
| 329 | 329 | <?php } ?> |
| 330 | 330 | <?php } ?> |
@@ -589,10 +589,10 @@ discard block |
||
| 589 | 589 | </div> |
| 590 | 590 | </div> |
| 591 | 591 | <?php |
| 592 | - $stmt = $__db->prepare("SELECT * FROM video_response WHERE toid = :v ORDER BY id DESC LIMIT 4"); |
|
| 593 | - $stmt->bindParam(":v", $_GET['v']); |
|
| 594 | - $stmt->execute(); |
|
| 595 | - ?> |
|
| 592 | + $stmt = $__db->prepare("SELECT * FROM video_response WHERE toid = :v ORDER BY id DESC LIMIT 4"); |
|
| 593 | + $stmt->bindParam(":v", $_GET['v']); |
|
| 594 | + $stmt->execute(); |
|
| 595 | + ?> |
|
| 596 | 596 | |
| 597 | 597 | <?php if($stmt->rowCount() != 0) { ?> |
| 598 | 598 | <div class="comments-section"> |
@@ -602,16 +602,16 @@ discard block |
||
| 602 | 602 | <h4>Video Responses</h4> |
| 603 | 603 | <ul class="video-list"> |
| 604 | 604 | <?php |
| 605 | - while($video = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
| 606 | - if($__video_h->video_exists($video['video'])) { |
|
| 607 | - $video = $__video_h->fetch_video_rid($video['video']); |
|
| 608 | - $video['age'] = $__time_h->time_elapsed_string($video['publish']); |
|
| 609 | - $video['duration'] = $__time_h->timestamp($video['duration']); |
|
| 610 | - $video['views'] = $__video_h->fetch_video_views($video['rid']); |
|
| 611 | - $video['author'] = htmlspecialchars($video['author']); |
|
| 612 | - $video['title'] = htmlspecialchars($video['title']); |
|
| 613 | - $video['description'] = $__video_h->shorten_description($video['description'], 50); |
|
| 614 | - ?> |
|
| 605 | + while($video = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
| 606 | + if($__video_h->video_exists($video['video'])) { |
|
| 607 | + $video = $__video_h->fetch_video_rid($video['video']); |
|
| 608 | + $video['age'] = $__time_h->time_elapsed_string($video['publish']); |
|
| 609 | + $video['duration'] = $__time_h->timestamp($video['duration']); |
|
| 610 | + $video['views'] = $__video_h->fetch_video_views($video['rid']); |
|
| 611 | + $video['author'] = htmlspecialchars($video['author']); |
|
| 612 | + $video['title'] = htmlspecialchars($video['title']); |
|
| 613 | + $video['description'] = $__video_h->shorten_description($video['description'], 50); |
|
| 614 | + ?> |
|
| 615 | 615 | <li class="video-list-item yt-tile-default"> |
| 616 | 616 | <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> |
| 617 | 617 | <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"> |
@@ -692,38 +692,38 @@ discard block |
||
| 692 | 692 | </div> |
| 693 | 693 | <ul class="comment-list" id="live_comments"> |
| 694 | 694 | <?php |
| 695 | - $results_per_page = 20; |
|
| 695 | + $results_per_page = 20; |
|
| 696 | 696 | |
| 697 | - $stmt = $__db->prepare("SELECT * FROM comments WHERE toid = :rid ORDER BY id DESC"); |
|
| 698 | - $stmt->bindParam(":rid", $_video['rid']); |
|
| 699 | - $stmt->execute(); |
|
| 697 | + $stmt = $__db->prepare("SELECT * FROM comments WHERE toid = :rid ORDER BY id DESC"); |
|
| 698 | + $stmt->bindParam(":rid", $_video['rid']); |
|
| 699 | + $stmt->execute(); |
|
| 700 | 700 | |
| 701 | - $number_of_result = $stmt->rowCount(); |
|
| 702 | - $number_of_page = ceil ($number_of_result / $results_per_page); |
|
| 701 | + $number_of_result = $stmt->rowCount(); |
|
| 702 | + $number_of_page = ceil ($number_of_result / $results_per_page); |
|
| 703 | 703 | |
| 704 | - if (!isset ($_GET['page']) ) { |
|
| 705 | - $page = 1; |
|
| 706 | - } else { |
|
| 707 | - $page = (int)$_GET['page']; |
|
| 708 | - } |
|
| 704 | + if (!isset ($_GET['page']) ) { |
|
| 705 | + $page = 1; |
|
| 706 | + } else { |
|
| 707 | + $page = (int)$_GET['page']; |
|
| 708 | + } |
|
| 709 | 709 | |
| 710 | - $page_first_result = ($page - 1) * $results_per_page; |
|
| 710 | + $page_first_result = ($page - 1) * $results_per_page; |
|
| 711 | 711 | |
| 712 | - $stmt = $__db->prepare("SELECT * FROM comments WHERE toid = :rid ORDER BY id DESC LIMIT :pfirst, :pper"); |
|
| 713 | - $stmt->bindParam(":rid", $_video['rid']); |
|
| 714 | - $stmt->bindParam(":pfirst", $page_first_result); |
|
| 715 | - $stmt->bindParam(":pper", $results_per_page); |
|
| 716 | - $stmt->execute(); |
|
| 712 | + $stmt = $__db->prepare("SELECT * FROM comments WHERE toid = :rid ORDER BY id DESC LIMIT :pfirst, :pper"); |
|
| 713 | + $stmt->bindParam(":rid", $_video['rid']); |
|
| 714 | + $stmt->bindParam(":pfirst", $page_first_result); |
|
| 715 | + $stmt->bindParam(":pper", $results_per_page); |
|
| 716 | + $stmt->execute(); |
|
| 717 | 717 | |
| 718 | - while($comment = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
| 719 | - if($__video_h->if_comment_liked($comment['id'], $_SESSION['siteusername'], true)) |
|
| 720 | - $comment['liked'] = true; |
|
| 721 | - else if($__video_h->if_comment_liked($comment['id'], $_SESSION['siteusername'], false)) |
|
| 722 | - $comment['disliked'] = true; |
|
| 718 | + while($comment = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
| 719 | + if($__video_h->if_comment_liked($comment['id'], $_SESSION['siteusername'], true)) |
|
| 720 | + $comment['liked'] = true; |
|
| 721 | + else if($__video_h->if_comment_liked($comment['id'], $_SESSION['siteusername'], false)) |
|
| 722 | + $comment['disliked'] = true; |
|
| 723 | 723 | |
| 724 | - $comment['likes'] = $__video_h->get_comment_likes($comment['id'], true); |
|
| 725 | - $comment['likes'] -= $__video_h->get_comment_likes($comment['id'], false); |
|
| 726 | - ?> |
|
| 724 | + $comment['likes'] = $__video_h->get_comment_likes($comment['id'], true); |
|
| 725 | + $comment['likes'] -= $__video_h->get_comment_likes($comment['id'], false); |
|
| 726 | + ?> |
|
| 727 | 727 | |
| 728 | 728 | <li class="comment yt-tile-default " data-author-viewing="" data-author-id="-uD01K8FQTeOSS5sniRFzQ" data-id="<?php echo $comment['id']; ?>" data-score="0"> |
| 729 | 729 | <div class="comment-body"> |
@@ -860,16 +860,16 @@ discard block |
||
| 860 | 860 | <ul id="watch-related" class="video-list"> |
| 861 | 861 | <div id="ppv-container" class="hid"></div> |
| 862 | 862 | <?php |
| 863 | - $stmt = $__db->prepare("SELECT * FROM videos ORDER BY rand() LIMIT 20"); |
|
| 864 | - $stmt->execute(); |
|
| 865 | - while($video = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
| 866 | - $video['age'] = $__time_h->time_elapsed_string($video['publish']); |
|
| 867 | - $video['duration'] = $__time_h->timestamp($video['duration']); |
|
| 868 | - $video['views'] = $__video_h->fetch_video_views($video['rid']); |
|
| 869 | - $video['author'] = htmlspecialchars($video['author']); |
|
| 870 | - $video['title'] = htmlspecialchars($video['title']); |
|
| 871 | - $video['description'] = $__video_h->shorten_description($video['description'], 50); |
|
| 872 | - ?> |
|
| 863 | + $stmt = $__db->prepare("SELECT * FROM videos ORDER BY rand() LIMIT 20"); |
|
| 864 | + $stmt->execute(); |
|
| 865 | + while($video = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
| 866 | + $video['age'] = $__time_h->time_elapsed_string($video['publish']); |
|
| 867 | + $video['duration'] = $__time_h->timestamp($video['duration']); |
|
| 868 | + $video['views'] = $__video_h->fetch_video_views($video['rid']); |
|
| 869 | + $video['author'] = htmlspecialchars($video['author']); |
|
| 870 | + $video['title'] = htmlspecialchars($video['title']); |
|
| 871 | + $video['description'] = $__video_h->shorten_description($video['description'], 50); |
|
| 872 | + ?> |
|
| 873 | 873 | <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> |
| 874 | 874 | <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"> |
| 875 | 875 | </span><img class="yt-uix-button-arrow" src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" alt=""></button> |