@@ -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']); |