@@ -15,29 +15,29 @@ discard block |
||
| 15 | 15 | <?php $_video = $__video_h->fetch_video_rid($_GET['v']); ?> |
| 16 | 16 | <?php $_video['comments'] = $__video_h->get_comments_from_video($_video['rid']); ?> |
| 17 | 17 | <?php |
| 18 | - if($_video['visibility'] == "v" && @$_SESSION['siteusername'] != $_video['author']) |
|
| 19 | - header("Location: /"); |
|
| 18 | + if($_video['visibility'] == "v" && @$_SESSION['siteusername'] != $_video['author']) |
|
| 19 | + header("Location: /"); |
|
| 20 | 20 | |
| 21 | - if(isset($_SESSION['siteusername'])) |
|
| 22 | - $__video_h->check_view($_GET['v'], @$_SESSION['siteusername']); |
|
| 21 | + if(isset($_SESSION['siteusername'])) |
|
| 22 | + $__video_h->check_view($_GET['v'], @$_SESSION['siteusername']); |
|
| 23 | 23 | |
| 24 | - $_SESSION['current_video'] = $_video['rid']; |
|
| 24 | + $_SESSION['current_video'] = $_video['rid']; |
|
| 25 | 25 | |
| 26 | - /* |
|
| 26 | + /* |
|
| 27 | 27 | PREPARE EMBEDS CLASS -- function(string $page_title, string $page_description...) |
| 28 | 28 | Returns a list of arrays for compatibility purposes & but downside is ugly for loop codes |
| 29 | 29 | Work on this tomorrow or some shit idk lol |
| 30 | 30 | */ |
| 31 | 31 | |
| 32 | - /* |
|
| 32 | + /* |
|
| 33 | 33 | USE THE GOD DAMN __CONFIG MORE -- idiot |
| 34 | 34 | Work on this tomorrow or some shit |
| 35 | 35 | */ |
| 36 | 36 | |
| 37 | - $__server->page_embeds->page_title = htmlspecialchars($_video['title']); |
|
| 38 | - $__server->page_embeds->page_description = htmlspecialchars($_video['description']); |
|
| 39 | - $__server->page_embeds->page_image = "/dynamic/thumbs/" . $_video['thumbnail']; |
|
| 40 | - $__server->page_embeds->page_url = "https://subrock.rocks/watch?v=" . htmlspecialchars($_video['rid']); |
|
| 37 | + $__server->page_embeds->page_title = htmlspecialchars($_video['title']); |
|
| 38 | + $__server->page_embeds->page_description = htmlspecialchars($_video['description']); |
|
| 39 | + $__server->page_embeds->page_image = "/dynamic/thumbs/" . $_video['thumbnail']; |
|
| 40 | + $__server->page_embeds->page_url = "https://subrock.rocks/watch?v=" . htmlspecialchars($_video['rid']); |
|
| 41 | 41 | ?> |
| 42 | 42 | <!DOCTYPE html> |
| 43 | 43 | <html> |
@@ -67,29 +67,29 @@ discard block |
||
| 67 | 67 | if (window.yt.timing) {yt.timing.tick("ct");} |
| 68 | 68 | </script> |
| 69 | 69 | <?php |
| 70 | - $_video['dislikes'] = $__video_h->get_video_stars_level($_video['rid'], 1); |
|
| 71 | - $_video['dislikes'] += $__video_h->get_video_stars_level($_video['rid'], 2); |
|
| 70 | + $_video['dislikes'] = $__video_h->get_video_stars_level($_video['rid'], 1); |
|
| 71 | + $_video['dislikes'] += $__video_h->get_video_stars_level($_video['rid'], 2); |
|
| 72 | 72 | |
| 73 | - $_video['likes'] = $__video_h->get_video_stars_level($_video['rid'], 4); |
|
| 74 | - $_video['likes'] += $__video_h->get_video_stars_level($_video['rid'], 5); |
|
| 73 | + $_video['likes'] = $__video_h->get_video_stars_level($_video['rid'], 4); |
|
| 74 | + $_video['likes'] += $__video_h->get_video_stars_level($_video['rid'], 5); |
|
| 75 | 75 | |
| 76 | - $_video['dislikes'] += $__video_h->get_video_likes($_video['rid'], false); |
|
| 77 | - $_video['likes'] += $__video_h->get_video_likes($_video['rid'], true); |
|
| 76 | + $_video['dislikes'] += $__video_h->get_video_likes($_video['rid'], false); |
|
| 77 | + $_video['likes'] += $__video_h->get_video_likes($_video['rid'], true); |
|
| 78 | 78 | |
| 79 | - if($_video['likes'] == 0 && $_video['dislikes'] == 0) { |
|
| 80 | - $_video['likeswidth'] = 0; |
|
| 81 | - $_video['dislikeswidth'] = 0; |
|
| 82 | - } else { |
|
| 83 | - $_video['likeswidth'] = $_video['likes'] / ($_video['likes'] + $_video['dislikes']) * 100; |
|
| 84 | - $_video['dislikeswidth'] = 100 - $_video['likeswidth']; |
|
| 85 | - } |
|
| 79 | + if($_video['likes'] == 0 && $_video['dislikes'] == 0) { |
|
| 80 | + $_video['likeswidth'] = 0; |
|
| 81 | + $_video['dislikeswidth'] = 0; |
|
| 82 | + } else { |
|
| 83 | + $_video['likeswidth'] = $_video['likes'] / ($_video['likes'] + $_video['dislikes']) * 100; |
|
| 84 | + $_video['dislikeswidth'] = 100 - $_video['likeswidth']; |
|
| 85 | + } |
|
| 86 | 86 | |
| 87 | - $_video['liked'] = $__video_h->if_liked(@$_SESSION['siteusername'], $_video['rid'], true); |
|
| 88 | - $_video['disliked'] = $__video_h->if_liked(@$_SESSION['siteusername'], $_video['rid'], false); |
|
| 89 | - $_video['author_videos'] = $__video_h->fetch_user_videos($_video['author']); |
|
| 90 | - $_video['subscribed'] = $__user_h->if_subscribed(@$_SESSION['siteusername'], $_video['author']); |
|
| 91 | - $_video['favorited'] = $__video_h->if_favorited(@$_SESSION['siteusername'], $_video['rid']); |
|
| 92 | - ?> |
|
| 87 | + $_video['liked'] = $__video_h->if_liked(@$_SESSION['siteusername'], $_video['rid'], true); |
|
| 88 | + $_video['disliked'] = $__video_h->if_liked(@$_SESSION['siteusername'], $_video['rid'], false); |
|
| 89 | + $_video['author_videos'] = $__video_h->fetch_user_videos($_video['author']); |
|
| 90 | + $_video['subscribed'] = $__user_h->if_subscribed(@$_SESSION['siteusername'], $_video['author']); |
|
| 91 | + $_video['favorited'] = $__video_h->if_favorited(@$_SESSION['siteusername'], $_video['rid']); |
|
| 92 | + ?> |
|
| 93 | 93 | </head> |
| 94 | 94 | <body id="" class="date-20120927 en_US ltr ytg-old-clearfix guide-feed-v2 gecko gecko-15" dir="ltr"> |
| 95 | 95 | <form name="logoutForm" method="POST" action="/logout"> |
@@ -333,21 +333,21 @@ discard block |
||
| 333 | 333 | <hr><br> |
| 334 | 334 | <h3>Add to a Playlist</h3> |
| 335 | 335 | <?php |
| 336 | - $stmt = $__db->prepare("SELECT * FROM playlists WHERE author = :username ORDER BY id DESC LIMIT 20"); |
|
| 337 | - $stmt->bindParam(":username", $_SESSION['siteusername']); |
|
| 338 | - $stmt->execute(); |
|
| 339 | - while($playlist = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
| 340 | - $buffer = json_decode($playlist['videos']); |
|
| 341 | - @$rid = $buffer[0]; |
|
| 342 | - if(!empty($rid)) { |
|
| 343 | - @$video = $__video_h->fetch_video_rid($rid); |
|
| 344 | - } else { |
|
| 345 | - $video['thumbnail'] = ""; |
|
| 346 | - $video['duration'] = 0; |
|
| 347 | - } |
|
| 336 | + $stmt = $__db->prepare("SELECT * FROM playlists WHERE author = :username ORDER BY id DESC LIMIT 20"); |
|
| 337 | + $stmt->bindParam(":username", $_SESSION['siteusername']); |
|
| 338 | + $stmt->execute(); |
|
| 339 | + while($playlist = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
| 340 | + $buffer = json_decode($playlist['videos']); |
|
| 341 | + @$rid = $buffer[0]; |
|
| 342 | + if(!empty($rid)) { |
|
| 343 | + @$video = $__video_h->fetch_video_rid($rid); |
|
| 344 | + } else { |
|
| 345 | + $video['thumbnail'] = ""; |
|
| 346 | + $video['duration'] = 0; |
|
| 347 | + } |
|
| 348 | 348 | |
| 349 | - $videos = count($buffer); |
|
| 350 | - ?> |
|
| 349 | + $videos = count($buffer); |
|
| 350 | + ?> |
|
| 351 | 351 | <a href="/get/add_to_playlist?id=<?php echo $_video['rid']; ?>&playlist=<?php echo $playlist['rid']; ?>">Add to <?php echo htmlspecialchars($playlist['title']); ?></a><br> |
| 352 | 352 | <?php } ?> |
| 353 | 353 | <?php } ?> |
@@ -612,10 +612,10 @@ discard block |
||
| 612 | 612 | </div> |
| 613 | 613 | </div> |
| 614 | 614 | <?php |
| 615 | - $stmt = $__db->prepare("SELECT * FROM video_response WHERE toid = :v ORDER BY id DESC LIMIT 4"); |
|
| 616 | - $stmt->bindParam(":v", $_GET['v']); |
|
| 617 | - $stmt->execute(); |
|
| 618 | - ?> |
|
| 615 | + $stmt = $__db->prepare("SELECT * FROM video_response WHERE toid = :v ORDER BY id DESC LIMIT 4"); |
|
| 616 | + $stmt->bindParam(":v", $_GET['v']); |
|
| 617 | + $stmt->execute(); |
|
| 618 | + ?> |
|
| 619 | 619 | |
| 620 | 620 | <?php if($stmt->rowCount() != 0) { ?> |
| 621 | 621 | <div class="comments-section"> |
@@ -625,16 +625,16 @@ discard block |
||
| 625 | 625 | <h4>Video Responses</h4> |
| 626 | 626 | <ul class="video-list"> |
| 627 | 627 | <?php |
| 628 | - while($video = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
| 629 | - if($__video_h->video_exists($video['video'])) { |
|
| 630 | - $video = $__video_h->fetch_video_rid($video['video']); |
|
| 631 | - $video['age'] = $__time_h->time_elapsed_string($video['publish']); |
|
| 632 | - $video['duration'] = $__time_h->timestamp($video['duration']); |
|
| 633 | - $video['views'] = $__video_h->fetch_video_views($video['rid']); |
|
| 634 | - $video['author'] = htmlspecialchars($video['author']); |
|
| 635 | - $video['title'] = htmlspecialchars($video['title']); |
|
| 636 | - $video['description'] = $__video_h->shorten_description($video['description'], 50); |
|
| 637 | - ?> |
|
| 628 | + while($video = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
| 629 | + if($__video_h->video_exists($video['video'])) { |
|
| 630 | + $video = $__video_h->fetch_video_rid($video['video']); |
|
| 631 | + $video['age'] = $__time_h->time_elapsed_string($video['publish']); |
|
| 632 | + $video['duration'] = $__time_h->timestamp($video['duration']); |
|
| 633 | + $video['views'] = $__video_h->fetch_video_views($video['rid']); |
|
| 634 | + $video['author'] = htmlspecialchars($video['author']); |
|
| 635 | + $video['title'] = htmlspecialchars($video['title']); |
|
| 636 | + $video['description'] = $__video_h->shorten_description($video['description'], 50); |
|
| 637 | + ?> |
|
| 638 | 638 | <li class="video-list-item yt-tile-default"> |
| 639 | 639 | <a href="/watch?v=<?php echo $video['rid']; ?>" class="related-video yt-uix-contextlink yt-uix-sessionlink" data-sessionlink="<?php echo htmlspecialchars($_video['author']); ?>&feature=watch_response"><span class="ux-thumb-wrap contains-addto "><span class="video-thumb ux-thumb yt-thumb-default-120 "><span class="yt-thumb-clip"><span class="yt-thumb-clip-inner"><img src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" alt="<?php echo $video['title']; ?>" data-thumb="/dynamic/thumbs/<?php echo $video['thumbnail']; ?>" width="120"><span class="vertical-align"></span></span></span></span><span class="video-time"><?php echo $video['duration']; ?></span> |
| 640 | 640 | <button onclick=";return false;" title="Watch Later" type="button" class="addto-button video-actions addto-watch-later-button-sign-in yt-uix-button yt-uix-button-default yt-uix-button-short yt-uix-tooltip" data-button-menu-id="shared-addto-watch-later-login" data-video-ids="cjls0QsHOBE" role="button"><span class="yt-uix-button-content"> <img src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" alt="Watch Later"> |
@@ -715,38 +715,38 @@ discard block |
||
| 715 | 715 | </div> |
| 716 | 716 | <ul class="comment-list" id="live_comments"> |
| 717 | 717 | <?php |
| 718 | - $results_per_page = 20; |
|
| 718 | + $results_per_page = 20; |
|
| 719 | 719 | |
| 720 | - $stmt = $__db->prepare("SELECT * FROM comments WHERE toid = :rid ORDER BY id DESC"); |
|
| 721 | - $stmt->bindParam(":rid", $_video['rid']); |
|
| 722 | - $stmt->execute(); |
|
| 720 | + $stmt = $__db->prepare("SELECT * FROM comments WHERE toid = :rid ORDER BY id DESC"); |
|
| 721 | + $stmt->bindParam(":rid", $_video['rid']); |
|
| 722 | + $stmt->execute(); |
|
| 723 | 723 | |
| 724 | - $number_of_result = $stmt->rowCount(); |
|
| 725 | - $number_of_page = ceil ($number_of_result / $results_per_page); |
|
| 724 | + $number_of_result = $stmt->rowCount(); |
|
| 725 | + $number_of_page = ceil ($number_of_result / $results_per_page); |
|
| 726 | 726 | |
| 727 | - if (!isset ($_GET['page']) ) { |
|
| 728 | - $page = 1; |
|
| 729 | - } else { |
|
| 730 | - $page = (int)$_GET['page']; |
|
| 731 | - } |
|
| 727 | + if (!isset ($_GET['page']) ) { |
|
| 728 | + $page = 1; |
|
| 729 | + } else { |
|
| 730 | + $page = (int)$_GET['page']; |
|
| 731 | + } |
|
| 732 | 732 | |
| 733 | - $page_first_result = ($page - 1) * $results_per_page; |
|
| 733 | + $page_first_result = ($page - 1) * $results_per_page; |
|
| 734 | 734 | |
| 735 | - $stmt = $__db->prepare("SELECT * FROM comments WHERE toid = :rid ORDER BY id DESC LIMIT :pfirst, :pper"); |
|
| 736 | - $stmt->bindParam(":rid", $_video['rid']); |
|
| 737 | - $stmt->bindParam(":pfirst", $page_first_result); |
|
| 738 | - $stmt->bindParam(":pper", $results_per_page); |
|
| 739 | - $stmt->execute(); |
|
| 735 | + $stmt = $__db->prepare("SELECT * FROM comments WHERE toid = :rid ORDER BY id DESC LIMIT :pfirst, :pper"); |
|
| 736 | + $stmt->bindParam(":rid", $_video['rid']); |
|
| 737 | + $stmt->bindParam(":pfirst", $page_first_result); |
|
| 738 | + $stmt->bindParam(":pper", $results_per_page); |
|
| 739 | + $stmt->execute(); |
|
| 740 | 740 | |
| 741 | - while($comment = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
| 742 | - if($__video_h->if_comment_liked($comment['id'], $_SESSION['siteusername'], true)) |
|
| 743 | - $comment['liked'] = true; |
|
| 744 | - else if($__video_h->if_comment_liked($comment['id'], $_SESSION['siteusername'], false)) |
|
| 745 | - $comment['disliked'] = true; |
|
| 741 | + while($comment = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
| 742 | + if($__video_h->if_comment_liked($comment['id'], $_SESSION['siteusername'], true)) |
|
| 743 | + $comment['liked'] = true; |
|
| 744 | + else if($__video_h->if_comment_liked($comment['id'], $_SESSION['siteusername'], false)) |
|
| 745 | + $comment['disliked'] = true; |
|
| 746 | 746 | |
| 747 | - $comment['likes'] = $__video_h->get_comment_likes($comment['id'], true); |
|
| 748 | - $comment['likes'] -= $__video_h->get_comment_likes($comment['id'], false); |
|
| 749 | - ?> |
|
| 747 | + $comment['likes'] = $__video_h->get_comment_likes($comment['id'], true); |
|
| 748 | + $comment['likes'] -= $__video_h->get_comment_likes($comment['id'], false); |
|
| 749 | + ?> |
|
| 750 | 750 | |
| 751 | 751 | <li class="comment yt-tile-default " data-author-viewing="" data-author-id="-uD01K8FQTeOSS5sniRFzQ" data-id="<?php echo $comment['id']; ?>" data-score="0"> |
| 752 | 752 | <div class="comment-body"> |
@@ -883,16 +883,16 @@ discard block |
||
| 883 | 883 | <ul id="watch-related" class="video-list"> |
| 884 | 884 | <div id="ppv-container" class="hid"></div> |
| 885 | 885 | <?php |
| 886 | - $stmt = $__db->prepare("SELECT * FROM videos WHERE visibility = 'n' ORDER BY rand() LIMIT 20"); |
|
| 887 | - $stmt->execute(); |
|
| 888 | - while($video = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
| 889 | - $video['age'] = $__time_h->time_elapsed_string($video['publish']); |
|
| 890 | - $video['duration'] = $__time_h->timestamp($video['duration']); |
|
| 891 | - $video['views'] = $__video_h->fetch_video_views($video['rid']); |
|
| 892 | - $video['author'] = htmlspecialchars($video['author']); |
|
| 893 | - $video['title'] = htmlspecialchars($video['title']); |
|
| 894 | - $video['description'] = $__video_h->shorten_description($video['description'], 50); |
|
| 895 | - ?> |
|
| 886 | + $stmt = $__db->prepare("SELECT * FROM videos WHERE visibility = 'n' ORDER BY rand() LIMIT 20"); |
|
| 887 | + $stmt->execute(); |
|
| 888 | + while($video = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
| 889 | + $video['age'] = $__time_h->time_elapsed_string($video['publish']); |
|
| 890 | + $video['duration'] = $__time_h->timestamp($video['duration']); |
|
| 891 | + $video['views'] = $__video_h->fetch_video_views($video['rid']); |
|
| 892 | + $video['author'] = htmlspecialchars($video['author']); |
|
| 893 | + $video['title'] = htmlspecialchars($video['title']); |
|
| 894 | + $video['description'] = $__video_h->shorten_description($video['description'], 50); |
|
| 895 | + ?> |
|
| 896 | 896 | <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> |
| 897 | 897 | <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"> |
| 898 | 898 | </span><img class="yt-uix-button-arrow" src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" alt=""></button> |
@@ -11,14 +11,14 @@ discard block |
||
| 11 | 11 | <?php $__user_u = new user_update($__db); ?> |
| 12 | 12 | <?php $__db_h = new db_helper(); ?> |
| 13 | 13 | <?php $__time_h = new time_helper(); ?> |
| 14 | -<?php if(!$__video_h->video_exists($_GET['v'])) { header("Location: /?error=This video doesn't exist!"); } ?> |
|
| 14 | +<?php if (!$__video_h->video_exists($_GET['v'])) { header("Location: /?error=This video doesn't exist!"); } ?> |
|
| 15 | 15 | <?php $_video = $__video_h->fetch_video_rid($_GET['v']); ?> |
| 16 | 16 | <?php $_video['comments'] = $__video_h->get_comments_from_video($_video['rid']); ?> |
| 17 | 17 | <?php |
| 18 | - if($_video['visibility'] == "v" && @$_SESSION['siteusername'] != $_video['author']) |
|
| 18 | + if ($_video['visibility'] == "v" && @$_SESSION['siteusername'] != $_video['author']) |
|
| 19 | 19 | header("Location: /"); |
| 20 | 20 | |
| 21 | - if(isset($_SESSION['siteusername'])) |
|
| 21 | + if (isset($_SESSION['siteusername'])) |
|
| 22 | 22 | $__video_h->check_view($_GET['v'], @$_SESSION['siteusername']); |
| 23 | 23 | |
| 24 | 24 | $_SESSION['current_video'] = $_video['rid']; |
@@ -67,20 +67,20 @@ discard block |
||
| 67 | 67 | if (window.yt.timing) {yt.timing.tick("ct");} |
| 68 | 68 | </script> |
| 69 | 69 | <?php |
| 70 | - $_video['dislikes'] = $__video_h->get_video_stars_level($_video['rid'], 1); |
|
| 70 | + $_video['dislikes'] = $__video_h->get_video_stars_level($_video['rid'], 1); |
|
| 71 | 71 | $_video['dislikes'] += $__video_h->get_video_stars_level($_video['rid'], 2); |
| 72 | 72 | |
| 73 | - $_video['likes'] = $__video_h->get_video_stars_level($_video['rid'], 4); |
|
| 74 | - $_video['likes'] += $__video_h->get_video_stars_level($_video['rid'], 5); |
|
| 73 | + $_video['likes'] = $__video_h->get_video_stars_level($_video['rid'], 4); |
|
| 74 | + $_video['likes'] += $__video_h->get_video_stars_level($_video['rid'], 5); |
|
| 75 | 75 | |
| 76 | 76 | $_video['dislikes'] += $__video_h->get_video_likes($_video['rid'], false); |
| 77 | 77 | $_video['likes'] += $__video_h->get_video_likes($_video['rid'], true); |
| 78 | 78 | |
| 79 | - if($_video['likes'] == 0 && $_video['dislikes'] == 0) { |
|
| 79 | + if ($_video['likes'] == 0 && $_video['dislikes'] == 0) { |
|
| 80 | 80 | $_video['likeswidth'] = 0; |
| 81 | 81 | $_video['dislikeswidth'] = 0; |
| 82 | 82 | } else { |
| 83 | - $_video['likeswidth'] = $_video['likes'] / ($_video['likes'] + $_video['dislikes']) * 100; |
|
| 83 | + $_video['likeswidth'] = $_video['likes']/($_video['likes'] + $_video['dislikes'])*100; |
|
| 84 | 84 | $_video['dislikeswidth'] = 100 - $_video['likeswidth']; |
| 85 | 85 | } |
| 86 | 86 | |
@@ -114,7 +114,7 @@ discard block |
||
| 114 | 114 | </div> |
| 115 | 115 | <div id="instream_google_companion_ad_div"></div> |
| 116 | 116 | </div> |
| 117 | - <?php if(@$_SESSION['siteusername'] == $_video['author']) { ?> |
|
| 117 | + <?php if (@$_SESSION['siteusername'] == $_video['author']) { ?> |
|
| 118 | 118 | <div id="watch-owner-container"> |
| 119 | 119 | <div id="masthead-subnav" class="yt-nav yt-nav-dark "> |
| 120 | 120 | <ul class="yt-nav-aside"> |
@@ -149,7 +149,7 @@ discard block |
||
| 149 | 149 | title="" |
| 150 | 150 | id="subscribe-button" |
| 151 | 151 | type="button" |
| 152 | - class="<?php if($_video['subscribed']) { echo "subscribed "; } ?>yt-subscription-button yt-uix-button yt-uix-button-subscription yt-uix-tooltip" |
|
| 152 | + class="<?php if ($_video['subscribed']) { echo "subscribed "; } ?>yt-subscription-button yt-uix-button yt-uix-button-subscription yt-uix-tooltip" |
|
| 153 | 153 | role="button"> |
| 154 | 154 | <span class="yt-uix-button-icon-wrapper"> |
| 155 | 155 | <img class="yt-uix-button-icon yt-uix-button-icon-subscribe" src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" alt=""> |
@@ -207,7 +207,7 @@ discard block |
||
| 207 | 207 | <div id="watch-main-container"> |
| 208 | 208 | <div id="watch-main"> |
| 209 | 209 | <div id="watch-panel"> |
| 210 | - <?php if($_video['visibility'] == "u") { ?> |
|
| 210 | + <?php if ($_video['visibility'] == "u") { ?> |
|
| 211 | 211 | <div id="masthead_child_div"><div class="yt-alert yt-alert-default yt-alert-warn"> <div class="yt-alert-icon"> |
| 212 | 212 | <img src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" class="icon master-sprite" alt="Alert icon"> |
| 213 | 213 | </div> |
@@ -216,7 +216,7 @@ discard block |
||
| 216 | 216 | This video is unlisted. Only people who have the link can view this video. |
| 217 | 217 | </div> |
| 218 | 218 | </div></div></div> |
| 219 | - <?php } else if($_video['visibility'] == "v") { ?> |
|
| 219 | + <?php } else if ($_video['visibility'] == "v") { ?> |
|
| 220 | 220 | <div id="masthead_child_div"><div class="yt-alert yt-alert-default yt-alert-error"> <div class="yt-alert-icon"> |
| 221 | 221 | <img src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" class="icon master-sprite" alt="Alert icon"> |
| 222 | 222 | </div> |
@@ -250,7 +250,7 @@ discard block |
||
| 250 | 250 | <button onclick=";like_video();return false;" |
| 251 | 251 | title="I like this" |
| 252 | 252 | type="button" |
| 253 | - class="start <?php if($_video['liked']) { echo "liked "; } ?>yt-uix-tooltip-reverse yt-uix-button yt-uix-button-default yt-uix-tooltip" |
|
| 253 | + class="start <?php if ($_video['liked']) { echo "liked "; } ?>yt-uix-tooltip-reverse yt-uix-button yt-uix-button-default yt-uix-tooltip" |
|
| 254 | 254 | id="watch-like" |
| 255 | 255 | href="/get/like_video?v=<?php echo $_video['rid']; ?>" |
| 256 | 256 | role="button"><span class="yt-uix-button-icon-wrapper"> |
@@ -264,7 +264,7 @@ discard block |
||
| 264 | 264 | type="button" |
| 265 | 265 | style="margin-left: -2px;" |
| 266 | 266 | href="/get/dislike_video?v=<?php echo $_video['rid']; ?>" |
| 267 | - class="end yt-uix-tooltip-reverse <?php if($_video['disliked']) { echo "unliked "; } ?> yt-uix-button yt-uix-button-default yt-uix-tooltip yt-uix-button-empty" |
|
| 267 | + class="end yt-uix-tooltip-reverse <?php if ($_video['disliked']) { echo "unliked "; } ?> yt-uix-button yt-uix-button-default yt-uix-tooltip yt-uix-button-empty" |
|
| 268 | 268 | id="watch-unlike" |
| 269 | 269 | role="button"> |
| 270 | 270 | <span class="yt-uix-button-icon-wrapper"> |
@@ -284,7 +284,7 @@ discard block |
||
| 284 | 284 | </div> |
| 285 | 285 | </div> |
| 286 | 286 | <div id="watch-actions-logged-out" class="watch-actions-panel hid"> |
| 287 | - <?php if(!isset($_SESSION['siteusername'])) { ?> |
|
| 287 | + <?php if (!isset($_SESSION['siteusername'])) { ?> |
|
| 288 | 288 | <div class="yt-alert yt-alert-naked yt-alert-warn "> |
| 289 | 289 | <div class="yt-alert-icon"> |
| 290 | 290 | <img src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" class="icon master-sprite" alt="Alert icon"> |
@@ -300,7 +300,7 @@ discard block |
||
| 300 | 300 | <?php } else { ?> |
| 301 | 301 | <h3>Be friends with the creator</h3> |
| 302 | 302 | |
| 303 | - <?php if($_SESSION['siteusername'] != $_video['author']) { ?> |
|
| 303 | + <?php if ($_SESSION['siteusername'] != $_video['author']) { ?> |
|
| 304 | 304 | <img style="width: 50px;height:50px;" src="/dynamic/pfp/<?php echo $__user_h->fetch_pfp($_video['author']); ?>"> |
| 305 | 305 | <span style="display: inline-block; vertical-align:top;width: 100px;font-size:11px;"> |
| 306 | 306 | <b><a href="/user/<?php echo htmlspecialchars($_video['author']); ?>"><?php echo htmlspecialchars($_video['author']); ?></a></b><br> |
@@ -314,8 +314,8 @@ discard block |
||
| 314 | 314 | </span><br><br> |
| 315 | 315 | <?php } ?> |
| 316 | 316 | |
| 317 | - <?php if($_SESSION['siteusername'] != $_video['author']) { ?> |
|
| 318 | - <?php if($_video['friended'] == false) { ?> |
|
| 317 | + <?php if ($_SESSION['siteusername'] != $_video['author']) { ?> |
|
| 318 | + <?php if ($_video['friended'] == false) { ?> |
|
| 319 | 319 | <a href="/friends">Send a friend request</a> |
| 320 | 320 | <?php } else { ?> |
| 321 | 321 | Your friend request is pending. |
@@ -325,7 +325,7 @@ discard block |
||
| 325 | 325 | <?php } ?> |
| 326 | 326 | <hr><br> |
| 327 | 327 | <h3>Add to Favorites</h3> |
| 328 | - <?php if($_video['favorited'] == false) { ?> |
|
| 328 | + <?php if ($_video['favorited'] == false) { ?> |
|
| 329 | 329 | <a href="/get/favorite?v=<?php echo $_video['rid']; ?>">Favorite Video</a> |
| 330 | 330 | <?php } else { ?> |
| 331 | 331 | <a href="/get/unfavorite?v=<?php echo $_video['rid']; ?>">Unfavorite Video</a> |
@@ -336,10 +336,10 @@ discard block |
||
| 336 | 336 | $stmt = $__db->prepare("SELECT * FROM playlists WHERE author = :username ORDER BY id DESC LIMIT 20"); |
| 337 | 337 | $stmt->bindParam(":username", $_SESSION['siteusername']); |
| 338 | 338 | $stmt->execute(); |
| 339 | - while($playlist = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
| 339 | + while ($playlist = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
| 340 | 340 | $buffer = json_decode($playlist['videos']); |
| 341 | 341 | @$rid = $buffer[0]; |
| 342 | - if(!empty($rid)) { |
|
| 342 | + if (!empty($rid)) { |
|
| 343 | 343 | @$video = $__video_h->fetch_video_rid($rid); |
| 344 | 344 | } else { |
| 345 | 345 | $video['thumbnail'] = ""; |
@@ -617,7 +617,7 @@ discard block |
||
| 617 | 617 | $stmt->execute(); |
| 618 | 618 | ?> |
| 619 | 619 | |
| 620 | - <?php if($stmt->rowCount() != 0) { ?> |
|
| 620 | + <?php if ($stmt->rowCount() != 0) { ?> |
|
| 621 | 621 | <div class="comments-section"> |
| 622 | 622 | <a class="comments-section-see-all" href="/video_response_view_all?v=<?php echo htmlspecialchars($_video['rid']); ?>"> |
| 623 | 623 | see all |
@@ -625,8 +625,8 @@ discard block |
||
| 625 | 625 | <h4>Video Responses</h4> |
| 626 | 626 | <ul class="video-list"> |
| 627 | 627 | <?php |
| 628 | - while($video = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
| 629 | - if($__video_h->video_exists($video['video'])) { |
|
| 628 | + while ($video = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
| 629 | + if ($__video_h->video_exists($video['video'])) { |
|
| 630 | 630 | $video = $__video_h->fetch_video_rid($video['video']); |
| 631 | 631 | $video['age'] = $__time_h->time_elapsed_string($video['publish']); |
| 632 | 632 | $video['duration'] = $__time_h->timestamp($video['duration']); |
@@ -657,18 +657,18 @@ discard block |
||
| 657 | 657 | </h4> |
| 658 | 658 | </div> |
| 659 | 659 | </div> |
| 660 | - <?php if(!isset($_SESSION['siteusername'])) { ?> |
|
| 660 | + <?php if (!isset($_SESSION['siteusername'])) { ?> |
|
| 661 | 661 | <div class="comments-post-container clearfix"> |
| 662 | 662 | <div class="comments-post-alert"> |
| 663 | 663 | <a href="/sign_in">Sign In</a> or <a href="/sign_up">Sign Up</a><span class="comments-post-form-rollover-text"> now to post a comment!</span> |
| 664 | 664 | </div> |
| 665 | 665 | </div> |
| 666 | - <?php } else if($_video['commenting'] == "d") { ?> |
|
| 666 | + <?php } else if ($_video['commenting'] == "d") { ?> |
|
| 667 | 667 | <div class="comments-disabled-message"> |
| 668 | 668 | <img src="http://s.ytimg.com/yt/img/icon_comments_disabled-vflxokpZC.png"> |
| 669 | 669 | <span>Adding comments has been disabled for this video.</span> |
| 670 | 670 | </div> |
| 671 | - <?php } else if($__user_h->if_blocked($_video['author'], $_SESSION['siteusername'])) { ?> |
|
| 671 | + <?php } else if ($__user_h->if_blocked($_video['author'], $_SESSION['siteusername'])) { ?> |
|
| 672 | 672 | <div class="comments-post-container clearfix"> |
| 673 | 673 | <div class="comments-post-alert"> |
| 674 | 674 | This user has blocked you! |
@@ -722,15 +722,15 @@ discard block |
||
| 722 | 722 | $stmt->execute(); |
| 723 | 723 | |
| 724 | 724 | $number_of_result = $stmt->rowCount(); |
| 725 | - $number_of_page = ceil ($number_of_result / $results_per_page); |
|
| 725 | + $number_of_page = ceil($number_of_result/$results_per_page); |
|
| 726 | 726 | |
| 727 | - if (!isset ($_GET['page']) ) { |
|
| 727 | + if (!isset ($_GET['page'])) { |
|
| 728 | 728 | $page = 1; |
| 729 | 729 | } else { |
| 730 | - $page = (int)$_GET['page']; |
|
| 730 | + $page = (int) $_GET['page']; |
|
| 731 | 731 | } |
| 732 | 732 | |
| 733 | - $page_first_result = ($page - 1) * $results_per_page; |
|
| 733 | + $page_first_result = ($page - 1)*$results_per_page; |
|
| 734 | 734 | |
| 735 | 735 | $stmt = $__db->prepare("SELECT * FROM comments WHERE toid = :rid ORDER BY id DESC LIMIT :pfirst, :pper"); |
| 736 | 736 | $stmt->bindParam(":rid", $_video['rid']); |
@@ -738,10 +738,10 @@ discard block |
||
| 738 | 738 | $stmt->bindParam(":pper", $results_per_page); |
| 739 | 739 | $stmt->execute(); |
| 740 | 740 | |
| 741 | - while($comment = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
| 742 | - if($__video_h->if_comment_liked($comment['id'], $_SESSION['siteusername'], true)) |
|
| 741 | + while ($comment = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
| 742 | + if ($__video_h->if_comment_liked($comment['id'], $_SESSION['siteusername'], true)) |
|
| 743 | 743 | $comment['liked'] = true; |
| 744 | - else if($__video_h->if_comment_liked($comment['id'], $_SESSION['siteusername'], false)) |
|
| 744 | + else if ($__video_h->if_comment_liked($comment['id'], $_SESSION['siteusername'], false)) |
|
| 745 | 745 | $comment['disliked'] = true; |
| 746 | 746 | |
| 747 | 747 | $comment['likes'] = $__video_h->get_comment_likes($comment['id'], true); |
@@ -763,7 +763,7 @@ discard block |
||
| 763 | 763 | <span dir="ltr"><?php echo $__time_h->time_elapsed_string($comment['date']); ?><span> |
| 764 | 764 | </span> |
| 765 | 765 | </span></span> |
| 766 | - <?php if($comment['likes'] != 0) { ?> |
|
| 766 | + <?php if ($comment['likes'] != 0) { ?> |
|
| 767 | 767 | <span dir="ltr" class="comments-rating-positive" title="9 up, 1 down"> |
| 768 | 768 | <?php echo $comment['likes']; ?> |
| 769 | 769 | <img class="comments-rating-thumbs-up" src="//s.ytimg.com/yts/img/pixel-vfl3z5WfW.gif"> |
@@ -791,7 +791,7 @@ discard block |
||
| 791 | 791 | </button> |
| 792 | 792 | </span> |
| 793 | 793 | </div> |
| 794 | - <?php if(isset($_SESSION['siteusername'])) { ?> |
|
| 794 | + <?php if (isset($_SESSION['siteusername'])) { ?> |
|
| 795 | 795 | <li id="reply_to_<?php echo $comment['id']; ?>" style="display: none;" class="comment yt-tile-default child" data-tag="O" data-author-viewing="" data-id="iRV7EkT9us81mDLFDSB6FAsB156Fdn13HUmTm26C3PE" data-score="34" data-author="<?php echo htmlspecialchars($row['author']); ?>"> |
| 796 | 796 | |
| 797 | 797 | <div class="comment-body"> |
@@ -885,7 +885,7 @@ discard block |
||
| 885 | 885 | <?php |
| 886 | 886 | $stmt = $__db->prepare("SELECT * FROM videos WHERE visibility = 'n' ORDER BY rand() LIMIT 20"); |
| 887 | 887 | $stmt->execute(); |
| 888 | - while($video = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
| 888 | + while ($video = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
| 889 | 889 | $video['age'] = $__time_h->time_elapsed_string($video['publish']); |
| 890 | 890 | $video['duration'] = $__time_h->timestamp($video['duration']); |
| 891 | 891 | $video['views'] = $__video_h->fetch_video_views($video['rid']); |