@@ -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> |
@@ -11,11 +11,11 @@ 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(isset($_SESSION['siteusername'])) |
|
18 | + if (isset($_SESSION['siteusername'])) |
|
19 | 19 | $__video_h->check_view($_GET['v'], @$_SESSION['siteusername']); |
20 | 20 | |
21 | 21 | $_SESSION['current_video'] = $_video['rid']; |
@@ -64,20 +64,20 @@ 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); |
|
67 | + $_video['dislikes'] = $__video_h->get_video_stars_level($_video['rid'], 1); |
|
68 | 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 | 73 | $_video['dislikes'] += $__video_h->get_video_likes($_video['rid'], false); |
74 | 74 | $_video['likes'] += $__video_h->get_video_likes($_video['rid'], true); |
75 | 75 | |
76 | - if($_video['likes'] == 0 && $_video['dislikes'] == 0) { |
|
76 | + if ($_video['likes'] == 0 && $_video['dislikes'] == 0) { |
|
77 | 77 | $_video['likeswidth'] = 0; |
78 | 78 | $_video['dislikeswidth'] = 0; |
79 | 79 | } else { |
80 | - $_video['likeswidth'] = $_video['likes'] / ($_video['likes'] + $_video['dislikes']) * 100; |
|
80 | + $_video['likeswidth'] = $_video['likes']/($_video['likes'] + $_video['dislikes'])*100; |
|
81 | 81 | $_video['dislikeswidth'] = 100 - $_video['likeswidth']; |
82 | 82 | } |
83 | 83 | |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | </div> |
112 | 112 | <div id="instream_google_companion_ad_div"></div> |
113 | 113 | </div> |
114 | - <?php if(@$_SESSION['siteusername'] == $_video['author']) { ?> |
|
114 | + <?php if (@$_SESSION['siteusername'] == $_video['author']) { ?> |
|
115 | 115 | <div id="watch-owner-container"> |
116 | 116 | <div id="masthead-subnav" class="yt-nav yt-nav-dark "> |
117 | 117 | <ul class="yt-nav-aside"> |
@@ -146,7 +146,7 @@ discard block |
||
146 | 146 | title="" |
147 | 147 | id="subscribe-button" |
148 | 148 | type="button" |
149 | - class="<?php if($_video['subscribed']) { echo "subscribed "; } ?>yt-subscription-button yt-uix-button yt-uix-button-subscription yt-uix-tooltip" |
|
149 | + class="<?php if ($_video['subscribed']) { echo "subscribed "; } ?>yt-subscription-button yt-uix-button yt-uix-button-subscription yt-uix-tooltip" |
|
150 | 150 | role="button"> |
151 | 151 | <span class="yt-uix-button-icon-wrapper"> |
152 | 152 | <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 | <button onclick=";like_video();return false;" |
228 | 228 | title="I like this" |
229 | 229 | type="button" |
230 | - class="start <?php if($_video['liked']) { echo "liked "; } ?>yt-uix-tooltip-reverse yt-uix-button yt-uix-button-default yt-uix-tooltip" |
|
230 | + class="start <?php if ($_video['liked']) { echo "liked "; } ?>yt-uix-tooltip-reverse yt-uix-button yt-uix-button-default yt-uix-tooltip" |
|
231 | 231 | id="watch-like" |
232 | 232 | href="/get/like_video?v=<?php echo $_video['rid']; ?>" |
233 | 233 | role="button"><span class="yt-uix-button-icon-wrapper"> |
@@ -241,7 +241,7 @@ discard block |
||
241 | 241 | type="button" |
242 | 242 | style="margin-left: -2px;" |
243 | 243 | href="/get/dislike_video?v=<?php echo $_video['rid']; ?>" |
244 | - 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" |
|
244 | + 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" |
|
245 | 245 | id="watch-unlike" |
246 | 246 | role="button"> |
247 | 247 | <span class="yt-uix-button-icon-wrapper"> |
@@ -261,7 +261,7 @@ discard block |
||
261 | 261 | </div> |
262 | 262 | </div> |
263 | 263 | <div id="watch-actions-logged-out" class="watch-actions-panel hid"> |
264 | - <?php if(!isset($_SESSION['siteusername'])) { ?> |
|
264 | + <?php if (!isset($_SESSION['siteusername'])) { ?> |
|
265 | 265 | <div class="yt-alert yt-alert-naked yt-alert-warn "> |
266 | 266 | <div class="yt-alert-icon"> |
267 | 267 | <img src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" class="icon master-sprite" alt="Alert icon"> |
@@ -277,7 +277,7 @@ discard block |
||
277 | 277 | <?php } else { ?> |
278 | 278 | <h3>Be friends with the creator</h3> |
279 | 279 | |
280 | - <?php if($_SESSION['siteusername'] != $_video['author']) { ?> |
|
280 | + <?php if ($_SESSION['siteusername'] != $_video['author']) { ?> |
|
281 | 281 | <img style="width: 50px;height:50px;" src="/dynamic/pfp/<?php echo $__user_h->fetch_pfp($_video['author']); ?>"> |
282 | 282 | <span style="display: inline-block; vertical-align:top;width: 100px;font-size:11px;"> |
283 | 283 | <b><a href="/user/<?php echo htmlspecialchars($_video['author']); ?>"><?php echo htmlspecialchars($_video['author']); ?></a></b><br> |
@@ -291,8 +291,8 @@ discard block |
||
291 | 291 | </span><br><br> |
292 | 292 | <?php } ?> |
293 | 293 | |
294 | - <?php if($_SESSION['siteusername'] != $_video['author']) { ?> |
|
295 | - <?php if($_video['friended'] == false) { ?> |
|
294 | + <?php if ($_SESSION['siteusername'] != $_video['author']) { ?> |
|
295 | + <?php if ($_video['friended'] == false) { ?> |
|
296 | 296 | <a href="/friends">Send a friend request</a> |
297 | 297 | <?php } else { ?> |
298 | 298 | Your friend request is pending. |
@@ -302,7 +302,7 @@ discard block |
||
302 | 302 | <?php } ?> |
303 | 303 | <hr><br> |
304 | 304 | <h3>Add to Favorites</h3> |
305 | - <?php if($_video['favorited'] == false) { ?> |
|
305 | + <?php if ($_video['favorited'] == false) { ?> |
|
306 | 306 | <a href="/get/favorite?v=<?php echo $_video['rid']; ?>">Favorite Video</a> |
307 | 307 | <?php } else { ?> |
308 | 308 | <a href="/get/unfavorite?v=<?php echo $_video['rid']; ?>">Unfavorite Video</a> |
@@ -313,10 +313,10 @@ discard block |
||
313 | 313 | $stmt = $__db->prepare("SELECT * FROM playlists WHERE author = :username ORDER BY id DESC LIMIT 20"); |
314 | 314 | $stmt->bindParam(":username", $_SESSION['siteusername']); |
315 | 315 | $stmt->execute(); |
316 | - while($playlist = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
316 | + while ($playlist = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
317 | 317 | $buffer = json_decode($playlist['videos']); |
318 | 318 | @$rid = $buffer[0]; |
319 | - if(!empty($rid)) { |
|
319 | + if (!empty($rid)) { |
|
320 | 320 | @$video = $__video_h->fetch_video_rid($rid); |
321 | 321 | } else { |
322 | 322 | $video['thumbnail'] = ""; |
@@ -594,7 +594,7 @@ discard block |
||
594 | 594 | $stmt->execute(); |
595 | 595 | ?> |
596 | 596 | |
597 | - <?php if($stmt->rowCount() != 0) { ?> |
|
597 | + <?php if ($stmt->rowCount() != 0) { ?> |
|
598 | 598 | <div class="comments-section"> |
599 | 599 | <a class="comments-section-see-all" href="/video_response_view_all?v=<?php echo htmlspecialchars($_video['rid']); ?>"> |
600 | 600 | see all |
@@ -602,8 +602,8 @@ 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'])) { |
|
605 | + while ($video = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
606 | + if ($__video_h->video_exists($video['video'])) { |
|
607 | 607 | $video = $__video_h->fetch_video_rid($video['video']); |
608 | 608 | $video['age'] = $__time_h->time_elapsed_string($video['publish']); |
609 | 609 | $video['duration'] = $__time_h->timestamp($video['duration']); |
@@ -634,18 +634,18 @@ discard block |
||
634 | 634 | </h4> |
635 | 635 | </div> |
636 | 636 | </div> |
637 | - <?php if(!isset($_SESSION['siteusername'])) { ?> |
|
637 | + <?php if (!isset($_SESSION['siteusername'])) { ?> |
|
638 | 638 | <div class="comments-post-container clearfix"> |
639 | 639 | <div class="comments-post-alert"> |
640 | 640 | <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> |
641 | 641 | </div> |
642 | 642 | </div> |
643 | - <?php } else if($_video['commenting'] == "d") { ?> |
|
643 | + <?php } else if ($_video['commenting'] == "d") { ?> |
|
644 | 644 | <div class="comments-disabled-message"> |
645 | 645 | <img src="http://s.ytimg.com/yt/img/icon_comments_disabled-vflxokpZC.png"> |
646 | 646 | <span>Adding comments has been disabled for this video.</span> |
647 | 647 | </div> |
648 | - <?php } else if($__user_h->if_blocked($_video['author'], $_SESSION['siteusername'])) { ?> |
|
648 | + <?php } else if ($__user_h->if_blocked($_video['author'], $_SESSION['siteusername'])) { ?> |
|
649 | 649 | <div class="comments-post-container clearfix"> |
650 | 650 | <div class="comments-post-alert"> |
651 | 651 | This user has blocked you! |
@@ -699,15 +699,15 @@ discard block |
||
699 | 699 | $stmt->execute(); |
700 | 700 | |
701 | 701 | $number_of_result = $stmt->rowCount(); |
702 | - $number_of_page = ceil ($number_of_result / $results_per_page); |
|
702 | + $number_of_page = ceil($number_of_result/$results_per_page); |
|
703 | 703 | |
704 | - if (!isset ($_GET['page']) ) { |
|
704 | + if (!isset ($_GET['page'])) { |
|
705 | 705 | $page = 1; |
706 | 706 | } else { |
707 | - $page = (int)$_GET['page']; |
|
707 | + $page = (int) $_GET['page']; |
|
708 | 708 | } |
709 | 709 | |
710 | - $page_first_result = ($page - 1) * $results_per_page; |
|
710 | + $page_first_result = ($page - 1)*$results_per_page; |
|
711 | 711 | |
712 | 712 | $stmt = $__db->prepare("SELECT * FROM comments WHERE toid = :rid ORDER BY id DESC LIMIT :pfirst, :pper"); |
713 | 713 | $stmt->bindParam(":rid", $_video['rid']); |
@@ -715,10 +715,10 @@ discard block |
||
715 | 715 | $stmt->bindParam(":pper", $results_per_page); |
716 | 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)) |
|
718 | + while ($comment = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
719 | + if ($__video_h->if_comment_liked($comment['id'], $_SESSION['siteusername'], true)) |
|
720 | 720 | $comment['liked'] = true; |
721 | - else if($__video_h->if_comment_liked($comment['id'], $_SESSION['siteusername'], false)) |
|
721 | + else if ($__video_h->if_comment_liked($comment['id'], $_SESSION['siteusername'], false)) |
|
722 | 722 | $comment['disliked'] = true; |
723 | 723 | |
724 | 724 | $comment['likes'] = $__video_h->get_comment_likes($comment['id'], true); |
@@ -740,7 +740,7 @@ discard block |
||
740 | 740 | <span dir="ltr"><?php echo $__time_h->time_elapsed_string($comment['date']); ?><span> |
741 | 741 | </span> |
742 | 742 | </span></span> |
743 | - <?php if($comment['likes'] != 0) { ?> |
|
743 | + <?php if ($comment['likes'] != 0) { ?> |
|
744 | 744 | <span dir="ltr" class="comments-rating-positive" title="9 up, 1 down"> |
745 | 745 | <?php echo $comment['likes']; ?> |
746 | 746 | <img class="comments-rating-thumbs-up" src="//s.ytimg.com/yts/img/pixel-vfl3z5WfW.gif"> |
@@ -768,7 +768,7 @@ discard block |
||
768 | 768 | </button> |
769 | 769 | </span> |
770 | 770 | </div> |
771 | - <?php if(isset($_SESSION['siteusername'])) { ?> |
|
771 | + <?php if (isset($_SESSION['siteusername'])) { ?> |
|
772 | 772 | <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']); ?>"> |
773 | 773 | |
774 | 774 | <div class="comment-body"> |
@@ -862,7 +862,7 @@ discard block |
||
862 | 862 | <?php |
863 | 863 | $stmt = $__db->prepare("SELECT * FROM videos ORDER BY rand() LIMIT 20"); |
864 | 864 | $stmt->execute(); |
865 | - while($video = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
865 | + while ($video = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
866 | 866 | $video['age'] = $__time_h->time_elapsed_string($video['publish']); |
867 | 867 | $video['duration'] = $__time_h->timestamp($video['duration']); |
868 | 868 | $video['views'] = $__video_h->fetch_video_views($video['rid']); |